Skip to content

Commit

Permalink
Add title attribute to embed iframe (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saira-A authored Oct 17, 2024
1 parent 88178e3 commit 39ee05b
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
const appUri: string = this.getAppUri();
const title: string = this.helper.getLabel() || "";
const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}`;
const script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
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 script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
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 script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
const appUri: string = this.getAppUri();
const title: string = this.helper.getLabel() || "";
const iframeSrc: string = `${appUri}#?manifest=${this.helper.manifestUri}&cfi=${this.cfiFragement}`;
const script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
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 script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ export default class ModelViewerExtension extends BaseExtension<Config> {

getEmbedScript(template: string, width: number, height: number): string {
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 script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,12 +1373,14 @@ export default class OpenSeadragonExtension extends BaseExtension<Config> {
const config: string = this.data.config!.uri || "";
const locales: string | null = this.getSerializedLocales();
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,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
"shareDialogue": {
"options": {
"embedEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareEnabled": true,
"shareFrameEnabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ export default class Extension extends BaseExtension<Config>

getEmbedScript(template: string, width: number, height: number): string {
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 script: string = Strings.format(
template,
iframeSrc,
width.toString(),
height.toString()
height.toString(),
title
);
return script;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"options": {
"embedEnabled": true,
"shareEnabled": true,
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\"></iframe>",
"embedTemplate": "<iframe src=\"{0}\" width=\"{1}\" height=\"{2}\" allowfullscreen frameborder=\"0\" title=\"{3}\"></iframe>",
"instructionsEnabled": false,
"shareFrameEnabled": true,
"shareManifestsEnabled": true,
Expand Down

0 comments on commit 39ee05b

Please sign in to comment.