-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #549 from giacomomarchioro/0540-link-for-opening-m…
…ultiple-canvases 0540 link for opening multiple canvases
- Loading branch information
Showing
28 changed files
with
498 additions
and
25 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
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
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,39 @@ | ||
{% if include.viewers %} | ||
{% assign viewers = include.viewers | split: "," %} | ||
{% else %} | ||
{% assign viewers = page.viewers %} | ||
{% endif %} | ||
[JSON-LD]({{ include.iiif-content }}) {% for viewerTxt in viewers %}{% assign viewer = viewerTxt | strip %}| {% include viewer_link.html type=viewer manifest=include.iiif-content class="content-state" %}{% endfor %} | ||
|
||
{% if page.code %} | ||
{% include code_links.html %} | ||
{% endif %} | ||
|
||
<script> | ||
function encodeContentState(plainContentState) { | ||
let uriEncoded = encodeURIComponent(plainContentState); // using built in function | ||
let base64 = btoa(uriEncoded); // using built in function | ||
let base64url = base64.replace(/\+/g, "-").replace(/\//g, "_"); | ||
let base64urlNoPadding = base64url.replace(/=/g, ""); | ||
return base64urlNoPadding; | ||
} | ||
|
||
const links = document.getElementsByClassName("content-state"); | ||
|
||
Array.from(links).forEach(link => { | ||
link.title = "Generating iiif-content link...." | ||
fetch(link.dataset.iiifContent).then(response=> { | ||
response.json().then (anno => { | ||
const encoded = encodeContentState(JSON.stringify(anno)); | ||
|
||
if (/iiif-content=.*&/.test(link.href)){ | ||
link.href = link.href.replace(/iiif-content=.*&/, "iiif-content=" + encoded + '&'); | ||
} else { | ||
link.href = link.href.replace(/iiif-content=.*$/, "iiif-content=" + encoded); | ||
} | ||
link.title = ""; | ||
}) | ||
|
||
}); | ||
}); | ||
</script> |
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
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
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
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ viewers: | |
- Clover | ||
- Glycerine Viewer | ||
- Theseus | ||
- Curation | ||
topic: | ||
- basic | ||
- image | ||
|
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ viewers: | |
- Mirador | ||
- Glycerine Viewer | ||
- Theseus | ||
- Curation | ||
topic: | ||
- image | ||
- basic | ||
|
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
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
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,14 @@ | ||
{ | ||
"@context": "http://iiif.io/api/presentation/3/context.json", | ||
"id": "https://example.org/import/1", | ||
"type": "Annotation", | ||
"motivation": ["contentState"], | ||
"target": { | ||
"id": "https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p2#xywh=1528,3024,344,408", | ||
"type": "Canvas", | ||
"partOf": [{ | ||
"id": "https://iiif.io/api/cookbook/recipe/0009-book-1/manifest.json", | ||
"type": "Manifest" | ||
}] | ||
} | ||
} |
Oops, something went wrong.