diff --git a/src/content-handlers/iiif/extensions/uv-aleph-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-aleph-extension/Extension.ts
index 75bf2f9c0..88bfa1916 100644
--- a/src/content-handlers/iiif/extensions/uv-aleph-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-aleph-extension/Extension.ts
@@ -121,16 +121,21 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
}
diff --git a/src/content-handlers/iiif/extensions/uv-aleph-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-aleph-extension/config/config.json
index f53a7097f..3151d013c 100644
--- a/src/content-handlers/iiif/extensions/uv-aleph-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-aleph-extension/config/config.json
@@ -239,7 +239,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-av-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-av-extension/Extension.ts
index 2319b82f7..46bc548ca 100644
--- a/src/content-handlers/iiif/extensions/uv-av-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-av-extension/Extension.ts
@@ -149,16 +149,25 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ rid: this.helper.rangeId?.toString() ?? ""
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}&rid=${this.helper.rangeId}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
diff --git a/src/content-handlers/iiif/extensions/uv-av-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-av-extension/config/config.json
index ab32b2ed9..8064cca57 100644
--- a/src/content-handlers/iiif/extensions/uv-av-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-av-extension/config/config.json
@@ -283,7 +283,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-default-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-default-extension/Extension.ts
index 2cbc30b26..28d7e91b0 100644
--- a/src/content-handlers/iiif/extensions/uv-default-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-default-extension/Extension.ts
@@ -116,16 +116,24 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
}
diff --git a/src/content-handlers/iiif/extensions/uv-default-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-default-extension/config/config.json
index 4c01ff653..9590b8f01 100644
--- a/src/content-handlers/iiif/extensions/uv-default-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-default-extension/config/config.json
@@ -65,7 +65,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts
index a5b0f4592..cfadf23cb 100644
--- a/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts
@@ -142,16 +142,22 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ cfi: this.cfiFragement,
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&cfi=${this.cfiFragement}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
diff --git a/src/content-handlers/iiif/extensions/uv-ebook-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-ebook-extension/config/config.json
index 1df06c3ff..d231e8328 100644
--- a/src/content-handlers/iiif/extensions/uv-ebook-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-ebook-extension/config/config.json
@@ -234,7 +234,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts
index 37dec4ade..4f7a4bc96 100644
--- a/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts
@@ -236,16 +236,24 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
diff --git a/src/content-handlers/iiif/extensions/uv-mediaelement-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-mediaelement-extension/config/config.json
index ecd1734e5..c8ee38fe5 100644
--- a/src/content-handlers/iiif/extensions/uv-mediaelement-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-mediaelement-extension/config/config.json
@@ -65,7 +65,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-model-viewer-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-model-viewer-extension/Extension.ts
index 7ff9a38da..adee391bb 100644
--- a/src/content-handlers/iiif/extensions/uv-model-viewer-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-model-viewer-extension/Extension.ts
@@ -255,16 +255,24 @@ export default class ModelViewerExtension extends BaseExtension {
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
}
diff --git a/src/content-handlers/iiif/extensions/uv-model-viewer-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-model-viewer-extension/config/config.json
index 13479234c..f44b295ea 100644
--- a/src/content-handlers/iiif/extensions/uv-model-viewer-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-model-viewer-extension/config/config.json
@@ -78,7 +78,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts
index eee4845fc..d15a340f3 100644
--- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts
@@ -1369,18 +1369,30 @@ export default class OpenSeadragonExtension extends BaseExtension {
zoom: string,
rotation: number
): string {
- const config: string = this.data.config!.uri || "";
- const locales: string | null = this.getSerializedLocales();
+ const config: string = this.data.config?.uri ?? "";
+ const locales: string = this.getSerializedLocales() ?? "";
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ config: config,
+ locales: locales,
+ xywh: zoom,
+ r: rotation.toString(),
+ });
+
const appUri: string = this.getAppUri();
const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}&config=${config}&locales=${locales}&xywh=${zoom}&r=${rotation}`;
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/config.json
index 6fa3d2127..39a6b2da3 100644
--- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/config.json
@@ -445,7 +445,7 @@
"shareDialogue": {
"options": {
"embedEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareEnabled": true,
"shareFrameEnabled": true,
diff --git a/src/content-handlers/iiif/extensions/uv-pdf-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-pdf-extension/Extension.ts
index 596d7dc7b..f7fd40c02 100644
--- a/src/content-handlers/iiif/extensions/uv-pdf-extension/Extension.ts
+++ b/src/content-handlers/iiif/extensions/uv-pdf-extension/Extension.ts
@@ -160,16 +160,24 @@ export default class Extension
}
getEmbedScript(template: string, width: number, height: number): string {
+ const hashParams = new URLSearchParams({
+ manifest: this.helper.manifestUri,
+ c: this.helper.collectionIndex.toString(),
+ m: this.helper.manifestIndex.toString(),
+ cv: this.helper.canvasIndex.toString(),
+ });
+
const appUri: string = this.getAppUri();
- const title: string = this.helper.getLabel() || "";
- const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&c=${this.helper.collectionIndex}&m=${this.helper.manifestIndex}&cv=${this.helper.canvasIndex}`;
+ const title: string = this.helper.getLabel() ?? "";
const script: string = Strings.format(
template,
- iframeSrc,
+ appUri,
+ hashParams.toString(),
width.toString(),
height.toString(),
title
);
+
return script;
}
}
diff --git a/src/content-handlers/iiif/extensions/uv-pdf-extension/config/config.json b/src/content-handlers/iiif/extensions/uv-pdf-extension/config/config.json
index 7aafa2bed..65d445307 100644
--- a/src/content-handlers/iiif/extensions/uv-pdf-extension/config/config.json
+++ b/src/content-handlers/iiif/extensions/uv-pdf-extension/config/config.json
@@ -289,7 +289,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
- "embedTemplate": "",
+ "embedTemplate": "",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
diff --git a/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts b/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts
index 6d850cfab..b72ef596b 100644
--- a/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts
+++ b/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts
@@ -765,13 +765,8 @@ export class BaseExtension implements IExtension {
}
getAppUri(): string {
- const appUri: string =
- window.location.protocol +
- "//" +
- window.location.hostname +
- (window.location.port ? ":" + window.location.port : "");
-
- return appUri + "/uv.html";
+ const port = window.location.port ? `:${window.location.port}` : "";
+ return `${window.location.protocol}//${window.location.hostname}${port}`;
}
getSettings(): ISettings {
diff --git a/src/uv-iiif-config.json b/src/uv-iiif-config.json
index 108d55ca5..10df1e846 100644
--- a/src/uv-iiif-config.json
+++ b/src/uv-iiif-config.json
@@ -43,6 +43,11 @@
"options": {
"downloadEnabled": true
}
+ },
+ "shareDialogue": {
+ "options": {
+ "embedTemplate": ""
+ }
}
}
}