Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75796676
page-version-view.component.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
Sun, Aug 4, 08:21
Size
2 KB
Mime Type
text/x-java
Expires
Tue, Aug 6, 08:21 (2 d)
Engine
blob
Format
Raw Data
Handle
19610690
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
page-version-view.component.ts
View Options
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { MatBottomSheetRef} from '@angular/material/bottom-sheet';
import { ManuscriptUnity, NavigationPage} from '../../models';
import { Mapping, RouteReader } from '../../route-reader';
import { RouteUpdater } from '../../route-updater';
import { TlnTextGeneticOrder} from '../../datatypes/text_version';
import { TLN_CONTEXT_VIEW_PARAM, TLN_PAGE_PARAM, TLN_MANUSCRIPT_PARAM, TLN_TEXT_GENETIC_ORDER_PARAM, TLN_CROSSREF_ROUTE } from '../../constants';
@Component({
selector: 'page-version-view',
templateUrl: './page-version-view.component.html',
styleUrls: ['./page-version-view.component.css']
})
export class PageVersionViewComponent extends RouteUpdater implements OnInit {
/**
* IRI of the current page
**/
current_iri: string;
/**
* the current page
**/
@Input() current_page_iri: string;
/**
* the genetic text order that should be displayed.
**/
@Input() geneticOrders: TlnTextGeneticOrder[] = [];
@Input() bottomSheetRef: MatBottomSheetRef;
@Input() parentActivatedRoute: ActivatedRoute;
@Input() targetRoute: string;
@Output() textGenesisSelected = new EventEmitter<string>();
current_manuscript_iri: string;
current_genetic_order: string;
contextView: string;
//TODO: change default parentActivatedRoute, exception @Input
protected currentRoute: string;// = TLN_CROSSREF_ROUTE;
protected mapping: Mapping = {
current_iri: { param: TLN_PAGE_PARAM, type: "string" },
current_manuscript_iri: { param: TLN_MANUSCRIPT_PARAM, type: "string" },
contextView: { param: TLN_CONTEXT_VIEW_PARAM, type: "string" },
current_genetic_order: { param: TLN_TEXT_GENETIC_ORDER_PARAM, type: "string" }
}
constructor(protected router: Router, protected activatedRoute: ActivatedRoute ){
super(router, activatedRoute);
}
ngOnInit() {
if (this.targetRoute != undefined && this.targetRoute != null){
this.currentRoute = this.targetRoute;
}
super.ngOnInit();
}
private openCrossRef(geneticOrder: TlnTextGeneticOrder){
this.current_genetic_order = geneticOrder.id;
this.textGenesisSelected.emit(this.current_genetic_order);
this.current_iri = this.current_page_iri
this.contextView = TLN_PAGE_PARAM;
this.updateParams();
if(this.bottomSheetRef != undefined && this.bottomSheetRef != null){
this.bottomSheetRef.dismiss();
}
}
}
Event Timeline
Log In to Comment