Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91971713
page-view.service.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 16, 06:45
Size
3 KB
Mime Type
text/x-java
Expires
Mon, Nov 18, 06:45 (2 d)
Engine
blob
Format
Raw Data
Handle
22353882
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
page-view.service.ts
View Options
import {EventEmitter, Injectable} from '@angular/core';
import { Configuration, Continuation, Copyright, Interactable, Line, Point, Reference, TextByForeignHand, Word } from './models';
/**
* This is an information service about clicked and (un-)hovered
* {@link /interfaces/Line.html|Lines},
* {@link /miscellaneous/typealiases.html#Word|Words}.
* and {@link /interfaces/TextByForeignHand.html|TextByForeignHands}.
* */
@Injectable()
export class PageViewService {
/**
* hovered line emitter
**/
onHoveredLine = new EventEmitter<Line>();
/**
* off hovered line emitter
**/
offHoveredLine = new EventEmitter<Line>();
/**
* clicked line emitter
**/
onClickedLine = new EventEmitter<Line>();
/**
* hovered word emitter
**/
onHoveredWord = new EventEmitter<Word>();
/**
* off hovered word emitter
**/
offHoveredWord = new EventEmitter<Word>();
/**
* clicked word emitter
**/
onClickedWord = new EventEmitter<Word>();
/**
* clicked text by foreign hand emitter
**/
onClickedTextByForeignHand = new EventEmitter<TextByForeignHand>();
/**
* hovered text by foreign hand emitter
**/
onHoveredTextByForeignHand = new EventEmitter<TextByForeignHand>();
/**
* off hovered text by foreign hand emitter
**/
offHoveredTextByForeignHand = new EventEmitter<TextByForeignHand>();
/**
* hovered line continuation
**/
onHoveredContinuation = new EventEmitter<Continuation>();
/**
* off hovered line continuation
**/
offHoveredContinuation = new EventEmitter<Continuation>();
/**
* point where mouse hovered/clicked
**/
mousePosition = new EventEmitter<Point>();
/**
* Reference change emitter, subscribe in order to navigate to reference.
**/
reference = new EventEmitter<Reference>();
/**
* copyright change emitter
* */
copyright = new EventEmitter<Copyright>();
public referenceService(reference: Reference){
this.reference.emit(reference);
}
public copyrightService(copyright: Copyright, point?: Point){
this.copyright.emit(copyright);
if (point != null && point != undefined){
this.mousePosition.emit(point);
}
}
/**
* emit an event on 'onClicked' + interactable.datatype
**/
public onClickService(interactable: Interactable, point?: Point){
this['onClicked' + interactable.datatype].emit(interactable);
if (interactable.datatype != 'Line' && point != null && point != undefined){
this.mousePosition.emit(point);
}
}
/**
* emit an event on 'onHover' + interactable.datatype
**/
public onHoverService(interactable: Interactable, point?: Point){
this['onHovered' + interactable.datatype].emit(interactable);
if (interactable.datatype != 'Line' && point != null && point != undefined){
this.mousePosition.emit(point);
}
}
/**
* emit an event on 'offHover' + interactable.datatype
**/
public offHoverService(interactable: Interactable){
this['offHovered' + interactable.datatype].emit(interactable);
this.mousePosition.emit({visible: false, clientX: -1, clientY: -1, layerX: -1, layerY: -1 });
}
}
Event Timeline
Log In to Comment