-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ bf96c6b 🚀
- Loading branch information
Showing
10 changed files
with
625 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<link rel="icon" href="/tify/update-ci/tify.DDW8MAeX.ico"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>TIFY</title> | ||
<style> | ||
:root { | ||
--base-color: #06b; | ||
--base-color-lighter: #e6f0f8; | ||
--button-hover-bg: #0058a2; | ||
} | ||
|
||
html { | ||
background: #666; | ||
color: #333; | ||
font-size: 24px; | ||
} | ||
|
||
body { | ||
font: 16px/1rem sans-serif; | ||
margin: 0; | ||
} | ||
|
||
.button { | ||
background: var(--base-color) linear-gradient(to bottom, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)); | ||
border: 0; | ||
border-radius: 2px; | ||
color: #fff; | ||
cursor: pointer; | ||
font: inherit; | ||
font-size: .8125em; | ||
margin: .125rem; | ||
padding: .125rem .5rem; | ||
white-space: nowrap; | ||
} | ||
|
||
.button:focus, | ||
.button:hover { | ||
background-color: var(--button-hover-bg); | ||
opacity: 1 !important; | ||
} | ||
|
||
.button:active { | ||
box-shadow: 0 .5px 3px rgba(0, 0, 0, .2) inset, 0 0 0 1px rgba(0, 0, 0, .1) inset; | ||
} | ||
|
||
.header-form { | ||
background: #fff; | ||
display: flex; | ||
align-items: center; | ||
padding: .125rem; | ||
} | ||
|
||
.header-input { | ||
background: #fff; | ||
border: 1px solid transparent; | ||
border-radius: 2px; | ||
color: inherit; | ||
flex: 1; | ||
font: inherit; | ||
margin: .125rem; | ||
min-width: 0; | ||
padding: calc(.125rem - 1px) calc(.25rem - 1px); | ||
} | ||
|
||
.header-input:focus { | ||
border-color: var(--base-color); | ||
outline: 2px solid var(--base-color-lighter); | ||
} | ||
|
||
.main { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.instance { | ||
box-shadow: -1px 0 rgba(0, 0, 0, .2), 0 -1px rgba(0, 0, 0, .2); | ||
flex: 1; | ||
position: relative; | ||
z-index: 1; | ||
} | ||
|
||
.instance-header { | ||
display: flex; | ||
position: absolute; | ||
top: 0; | ||
z-index: 10; | ||
} | ||
|
||
.instance-close { | ||
border-radius: 0; | ||
clip-path: polygon(0 0, 100% 0, 0 100%); | ||
height: 1.25rem; | ||
line-height: 1; | ||
margin: 0; | ||
opacity: .5; | ||
padding: 0 .5rem .5rem 0; | ||
width: 1.25rem; | ||
} | ||
|
||
.instance-tify { | ||
height: calc(100vh - 1.75rem); | ||
} | ||
</style> | ||
<script type="module" crossorigin src="/tify/update-ci/tify.Dkivg9DL.js"></script> | ||
<link rel="stylesheet" crossorigin href="/tify/update-ci/tify.DswYTg7Y.css"> | ||
</head> | ||
|
||
<body> | ||
<header class="header"> | ||
<form class="header-form" onsubmit="addInstance(); return false"> | ||
<input | ||
type="url" | ||
class="header-input" | ||
id="manifestUrl" | ||
placeholder="IIIF manifest URL" | ||
aria-label="IIIF manifest URL" | ||
onfocus="event.target.select()" | ||
/> | ||
<button type="submit" class="button">Add</button> | ||
<button type="reset" class="button" onclick="removeAllInstances()">Remove all</button> | ||
</form> | ||
</header> | ||
<main class="main"> | ||
<div class="instance"> | ||
<header class="instance-header"> | ||
<button class="button instance-close" aria-label="Remove instance"> | ||
× | ||
</button> | ||
</header> | ||
<div class="instance-tify"></div> | ||
</div> | ||
</main> | ||
|
||
<script> | ||
const tifyOptions = { | ||
translationsDirUrl: 'translations', | ||
}; | ||
|
||
const main = document.querySelector('main'); | ||
const manifestUrlInput = document.querySelector('#manifestUrl'); | ||
const template = document.querySelector('.instance'); | ||
template.remove(); | ||
|
||
const instances = []; | ||
window.instances = instances; | ||
|
||
// Restore instances from URL query | ||
window.onload = () => { | ||
const url = new URL(window.location); | ||
for (const [key, value] of url.searchParams) { | ||
if (key.startsWith('language')) { | ||
const id = parseInt(key.replace('language', ''), 10) || ''; | ||
instances.find(instance => instance.id === id).tify.setLanguage(value) | ||
} | ||
|
||
if (!key.startsWith('manifest')) { | ||
continue | ||
} | ||
|
||
const id = parseInt(key.replace('manifest', ''), 10) || ''; | ||
addInstance({ | ||
id, | ||
manifestUrl: value, | ||
urlQueryKey: `tify${id}`, | ||
}); | ||
} | ||
}; | ||
|
||
function addInstance(options = {}) { | ||
element = template.cloneNode(true); | ||
main.append(element); | ||
|
||
let id = options.id || ''; | ||
while (instances.find(instance => instance.id === id)) { | ||
id = (id || 0) + 1; | ||
} | ||
|
||
tifyOptions.container = element.querySelector('.instance-tify'); | ||
tifyOptions.manifestUrl = options.manifestUrl || manifestUrlInput.value; | ||
tifyOptions.urlQueryKey = options.urlQueryKey || `tify${id}`; | ||
|
||
const tify = new Tify(tifyOptions); | ||
const instance = { element, id, tify }; | ||
instances.push(instance); | ||
|
||
// Expose API of lastest instance for e2e tests | ||
window.tify = tify; | ||
|
||
element.querySelector('.instance-close').onclick = () => removeInstance(instance); | ||
|
||
// Update URL query if manifest was set via input | ||
if (!options.manifestUrl) { | ||
const url = new URL(window.location); | ||
url.searchParams.append(`manifest${id}`, tifyOptions.manifestUrl); | ||
window.history.pushState(null, '', url.toString()); | ||
} | ||
} | ||
|
||
function removeInstance(instanceToRemove) { | ||
instanceToRemove.element.remove(); | ||
instanceToRemove.tify.destroy(); | ||
|
||
instances.splice(instances.findIndex(instance => instance.id === instanceToRemove.id), 1); | ||
|
||
const url = new URL(window.location); | ||
url.searchParams.delete(`language${instanceToRemove.id}`); | ||
url.searchParams.delete(`manifest${instanceToRemove.id}`); | ||
url.searchParams.delete(`tify${instanceToRemove.id}`); | ||
window.history.pushState(null, '', url.toString()); | ||
} | ||
|
||
function removeAllInstances() { | ||
[...instances].forEach(instance => removeInstance(instance)) | ||
} | ||
</script> | ||
</body> |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"$language": "Deutsch", | ||
"$copyright": "Copyright © 2017–2022 <a href='https://www.uni-goettingen.de/'>Universität Göttingen</a> / <a href='https://www.sub.uni-goettingen.de/'>Staats- und Universitätsbibliothek Göttingen</a>", | ||
"$info": "TIFY ist ein schlanker und für Mobilgeräte optimierter IIIF-Dokumenten­betrachter, veröffentlicht unter der <a href='https://www.gnu.org/licenses/agpl-3.0.html.en'>GNU Affero General Public License 3.0</a>.", | ||
"About TIFY": "Über TIFY", | ||
"Brightness": "Helligkeit", | ||
"Close PDF list": "PDF-Liste schließen", | ||
"Collapse": "Einklappen", | ||
"Collapse all": "Alle einklappen", | ||
"Collection": "Sammlung", | ||
"Contents": "Inhalt", | ||
"Contrast": "Kontrast", | ||
"Contributors": "Beitragende", | ||
"Could not load child manifest": "Konnte Kind-Manifest nicht laden", | ||
"Current Element": "Aktuelles Element", | ||
"Current page:": "Aktuelle Seite:", | ||
"Description": "Beschreibung", | ||
"Dismiss": "Ausblenden", | ||
"Document": "Dokument", | ||
"Download Individual Images": "Einzelbilder herunterladen", | ||
"Exit fullscreen": "Vollbildmodus verlassen", | ||
"Expand": "Ausklappen", | ||
"Expand all": "Alle ausklappen", | ||
"Export": "Export", | ||
"Filter collection": "Sammlung filtern", | ||
"Filter pages": "Seiten filtern", | ||
"First page": "Erste Seite", | ||
"Fullscreen": "Vollbildmodus", | ||
"Fulltext": "Volltext", | ||
"Fulltext not available for this page": "Volltext nicht verfügbar", | ||
"Help": "Hilfe", | ||
"IIIF manifest": "IIIF-Manifest", | ||
"IIIF manifest (collection)": "IIIF-Manifest (Sammlung)", | ||
"IIIF manifest (current document)": "IIIF-Manifest (Dokument)", | ||
"Image filters": "Bildfilter", | ||
"Info": "Info", | ||
"Last page": "Letzte Seite", | ||
"License": "Lizenz", | ||
"Loading": "Wird geladen", | ||
"Logo": "Logo", | ||
"Metadata": "Metadaten", | ||
"Next page": "Nächste Seite", | ||
"Next section": "Nächster Abschnitt", | ||
"No results": "Keine Treffer", | ||
"Other Formats": "Andere Formate", | ||
"page": "Seite", | ||
"Page": "Seite", | ||
"pages": "Seiten", | ||
"Pages": "Seiten", | ||
"PDFs for each element": "PDFs für einzelne Elemente", | ||
"Previous page": "Vorige Seite", | ||
"Previous section": "Voriger Abschnitt", | ||
"Related Resources": "Zugehörige Quellen", | ||
"Renderings": "Bilddaten", | ||
"Report a bug": "Fehler melden", | ||
"Reset": "Zurücksetzen", | ||
"Rotate": "Drehen", | ||
"Saturation": "Sättigung", | ||
"Scan": "Scan", | ||
"Source code": "Quellcode", | ||
"Table of Contents": "Inhaltsverzeichnis", | ||
"Title": "Titel", | ||
"Toggle double-page": "Doppelseite umschalten", | ||
"Toggle image filters": "Bildfilter umschalten", | ||
"Toggle page select": "Seitenauswahl umschalten", | ||
"User guide": "Kurzanleitung", | ||
"Version": "Version", | ||
"View": "Ansicht", | ||
"Zoom in": "Vergrößern", | ||
"Zoom out": "Verkleinern" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"$language": "Esperanto", | ||
"$copyright": "Kopirajtoj © 2017–2022 <a href='https://www.uni-goettingen.de/'>Universitato Goettingen</a> / <a href='https://www.sub.uni-goettingen.de/'>Ŝtata kaj Universitata Biblioteko Goettingen</a>", | ||
"$info": "TIFY estas pli svelta kaj pli movebla amika IIIF-dokumentrigardilo publikigita sub la <a href='https://www.gnu.org/licenses/agpl-3.0.html.en'>Ĝenerala Publika Permesilo 3.0 de GNU Affero</a>.", | ||
"About TIFY": "Per TIFY", | ||
"Brightness": "Helecon", | ||
"Close PDF list": "Fermu PDF-liston", | ||
"Collapse all": "Kolapu ĉion", | ||
"Collapse": "Kolapso", | ||
"Collection": "Kolekto", | ||
"Contents": "Enhavojn", | ||
"Contrast": "Kontrasto", | ||
"Contributors": "Kontribuanto", | ||
"Current Element": "Nuna ero", | ||
"Current page:": "Nuna paĝo:", | ||
"Description": "Priskribo", | ||
"Document": "Dokumento", | ||
"Download Individual Images": "Elŝutu unuopajn bildojn", | ||
"Exit fullscreen": "Eliru plenekranan reĝimon", | ||
"Expand all": "Plivastigu ĉion", | ||
"Expand": "Disfaldas", | ||
"Export": "Eksporti", | ||
"Filter pages": "Filtrilaj paĝoj", | ||
"First page": "Unua paĝo", | ||
"Fullscreen": "Plena ekrana reĝimo", | ||
"Fulltext not available for this page": "Plena teksto ne havebla", | ||
"Fulltext": "Plena teksto", | ||
"Help": "Helpu", | ||
"IIIF manifest": "IIIF-Manifesto", | ||
"Image filters": "Bilda filtrilo", | ||
"Info": "Info", | ||
"Last page": "Lasta paĝo", | ||
"License": "Permesilo", | ||
"Loading": "Ŝarĝante", | ||
"Logo": "Emblemo", | ||
"Metadata": "Metadatenoj", | ||
"Next page": "Sekva paĝo", | ||
"Next section": "Sekva sekcio", | ||
"Other Formats": "Aliaj formatoj", | ||
"page": "paĝo", | ||
"Page": "Paĝo", | ||
"pages": "paĝoj", | ||
"Pages": "Paĝoj", | ||
"PDFs for each element": "PDF-oj por individuaj eroj", | ||
"Previous page": "Antaŭa paĝo", | ||
"Previous section": "Antaŭa sekcio", | ||
"Related Resources": "Rilataj fontoj", | ||
"Renderings": "Bildaj datumoj", | ||
"Report a bug": "Raportu eraron", | ||
"Reset": "Restarigi al defaŭlta", | ||
"Rotate": "Turni", | ||
"Saturation": "Saturiĝo", | ||
"Scan": "Skani", | ||
"Source code": "Fontkodo", | ||
"Table of Contents": "Enhavtabelo", | ||
"Title": "Titolo", | ||
"Toggle double-page": "Ŝaltu duoblan paĝon", | ||
"Toggle image filters": "Ŝaltu bildfiltrilojn", | ||
"User guide": "Uzant-gvidilo", | ||
"Version": "Versio", | ||
"View": "Vido", | ||
"Zoom in": "Zomi", | ||
"Zoom out": "Malzomi" | ||
} |
Oops, something went wrong.