Skip to content

Commit

Permalink
Lint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Jan 22, 2025
1 parent 9d5cef4 commit ee7495a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/BaseContentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export type EventListener = {
type EventListenerDictionaryItem = Pick<EventListener, "cb" | "ctx">;

export default class BaseContentHandler<IUVData>
implements IContentHandler<IUVData> {
implements IContentHandler<IUVData>
{
protected _el: HTMLElement;
private _eventListeners: {
[key: string]: EventListenerDictionaryItem[];
Expand Down
17 changes: 9 additions & 8 deletions src/UniversalViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ export class UniversalViewer extends BaseContentHandler<IUVData<any>> {
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;
Expand Down
14 changes: 10 additions & 4 deletions src/content-handlers/iiif/IIIFContentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ const Extension: IExtensionRegistry = {
},
};

export default class IIIFContentHandler extends BaseContentHandler<IIIFData>
implements IIIFExtensionHost, IContentHandler<IIIFData> {
export default class IIIFContentHandler
extends BaseContentHandler<IIIFData>
implements IIIFExtensionHost, IContentHandler<IIIFData>
{
private _extensionRegistry: IExtensionRegistry;
private _pubsub: PubSub;
public extension: IExtension | undefined;
Expand Down Expand Up @@ -264,13 +266,17 @@ export default class IIIFContentHandler extends BaseContentHandler<IIIFData>
this.disposed = true;
}

private async _loadAndApplyConfigToExtension(that: IIIFContentHandler, data: IUVData<any>, extension: any): Promise<void> {
private async _loadAndApplyConfigToExtension(
that: IIIFContentHandler,
data: IUVData<any>,
extension: any
): Promise<void> {
// 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
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Config>
implements IMediaElementExtension {
export default class Extension
extends BaseExtension<Config>
implements IMediaElementExtension
{
$downloadDialogue: JQuery;
$shareDialogue: JQuery;
$helpDialogue: JQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ee7495a

Please sign in to comment.