/
viewer-playground.component.ts
55 lines (45 loc) · 1.7 KB
/
viewer-playground.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { Component, OnInit } from '@angular/core';
import { SessionService } from '@dasch-swiss/dsp-ui';
import { ReadLinkValue, ReadProject } from '@dasch-swiss/dsp-js';
@Component({
selector: 'app-viewer-playground',
templateUrl: './viewer-playground.component.html',
styleUrls: ['./viewer-playground.component.scss']
})
export class ViewerPlaygroundComponent implements OnInit {
// resorce from incunabula: book page
resources = [
'http://rdfh.ch/0803/18a671b8a601',
'http://rdfh.ch/0803/7e4cfc5417',
'http://rdfh.ch/0803/6ad3e2c47501',
'http://rdfh.ch/0001/a-thing-with-text-valuesLanguage'
];
resourceIri: string = this.resources[0];
resourceIds = [
'http://rdfh.ch/0803/18a671b8a601',
'http://rdfh.ch/0803/7e4cfc5417',
'http://rdfh.ch/0803/6ad3e2c47501',
'http://rdfh.ch/0803/009e225a5f01',
'http://rdfh.ch/0803/00ed33070f02'
];
noOfResources = this.resourceIds.length;
constructor(
private _sessionService: SessionService
) { }
ngOnInit(): void {
this._sessionService.isSessionValid().subscribe(status => console.log('session valid: ', status));
}
refProjectClicked(project: ReadProject) {
// here you can redirect a user to the project page
console.log('project clicked: redircet to project page e.g. /project/:shortcode', project);
}
refProjectHovered(project: ReadProject) {
console.log('project hovered: show preview', project);
}
refResourceClicked(linkValue: ReadLinkValue) {
console.log('clicked: ', linkValue);
}
refResourceHovered(linkValue: ReadLinkValue) {
console.log('hovered: ', linkValue);
}
}