Skip to content

Commit

Permalink
rm old files
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Nov 15, 2023
1 parent e16a012 commit 062af38
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 792 deletions.
4 changes: 2 additions & 2 deletions src/IUVData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { EPubData } from "./content-handlers/iiif/EPubData";
import { IIIFData } from "./content-handlers/iiif/IIIFData";
import { YouTubeData } from "./content-handlers/youtube/YouTubeData";
import { ILocale } from "./content-handlers/iiif/modules/uv-shared-module/ILocale";
import { BaseConfig2 } from "./content-handlers/iiif/BaseConfig2";
import { BaseConfig } from "./content-handlers/iiif/BaseConfig";

export interface IUVData extends IIIFData, EPubData, YouTubeData {
config?: BaseConfig2; // do not pass this on initialisation, internal use only
config?: BaseConfig; // do not pass this on initialisation, internal use only
debug?: boolean;
embedded?: boolean;
isReload?: boolean;
Expand Down
88 changes: 84 additions & 4 deletions src/content-handlers/iiif/BaseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StorageType } from "@edsilv/utils";

export { StorageType } from "@edsilv/utils";

export type MetricType = "sm" | "md" | "lg" | "xl";
export type MetricType = string | "sm" | "md" | "lg" | "xl";

export class Metric {
constructor(public type: MetricType, public minWidth: number) {}
Expand Down Expand Up @@ -88,7 +88,7 @@ export type Options = {
theme: string;

/** Storage for tokens */
tokenStorage: StorageType;
tokenStorage: string | StorageType;

/** Determines if arrow keys can be used to navigate */
useArrowKeysToNavigate: boolean;
Expand All @@ -110,6 +110,80 @@ export type Localisation = {
locales: Locale[];
};

type DialogueContent = {
close: string;
};

type Dialogue = {
topCloseButtonEnabled: boolean;
content: DialogueContent;
};

/**
* Type for Download Dialogue Options
*/
type DownloadDialogueOptions = {
/** Size of the confined image */
confinedImageSize: number;
/** Percentage of the current view that is disabled */
currentViewDisabledPercentage: number;
/** Determines if download of current view is enabled */
downloadCurrentViewEnabled: boolean;
/** Determines if download of whole image in high resolution is enabled */
downloadWholeImageHighResEnabled: boolean;
/** Determines if download of whole image in low resolution is enabled */
downloadWholeImageLowResEnabled: boolean;
/** Maximum width of the image */
maxImageWidth: number;
/** Determines if explanatory text for options is enabled */
optionsExplanatoryTextEnabled: boolean;
/** Determines if selection is enabled */
selectionEnabled: boolean;
};

type DownloadDialogueContent = {
allPages: string;
currentViewAsJpg: string;
currentViewAsJpgExplanation: string;
download: string;
downloadSelection: string;
downloadSelectionExplanation: string;
editSettings: string;
entireDocument: string;
entireFileAsOriginal: string;
individualPages: string;
noneAvailable: string;
pagingNote: string;
preview: string;
selection: string;
termsOfUse: string;
title: string;
wholeImageHighRes: string;
wholeImageHighResExplanation: string;
wholeImageLowResAsJpg: string;
wholeImageLowResAsJpgExplanation: string;
wholeImagesHighRes: string;
wholeImagesHighResExplanation: string;
};

type DownloadDialogue = {
options: DownloadDialogueOptions;
content: DownloadDialogueContent;
};

type GenericDialogueContent = {
emptyValue: string;
invalidNumber: string;
noMatches: string;
ok: string;
pageNotFound: string;
refresh: string;
};

type GenericDialogue = {
content: GenericDialogueContent;
};

export type Content = {
authCORSError: string;
authorisationFailedMessage: string;
Expand All @@ -122,8 +196,14 @@ export type Content = {
termsOfUse: string;
};

export default interface BaseConfig {
export type BaseConfig = {
uri?: string;
options: Options;
modules: {
dialogue: Dialogue;
downloadDialogue: DownloadDialogue;
genericDialogue: GenericDialogue;
};
localisation: Localisation;
content: Content;
}
};
130 changes: 0 additions & 130 deletions src/content-handlers/iiif/BaseConfig2.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { createElement } from "react";
import { createStore, OpenSeadragonExtensionState } from "./Store";
import { merge } from "../../../../Utils";
import defaultConfig from "./config/config.json";
import { Config2 } from "./config/Config2";
import { Config } from "./config/Config";

export default class OpenSeadragonExtension extends BaseExtension {
$downloadDialogue: JQuery;
Expand Down Expand Up @@ -81,7 +81,7 @@ export default class OpenSeadragonExtension extends BaseExtension {
rightPanel: MoreInfoRightPanel;
settingsDialogue: SettingsDialogue;
shareDialogue: ShareDialogue;
defaultConfig: Config2 = defaultConfig;
defaultConfig: Config = defaultConfig;
locales = {
"en-GB": defaultConfig,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import BaseConfig, {
Content,
Localisation,
Options,
} from "@/content-handlers/iiif/BaseConfig";
import { BaseConfig } from "@/content-handlers/iiif/BaseConfig";

/**
* Type for Thumbs Cache Invalidation
Expand Down Expand Up @@ -97,67 +93,6 @@ type ContentLeftPanel = {
content: ContentLeftPanelContent;
};

type DialogueContent = {
close: string;
};

type Dialogue = {
topCloseButtonEnabled: boolean;
content: DialogueContent;
};

/**
* Type for Download Dialogue Options
*/
type DownloadDialogueOptions = {
/** Size of the confined image */
confinedImageSize: number;
/** Percentage of the current view that is disabled */
currentViewDisabledPercentage: number;
/** Determines if download of current view is enabled */
downloadCurrentViewEnabled: boolean;
/** Determines if download of whole image in high resolution is enabled */
downloadWholeImageHighResEnabled: boolean;
/** Determines if download of whole image in low resolution is enabled */
downloadWholeImageLowResEnabled: boolean;
/** Maximum width of the image */
maxImageWidth: number;
/** Determines if explanatory text for options is enabled */
optionsExplanatoryTextEnabled: boolean;
/** Determines if selection is enabled */
selectionEnabled: boolean;
};

type DownloadDialogueContent = {
allPages: string;
currentViewAsJpg: string;
currentViewAsJpgExplanation: string;
download: string;
downloadSelection: string;
downloadSelectionExplanation: string;
editSettings: string;
entireDocument: string;
entireFileAsOriginal: string;
individualPages: string;
noneAvailable: string;
pagingNote: string;
preview: string;
selection: string;
termsOfUse: string;
title: string;
wholeImageHighRes: string;
wholeImageHighResExplanation: string;
wholeImageLowResAsJpg: string;
wholeImageLowResAsJpgExplanation: string;
wholeImagesHighRes: string;
wholeImagesHighResExplanation: string;
};

type DownloadDialogue = {
options: DownloadDialogueOptions;
content: DownloadDialogueContent;
};

type FooterPanelOptions = {
/** Determines if autocomplete for words is allowed */
autocompleteAllowWords: boolean;
Expand Down Expand Up @@ -200,19 +135,6 @@ type FooterPanel = {
content: FooterPanelContent;
};

type GenericDialogueContent = {
emptyValue: string;
invalidNumber: string;
noMatches: string;
ok: string;
pageNotFound: string;
refresh: string;
};

type GenericDialogue = {
content: GenericDialogueContent;
};

type HeaderPanelOptions = {
/** Determines if center options are enabled */
centerOptionsEnabled: boolean;
Expand Down Expand Up @@ -544,10 +466,7 @@ type RestrictedDialogue = {

type Modules = {
contentLeftPanel: ContentLeftPanel;
dialogue: Dialogue;
downloadDialogue: DownloadDialogue;
footerPanel: FooterPanel;
genericDialogue: GenericDialogue;
headerPanel: HeaderPanel;
helpDialogue: HelpDialogue;
moreInfoRightPanel: MoreInfoRightPanel;
Expand All @@ -564,9 +483,6 @@ type Modules = {
restrictedDialogue: RestrictedDialogue;
};

export default interface Config extends BaseConfig {
options: Options;
localisation: Localisation;
content: Content;
export type Config = BaseConfig & {
modules: Modules;
}
};
Loading

0 comments on commit 062af38

Please sign in to comment.