Skip to content

Commit d420678

Browse files
Davide NegrettiFrancescoMolinaro
authored andcommitted
Merged in DSC-1298-maintenance (pull request DSpace#1333)
DSC-1298 maintenance Approved-by: Francesco Molinaro
2 parents 07494ad + e1141a5 commit d420678

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

src/app/item-page/mirador-viewer/mirador-viewer.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export class MiradorViewerComponent implements OnInit {
3131
*/
3232
@Input() searchable: boolean;
3333

34+
/**
35+
* Is used as canvas identifier of the element to show.
36+
*/
37+
@Input() canvasId: string;
38+
3439
/**
3540
* Hides embedded viewer in dev mode.
3641
*/
@@ -90,6 +95,9 @@ export class MiradorViewerComponent implements OnInit {
9095
if (environment.mirador.enableDownloadPlugin) {
9196
viewerPath += '&enableDownloadPlugin=true';
9297
}
98+
if (this.canvasId) {
99+
viewerPath += `&canvasId=${this.canvasId}`;
100+
}
93101

94102
// TODO: Should the query term be trusted here?
95103
return this.sanitizer.bypassSecurityTrustResourceUrl(viewerPath);

src/mirador-viewer/config.default.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import miradorSharePlugin from 'mirador-share-plugin/es/miradorSharePlugin';
1717
import miradorDownloadPlugin from 'mirador-dl-plugin/es/miradorDownloadPlugin';
1818
import miradorDownloadDialog from 'mirador-dl-plugin/es/MiradorDownloadDialog';
1919

20+
const MANIFEST_URL_PART = /\/manifest$/;
21+
2022
const embedURL = location.href;
2123
const params = new URLSearchParams(location.search);
2224
const manifest = params.get('manifest');
@@ -25,6 +27,7 @@ const query = params.get('query');
2527
const multi = params.get('multi');
2628
const notMobile = params.get('notMobile');
2729
const isDownloadPluginEnabled = (params.get('enableDownloadPlugin') === 'true');
30+
const canvasId = params.get('canvasId');
2831

2932
let windowSettings = {};
3033
let sideBarPanel = 'info';
@@ -56,6 +59,10 @@ windowSettings.manifestId = manifest;
5659
}
5760
}
5861
}
62+
if (canvasId && canvasId !== 'null') {
63+
windowSettings.canvasId =
64+
`${(manifest.replace(MANIFEST_URL_PART, ''))}/canvas/${canvasId}`;
65+
}
5966
})();
6067

6168
let miradorConfiguration = {
@@ -64,7 +71,7 @@ let miradorConfiguration = {
6471
show: true
6572
},
6673
thumbnailNavigation: {
67-
defaultPosition: thumbNavigation, // Which position for the thumbnail navigation to be be displayed. Other possible values are "far-bottom" or "far-right"
74+
defaultPosition: thumbNavigation, // Which position for the thumbnail navigation to be displayed. Other possible values are "far-bottom" or "far-right"
6875
displaySettings: true, // Display the settings for this in WindowTopMenu
6976
height: 120, // height of entire ThumbnailNavigation area when position is "far-bottom"
7077
width: 100, // width of one canvas (doubled for book view) in ThumbnailNavigation area when position is "far-right"
@@ -89,9 +96,9 @@ let miradorConfiguration = {
8996
secondary: '#00BFFF',
9097
},
9198
search: {
92-
default: { fillStyle: '#00BFFF', globalAlpha: 0.3 },
93-
hovered: { fillStyle: '#00FFFF', globalAlpha: 0.3 },
94-
selected: { fillStyle: '#ff0900', globalAlpha: 0.3 },
99+
default: {fillStyle: '#00BFFF', globalAlpha: 0.3},
100+
hovered: {fillStyle: '#00FFFF', globalAlpha: 0.3},
101+
selected: {fillStyle: '#ff0900', globalAlpha: 0.3},
95102
},
96103
},
97104
},
@@ -147,10 +154,10 @@ let miradorConfiguration = {
147154
defaultSidebarPanelWidth: 230,
148155
switchCanvasOnSearch: true,
149156
views: [
150-
{ key: 'single', behaviors: ['individuals'] },
151-
{ key: 'book', behaviors: ['paged'] },
152-
{ key: 'scroll', behaviors: ['continuous'] },
153-
{ key: 'gallery' },
157+
{key: 'single', behaviors: ['individuals']},
158+
{key: 'book', behaviors: ['paged']},
159+
{key: 'scroll', behaviors: ['continuous']},
160+
{key: 'gallery'},
154161
],
155162
panels: {
156163
info: true,

0 commit comments

Comments
 (0)