From 7fd6e9ce7df7e448a2c2ee8eae2962bea825881d Mon Sep 17 00:00:00 2001 From: jamesmisson Date: Thu, 27 Feb 2025 17:40:58 +0000 Subject: [PATCH 1/5] trigger rightpanel with mobile footer moreinfo button --- src/content-handlers/iiif/IIIFEvents.ts | 3 +- .../uv-ebook-extension/Extension.ts | 9 -- .../uv-model-viewer-extension/Extension.ts | 9 -- .../uv-openseadragon-extension/Extension.ts | 9 -- .../uv-dialogues-module/MoreInfoDialogue.ts | 119 ------------------ .../modules/uv-shared-module/FooterPanel.ts | 2 +- .../modules/uv-shared-module/RightPanel.ts | 6 + .../uv-shared-module/css/right-panel.less | 2 +- .../iiif/modules/uv-shared-module/css/sm.less | 4 +- 9 files changed, 11 insertions(+), 152 deletions(-) delete mode 100644 src/content-handlers/iiif/modules/uv-dialogues-module/MoreInfoDialogue.ts diff --git a/src/content-handlers/iiif/IIIFEvents.ts b/src/content-handlers/iiif/IIIFEvents.ts index 865abb540..4934bb3b9 100644 --- a/src/content-handlers/iiif/IIIFEvents.ts +++ b/src/content-handlers/iiif/IIIFEvents.ts @@ -37,7 +37,6 @@ export class IIIFEvents { static HIDE_HELP_DIALOGUE: string = "hideHelpDialogue"; static HIDE_INFORMATION: string = "hideInformation"; static HIDE_LOGIN_DIALOGUE: string = "hideLoginDialogue"; - static HIDE_MOREINFO_DIALOGUE: string = "hideMoreInfoDialogue"; static HIDE_MULTISELECT_DIALOGUE: string = "hideMultiSelectDialogue"; static HIDE_OVERLAY: string = "hideOverlay"; static HIDE_RESTRICTED_DIALOGUE: string = "hideRestrictedDialogue"; @@ -100,7 +99,6 @@ export class IIIFEvents { static SHOW_LOGIN_DIALOGUE: string = "showLoginDialogue"; static SHOW_MESSAGE: string = "showMessage"; static MESSAGE_DISPLAYED: string = "messageDisplayed"; - static SHOW_MOREINFO_DIALOGUE: string = "showMoreInfoDialogue"; static SHOW_MULTISELECT_DIALOGUE: string = "showMultiSelectDialogue"; static SHOW_OVERLAY: string = "showOverlay"; static SHOW_RESTRICTED_DIALOGUE: string = "showRestrictedDialogue"; @@ -108,6 +106,7 @@ export class IIIFEvents { static SHOW_SHARE_DIALOGUE: string = "showShareDialogue"; static SHOW_TERMS_OF_USE: string = "showTermsOfUse"; static TARGET_CHANGE: string = "targetChange"; + static TOGGLE_MOREINFO_RIGHT_PANEL: string = "toggleMoreInfoRightPanel"; static THUMB_MULTISELECTED: string = "thumbMultiSelected"; static THUMB_SELECTED: string = "thumbSelected"; static TOGGLE_EXPAND_LEFT_PANEL: string = "toggleExpandLeftPanel"; 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..10a0834a1 100644 --- a/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts +++ b/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts @@ -8,7 +8,6 @@ import { FooterPanel } from "../../modules/uv-shared-module/FooterPanel"; import { FooterPanel as MobileFooterPanel } from "../../modules/uv-ebookmobilefooterpanel-module/MobileFooter"; import { HeaderPanel } from "../../modules/uv-shared-module/HeaderPanel"; import { IEbookExtension } from "./IEbookExtension"; -import { MoreInfoDialogue } from "../../modules/uv-dialogues-module/MoreInfoDialogue"; import { MoreInfoRightPanel } from "../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel"; import { SettingsDialogue } from "./SettingsDialogue"; import { ShareDialogue } from "./ShareDialogue"; @@ -23,7 +22,6 @@ export default class Extension implements IEbookExtension { $downloadDialogue: JQuery; - $moreInfoDialogue: JQuery; $multiSelectDialogue: JQuery; $settingsDialogue: JQuery; $shareDialogue: JQuery; @@ -33,7 +31,6 @@ export default class Extension headerPanel: HeaderPanel; leftPanel: EbookLeftPanel; mobileFooterPanel: MobileFooterPanel; - moreInfoDialogue: MoreInfoDialogue; rightPanel: MoreInfoRightPanel; settingsDialogue: SettingsDialogue; shareDialogue: ShareDialogue; @@ -91,12 +88,6 @@ export default class Extension this.shell.$footerPanel.hide(); } - this.$moreInfoDialogue = $( - '' - ); - this.shell.$overlays.append(this.$moreInfoDialogue); - this.moreInfoDialogue = new MoreInfoDialogue(this.$moreInfoDialogue); - this.$shareDialogue = $( '' ); 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..c039c0830 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 @@ -7,7 +7,6 @@ import { FooterPanel } from "../../modules/uv-shared-module/FooterPanel"; import { FooterPanel as MobileFooterPanel } from "../../modules/uv-modelviewermobilefooterpanel-module/MobileFooter"; import { HeaderPanel } from "../../modules/uv-shared-module/HeaderPanel"; import { HelpDialogue } from "../../modules/uv-dialogues-module/HelpDialogue"; -import { MoreInfoDialogue } from "../../modules/uv-dialogues-module/MoreInfoDialogue"; import { MoreInfoRightPanel } from "../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel"; import { SettingsDialogue } from "./SettingsDialogue"; import { ShareDialogue } from "./ShareDialogue"; @@ -27,7 +26,6 @@ export default class ModelViewerExtension extends BaseExtension { $downloadDialogue: JQuery; $shareDialogue: JQuery; $helpDialogue: JQuery; - $moreInfoDialogue: JQuery; $settingsDialogue: JQuery; centerPanel: ModelViewerCenterPanel; downloadDialogue: DownloadDialogue; @@ -36,7 +34,6 @@ export default class ModelViewerExtension extends BaseExtension { helpDialogue: HelpDialogue; leftPanel: ContentLeftPanel; mobileFooterPanel: FooterPanel; - moreInfoDialogue: MoreInfoDialogue; rightPanel: MoreInfoRightPanel; settingsDialogue: SettingsDialogue; shareDialogue: ShareDialogue; @@ -99,12 +96,6 @@ export default class ModelViewerExtension extends BaseExtension { this.shell.$footerPanel.hide(); } - this.$moreInfoDialogue = $( - '' - ); - this.shell.$overlays.append(this.$moreInfoDialogue); - this.moreInfoDialogue = new MoreInfoDialogue(this.$moreInfoDialogue); - this.$downloadDialogue = $( '' ); 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 021e6f5ba..dc0bf3385 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts @@ -12,7 +12,6 @@ import { FooterPanel } from "../../modules/uv-searchfooterpanel-module/FooterPan import { HelpDialogue } from "../../modules/uv-dialogues-module/HelpDialogue"; import { IOpenSeadragonExtensionData } from "./IOpenSeadragonExtensionData"; import { Mode } from "./Mode"; -import { MoreInfoDialogue } from "../../modules/uv-dialogues-module/MoreInfoDialogue"; import { MoreInfoRightPanel } from "../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel"; import { MultiSelectDialogue } from "../../modules/uv-multiselectdialogue-module/MultiSelectDialogue"; import { MultiSelectionArgs } from "./MultiSelectionArgs"; @@ -60,7 +59,6 @@ export default class OpenSeadragonExtension extends BaseExtension { $downloadDialogue: JQuery; $externalContentDialogue: JQuery; $helpDialogue: JQuery; - $moreInfoDialogue: JQuery; $multiSelectDialogue: JQuery; $settingsDialogue: JQuery; $shareDialogue: JQuery; @@ -78,7 +76,6 @@ export default class OpenSeadragonExtension extends BaseExtension { leftPanel: ContentLeftPanel; mobileFooterPanel: MobileFooterPanel; mode: Mode; - moreInfoDialogue: MoreInfoDialogue; multiSelectDialogue: MultiSelectDialogue; previousAnnotationRect: AnnotationRect | null; rightPanel: MoreInfoRightPanel; @@ -551,12 +548,6 @@ export default class OpenSeadragonExtension extends BaseExtension { this.shell.$overlays.append(this.$helpDialogue); this.helpDialogue = new HelpDialogue(this.$helpDialogue); - this.$moreInfoDialogue = $( - '' - ); - this.shell.$overlays.append(this.$moreInfoDialogue); - this.moreInfoDialogue = new MoreInfoDialogue(this.$moreInfoDialogue); - this.$multiSelectDialogue = $( '' ); diff --git a/src/content-handlers/iiif/modules/uv-dialogues-module/MoreInfoDialogue.ts b/src/content-handlers/iiif/modules/uv-dialogues-module/MoreInfoDialogue.ts deleted file mode 100644 index 1f16db897..000000000 --- a/src/content-handlers/iiif/modules/uv-dialogues-module/MoreInfoDialogue.ts +++ /dev/null @@ -1,119 +0,0 @@ -const $ = require("jquery"); -import { IIIFEvents } from "../../IIIFEvents"; -import { Dialogue } from "../uv-shared-module/Dialogue"; -import { sanitize } from "../../../../Utils"; -import { Bools } from "@edsilv/utils"; -import { MetadataComponent, LimitType } from "@iiif/iiif-metadata-component"; -import { BaseConfig } from "../../BaseConfig"; - -export class MoreInfoDialogue extends Dialogue< - BaseConfig["modules"]["moreInfoRightPanel"] -> { - $title: JQuery; - metadataComponent: any; - $metadata: JQuery; - - constructor($element: JQuery) { - super($element); - } - - create(): void { - this.setConfig("moreInfoDialogue"); - - super.create(); - - this.openCommand = IIIFEvents.SHOW_MOREINFO_DIALOGUE; - this.closeCommand = IIIFEvents.HIDE_MOREINFO_DIALOGUE; - - this.extensionHost.subscribe( - this.openCommand, - (triggerButton: HTMLElement) => { - this.open(triggerButton); - } - ); - - this.extensionHost.subscribe(this.closeCommand, () => { - this.close(); - }); - - this.extensionHost.subscribe(IIIFEvents.CANVAS_INDEX_CHANGE, () => { - this.metadataComponent.set(this._getData()); - }); - - this.config.content = - this.extension.data.config!.modules.moreInfoRightPanel.content; - this.config.options = - this.extension.data.config!.modules.moreInfoRightPanel.options; - - // create ui - this.$title = $( - `
${this.config.content.title}
` - ); - this.$content.append(this.$title); - - this.$metadata = $(''); - this.$content.append(this.$metadata); - - this.metadataComponent = new MetadataComponent({ - target: this.$metadata[0], - }); - - // hide - this.$element.hide(); - } - - open(triggerButton?: HTMLElement): void { - super.open(triggerButton); - this.metadataComponent.set(this._getData()); - } - - private _getData() { - return { - canvasDisplayOrder: this.config.options.canvasDisplayOrder, - canvases: this.extension.getCurrentCanvases(), - canvasExclude: this.config.options.canvasExclude, - canvasLabels: this.extension.getCanvasLabels(this.content.page), - content: this.config.content, - copiedMessageDuration: 2000, - copyToClipboardEnabled: Bools.getBool( - this.config.options.copyToClipboardEnabled, - false - ), - helper: this.extension.helper, - licenseFormatter: null, - limit: this.config.options.textLimit || 4, - limitType: LimitType.LINES, - manifestDisplayOrder: this.config.options.manifestDisplayOrder, - manifestExclude: this.config.options.manifestExclude, - range: this.extension.getCurrentCanvasRange(), - rtlLanguageCodes: this.config.options.rtlLanguageCodes, - sanitizer: (html: string) => { - return sanitize(html); - }, - showAllLanguages: this.config.options.showAllLanguages, - }; - } - - close(): void { - super.close(); - } - - resize(): void { - this.setDockedPosition(); - - // always put tabindex on, so the metadata is focusable, - // just in case there's something wrong with the height - // comparison below - this.$metadata.attr("tabindex", 0); - this.$metadata.attr("aria-label", this.config.content.title); - - // if metadata's first group's height is lte than metadata (200px fixed I think), - // there's no scroll happening, so no focus needed, and no aria label either - if ( - this.$metadata.find(".groups").first().height() <= this.$metadata.height() - ) { - this.$metadata.removeAttr("tabindex"); - this.$metadata.removeAttr("aria-label"); - } - } -} diff --git a/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts index 11c538774..d18751c58 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts @@ -149,7 +149,7 @@ export class FooterPanel< this.$moreInfoButton.onPressed(() => { this.extensionHost.publish( - IIIFEvents.SHOW_MOREINFO_DIALOGUE, + IIIFEvents.TOGGLE_MOREINFO_RIGHT_PANEL, this.$moreInfoButton ); }); diff --git a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts index f11ce04bf..c34c9ec3b 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts @@ -32,8 +32,14 @@ export class RightPanel extends BaseExpandPanel { this.expandFull(); } }); + + this.extensionHost.subscribe(IIIFEvents.TOGGLE_MOREINFO_RIGHT_PANEL, () => { + this.toggle(); + }); } + + getTargetWidth(): number { return this.isExpanded ? this.options.panelCollapsedWidth diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less b/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less index 78c2b6da5..fd0acdcc8 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less @@ -122,4 +122,4 @@ display: block; } } -} +} \ No newline at end of file diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/sm.less b/src/content-handlers/iiif/modules/uv-shared-module/css/sm.less index b4731f34c..e1e87b58b 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/sm.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/sm.less @@ -23,8 +23,8 @@ } .rightPanel { - display: none; - visibility: hidden; + display: block; + visibility: visible; } } From 148200db9659e299f42f233a443f5dac208be43e Mon Sep 17 00:00:00 2001 From: jamesmisson Date: Fri, 28 Feb 2025 14:53:23 +0000 Subject: [PATCH 2/5] merge jonathan/dev --- .../iiif/modules/uv-shared-module/css/styles.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less b/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less index 9516d1c2a..1163fa912 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less @@ -176,7 +176,7 @@ .leftPanel, .rightPanel { overflow: hidden; z-index: 20; - /* display: none; */ + // display: none; transition:all calc(var(--uv-animation) * 250ms) ease-in-out; From aa94f0ee1ee068259ff8ad29955e8e3a5c67ba03 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 15:51:31 +0000 Subject: [PATCH 3/5] Commit from GitHub Actions (Lint code) --- .../iiif/modules/uv-shared-module/RightPanel.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts index 7084ccaa8..9ee229700 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts @@ -38,8 +38,6 @@ export class RightPanel extends BaseExpandPanel { }); } - - getTargetWidth(): number { return this.isExpanded ? this.options.panelCollapsedWidth From d29f0f7c1f96b5a8abc08df6612c52b3280d956b Mon Sep 17 00:00:00 2001 From: jamesmisson Date: Fri, 7 Mar 2025 17:05:57 +0000 Subject: [PATCH 4/5] left and right panel buttons in mobile footer --- src/content-handlers/iiif/BaseConfig.ts | 1 + src/content-handlers/iiif/IIIFEvents.ts | 3 +- .../uv-aleph-extension/config/config.json | 1 + .../uv-av-extension/config/config.json | 3 +- .../uv-default-extension/config/config.json | 3 +- .../uv-ebook-extension/config/config.json | 3 +- .../config/config.json | 3 +- .../config/config.json | 3 +- .../config/Config.ts | 1 + .../config/config.json | 9 ++- .../uv-pdf-extension/config/config.json | 3 +- .../MobileFooter.ts | 6 +- .../modules/uv-shared-module/FooterPanel.ts | 60 ++++++++++++++----- .../modules/uv-shared-module/LeftPanel.ts | 4 ++ .../modules/uv-shared-module/RightPanel.ts | 2 +- .../uv-shared-module/css/catch-all.less | 10 ++++ .../uv-shared-module/css/footer-panel.less | 4 ++ .../modules/uv-shared-module/css/icons.less | 4 ++ .../img/toggle-left-panel.svg | 14 +++++ src/locales/cy-GB.json | 1 + src/locales/en-GB.json | 1 + src/locales/fr-FR.json | 1 + src/locales/pl-PL.json | 1 + src/locales/sv-SE.json | 1 + 24 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 src/content-handlers/iiif/modules/uv-shared-module/img/toggle-left-panel.svg diff --git a/src/content-handlers/iiif/BaseConfig.ts b/src/content-handlers/iiif/BaseConfig.ts index 69967e956..35fcf2293 100644 --- a/src/content-handlers/iiif/BaseConfig.ts +++ b/src/content-handlers/iiif/BaseConfig.ts @@ -199,6 +199,7 @@ export type FooterPanelContent = { feedback: string; fullScreen: string; moreInfo: string; + toggleLeftPanel: string; open: string; share: string; }; diff --git a/src/content-handlers/iiif/IIIFEvents.ts b/src/content-handlers/iiif/IIIFEvents.ts index 4934bb3b9..7888e3c1b 100644 --- a/src/content-handlers/iiif/IIIFEvents.ts +++ b/src/content-handlers/iiif/IIIFEvents.ts @@ -106,7 +106,8 @@ export class IIIFEvents { static SHOW_SHARE_DIALOGUE: string = "showShareDialogue"; static SHOW_TERMS_OF_USE: string = "showTermsOfUse"; static TARGET_CHANGE: string = "targetChange"; - static TOGGLE_MOREINFO_RIGHT_PANEL: string = "toggleMoreInfoRightPanel"; + static TOGGLE_RIGHT_PANEL: string = "toggleRightPanel"; + static TOGGLE_LEFT_PANEL: string = "toggleLeftPanel"; static THUMB_MULTISELECTED: string = "thumbMultiSelected"; static THUMB_SELECTED: string = "thumbSelected"; static TOGGLE_EXPAND_LEFT_PANEL: string = "toggleExpandLeftPanel"; 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 37c6212fb..21384ae2f 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 @@ -110,6 +110,7 @@ "feedback": "Feedback", "fullScreen": "Full Screen", "moreInfo": "More Information", + "toggleLeftPanel": "Toggle Left Panel", "open": "Open", "share": "Share" } 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 8ba3c2c6c..745773d83 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 @@ -138,7 +138,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "$toggleLeftPanel" } }, "genericDialogue": { 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 e243795e8..14f2b54de 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 @@ -134,7 +134,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { 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 3caf8beb7..6f1824338 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 @@ -107,7 +107,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { 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 27e21be1b..3457fa79d 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 @@ -108,7 +108,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { 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 a2924d570..c814beaf3 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 @@ -121,7 +121,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts index 88d016cdf..090f695d4 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/config/Config.ts @@ -198,6 +198,7 @@ type MobileFooterPanelOptions = FooterPanelOptions & {}; type MobileFooterPanelContent = FooterPanelContent & { rotateRight: string; moreInfo: string; + toggleLeftPanel: string; zoomIn: string; zoomOut: string; }; 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 363c14b22..e8e512593 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 @@ -187,7 +187,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { @@ -424,7 +425,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "settingsDialogue": { @@ -538,7 +540,8 @@ "feedback": "$feedback", "fullScreen": "$fullScreen", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "restrictedDialogue": { 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 da651f467..c90b85d2a 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 @@ -83,7 +83,8 @@ "fullScreen": "$fullScreen", "moreInfo": "$moreInfo", "open": "$open", - "share": "$share" + "share": "$share", + "toggleLeftPanel": "Toggle Left Panel" } }, "genericDialogue": { diff --git a/src/content-handlers/iiif/modules/uv-osdmobilefooterpanel-module/MobileFooter.ts b/src/content-handlers/iiif/modules/uv-osdmobilefooterpanel-module/MobileFooter.ts index c7bb229c5..3578b2959 100644 --- a/src/content-handlers/iiif/modules/uv-osdmobilefooterpanel-module/MobileFooter.ts +++ b/src/content-handlers/iiif/modules/uv-osdmobilefooterpanel-module/MobileFooter.ts @@ -28,21 +28,21 @@ export class FooterPanel extends BaseFooterPanel< ${this.content.rotateRight} `); - this.$options.prepend(this.$rotateButton); + this.$mainOptions.prepend(this.$rotateButton); this.$zoomOutButton = $(` `); - this.$options.prepend(this.$zoomOutButton); + this.$mainOptions.prepend(this.$zoomOutButton); this.$zoomInButton = $(` `); - this.$options.prepend(this.$zoomInButton); + this.$mainOptions.prepend(this.$zoomInButton); this.$zoomInButton.onPressed(() => { this.extensionHost.publish(OpenSeadragonExtensionEvents.ZOOM_IN); diff --git a/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts index d18751c58..9baec43af 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/FooterPanel.ts @@ -17,6 +17,10 @@ export class FooterPanel< $openButton: JQuery; $fullScreenBtn: JQuery; $options: JQuery; + $toggleLeftPanelButton: JQuery; + $mainOptions: JQuery; + $leftOptions: JQuery; + $rightOptions: JQuery; constructor($element: JQuery) { super($element); @@ -50,13 +54,22 @@ export class FooterPanel< this.$options = $('
'); this.$element.append(this.$options); + this.$leftOptions = $('
'); + this.$options.prepend(this.$leftOptions); + + this.$mainOptions = $('
'); + this.$options.append(this.$mainOptions); + + this.$rightOptions = $('
'); + this.$options.append(this.$rightOptions); + this.$feedbackButton = $(` `); - this.$options.prepend(this.$feedbackButton); + this.$mainOptions.prepend(this.$feedbackButton); this.$openButton = $(` `); - this.$options.prepend(this.$openButton); + this.$mainOptions.prepend(this.$openButton); this.$bookmarkButton = $(` `); - this.$options.prepend(this.$bookmarkButton); + this.$mainOptions.prepend(this.$bookmarkButton); this.$shareButton = $(` `); - this.$options.append(this.$shareButton); + this.$mainOptions.append(this.$shareButton); this.$embedButton = $(` `); - this.$options.append(this.$embedButton); + this.$mainOptions.append(this.$embedButton); this.$downloadButton = $(` `); - this.$options.prepend(this.$downloadButton); - - this.$moreInfoButton = $(` - - `); - this.$options.prepend(this.$moreInfoButton); + this.$mainOptions.prepend(this.$downloadButton); this.$fullScreenBtn = $(` `); - this.$options.append(this.$fullScreenBtn); + this.$mainOptions.append(this.$fullScreenBtn); + + this.$moreInfoButton = $(` + + `); + this.$rightOptions.append(this.$moreInfoButton); + + this.$toggleLeftPanelButton = $(` + + `); + this.$leftOptions.append(this.$toggleLeftPanelButton); this.$openButton.onPressed(() => { this.extensionHost.publish(IIIFEvents.OPEN); @@ -149,7 +170,14 @@ export class FooterPanel< this.$moreInfoButton.onPressed(() => { this.extensionHost.publish( - IIIFEvents.TOGGLE_MOREINFO_RIGHT_PANEL, + IIIFEvents.TOGGLE_RIGHT_PANEL, + this.$moreInfoButton + ); + }); + + this.$toggleLeftPanelButton.onPressed(() => { + this.extensionHost.publish( + IIIFEvents.TOGGLE_LEFT_PANEL, this.$moreInfoButton ); }); diff --git a/src/content-handlers/iiif/modules/uv-shared-module/LeftPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/LeftPanel.ts index fe794ece3..62c292cb0 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/LeftPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/LeftPanel.ts @@ -35,6 +35,10 @@ export class LeftPanel< if (shouldOpenPanel) { this.toggle(true); } + + this.extensionHost.subscribe(IIIFEvents.TOGGLE_LEFT_PANEL, () => { + this.toggle(); + }); } getTargetWidth(): number { diff --git a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts index 9ee229700..3320ed983 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts +++ b/src/content-handlers/iiif/modules/uv-shared-module/RightPanel.ts @@ -33,7 +33,7 @@ export class RightPanel extends BaseExpandPanel { } }); - this.extensionHost.subscribe(IIIFEvents.TOGGLE_MOREINFO_RIGHT_PANEL, () => { + this.extensionHost.subscribe(IIIFEvents.TOGGLE_RIGHT_PANEL, () => { this.toggle(); }); } diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/catch-all.less b/src/content-handlers/iiif/modules/uv-shared-module/css/catch-all.less index da1acdf90..7a5c63768 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/catch-all.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/catch-all.less @@ -31,6 +31,12 @@ /*width: 315px;*/ height: 42px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 100%; + .spacer { float: left; width: 30px; @@ -48,6 +54,10 @@ display: inline-block; } + &.toggleLeftPanelButton { + display: inline-block; + } + &.bookmark { display: none; } diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/footer-panel.less b/src/content-handlers/iiif/modules/uv-shared-module/css/footer-panel.less index a349ac304..7e854c3f5 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/footer-panel.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/footer-panel.less @@ -17,6 +17,10 @@ display: none; } + &.toggleLeftPanelButton { + display: none; + } + &.fullScreen, &.exitFullscreen { float: right; diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/icons.less b/src/content-handlers/iiif/modules/uv-shared-module/css/icons.less index 6e6046f8a..fbbe7268f 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/icons.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/icons.less @@ -21,6 +21,10 @@ .icon-btn-2(data-uri('../img/moreinfo.png')); } +.@{icon-prefix}-toggle-left-panel { + .icon-btn-2(data-uri('../img/toggle-left-panel.svg')) +} + .@{icon-prefix}-open { .icon-btn-2(data-uri('../img/moreinfo.png')); } diff --git a/src/content-handlers/iiif/modules/uv-shared-module/img/toggle-left-panel.svg b/src/content-handlers/iiif/modules/uv-shared-module/img/toggle-left-panel.svg new file mode 100644 index 000000000..28773c91d --- /dev/null +++ b/src/content-handlers/iiif/modules/uv-shared-module/img/toggle-left-panel.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/locales/cy-GB.json b/src/locales/cy-GB.json index bcb9460ad..8d75f19a1 100644 --- a/src/locales/cy-GB.json +++ b/src/locales/cy-GB.json @@ -42,6 +42,7 @@ "$feedback": "Adborth", "$fullScreen": "Sgrin lawn", "$moreInfo": "Mwy o Wybodaeth", + "$toggleLeftPanel": "Toggle Left Panel", "$open": "Agor", "$share": "Rhannu", "$emptyValue": "rhowch rif", diff --git a/src/locales/en-GB.json b/src/locales/en-GB.json index 472fa8859..1fee69375 100644 --- a/src/locales/en-GB.json +++ b/src/locales/en-GB.json @@ -42,6 +42,7 @@ "$feedback": "Feedback", "$fullScreen": "Full Screen", "$moreInfo": "More Information", + "$toggleLeftPanel": "Toggle Left Panel", "$open": "Open", "$share": "Share", "$emptyValue": "please enter a value.", diff --git a/src/locales/fr-FR.json b/src/locales/fr-FR.json index e9b46933c..a3d8c3f8e 100644 --- a/src/locales/fr-FR.json +++ b/src/locales/fr-FR.json @@ -42,6 +42,7 @@ "$feedback": "Commentaire", "$fullScreen": "Affichage en plein écran", "$moreInfo": "Informations", + "$toggleLeftPanel": "Toggle Left Panel", "$open": "Ouvrir", "$share": "Partager", "$emptyValue": "veuillez saisir une valeur.", diff --git a/src/locales/pl-PL.json b/src/locales/pl-PL.json index 9e9cf5ba1..0c8bb01c5 100644 --- a/src/locales/pl-PL.json +++ b/src/locales/pl-PL.json @@ -42,6 +42,7 @@ "$feedback": "Feedback", "$fullScreen": "Pełny ekran", "$moreInfo": "Więcej informacji", + "$toggleLeftPanel": "Toggle Left Panel", "$open": "Otwórz", "$share": "Udostępnij", "$emptyValue": "proszę wprowadzić wartość.", diff --git a/src/locales/sv-SE.json b/src/locales/sv-SE.json index 5c2835c8f..b356b7115 100644 --- a/src/locales/sv-SE.json +++ b/src/locales/sv-SE.json @@ -42,6 +42,7 @@ "$feedback": "Feedback", "$fullScreen": "Helskärm", "$moreInfo": "Mer information", + "$toggleLeftPanel": "Toggle Left Panel", "$open": "Öppna", "$share": "Dela", "$emptyValue": "ange ett värde.", From 0a6592177ff26b2b04dbbc955ae053307017f0b6 Mon Sep 17 00:00:00 2001 From: jamesmisson Date: Fri, 7 Mar 2025 17:16:47 +0000 Subject: [PATCH 5/5] tidy up whitespace --- .../iiif/modules/uv-shared-module/css/right-panel.less | 2 +- .../iiif/modules/uv-shared-module/css/styles.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less b/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less index fd0acdcc8..78c2b6da5 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/right-panel.less @@ -122,4 +122,4 @@ display: block; } } -} \ No newline at end of file +} diff --git a/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less b/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less index 9593be4e9..564492cb9 100644 --- a/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less +++ b/src/content-handlers/iiif/modules/uv-shared-module/css/styles.less @@ -176,7 +176,7 @@ .leftPanel, .rightPanel { overflow: hidden; z-index: 20; - // display: none; + /* display: none; */ transition:all calc(var(--uv-animation) * 250ms) ease-in-out;