From 5506f800a90c89eac11b3dc9b0b14f6e213b77d1 Mon Sep 17 00:00:00 2001 From: eumalin Date: Tue, 19 May 2026 15:27:00 -0400 Subject: [PATCH] run prettier --- pt/web/firebird/src/js/App.svelte | 10 +- .../js/components/DownloadPanel/index.svelte | 834 +++++++++--------- .../JumpToSectionPanel/index.svelte | 2 +- .../src/js/components/Reader/GridView.svelte | 14 +- .../js/components/Reader/ImageFormat.svelte | 15 +- .../src/js/components/Reader/OneUpView.svelte | 12 +- .../src/js/components/Reader/Page.svelte | 27 +- .../src/js/components/Reader/PageMenu.svelte | 27 +- .../js/components/Reader/PageMessage.svelte | 3 +- .../components/Reader/PlaintextFormat.svelte | 9 +- .../src/js/components/Reader/TwoUpView.svelte | 19 +- .../RestrictedView/TombstoneItem.svelte | 5 +- .../src/js/components/SearchForm/index.svelte | 56 +- .../components/SearchHighlights/index.svelte | 2 +- .../src/js/components/SharePanel/index.svelte | 1 - .../components/ViewerToolbar/ViewMenu.svelte | 94 +- .../js/components/ViewerToolbar/index.svelte | 40 +- pt/web/firebird/src/js/lib/tippy.js | 14 +- 18 files changed, 623 insertions(+), 561 deletions(-) diff --git a/pt/web/firebird/src/js/App.svelte b/pt/web/firebird/src/js/App.svelte index 60475d872..e852f3a30 100644 --- a/pt/web/firebird/src/js/App.svelte +++ b/pt/web/firebird/src/js/App.svelte @@ -1,7 +1,7 @@ {#snippet icon()} - + {/snippet} {#snippet title()} Download {/snippet} {#snippet body()} - {#if allowDownload && !manifest.allowFullDownload && $currentView == 'thumb'} -
Please choose another view to download individual pages.
- {:else if allowDownload} -
-
- Format + {#if allowDownload && !manifest.allowFullDownload && $currentView == 'thumb'} +
Please choose another view to download individual pages.
+ {:else if allowDownload} + +
+ Format +
+ + +
+ {#if manifest.allowFullDownload}
- +
- {#if manifest.allowFullDownload} -
- - -
- {/if} + {/if} +
+ + +
+ {#if manifest.allowFullDownload}
- +
- {#if manifest.allowFullDownload} -
- - -
- {/if} + {/if} +
+ + +
+
+ + +
+
+ + {#if format.startsWith('image-')} +
+ Image Resolution
- +
- +
+ {/if} - {#if format.startsWith('image-')} -
- Image Resolution -
- - -
-
- - -
-
- {/if} - - -
- Range - {#if $currentView == '1up'} + +
+ Range + {#if $currentView == '1up'} +
+ + +
+ {:else if $currentView == '2up'} + {#if $currentLocation.verso}
-
- {:else if $currentView == '2up'} - {#if $currentLocation.verso} -
- - -
- {/if} - {#if $currentLocation.recto} -
- - -
- {/if} {/if} - {#if manifest.allowFullDownload} -
- 10 && format == 'image-tiff'} - bind:group={range} - /> - -
+ {#if $currentLocation.recto}
- -
- -
-
    - {#each flattenedSelection as sel} -
  • - -
  • - {/each} -
- +
{/if} -
-

+ {/if} + {#if manifest.allowFullDownload} +

+ 10 && format == 'image-tiff'} + bind:group={range} + /> + +
+
+ + +
+ +
+
    + {#each flattenedSelection as sel} +
  • + +
  • + {/each} +
+ +
+ {/if} +
+

{#if !simpleDownload} - {:else if simpleDownload && buttonDisabled} - Download - {:else} - {downloadAttempt++}} - href={simpleUrl}>Download - {/if} -

- {#if errorMessage} -
-
- -
-

{@html errorMessage}

-
- {/if} -

+ {:else if simpleDownload && buttonDisabled} + Download + {:else} Download Help { + downloadAttempt++; + }} + href={simpleUrl}>Download -

- {#if !manifest.allowFullDownload && !HT.login_status.logged_in} -

- Log in to your library to - download this item. -

-

- If you are not affiliated with a member institution, whole book download is not available. (Why not?) -

{/if} - - {:else} -

This item cannot be downloaded.

- {/if} - +

+ {#if errorMessage} +
+
+ +
+

{@html errorMessage}

+
+ {/if} +

+ Download Help +

+ {#if !manifest.allowFullDownload && !HT.login_status.logged_in} +

+ Log in to your library to + download this item. +

+

+ If you are not affiliated with a member institution, whole book download is not available. (Why not?) +

+ {/if} + + {:else} +

This item cannot be downloaded.

+ {/if} {/snippet} {#snippet title()} {#if simpleDownload} Download your {formatTitle[format]} - {:else if downloadError} + {:else if downloadError} Download failed {:else} Building your {formatTitle[format]} @@ -776,74 +806,74 @@
{#if simpleDownload}

Your download is ready.

- {:else} - {#if status.percent < 100 && !downloadError} -

Please wait while we build your {formatTitle[format]}.

+ {:else if status.percent < 100 && !downloadError} +

Please wait while we build your {formatTitle[format]}.

+
+
+

+ What affects the download speed? -

-
-

- What affects the download speed? -

- {/if} +

{/if} {#if !simpleDownload && status.done}

All done! Your {formatTitle[format]} is ready for download.

{/if} - {#if !simpleDownload && downloadError} + {#if !simpleDownload && downloadError}
-

{@html downloadErrorMessage}

+

{@html downloadErrorMessage}

{/if} - {/snippet} {#snippet footer()} - {#if !downloadError} -
-
- {#if !simpleDownload} - - {/if} - {#if !simpleDownload && downloadInProgress} - Download - {:else} - {modal.hide(); () => document.getElementById('submit-download').focus();})} - href={simpleDownload ? simpleUrl : downloadUrl}>Download + {#if !downloadError} +
+
+ {#if !simpleDownload} + + {/if} + {#if !simpleDownload && downloadInProgress} + Download + {:else} + { + modal.hide(); + () => document.getElementById('submit-download').focus(); + }} + href={simpleDownload ? simpleUrl : downloadUrl}>Download + {/if} +
+ {#if !simpleDownload && cancellingDownload} + Download cancelled {/if}
- {#if !simpleDownload && cancellingDownload} - Download cancelled - {/if} -
{/if} {/snippet} diff --git a/pt/web/firebird/src/js/components/JumpToSectionPanel/index.svelte b/pt/web/firebird/src/js/components/JumpToSectionPanel/index.svelte index 2527d86b2..cbf9bed01 100644 --- a/pt/web/firebird/src/js/components/JumpToSectionPanel/index.svelte +++ b/pt/web/firebird/src/js/components/JumpToSectionPanel/index.svelte @@ -91,7 +91,7 @@ {#snippet title()} Jump to page scan - {/snippet} + {/snippet} {#snippet body()}

diff --git a/pt/web/firebird/src/js/components/Reader/GridView.svelte b/pt/web/firebird/src/js/components/Reader/GridView.svelte index b580721d5..10fc56708 100644 --- a/pt/web/firebird/src/js/components/Reader/GridView.svelte +++ b/pt/web/firebird/src/js/components/Reader/GridView.svelte @@ -1,6 +1,6 @@ - - - + import View from './View.svelte'; + export let view; + + + + diff --git a/pt/web/firebird/src/js/components/Reader/OneUpView.svelte b/pt/web/firebird/src/js/components/Reader/OneUpView.svelte index 9f32dd3c0..688bd1091 100644 --- a/pt/web/firebird/src/js/components/Reader/OneUpView.svelte +++ b/pt/web/firebird/src/js/components/Reader/OneUpView.svelte @@ -1,17 +1,17 @@ - - + diff --git a/pt/web/firebird/src/js/components/Reader/Page.svelte b/pt/web/firebird/src/js/components/Reader/Page.svelte index c4d3f23fc..0a57f9ab0 100644 --- a/pt/web/firebird/src/js/components/Reader/Page.svelte +++ b/pt/web/firebird/src/js/components/Reader/Page.svelte @@ -420,28 +420,27 @@ } }; - const togglePageSelection = function (event) { - manifest.select(seq, event) - } + manifest.select(seq, event); + }; const rotateScan = async function () { orient = (orient + 90) % 360; if (orient == 0) { - rotateButtonContent = '90' + rotateButtonContent = '90'; return; } else if (orient == 90) { - rotateButtonContent = '180' + rotateButtonContent = '180'; } else if (orient == 180) { - rotateButtonContent = '270' - } else if (orient = 270) { - rotateButtonContent = '0' + rotateButtonContent = '270'; + } else if ((orient = 270)) { + rotateButtonContent = '0'; } if (!rotatedImage) { await tick(); } - console.log("-- page.rotateScan", seq, rotatedImage, orient, `Rorate page, ${rotateButtonContent} degrees`); + console.log('-- page.rotateScan', seq, rotatedImage, orient, `Rorate page, ${rotateButtonContent} degrees`); drawRotatedImage(); }; @@ -477,7 +476,7 @@ pageZoom = zoom; } pageZoom += delta; - console.log('zoom: ', delta, pageZoom, zoom) + console.log('zoom: ', delta, pageZoom, zoom); loadImage(true); }; @@ -978,7 +977,9 @@ Delta: {xChokeDelta}{#if xChokeAllowed == 0} padding: 2rem 1rem; background: #fff; - box-shadow: 0px 10px 13px -7px #000000, 0px 6px 15px 5px rgba(0, 0, 0, 0); + box-shadow: + 0px 10px 13px -7px #000000, + 0px 6px 15px 5px rgba(0, 0, 0, 0); border: 1px solid #ddd; transition: height 100ms; @@ -1000,7 +1001,9 @@ Delta: {xChokeDelta}{#if xChokeAllowed == 0} height: auto; background: #f9f8f5; - box-shadow: 0px 10px 13px -7px #000000, 0px 6px 15px 5px rgba(0, 0, 0, 0); + box-shadow: + 0px 10px 13px -7px #000000, + 0px 6px 15px 5px rgba(0, 0, 0, 0); border: 1px solid #ddd; } diff --git a/pt/web/firebird/src/js/components/Reader/PageMenu.svelte b/pt/web/firebird/src/js/components/Reader/PageMenu.svelte index 5e5bf9c7c..b83e0ef37 100644 --- a/pt/web/firebird/src/js/components/Reader/PageMenu.svelte +++ b/pt/web/firebird/src/js/components/Reader/PageMenu.svelte @@ -22,16 +22,15 @@ let selectedButtonContent; - - function scanSelected () { + function scanSelected() { if (selected) { - selectedButtonContent = `Scan #${seq} is selected` - } else if(!selected) { - selectedButtonContent = `Select scan #${seq}` + selectedButtonContent = `Scan #${seq} is selected`; + } else if (!selected) { + selectedButtonContent = `Select scan #${seq}`; } - }; + } - scanSelected() + scanSelected(); // let isOpen = true; // selected || null; let isDisabled = view == 'thumb' && !allowFullDownload; @@ -41,8 +40,6 @@ export let updateZoom = function () {}; export let togglePageSelection = function () {}; export let openLightbox = function () {}; - - @@ -73,7 +70,7 @@ {:else} {@html message.alert} diff --git a/pt/web/firebird/src/js/components/Reader/PlaintextFormat.svelte b/pt/web/firebird/src/js/components/Reader/PlaintextFormat.svelte index bc0853b4b..b5f25f7fa 100644 --- a/pt/web/firebird/src/js/components/Reader/PlaintextFormat.svelte +++ b/pt/web/firebird/src/js/components/Reader/PlaintextFormat.svelte @@ -1,7 +1,8 @@ - + + - \ No newline at end of file + diff --git a/pt/web/firebird/src/js/components/Reader/TwoUpView.svelte b/pt/web/firebird/src/js/components/Reader/TwoUpView.svelte index a625ec6d7..05b002d89 100644 --- a/pt/web/firebird/src/js/components/Reader/TwoUpView.svelte +++ b/pt/web/firebird/src/js/components/Reader/TwoUpView.svelte @@ -1,7 +1,7 @@ - - + diff --git a/pt/web/firebird/src/js/components/RestrictedView/TombstoneItem.svelte b/pt/web/firebird/src/js/components/RestrictedView/TombstoneItem.svelte index d1582c960..f9a1a7fed 100644 --- a/pt/web/firebird/src/js/components/RestrictedView/TombstoneItem.svelte +++ b/pt/web/firebird/src/js/components/RestrictedView/TombstoneItem.svelte @@ -12,7 +12,10 @@

  • It was suppressed at the request of the rights holder;
  • -
  • There were issues related to contractual, legal, copyright, privacy, or confidentiality (e.g., sensitive archaeological sites, Native American sacred knowledge);
  • +
  • + There were issues related to contractual, legal, copyright, privacy, or confidentiality (e.g., sensitive + archaeological sites, Native American sacred knowledge); +
  • It was either wholly unusable or a superior copy is available.
diff --git a/pt/web/firebird/src/js/components/SearchForm/index.svelte b/pt/web/firebird/src/js/components/SearchForm/index.svelte index 6a75f4cfc..39cd8c2d2 100644 --- a/pt/web/firebird/src/js/components/SearchForm/index.svelte +++ b/pt/web/firebird/src/js/components/SearchForm/index.svelte @@ -383,38 +383,42 @@ diff --git a/pt/web/firebird/src/js/components/SearchHighlights/index.svelte b/pt/web/firebird/src/js/components/SearchHighlights/index.svelte index 8fad1b170..e634c6041 100644 --- a/pt/web/firebird/src/js/components/SearchHighlights/index.svelte +++ b/pt/web/firebird/src/js/components/SearchHighlights/index.svelte @@ -202,7 +202,7 @@ style:height={highlight.height} style:top={highlight.top} style:left={highlight.left} - > + > {/each} {/if} diff --git a/pt/web/firebird/src/js/components/SharePanel/index.svelte b/pt/web/firebird/src/js/components/SharePanel/index.svelte index e3ab17eb7..008129ba4 100644 --- a/pt/web/firebird/src/js/components/SharePanel/index.svelte +++ b/pt/web/firebird/src/js/components/SharePanel/index.svelte @@ -191,4 +191,3 @@

{/snippet}
- diff --git a/pt/web/firebird/src/js/components/ViewerToolbar/ViewMenu.svelte b/pt/web/firebird/src/js/components/ViewerToolbar/ViewMenu.svelte index b1db0a4c3..20da309df 100644 --- a/pt/web/firebird/src/js/components/ViewerToolbar/ViewMenu.svelte +++ b/pt/web/firebird/src/js/components/ViewerToolbar/ViewMenu.svelte @@ -13,8 +13,9 @@ emitter.emit('view.switch', { view: value }); // $view = value; } - - if (document.activeElement !== document.getElementById('view-button')) document.getElementById('view-button').focus(); + + if (document.activeElement !== document.getElementById('view-button')) + document.getElementById('view-button').focus(); } function switchFormat(event) { @@ -24,7 +25,8 @@ // $format = value; emitter.emit('view.switch.format', { format: value }); } - if (document.activeElement !== document.getElementById('view-button')) document.getElementById('view-button').focus(); + if (document.activeElement !== document.getElementById('view-button')) + document.getElementById('view-button').focus(); } @@ -39,10 +41,10 @@ + > View {#if manifest.ui !== 'embed'} - -
  • - - View Mode - -
  • - - -
  • - -
  • {/if}
    diff --git a/pt/web/firebird/src/js/components/ViewerToolbar/index.svelte b/pt/web/firebird/src/js/components/ViewerToolbar/index.svelte index 9ce4d7edd..908adc977 100644 --- a/pt/web/firebird/src/js/components/ViewerToolbar/index.svelte +++ b/pt/web/firebird/src/js/components/ViewerToolbar/index.svelte @@ -59,7 +59,7 @@ // console.log("-- toggleFullScreen", screenfull.isFullscreen); $isFullscreen = screenfull.isFullscreen; emitter.emit('log.action', { action: 'toggle.fullscreen', value: $isFullscreen }); - $isFullscreen ? fullscreenButtonContent = 'Exit Full Screen' : fullscreenButtonContent = 'Enter Full Screen' + $isFullscreen ? (fullscreenButtonContent = 'Exit Full Screen') : (fullscreenButtonContent = 'Enter Full Screen'); }); }; @@ -67,14 +67,14 @@ // if it's not fullscreen and the interface is still in 'minimal' mode, // change the interface back to default // regardless, the tooltip text should change - addEventListener("fullscreenchange", () => { + addEventListener('fullscreenchange', () => { if (screenfull.isEnabled) { - if (!screenfull.isFullscreen) { - if ($interfaceMode == 'minimal') { - toggleInterface() - } - fullscreenButtonContent = 'Enter Full Screen' + if (!screenfull.isFullscreen) { + if ($interfaceMode == 'minimal') { + toggleInterface(); } + fullscreenButtonContent = 'Enter Full Screen'; + } } }); @@ -120,7 +120,7 @@ onMount(() => { isFullscreenEnabled = screenfull.isEnabled; - isFullscreen ? fullscreenButtonContent = 'Enter Full Screen' : fullscreenButtonContent = 'Exit Full Screen' + isFullscreen ? (fullscreenButtonContent = 'Enter Full Screen') : (fullscreenButtonContent = 'Exit Full Screen'); window.screenfull = screenfull; return () => { // emitter.off('location.updated', updateSeq); @@ -144,7 +144,7 @@ class:fa-eye={$interfaceMode == 'default'} class:fa-regular={$interfaceMode == 'minimal'} class:fa-eye-slash={$interfaceMode == 'minimal'} - > + > @@ -183,7 +183,7 @@ class="btn btn-outline-dark" aria-label="Zoom In" disabled={!enableZoomIn} - use:tooltippy={{appendTo: document.querySelector("[aria-label='Zoom']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Zoom']") }} on:click={() => zoom(1)} > @@ -193,7 +193,7 @@ class="btn btn-outline-dark" aria-label="Zoom Out" disabled={!enableZoomOut} - use:tooltippy={{appendTo: document.querySelector("[aria-label='Zoom']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Zoom']") }} on:click={() => zoom(-1)} > @@ -208,7 +208,7 @@ type="button" class="btn btn-outline-dark d-none d-md-block" aria-label="Last Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.last', seq: manifest.totalSeq })} > @@ -218,7 +218,7 @@ type="button" class="btn btn-outline-dark" aria-label="Next Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.next', delta: 1 })} > @@ -228,7 +228,7 @@ type="button" class="btn btn-outline-dark" aria-label="Previous Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.prev', delta: -1 })} > @@ -238,7 +238,7 @@ type="button" class="btn btn-outline-dark d-none d-md-block" aria-label="First Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.first', seq: 1 })} > @@ -251,7 +251,7 @@ type="button" class="btn btn-outline-dark d-none d-md-block" aria-label="First Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.first', seq: 1 })} > @@ -261,7 +261,7 @@ type="button" class="btn btn-outline-dark" aria-label="Previous Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.prev', delta: -1 })} > @@ -271,7 +271,7 @@ type="button" class="btn btn-outline-dark" aria-label="Next Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.next', delta: 1 })} > @@ -281,7 +281,7 @@ type="button" class="btn btn-outline-dark d-none d-md-block" aria-label="Last Page" - use:tooltippy={{appendTo: document.querySelector("[aria-label='Pagination']")}} + use:tooltippy={{ appendTo: document.querySelector("[aria-label='Pagination']") }} on:click={() => goto({ action: 'goto.last', seq: manifest.totalSeq })} > @@ -295,7 +295,7 @@ type="button" class="btn btn-outline-dark" aria-label={`${fullscreenButtonContent}`} - use:tooltippy={{content: `${fullscreenButtonContent}`}} + use:tooltippy={{ content: `${fullscreenButtonContent}` }} on:click={toggleFullscreen} > diff --git a/pt/web/firebird/src/js/lib/tippy.js b/pt/web/firebird/src/js/lib/tippy.js index d97bdab9b..f7afd25ae 100644 --- a/pt/web/firebird/src/js/lib/tippy.js +++ b/pt/web/firebird/src/js/lib/tippy.js @@ -22,12 +22,10 @@ const hideOnEsc = { }, }; - - export function tooltippy(element, params = {}) { const custom = params.content; - const label = element.getAttribute("aria-label"); - + const label = element.getAttribute('aria-label'); + const content = custom || label; const tooltippy = tippy(element, { @@ -35,19 +33,19 @@ export function tooltippy(element, params = {}) { content, appendTo: 'parent', interactive: true, - aria: { - expanded: false, + aria: { + expanded: false, }, plugins: [hideOnEsc], // hideOnClick: true, placement: 'top', theme: 'pt', maxWidth: 'none', - ...params + ...params, }); return { update(newParams) { - tooltippy.setProps({content, ...newParams}); + tooltippy.setProps({ content, ...newParams }); }, destroy() { tooltippy.destroy();