Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75730435
open-in-viewer.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
Sat, Aug 3, 22:29
Size
1 KB
Mime Type
text/x-java
Expires
Mon, Aug 5, 22:29 (2 d)
Engine
blob
Format
Raw Data
Handle
19506243
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
open-in-viewer.component.ts
View Options
import { Component, Input, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { TLN_VIEWER_ROUTE, TLN_PAGE_PARAM, TLN_MANUSCRIPT_PARAM } from '../constants';
import { Mapping } from '../route-reader';
import { RouteUpdater } from '../route-updater';
import { NavigationPage } from '../models';
interface ViewerRouteInformation {
title: string;
number: string;
page: string;
manuscript?: string;
launchExternally?: boolean;
}
@Component({
selector: 'open-in-viewer',
templateUrl: './open-in-viewer.component.html',
styleUrls: ['./open-in-viewer.component.scss']
})
export class OpenInViewerComponent extends RouteUpdater {
@Input() routerInformation: ViewerRouteInformation;
launch: boolean = false;
page: NavigationPage;
protected currentRoute: string = TLN_VIEWER_ROUTE;
current_iri: string;
current_manuscript_unity: string;
protected mapping: Mapping = { current_iri: { param: TLN_PAGE_PARAM, type: "string" },
current_manuscript_unity: { param: TLN_MANUSCRIPT_PARAM, type: "string" }}
constructor(protected router: Router, protected activatedRoute: ActivatedRoute ) {
super(router, activatedRoute);
}
ngOnInit(){
super.ngOnInit();
this.page = { id: this.routerInformation.page,
number: this.routerInformation.number,
title: this.routerInformation.title };
this.launch = (this.routerInformation.launchExternally != undefined
&& this.routerInformation.launchExternally != null
&& this.routerInformation.launchExternally)
}
private openInViewer(){
if (this.routerInformation != undefined && this.routerInformation != null){
this.current_iri = this.routerInformation.page;
if (this.routerInformation.manuscript != undefined && this.routerInformation != null){
this.current_manuscript_unity = this.routerInformation.manuscript;
}
this.updateParams(this.launch);
}
}
}
Event Timeline
Log In to Comment