From ee7495af0998efebbfa05820cade91d7eccd1494 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 22 Jan 2025 12:19:31 -0500 Subject: [PATCH] Lint fixes. --- src/BaseContentHandler.ts | 3 ++- src/UniversalViewer.ts | 17 +++++++++-------- src/content-handlers/iiif/IIIFContentHandler.ts | 14 ++++++++++---- .../uv-mediaelement-extension/Extension.ts | 6 ++++-- .../MediaElementCenterPanel.ts | 4 ++-- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/BaseContentHandler.ts b/src/BaseContentHandler.ts index 05a190cbc..d8e38d2ee 100644 --- a/src/BaseContentHandler.ts +++ b/src/BaseContentHandler.ts @@ -13,7 +13,8 @@ export type EventListener = { type EventListenerDictionaryItem = Pick; export default class BaseContentHandler - implements IContentHandler { + implements IContentHandler +{ protected _el: HTMLElement; private _eventListeners: { [key: string]: EventListenerDictionaryItem[]; diff --git a/src/UniversalViewer.ts b/src/UniversalViewer.ts index 45fb0ad4a..70b2cc83d 100644 --- a/src/UniversalViewer.ts +++ b/src/UniversalViewer.ts @@ -78,14 +78,15 @@ export class UniversalViewer extends BaseContentHandler> { const m = await ContentHandler[contentType](); // import content handler this.showSpinner(); // show spinner // include _assignedContentHandler for backwards compat, remove in next major version (UV5) - this.assignedContentHandler = this._assignedContentHandler = new m.default( - { - target: this._el, - data: data, - }, - this.adapter, - this._externalEventListeners - ); // create content handler + this.assignedContentHandler = this._assignedContentHandler = + new m.default( + { + target: this._el, + data: data, + }, + this.adapter, + this._externalEventListeners + ); // create content handler } return handlerChanged; diff --git a/src/content-handlers/iiif/IIIFContentHandler.ts b/src/content-handlers/iiif/IIIFContentHandler.ts index 76f61208c..c9f7931a7 100644 --- a/src/content-handlers/iiif/IIIFContentHandler.ts +++ b/src/content-handlers/iiif/IIIFContentHandler.ts @@ -97,8 +97,10 @@ const Extension: IExtensionRegistry = { }, }; -export default class IIIFContentHandler extends BaseContentHandler - implements IIIFExtensionHost, IContentHandler { +export default class IIIFContentHandler + extends BaseContentHandler + implements IIIFExtensionHost, IContentHandler +{ private _extensionRegistry: IExtensionRegistry; private _pubsub: PubSub; public extension: IExtension | undefined; @@ -264,13 +266,17 @@ export default class IIIFContentHandler extends BaseContentHandler this.disposed = true; } - private async _loadAndApplyConfigToExtension(that: IIIFContentHandler, data: IUVData, extension: any): Promise { + private async _loadAndApplyConfigToExtension( + that: IIIFContentHandler, + data: IUVData, + extension: any + ): Promise { // import the config file if (!data.locales) { data.locales = []; data.locales.push(defaultLocale); } - let config = await (extension).loadConfig( + let config = await extension.loadConfig( data.locales[0].name, extension?.type.name ); 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 d3cc176d0..8c0dc02cf 100644 --- a/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts +++ b/src/content-handlers/iiif/extensions/uv-mediaelement-extension/Extension.ts @@ -30,8 +30,10 @@ import defaultConfig from "./config/config.json"; import { Events } from "../../../../Events"; import { Config } from "./config/Config"; -export default class Extension extends BaseExtension - implements IMediaElementExtension { +export default class Extension + extends BaseExtension + implements IMediaElementExtension +{ $downloadDialogue: JQuery; $shareDialogue: JQuery; $helpDialogue: JQuery; diff --git a/src/content-handlers/iiif/modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel.ts b/src/content-handlers/iiif/modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel.ts index 9a88aceb1..02de12e43 100644 --- a/src/content-handlers/iiif/modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel.ts +++ b/src/content-handlers/iiif/modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel.ts @@ -234,7 +234,7 @@ export class MediaElementCenterPanel extends CenterPanel< "sourcechooser", "fullscreen", ], - success: function(mediaElement: any, originalNode: any) { + success: function (mediaElement: any, originalNode: any) { mediaElement.addEventListener("loadstart", () => { // console.log("loadstart"); that.resize(); @@ -326,7 +326,7 @@ export class MediaElementCenterPanel extends CenterPanel< defaultAudioHeight: "auto", showPosterWhenPaused: true, showPosterWhenEnded: true, - success: function(mediaElement: any, originalNode: any) { + success: function (mediaElement: any, originalNode: any) { mediaElement.addEventListener("play", () => { that.extensionHost.publish( MediaElementExtensionEvents.MEDIA_PLAYED,