File tree Expand file tree Collapse file tree
app/item-page/mirador-viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ export class MiradorViewerComponent implements OnInit {
3131 */
3232 @Input ( ) searchable : boolean ;
3333
34+ /**
35+ * Is used as index of the element to show.
36+ */
37+ @Input ( ) canvasIndex : number ;
38+
3439 /**
3540 * Hides embedded viewer in dev mode.
3641 */
@@ -87,6 +92,9 @@ export class MiradorViewerComponent implements OnInit {
8792 if ( this . notMobile ) {
8893 viewerPath += '¬Mobile=true' ;
8994 }
95+ if ( this . canvasIndex ) {
96+ viewerPath += `&canvasId=${ this . canvasIndex } ` ;
97+ }
9098
9199 // TODO: Should the query term be trusted here?
92100 return this . sanitizer . bypassSecurityTrustResourceUrl ( viewerPath ) ;
Original file line number Diff line number Diff line change @@ -17,13 +17,16 @@ import miradorSharePlugin from 'mirador-share-plugin/es/miradorSharePlugin';
1717import miradorDownloadPlugin from 'mirador-dl-plugin/es/miradorDownloadPlugin' ;
1818import miradorDownloadDialog from 'mirador-dl-plugin/es/MiradorDownloadDialog' ;
1919
20+ const MANIFEST_URL_PART = / \/ m a n i f e s t $ / ;
21+
2022const embedURL = location . href ;
2123const params = new URLSearchParams ( location . search ) ;
2224const manifest = params . get ( 'manifest' ) ;
2325const searchOption = params . get ( 'searchable' ) ;
2426const query = params . get ( 'query' ) ;
2527const multi = params . get ( 'multi' ) ;
2628const notMobile = params . get ( 'notMobile' ) ;
29+ const canvasId = params . get ( 'canvasId' ) ;
2730
2831let windowSettings = { } ;
2932let sidbarPanel = 'info' ;
@@ -52,6 +55,10 @@ windowSettings.manifestId = manifest;
5255 }
5356 }
5457 }
58+ if ( canvasId != null && canvasId !== 'null' && + canvasId >= 0 ) {
59+ windowSettings . canvasId =
60+ `${ ( manifest . replace ( MANIFEST_URL_PART , '' ) ) } /canvas/c${ canvasId } ` ;
61+ }
5562} ) ( ) ;
5663
5764( Mirador . viewer (
You can’t perform that action at this time.
0 commit comments