Skip to content

Commit

Permalink
add info + js
Browse files Browse the repository at this point in the history
  • Loading branch information
Marii committed Dec 21, 2017
1 parent 2b7a213 commit 6cdd205
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
_site
.sass-cache/
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ruby "2.4.2"
source 'https://rubygems.org'
gem 'jekyll', '3.6.2'
gem 'minima', '2.1.1'
59 changes: 59 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
ffi (1.9.18)
forwardable-extended (2.6.0)
jekyll (3.6.2)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 3)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.1)
sass (~> 3.4)
jekyll-watch (1.5.1)
listen (~> 3.0)
kramdown (1.16.2)
liquid (4.0.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
minima (2.1.1)
jekyll (~> 3.3)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
public_suffix (3.0.1)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (2.2.1)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.5.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)

PLATFORMS
ruby

DEPENDENCIES
jekyll (= 3.6.2)
minima (= 2.1.1)

RUBY VERSION
ruby 2.4.2p198

BUNDLED WITH
1.16.0
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ url: "" # the base hostname & protocol for your site, e.g. http://example.com
markdown: kramdown
permalink: pretty

theme: minima

webrick:
headers:
"Access-Control-Allow-Origin": "*"
27 changes: 27 additions & 0 deletions _includes/iiif_presentation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<iframe title='Mirador' class="iiif_presentation" allowtransparency="true" src='iiif_mirador.html' allowfullscreen='true' webkitallowfullscreen='true' mozallowfullscreen='true' style='width: 100%; height: 600px;' srcdoc="<link rel='stylesheet' type='text/css' href='{{ site.baseurl }}/build/mirador/css/mirador-combined.css'>
<style>
#viewer {
width: 100%;
height: 500px
}
</style>
<div id='viewer'></div>
<script src='{{ site.baseurl }}/build/mirador/mirador.js'></script>
<script type='text/javascript'>
$(function() {
myMiradorInstance = Mirador({
id: 'viewer',
data: [
{ manifestUri: '{{ site.baseurl }}/manifest.json', 'location': 'Gallica'}
],
windowObjects: [{
loadedManifest: '{{ site.baseurl }}/manifest.json',
canvasID: 'http://gallica.bnf.fr/iiif/ark:/12148/btv1b10500001g/canvas/f7',
bottomPanelVisible: true
}],
annotationEndpoint: { 'name':'Local Storage', 'module': 'LocalStorageEndpoint' }
});
});
</script>">
</iframe>
39 changes: 0 additions & 39 deletions index.html

This file was deleted.

31 changes: 31 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: default
---

# Bibliothèque nationale de France Français 640

### Sample static annotations can be found on 1r, 3r, and 3v by toggling the <i class="fa fa-comments" aria-hidden="true"></i> button on the top left of the viewer.

<br><br>
{% include iiif_presentation.html %}
<br><br>

### To grab annotations added via Mirador in LocalStorage, add your annotation using the <i class="fa fa-comments" aria-hidden="true"></i> panel, open the browser console, and run the following:
<br><br>
```js
var gallicaUrlRegex = /.+gallica\.bnf\.fr.+canvas\/(.+)/g;

for(var i =0; i < localStorage.length; i++){
var key = localStorage.key(i);
var matches = gallicaUrlRegex.exec(key);
if(matches != null) {
console.log(matches[1]);
var fileName = matches[1] + '.json';
var fileContent = localStorage.getItem(key);
console.log('Want to save ' + fileName + ' with content: ' + fileContent);
}
}
```
<br><br>
## To Do:
### Download JSON from localStorage instead of displaying it.<br><br>See: [https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server](https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server) ?<br><br>Also: [http://www.darthcrimson.org/hacking-mirador-workshop/annotate.html](http://www.darthcrimson.org/hacking-mirador-workshop/annotate.html) should be fixed soonish...?
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ layout: null
},
"@type": "sc:Canvas",
"otherContent": [{
"@id": "{{ site.url }}{{ site.baseurl }}/annotation-lists/f7.json",
"@id": "{{ site.baseurl }}/annotation-lists/f7.json",
"@type":"sc:AnnotationList"
}]
},
Expand Down Expand Up @@ -393,7 +393,7 @@ layout: null
},
"@type": "sc:Canvas",
"otherContent": [{
"@id": "{{ site.url }}{{ site.baseurl }}/annotation-lists/f11.json",
"@id": "{{ site.baseurl }}/annotation-lists/f11.json",
"@type":"sc:AnnotationList"
}]
},
Expand Down Expand Up @@ -426,7 +426,7 @@ layout: null
},
"@type": "sc:Canvas",
"otherContent": [{
"@id": "{{ site.url }}{{ site.baseurl }}/annotation-lists/f12.json",
"@id": "{{ site.baseurl }}/annotation-lists/f12.json",
"@type":"sc:AnnotationList"
}]
},
Expand Down

0 comments on commit 6cdd205

Please sign in to comment.