├── VERSION ├── public ├── javascripts │ └── DV │ │ ├── views │ │ ├── navigationExpander.jst │ │ ├── annotationNav.jst │ │ ├── chapterNav.jst │ │ ├── descriptionContainer.jst │ │ ├── pages.jst │ │ ├── navControls.jst │ │ ├── pageAnnotation.jst │ │ ├── unsupported.jst │ │ ├── header.jst │ │ ├── viewer.jst │ │ └── annotation.jst │ │ ├── lib │ │ ├── initializer.js │ │ ├── model.js │ │ ├── elements.js │ │ ├── inflector.js │ │ ├── class.js │ │ ├── history.js │ │ ├── dragReporter.js │ │ ├── stateMachine.js │ │ ├── annotation.js │ │ └── pageSet.js │ │ ├── events │ │ ├── ViewSearch.js │ │ ├── ViewText.js │ │ ├── ViewDocument.js │ │ ├── ViewAnnotation.js │ │ ├── navigation.js │ │ ├── history.js │ │ └── events.js │ │ ├── states │ │ ├── ViewEntity.js │ │ ├── ViewText.js │ │ ├── ViewSearch.js │ │ ├── ViewAnnotation.js │ │ ├── ViewDocument.js │ │ └── states.js │ │ ├── helpers │ │ ├── navigation.js │ │ ├── editor.js │ │ ├── annotations.js │ │ ├── construction.js │ │ └── search.js │ │ ├── models │ │ ├── chapter.js │ │ ├── page.js │ │ ├── document.js │ │ └── annotation.js │ │ ├── elements │ │ └── elements.js │ │ ├── controllers │ │ ├── documentViewer.js │ │ └── api.js │ │ ├── vendor │ │ ├── jquery.easing.compatibility.js │ │ ├── jquery.scrollTo-min.js │ │ └── jquery.acceptInput.js │ │ ├── schema │ │ └── schema.js │ │ └── tests │ │ └── testsuite.css ├── stylesheets │ └── DV │ │ ├── components │ │ ├── ui.css │ │ ├── ui-header.css │ │ ├── reset.css │ │ ├── view-document.css │ │ ├── unsupported.css │ │ ├── ui-text.css │ │ ├── view-text.css │ │ ├── ui-zoom.css │ │ ├── view-search.css │ │ ├── ui-menu.css │ │ ├── structure.css │ │ ├── view-annotations.css │ │ ├── dropShadow.css │ │ ├── pages.css │ │ ├── ui-search.css │ │ └── ui-navigation.css │ │ └── plain.css ├── images │ └── DV │ │ ├── tab.png │ │ ├── grab.cur │ │ ├── white.png │ │ ├── grabbing.cur │ │ ├── tab-note.png │ │ ├── embed │ │ ├── bar.gif │ │ ├── black.png │ │ ├── box-bl.gif │ │ ├── box-bl.png │ │ ├── box-br.gif │ │ ├── box-br.png │ │ ├── box-tl.gif │ │ ├── box-tl.png │ │ ├── box-tla.gif │ │ ├── box-tla.png │ │ ├── box-top.gif │ │ ├── box-top.png │ │ ├── box-tr.gif │ │ ├── box-tr.png │ │ ├── corner.png │ │ ├── indent.gif │ │ ├── shadow.png │ │ ├── slider.gif │ │ ├── spinner.gif │ │ ├── box-bottom.gif │ │ ├── box-bottom.png │ │ ├── box-left.gif │ │ ├── box-left.png │ │ ├── box-right.gif │ │ ├── box-right.png │ │ ├── bullet4x4.gif │ │ ├── highlight.gif │ │ ├── leftArrow.gif │ │ ├── rightArrow.gif │ │ ├── shadow-white.gif │ │ ├── box-bl-private.gif │ │ ├── box-bl-private.png │ │ ├── box-br-private.gif │ │ ├── box-br-private.png │ │ ├── box-tl-private.gif │ │ ├── box-tl-private.png │ │ ├── box-tla-private.gif │ │ ├── box-tla-private.png │ │ ├── box-top-private.gif │ │ ├── box-top-private.png │ │ ├── box-tr-private.gif │ │ ├── box-tr-private.png │ │ ├── controlsArrows.gif │ │ ├── corner-private.png │ │ ├── box-left-private.gif │ │ ├── box-left-private.png │ │ ├── box-right-private.gif │ │ ├── box-right-private.png │ │ ├── box-bottom-private.gif │ │ └── box-bottom-private.png │ │ ├── expanders.gif │ │ ├── tab-note-ie.png │ │ ├── tab-private.png │ │ ├── tabActive.png │ │ ├── tabActive-ie.png │ │ ├── browsers │ │ ├── chrome.gif │ │ ├── firefox.gif │ │ └── safari.gif │ │ ├── tab-note-private.png │ │ ├── tabActive-private.png │ │ ├── interface │ │ ├── arrow-left.gif │ │ ├── arrow-right.gif │ │ ├── blank_page.jpg │ │ ├── newspaper.png │ │ ├── arrow-left-noresults.gif │ │ └── arrow-right-noresults.gif │ │ ├── tab-note-ie-private.png │ │ └── tabActive-ie-private.png └── assets │ ├── plain.css.gz │ ├── viewer.css.gz │ ├── viewer.js.gz │ ├── viewer.jst.gz │ ├── fallback.css.gz │ ├── templates.js.gz │ ├── plain-datauri.css.gz │ ├── fallback-datauri.css.gz │ ├── viewer-datauri.css.gz │ ├── plain.css │ ├── plain-datauri.css │ └── viewer.jst ├── viewer.html ├── config └── assets.yml ├── README.rdoc ├── NOTICE └── viewer-debug.html /VERSION: -------------------------------------------------------------------------------- 1 | 0.0.1 -------------------------------------------------------------------------------- /public/javascripts/DV/views/navigationExpander.jst: -------------------------------------------------------------------------------- 1 | Expand -------------------------------------------------------------------------------- /public/stylesheets/DV/components/ui.css: -------------------------------------------------------------------------------- 1 | .DV-trigger{ 2 | cursor: pointer; 3 | cursor: hand; 4 | } -------------------------------------------------------------------------------- /public/images/DV/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab.png -------------------------------------------------------------------------------- /public/assets/plain.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/plain.css.gz -------------------------------------------------------------------------------- /public/assets/viewer.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/viewer.css.gz -------------------------------------------------------------------------------- /public/assets/viewer.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/viewer.js.gz -------------------------------------------------------------------------------- /public/assets/viewer.jst.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/viewer.jst.gz -------------------------------------------------------------------------------- /public/images/DV/grab.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/grab.cur -------------------------------------------------------------------------------- /public/images/DV/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/white.png -------------------------------------------------------------------------------- /public/assets/fallback.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/fallback.css.gz -------------------------------------------------------------------------------- /public/assets/templates.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/templates.js.gz -------------------------------------------------------------------------------- /public/images/DV/grabbing.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/grabbing.cur -------------------------------------------------------------------------------- /public/images/DV/tab-note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab-note.png -------------------------------------------------------------------------------- /public/images/DV/embed/bar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/bar.gif -------------------------------------------------------------------------------- /public/images/DV/embed/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/black.png -------------------------------------------------------------------------------- /public/images/DV/expanders.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/expanders.gif -------------------------------------------------------------------------------- /public/images/DV/tab-note-ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab-note-ie.png -------------------------------------------------------------------------------- /public/images/DV/tab-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab-private.png -------------------------------------------------------------------------------- /public/images/DV/tabActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tabActive.png -------------------------------------------------------------------------------- /public/assets/plain-datauri.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/plain-datauri.css.gz -------------------------------------------------------------------------------- /public/images/DV/embed/box-bl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bl.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bl.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-br.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-br.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-br.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-br.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tl.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tl.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tla.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tla.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tla.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-top.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-top.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tr.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tr.png -------------------------------------------------------------------------------- /public/images/DV/embed/corner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/corner.png -------------------------------------------------------------------------------- /public/images/DV/embed/indent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/indent.gif -------------------------------------------------------------------------------- /public/images/DV/embed/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/shadow.png -------------------------------------------------------------------------------- /public/images/DV/embed/slider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/slider.gif -------------------------------------------------------------------------------- /public/images/DV/embed/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/spinner.gif -------------------------------------------------------------------------------- /public/images/DV/tabActive-ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tabActive-ie.png -------------------------------------------------------------------------------- /public/assets/fallback-datauri.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/fallback-datauri.css.gz -------------------------------------------------------------------------------- /public/assets/viewer-datauri.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/assets/viewer-datauri.css.gz -------------------------------------------------------------------------------- /public/images/DV/browsers/chrome.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/browsers/chrome.gif -------------------------------------------------------------------------------- /public/images/DV/browsers/firefox.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/browsers/firefox.gif -------------------------------------------------------------------------------- /public/images/DV/browsers/safari.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/browsers/safari.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-bottom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bottom.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bottom.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-left.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-left.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-right.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-right.png -------------------------------------------------------------------------------- /public/images/DV/embed/bullet4x4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/bullet4x4.gif -------------------------------------------------------------------------------- /public/images/DV/embed/highlight.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/highlight.gif -------------------------------------------------------------------------------- /public/images/DV/embed/leftArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/leftArrow.gif -------------------------------------------------------------------------------- /public/images/DV/embed/rightArrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/rightArrow.gif -------------------------------------------------------------------------------- /public/images/DV/tab-note-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab-note-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/shadow-white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/shadow-white.gif -------------------------------------------------------------------------------- /public/images/DV/tabActive-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tabActive-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-bl-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bl-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-bl-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bl-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-br-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-br-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-br-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-br-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tl-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tl-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tl-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tl-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tla-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tla-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tla-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tla-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-top-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-top-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-top-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-top-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-tr-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tr-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-tr-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-tr-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/controlsArrows.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/controlsArrows.gif -------------------------------------------------------------------------------- /public/images/DV/embed/corner-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/corner-private.png -------------------------------------------------------------------------------- /public/images/DV/interface/arrow-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/arrow-left.gif -------------------------------------------------------------------------------- /public/images/DV/interface/arrow-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/arrow-right.gif -------------------------------------------------------------------------------- /public/images/DV/interface/blank_page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/blank_page.jpg -------------------------------------------------------------------------------- /public/images/DV/interface/newspaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/newspaper.png -------------------------------------------------------------------------------- /public/images/DV/tab-note-ie-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tab-note-ie-private.png -------------------------------------------------------------------------------- /public/images/DV/tabActive-ie-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/tabActive-ie-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-left-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-left-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-left-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-left-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-right-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-right-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-right-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-right-private.png -------------------------------------------------------------------------------- /public/images/DV/embed/box-bottom-private.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bottom-private.gif -------------------------------------------------------------------------------- /public/images/DV/embed/box-bottom-private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/embed/box-bottom-private.png -------------------------------------------------------------------------------- /public/images/DV/interface/arrow-left-noresults.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/arrow-left-noresults.gif -------------------------------------------------------------------------------- /public/images/DV/interface/arrow-right-noresults.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grangier/document-viewer/frontend/public/images/DV/interface/arrow-right-noresults.gif -------------------------------------------------------------------------------- /public/javascripts/DV/views/annotationNav.jst: -------------------------------------------------------------------------------- 1 |
2 | 3 | <%= title %> 4 | p.<%= page %> 5 | 6 |
-------------------------------------------------------------------------------- /public/javascripts/DV/views/chapterNav.jst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/javascripts/DV/views/descriptionContainer.jst: -------------------------------------------------------------------------------- 1 | <% if (description) { %> 2 |
3 |
4 | Toggle Description 5 | Description 6 |
7 |
<%= description %>
8 |
9 | <% } %> 10 | -------------------------------------------------------------------------------- /public/javascripts/DV/lib/initializer.js: -------------------------------------------------------------------------------- 1 | window.$j = jQuery.noConflict(); 2 | window.DV = window.DV || {}; 3 | 4 | DV.register = function(_name, _instance) { 5 | if(!window.DV[_name]){ 6 | window.DV[_name] = _instance; 7 | } 8 | }; 9 | // IE6 backgroundImageCache hack 10 | if($j.browser.msie === true && $j.browser.version == 6){ 11 | document.execCommand('BackgroundImageCache', false, true); 12 | } 13 | -------------------------------------------------------------------------------- /public/stylesheets/DV/components/ui-header.css: -------------------------------------------------------------------------------- 1 | #DV-header{ 2 | padding:10px 0; 3 | } 4 | 5 | #DV-branding{ 6 | font-family:Arial,Helvetica,sans-serif; 7 | font-size:15px; 8 | font-weight:bold; 9 | padding: 0 5px 0 0; 10 | } 11 | 12 | #DV-headerHat{ 13 | padding: 15px 0 5px; 14 | margin: 0 10px 10px 15px; 15 | position:relative; 16 | } 17 | 18 | #DV-title{ 19 | font-family: Georgia,Times,serif; 20 | font-size: 20px; 21 | font-weight: normal; 22 | } -------------------------------------------------------------------------------- /public/javascripts/DV/events/ViewSearch.js: -------------------------------------------------------------------------------- 1 | DV.Schema.events.ViewSearch = { 2 | next: function(e){ 3 | var nextPage = this.models.document.nextPage(); 4 | this.loadText(nextPage); 5 | 6 | }, 7 | previous: function(e){ 8 | var previousPage = this.models.document.previousPage(); 9 | this.loadText(previousPage); 10 | 11 | }, 12 | search: function(e){ 13 | this.helpers.getSearchResponse(this.elements.searchInput.val()); 14 | 15 | return false; 16 | } 17 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/states/ViewEntity.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states.ViewEntity = { 2 | enter: function(sourceState) { 3 | this.dragReporter.unBind(); 4 | this.elements.window.scrollTop(0); 5 | }, 6 | ViewEntity: function(name, offset, length) { 7 | this.helpers.toggleContent('viewSearch'); 8 | this.helpers.showEntity(name, offset, length); 9 | }, 10 | exit: function(destinationState) { 11 | this.elements.searchInput.val(''); 12 | this.helpers.cleanUpSearch(); 13 | return true; 14 | } 15 | }; -------------------------------------------------------------------------------- /public/stylesheets/DV/components/reset.css: -------------------------------------------------------------------------------- 1 | #DV-docViewer .clearfix:after { 2 | content: "."; 3 | display: block; 4 | height: 0; 5 | clear: both; 6 | visibility: hidden; 7 | } 8 | 9 | #DV-docViewer .clearfix {display: inline-block;} 10 | 11 | /* Hides from IE-mac \*/ 12 | * html #DV-docViewer .clearfix {height: 1%;} 13 | #DV-docViewer .clearfix {display: block;} 14 | /* End hide from IE-mac */ 15 | 16 | #DV-docViewer a, 17 | #DV-docViewer a:visited{ 18 | color:#004276; 19 | } 20 | 21 | #DV-docViewer{ 22 | overflow:hidden; 23 | } -------------------------------------------------------------------------------- /public/javascripts/DV/events/ViewText.js: -------------------------------------------------------------------------------- 1 | DV.Schema.events.ViewText = { 2 | next: function(e){ 3 | var nextPage = this.models.document.nextPage(); 4 | this.loadText(nextPage); 5 | 6 | DV.history.save('text/p'+(nextPage+1)); 7 | }, 8 | previous: function(e){ 9 | var previousPage = this.models.document.previousPage(); 10 | this.loadText(previousPage); 11 | 12 | DV.history.save('text/p'+(previousPage+1)); 13 | 14 | }, 15 | search: function(e){ 16 | e.preventDefault(); 17 | this.states.ViewSearch(); 18 | 19 | return false; 20 | } 21 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/views/pages.jst: -------------------------------------------------------------------------------- 1 |
2 |
p. <%= pageNumber %>
3 |
4 |
5 | Loading 6 | Loading 7 |
8 | 9 |
10 |
-------------------------------------------------------------------------------- /public/javascripts/DV/events/ViewDocument.js: -------------------------------------------------------------------------------- 1 | DV.Schema.events.ViewDocument = { 2 | next: function(){ 3 | var nextPage = this.models.document.nextPage(); 4 | this.helpers.jump(nextPage); 5 | 6 | DV.history.save('document/p'+(nextPage+1)); 7 | }, 8 | previous: function(e){ 9 | var previousPage = this.models.document.previousPage(); 10 | this.helpers.jump(previousPage); 11 | 12 | DV.history.save('document/p'+(previousPage+1)); 13 | }, 14 | search: function(e){ 15 | e.preventDefault(); 16 | 17 | this.states.ViewSearch(); 18 | return false; 19 | } 20 | } -------------------------------------------------------------------------------- /public/javascripts/DV/states/ViewText.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states.ViewText = { 2 | 3 | enter: function(sourceState){ 4 | this.dragReporter.unBind(); 5 | this.helpers.resetNavigationState(); 6 | this.elements.window.scrollTop(0); 7 | this.acceptInput.allow(); 8 | this.pageSet.zoomText(); 9 | return true; 10 | }, 11 | ViewText: function(){ 12 | this.helpers.toggleContent('viewText'); 13 | this.events.loadText(); 14 | 15 | return true; 16 | }, 17 | exit: function(destinationState){ 18 | this.helpers.resetNavigationState(); 19 | this.elements.collection.width(this.models.pages.width + 110); 20 | return true; 21 | } 22 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/views/navControls.jst: -------------------------------------------------------------------------------- 1 |
2 | « 3 |
4 | Page  5 | Annot.  6 | 1 7 | of  8 | <%= totalPages %> 9 | <%= totalAnnotations %> 10 | 11 |
12 | » 13 |
-------------------------------------------------------------------------------- /public/javascripts/DV/helpers/navigation.js: -------------------------------------------------------------------------------- 1 | _.extend(DV.Schema.helpers, { 2 | resetNavigationState: function(){ 3 | var elements = this.elements; 4 | elements.chaptersContainer[0].id = ''; 5 | elements.navigation[0].id = ''; 6 | }, 7 | setActiveChapter: function(chapterId){ 8 | this.elements.chaptersContainer.attr('id','DV-selectedChapter-'+chapterId); 9 | }, 10 | setActiveAnnotationInNav: function(annotationId){ 11 | if(annotationId){ 12 | this.elements.navigation.attr('id','DV-selectedAnnotation-'+annotationId); 13 | }else{ 14 | this.elements.navigation.attr('id',''); 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /public/javascripts/DV/states/ViewSearch.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states.ViewSearch = { 2 | 3 | enter: function(sourceState){ 4 | this.dragReporter.unBind(); 5 | this.elements.window.scrollTop(0); 6 | 7 | if(this.elements.searchInput.val() == ''){ 8 | this.elements.searchInput.val(searchRequest); 9 | }else{ 10 | var searchRequest = this.elements.searchInput.val(); 11 | } 12 | 13 | this.helpers.getSearchResponse(searchRequest); 14 | this.acceptInput.deny(); 15 | return true; 16 | }, 17 | ViewSearch: function(){ 18 | this.helpers.toggleContent('viewSearch'); 19 | 20 | return true; 21 | }, 22 | exit: function(destinationState){ 23 | this.elements.searchInput.val(''); 24 | this.helpers.cleanUpSearch(); 25 | return true; 26 | } 27 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/states/ViewAnnotation.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states.ViewAnnotation = { 2 | enter: function(sourceState){ 3 | this.elements.window.scrollTop(0); 4 | this.activeAnnotationId = null; 5 | this.acceptInput.deny(); 6 | // Nudge IE to force the annotations to repaint. 7 | if (jQuery.browser.msie) { 8 | this.elements.annotations.css({zoom : 0}); 9 | this.elements.annotations.css({zoom : 1}); 10 | } 11 | return true; 12 | }, 13 | ViewAnnotation: function(){ 14 | 15 | this.helpers.toggleContent('viewAnnotations'); 16 | this.compiled.next(); 17 | 18 | 19 | return true; 20 | }, 21 | exit: function(destinationState){ 22 | this.helpers.resetNavigationState(); 23 | this.activeAnnotationId = null; 24 | return true; 25 | } 26 | }; -------------------------------------------------------------------------------- /public/stylesheets/DV/components/view-document.css: -------------------------------------------------------------------------------- 1 | .DV-viewDocument #DV-annotations, 2 | .DV-viewDocument #DV-text, 3 | .DV-viewDocument #DV-search, 4 | #p0, 5 | #p1, 6 | #p2{ 7 | display:none; 8 | } 9 | 10 | .DV-viewDocument #p0, 11 | .DV-viewDocument #p1, 12 | .DV-viewDocument #p2{ 13 | display:block; 14 | } 15 | 16 | .DV-coverVisible .DV-viewDocument #p0, 17 | .DV-coverVisible .DV-viewDocument #p1, 18 | .DV-coverVisible .DV-viewDocument #p2{ 19 | background:none; 20 | } 21 | 22 | .DV-viewDocument #DV-currentAnnotationPrefix, 23 | .DV-viewDocument #DV-totalAnnotations{ 24 | display:none; 25 | } 26 | 27 | .DV-viewDocument #DV-currentPagePrefix, 28 | .DV-viewDocument #DV-totalPages{ 29 | display:inline; 30 | } 31 | 32 | .DV-viewDocument .DV-coverVisible .DV-cover{ 33 | cursor:pointer !important; 34 | } 35 | 36 | .DV-viewDocument .DV-annotationRegionBorder { 37 | display: block; 38 | } -------------------------------------------------------------------------------- /public/stylesheets/DV/components/unsupported.css: -------------------------------------------------------------------------------- 1 | #DV-unsupported { 2 | text-align: center; 3 | font: 16px Helvetica, Arial, sans-serif; 4 | width: 400px; 5 | margin: 30px; 6 | } 7 | #DV-unsupported .DV-intro { 8 | font-weight: bold; 9 | } 10 | #DV-unsupported .DV-browsers { 11 | margin: 20px 20px; 12 | height: 90px; 13 | } 14 | #DV-unsupported .DV-browser { 15 | float: left; 16 | width: 70px; 17 | margin: 0 20px; 18 | line-height: 30px; 19 | } 20 | #DV-unsupported .DV-image { 21 | width: 70px; height: 67px; 22 | clear: both; 23 | } 24 | #DV-unsupported #DV-safari { 25 | background: url(../../../images/DV/browsers/safari.gif); 26 | } 27 | #DV-unsupported #DV-chrome { 28 | background: url(../../../images/DV/browsers/chrome.gif); 29 | } 30 | #DV-unsupported #DV-firefox { 31 | background: url(../../../images/DV/browsers/firefox.gif); 32 | } 33 | #DV-unsupported .DV-after { 34 | margin-top: 20px; 35 | } -------------------------------------------------------------------------------- /public/javascripts/DV/states/ViewDocument.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states.ViewDocument = { 2 | enter: function(sourceState){ 3 | this.helpers.addObserver('drawPages'); 4 | this.dragReporter.setBinding(); 5 | this.elements.window.mouseleave($j.proxy(this.dragReporter.stop, this.dragReporter)); 6 | this.acceptInput.allow(); 7 | return true; 8 | }, 9 | ViewDocument: function(){ 10 | this.helpers.toggleContent('viewDocument'); 11 | 12 | this.helpers.setActiveChapter(this.models.chapters.getChapterId(this.models.document.currentIndex())); 13 | 14 | this.helpers.jump(this.models.document.currentIndex()); 15 | return true; 16 | }, 17 | exit: function(destinationState){ 18 | if(this.activeAnnotation){ 19 | this.pageSet.cleanUp(); 20 | } 21 | this.helpers.removeObserver('drawPages'); 22 | this.elements.chaptersContainer[0].id = ''; 23 | this.dragReporter.unBind(); 24 | return true; 25 | } 26 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/views/pageAnnotation.jst: -------------------------------------------------------------------------------- 1 |
2 |
3 |
p. <%= pageNumber %>
4 |
5 | 6 |
7 | 8 |
9 |
10 | Previous 11 | Next 12 |
13 |
Go to Page <%= pageNumber %>
14 |
<%= title %>
15 |
16 | 17 |
18 | <%= text %> 19 |
20 |
21 |
-------------------------------------------------------------------------------- /public/stylesheets/DV/components/ui-text.css: -------------------------------------------------------------------------------- 1 | #DV-textPage{ 2 | min-height:867px; 3 | background-color:#fff; 4 | margin: 10px auto; 5 | -moz-box-shadow: 0 0 1em #a9a9a9; 6 | -webkit-box-shadow: 0 0 1em #a9a9a9; 7 | } 8 | 9 | #DV-textCurrentPage{ 10 | color:#000; 11 | font-size:10px; 12 | font-family:Arial,Helvetica,sans-serif; 13 | position:absolute; 14 | left:0; 15 | padding-left:8px; 16 | top:30px; 17 | font-weight:bold; 18 | } 19 | 20 | #DV-textContents { 21 | background-color:#FFFFFF; 22 | color:#333333; 23 | font-size:14px; 24 | font-family: courier, monotype; 25 | line-height:1.4em; 26 | overflow: hidden; 27 | white-space: pre-wrap; /* css-3 */ 28 | white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ 29 | white-space: -pre-wrap; /* Opera 4-6 */ 30 | white-space: -o-pre-wrap; /* Opera 7 */ 31 | word-wrap: break-word; /* Internet Explorer 5.5+ */ 32 | padding:50px; 33 | margin: 0 auto; 34 | } -------------------------------------------------------------------------------- /public/javascripts/DV/lib/model.js: -------------------------------------------------------------------------------- 1 | // basic model class 2 | DV.model = function(_super,methods){ 3 | this.set('application',_super); 4 | if(methods != null){ 5 | this.addMethods(methods); 6 | } 7 | if(this.setup){ 8 | this.setup(); 9 | } 10 | }; 11 | // Used to add methods to your model 12 | DV.model.prototype.addMethods = function(methods){ 13 | for (var key in methods){ 14 | this.set(key,methods[key]); 15 | }; 16 | }; 17 | // base getter 18 | DV.model.prototype.get = function(attr){ 19 | return this[attr]; 20 | }; 21 | // base setter 22 | DV.model.prototype.set = function(attr,value){ 23 | if(attr !== 'set' && attr !== 'get' && attr !== 'bind'){ 24 | this[attr] = value; 25 | return this[attr]; 26 | }else{ 27 | return false; 28 | } 29 | }; 30 | // Probably dont need this anymore 31 | DV.model.prototype.bind = function(object, method){ 32 | return function() { 33 | return method.apply(object, arguments); 34 | }; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /public/stylesheets/DV/components/view-text.css: -------------------------------------------------------------------------------- 1 | .DV-viewText #DV-pageCollection{ 2 | cursor: text; 3 | } 4 | 5 | .DV-viewText .DV-set, 6 | .DV-viewText #DV-bar, 7 | .DV-viewText #DV-annotations{ 8 | display:none; 9 | } 10 | 11 | .DV-viewText #DV-text{ 12 | display:block; 13 | } 14 | 15 | .DV-viewText #DV-currentAnnotationPrefix, 16 | .DV-viewText #DV-totalAnnotations{ 17 | display:none; 18 | } 19 | 20 | .DV-viewText #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div, 21 | .DV-viewText #DV-sidebar #DV-well .DV-chaptersContainer span.DV-expander{ 22 | display:none !important; 23 | } 24 | 25 | .DV-viewText #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div.DV-first{ 26 | display:block !important; 27 | } 28 | 29 | .DV-viewText #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div.DV-first .DV-trigger{ 30 | margin-left:-1px; 31 | } 32 | 33 | .DV-viewText .DV-annotationMarker, 34 | .DV-viewText .DV-chapter{ 35 | margin-left:14px; 36 | } 37 | 38 | #DV-textView{ 39 | display:none; 40 | } 41 | 42 | #DV-docViewer.DV-searchable #DV-textView{ 43 | display:inline; 44 | } -------------------------------------------------------------------------------- /public/javascripts/DV/models/chapter.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 3 | var chaptersModel = new DV.model(DV.Schema,{ 4 | 5 | init : function() { 6 | this.loadChapters(); 7 | }, 8 | 9 | // Load (or reload) the chapter model from the schema's defined sections. 10 | loadChapters : function() { 11 | var chapters = this.chapters = DV.Schema.data.chapters = []; 12 | _.each(DV.Schema.data.sections, function(sec) { 13 | sec.id = sec.id || _.uniqueId(); 14 | var range = sec.pages.split('-'); 15 | var start = parseInt(range[0], 10); 16 | var end = parseInt(range[0], 10); 17 | for (var i=range[0]-1; i 2 |
3 | <% if (DV.Schema.document.resources && DV.Schema.document.resources.pdf) { %> 4 | Download this document as a PDF 5 | <% } %> 6 |
7 |
8 | To use the Document Viewer you need to
upgrade your browser: 9 |
10 |
11 | 16 | 21 | 26 |
27 |
28 |
29 | Or, if you'd like to continue using Internet Explorer 6,
you can 30 | install Google Chrome Frame. 31 |
32 | 33 | -------------------------------------------------------------------------------- /public/javascripts/DV/elements/elements.js: -------------------------------------------------------------------------------- 1 | // We cache DOM references to improve speed and reduce DOM queries 2 | DV.Schema.elements = 3 | [ 4 | { name: 'browserDocument', query: document }, 5 | { name: 'browserWindow', query: window }, 6 | { name: 'header', query: 'div#DV-header'}, 7 | { name: 'viewer', query: 'div#DV-docViewer'}, 8 | { name: 'window', query: 'div#DV-pages'}, 9 | { name: 'sets', query: 'div.DV-set'}, 10 | { name: 'pages', query: 'div.DV-page'}, 11 | { name: 'metas', query: 'div.DV-pageMeta'}, 12 | { name: 'bar', query: 'div#DV-bar'}, 13 | { name: 'currentPage', query: 'span#DV-currentPage'}, 14 | { name: 'well', query: 'div#DV-well'}, 15 | { name: 'collection', query: 'div#DV-pageCollection'}, 16 | { name: 'annotations', query: 'div#DV-annotations'}, 17 | { name: 'navigation', query: 'div#DV-well div.DV-navigation' }, 18 | { name: 'chaptersContainer', query: 'div#DV-well div.DV-chaptersContainer' }, 19 | { name: 'searchInput', query: 'input#DV-searchInput' }, 20 | { name: 'textCurrentPage', query: 'span#DV-textCurrentPage' }, 21 | { name: 'coverPages', query: 'div.DV-cover' } 22 | ]; -------------------------------------------------------------------------------- /public/javascripts/DV/lib/elements.js: -------------------------------------------------------------------------------- 1 | DV.Elements = DV.Class.extend({ 2 | init: function(elements){ 3 | if(!elements){ 4 | throw('Elements to query must be defined'); 5 | return; 6 | } 7 | this.names = []; 8 | 9 | if(elements.constructor === Array){ 10 | return this.getElements(elements); 11 | }else{ 12 | return this.getElement(elements); 13 | } 14 | }, 15 | // Get and store an element reference 16 | getElement: function(elementQuery,force){ 17 | if(this[elementQuery.name] && force === null){ 18 | return; 19 | }else{ 20 | this[elementQuery.name] = jQuery(elementQuery.query); 21 | this.names.push(elementQuery.name); 22 | return this; 23 | } 24 | }, 25 | // Get a collection of elements 26 | getElements: function(querySet,force){ 27 | for (var i = querySet.length - 1; i >= 0; i--){ 28 | this.getElement(querySet[i],force); 29 | }; 30 | return this; 31 | }, 32 | 33 | // Remove all references and bindings 34 | destroy: function(){ 35 | for(var i = 0,len=this.names.length; i < len; i++){ 36 | this[this.names[i]].unbind(); 37 | this[this.names[i]].die(); 38 | delete this[this.names[i]]; 39 | } 40 | delete this.names; 41 | } 42 | }); -------------------------------------------------------------------------------- /public/stylesheets/DV/components/ui-zoom.css: -------------------------------------------------------------------------------- 1 | .DV-zoomControls{ 2 | font-family:Arial,Helvetica,sans-serif; 3 | font-size:11px; 4 | float: right; 5 | margin: 8px 20px 0 0; 6 | position: absolute; 7 | right:-10px; 8 | } 9 | 10 | #DV-docViewer.DV-searchable .DV-zoomControls { 11 | right:235px; 12 | } 13 | 14 | .DV-zoomLabel{ 15 | color:#333333; 16 | display:inline; 17 | float:left; 18 | font-family:Arial,Helvetica,sans-serif; 19 | font-size:11px; 20 | padding:3px 16px 0 0; 21 | margin: 3px 0 0 -74px; 22 | position:relative; 23 | } 24 | 25 | #DV-zoomBox{ 26 | background: url(../../../images/DV/embed/bar.gif) repeat-x 0 88%; 27 | height:20px; 28 | width:85px; 29 | float: left; 30 | position:relative; 31 | margin-right:25px; 32 | } 33 | 34 | #DV-zoomBox .ui-slider-handle{ 35 | height:12px; 36 | width:12px; 37 | position:absolute; 38 | left:0; 39 | top:0; 40 | margin-top:5px; 41 | margin-left:-5px; 42 | background: transparent url(../../../images/DV/embed/slider.gif) no-repeat 0 0; 43 | outline: none; 44 | } 45 | 46 | .DV-zoomControls .DV-trigger{ 47 | font-size:11px; 48 | text-decoration:none; 49 | font-family:Arial,Helvetica,sans-serif; 50 | color:#004276; 51 | } 52 | 53 | .DV-triggers .DV-selected{ 54 | font-weight:bold; 55 | color:#000; 56 | } 57 | -------------------------------------------------------------------------------- /public/javascripts/DV/events/ViewAnnotation.js: -------------------------------------------------------------------------------- 1 | DV.Schema.events.ViewAnnotation = { 2 | next: function(e){ 3 | var application = this.application; 4 | var activeAnnotationId = application.activeAnnotationId; 5 | var annotationsModel = this.models.annotations; 6 | var nextAnnotation = (activeAnnotationId === null) ? 7 | annotationsModel.getFirstAnnotation() : annotationsModel.getNextAnnotation(activeAnnotationId); 8 | 9 | if (!nextAnnotation){ 10 | return false; 11 | } 12 | 13 | application.pageSet.showAnnotation(nextAnnotation); 14 | this.helpers.setAnnotationPosition(nextAnnotation.position); 15 | 16 | 17 | }, 18 | previous: function(e){ 19 | var application = this.application; 20 | var activeAnnotationId = application.activeAnnotationId; 21 | var annotationsModel = this.models.annotations; 22 | 23 | var previousAnnotation = (!activeAnnotationId) ? 24 | annotationsModel.getFirstAnnotation() : annotationsModel.getPreviousAnnotation(activeAnnotationId); 25 | if (!previousAnnotation){ 26 | return false; 27 | } 28 | 29 | application.pageSet.showAnnotation(previousAnnotation); 30 | this.helpers.setAnnotationPosition(previousAnnotation.position); 31 | 32 | 33 | }, 34 | search: function(e){ 35 | e.preventDefault(); 36 | this.states.ViewSearch(); 37 | 38 | return false; 39 | } 40 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/views/header.jst: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <% if (story_url) { %> 5 | <%= story_url %> 6 | <% } %> 7 |
8 |
9 | <%= title %> 10 |
11 |
12 | 13 |
14 |
15 |
Document
16 | 17 |
Text
18 |
19 | 20 | 30 | 31 |
32 |
33 | 34 |
35 | Zoom Level 36 |
37 |
38 | 39 |
40 |
41 | 42 |
-------------------------------------------------------------------------------- /viewer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document Title 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 |
23 | 24 |
Loading
25 | 30 | 31 |
32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/stylesheets/DV/components/view-search.css: -------------------------------------------------------------------------------- 1 | .DV-viewSearch #DV-pages{ 2 | background-color:#999; 3 | } 4 | 5 | .DV-viewSearch #DV-textPage{ 6 | background-color:#eee; 7 | } 8 | 9 | .DV-viewSearch .DV-zoomControls{ 10 | display:none; 11 | } 12 | 13 | .DV-viewSearch #DV-pageCollection{ 14 | cursor: text; 15 | } 16 | 17 | .DV-viewSearch #DV-annotations, 18 | .DV-viewSearch #DV-bar{ 19 | display:none; 20 | } 21 | 22 | .DV-viewSearch #DV-search, 23 | .DV-viewSearch #DV-searchBar{ 24 | display:block; 25 | } 26 | 27 | .DV-viewSearch #DV-totalAnnotations, 28 | .DV-viewSearch #DV-currentAnnotationPrefix{ 29 | display:none; 30 | } 31 | 32 | .DV-viewSearch #DV-textPage{ 33 | margin-top:50px; 34 | } 35 | 36 | .DV-viewSearch #DV-textCurrentPage{ 37 | top:60px; 38 | } 39 | 40 | .DV-viewSearch #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div, 41 | .DV-viewSearch #DV-sidebar #DV-well .DV-chaptersContainer span.DV-expander, 42 | .DV-viewSearch .DV-annotationMarker{ 43 | display:none !important; 44 | } 45 | 46 | .DV-viewSearch #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div.DV-first{ 47 | display:block !important; 48 | } 49 | 50 | .DV-viewSearch #DV-sidebar #DV-well .DV-chaptersContainer div.DV-hasChildren div.DV-first span.DV-trigger{ 51 | margin-left:-1px; 52 | } 53 | 54 | .DV-viewSearch #DV-textContents, 55 | .DV-viewSearch #DV-textPage{ 56 | background-color:#c5c5c5; 57 | } 58 | 59 | .DV-viewSearch .DV-annotationMarker, 60 | .DV-viewSearch .DV-chapter{ 61 | margin-left:14px; 62 | } -------------------------------------------------------------------------------- /config/assets.yml: -------------------------------------------------------------------------------- 1 | embed_images: datauri 2 | template_function: _.template 3 | 4 | javascripts: 5 | viewer: 6 | - public/javascripts/DV/vendor/jquery-1.4.2.js 7 | - public/javascripts/DV/vendor/jquery-ui-1.8.1.custom.min.js 8 | - public/javascripts/DV/vendor/jquery.scrollTo-min.js 9 | - public/javascripts/DV/vendor/underscore.js 10 | - public/javascripts/DV/vendor/jquery.easing.compatibility.js 11 | - public/javascripts/DV/vendor/jquery.acceptInput.js 12 | - public/javascripts/DV/lib/initializer.js 13 | - public/javascripts/DV/lib/class.js 14 | - public/javascripts/DV/lib/history.js 15 | - public/javascripts/DV/lib/*.js 16 | - public/javascripts/DV/schema/*.js 17 | - public/javascripts/DV/elements/*.js 18 | - public/javascripts/DV/models/*.js 19 | - public/javascripts/DV/events/events.js 20 | - public/javascripts/DV/events/View*.js 21 | - public/javascripts/DV/events/*.js 22 | - public/javascripts/DV/helpers/helpers.js 23 | - public/javascripts/DV/helpers/*.js 24 | - public/javascripts/DV/states/states.js 25 | - public/javascripts/DV/states/*.js 26 | - public/javascripts/DV/controllers/documentViewer.js 27 | - public/javascripts/DV/controllers/*.js 28 | 29 | templates: 30 | - public/javascripts/DV/views/*.jst 31 | 32 | stylesheets: 33 | viewer: 34 | - public/stylesheets/DV/components/reset.css 35 | - public/stylesheets/DV/components/structure.css 36 | - public/stylesheets/DV/components/ui.css 37 | - public/stylesheets/DV/components/*.css 38 | 39 | plain: 40 | - public/stylesheets/DV/plain.css 41 | 42 | -------------------------------------------------------------------------------- /public/javascripts/DV/lib/inflector.js: -------------------------------------------------------------------------------- 1 | window.Inflector = { 2 | 3 | camelize: function(s) { 4 | var parts = s.split('-'), len = parts.length; 5 | if (len == 1) return parts[0]; 6 | 7 | var camelized = s.charAt(0) == '-' 8 | ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) 9 | : parts[0]; 10 | 11 | for (var i = 1; i < len; i++) 12 | camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); 13 | 14 | return camelized; 15 | }, 16 | 17 | capitalize: function(s) { 18 | return s.charAt(0).toUpperCase() + s.substring(1).toLowerCase(); 19 | }, 20 | 21 | underscore: function(s) { 22 | return s.replace(/::/g, '/').replace(/([A-Z]+)([A-Z][a-z])/g,'$1_$2').replace(/([a-z\d])([A-Z])/g,'$1_$2').replace(/-/g,'_').toLowerCase(); 23 | }, 24 | 25 | dasherize: function(s) { 26 | return s.replace(/_/g,'-'); 27 | }, 28 | 29 | singularize: function(s) { 30 | return s.replace(/e?s$/, ''); 31 | }, 32 | 33 | // Only works for words that pluralize by adding an 's'. 34 | pluralize: function(s, count) { 35 | return count != 1 ? s + 's' : s; 36 | }, 37 | 38 | classify: function(s) { 39 | return this.camelize(this.capitalize(this.dasherize(this.singularize(s)))); 40 | }, 41 | 42 | truncate : function(s, length, truncation) { 43 | length = length || 30; 44 | truncation = _.isUndefined(truncation) ? '...' : truncation; 45 | return s.length > length ? s.slice(0, length - truncation.length) + truncation : s; 46 | }, 47 | 48 | // Borrowed from Prototype 1.6 49 | stripTags: function(s) { 50 | return s.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); 51 | } 52 | 53 | 54 | }; -------------------------------------------------------------------------------- /public/javascripts/DV/helpers/editor.js: -------------------------------------------------------------------------------- 1 | _.extend(DV.Schema.helpers,{ 2 | showAnnotationEdit : function(e) { 3 | var annoEl = $j(e.target).closest(this.annotationClassName); 4 | annoEl.addClass('DV-editing'); 5 | $j('.DV-annotationTextArea', annoEl).focus(); 6 | }, 7 | cancelAnnotationEdit : function(e) { 8 | var annoEl = $j(e.target).closest(this.annotationClassName); 9 | var anno = this.getAnnotationModel(annoEl); 10 | $j('.DV-annotationTitleInput', annoEl).val(anno.title); 11 | $j('.DV-annotationTextArea', annoEl).val(anno.text); 12 | if (anno.unsaved) { 13 | this.models.annotations.removeAnnotation(anno); 14 | } else { 15 | annoEl.removeClass('DV-editing'); 16 | } 17 | }, 18 | saveAnnotation : function(e, option) { 19 | var annoEl = $j(e.target).closest(this.annotationClassName); 20 | var anno = this.getAnnotationModel(annoEl); 21 | if (!anno) return; 22 | anno.title = $j('.DV-annotationTitleInput', annoEl).val(); 23 | anno.text = $j('.DV-annotationTextArea', annoEl).val(); 24 | if (option == 'onlyIfText' && (!anno.title || anno.title == 'Untitled Note') && !anno.text) { 25 | return this.models.annotations.removeAnnotation(anno); 26 | } 27 | this.models.annotations.refreshAnnotation(anno); 28 | annoEl.removeClass('DV-editing'); 29 | DV.api.redraw(); 30 | this.models.annotations.fireSaveCallbacks(anno); 31 | }, 32 | deleteAnnotation : function(e) { 33 | var annoEl = $j(e.target).closest(this.annotationClassName); 34 | var anno = this.getAnnotationModel(annoEl); 35 | this.models.annotations.removeAnnotation(anno); 36 | this.models.annotations.fireDeleteCallbacks(anno); 37 | } 38 | }); -------------------------------------------------------------------------------- /public/javascripts/DV/events/navigation.js: -------------------------------------------------------------------------------- 1 | _.extend(DV.Schema.events, { 2 | handleNavigation: function(e){ 3 | var el = $j(e.target); 4 | var parentEl = el.parent(); 5 | 6 | if(el.hasClass('DV-trigger') || parentEl.hasClass('DV-trigger')){ 7 | 8 | if(el.hasClass('DV-expander')){ 9 | return parentEl.parent().toggleClass('DV-expanded'); 10 | 11 | }else if(parentEl.hasClass('DV-first')){ 12 | // its a header, take it to the page 13 | parentEl.parent().addClass('DV-expanded'); 14 | var cid = parseInt(parentEl.parent()[0].id.replace('DV-chapter-',''), 10); 15 | var chapterIndex = parseInt(this.models.chapters.getChapterPosition(cid),10); 16 | var pageNumber = parseInt(chapterIndex,10)+1; 17 | 18 | if(this.application.state === 'ViewText'){ 19 | this.loadText(chapterIndex); 20 | DV.history.save('text/p'+pageNumber); 21 | }else if(this.application.state === 'ViewDocument'){ 22 | this.helpers.jump(chapterIndex); 23 | DV.history.save('document/p'+pageNumber); 24 | }else{ 25 | return false; 26 | } 27 | 28 | }else if(parentEl[0].tagName.toUpperCase() === 'DIV'){ 29 | var aid = parentEl[0].id.replace('DV-annotationMarker-',''); 30 | var annotation = this.models.annotations.getAnnotation(aid); 31 | var pageNumber = parseInt(annotation.index,10)+1; 32 | 33 | if(this.application.state === 'ViewText'){ 34 | this.loadText(annotation.index); 35 | 36 | DV.history.save('text/p'+pageNumber); 37 | }else{ 38 | this.application.pageSet.showAnnotation(annotation); 39 | } 40 | 41 | }else{ 42 | return false; 43 | } 44 | } 45 | } 46 | }); -------------------------------------------------------------------------------- /public/javascripts/DV/controllers/documentViewer.js: -------------------------------------------------------------------------------- 1 | DV.controller = new DV.stateMachine(DV.Schema.states, 2 | { 3 | events : DV.Schema.events, 4 | elements : DV.Schema.elements, 5 | helpers : DV.Schema.helpers, 6 | models : DV.Schema.models 7 | } 8 | ); 9 | 10 | // The origin function, kicking off the entire documentViewer render. 11 | DV.load = function(documentRep, options) { 12 | options = options || {}; 13 | DV.container = options.container || document.body; 14 | DV.options = options; 15 | 16 | // Once we have the JSON representation in-hand, finish loading the viewer. 17 | var continueLoad = DV.loadJSON = function(json) { 18 | DV.Schema.importCanonicalDocument(json); 19 | DV.controller.states.InitialLoad(); 20 | if (options.afterLoad) options.afterLoad(); 21 | if (DV.afterLoad) DV.afterLoad(); 22 | }; 23 | 24 | // If we've been passed the JSON directly, we can go ahead, 25 | // otherwise make a JSONP request to fetch it. 26 | var jsonLoad = function() { 27 | if (_.isString(documentRep)) { 28 | if (documentRep.match(/\.js$/)) { 29 | $j.getScript(documentRep); 30 | } else { 31 | var crossDomain = DV.controller.helpers.isCrossDomain(documentRep); 32 | if (crossDomain) documentRep = documentRep + '?callback=?'; 33 | $j.getJSON(documentRep, continueLoad); 34 | } 35 | } else { 36 | continueLoad(documentRep); 37 | } 38 | }; 39 | 40 | // If we're being asked the fetch the templates, load them remotely before 41 | // continuing. 42 | if (options.templates) { 43 | $j.getScript(options.templates, jsonLoad); 44 | } else { 45 | jsonLoad(); 46 | } 47 | }; 48 | 49 | // If the document viewer has been loaded dynamically, allow the external 50 | // script to specify the onLoad behavior. 51 | if (DV.onload) setTimeout(DV.onload, 0); 52 | 53 | -------------------------------------------------------------------------------- /public/javascripts/DV/vendor/jquery.easing.compatibility.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php 3 | * 4 | * Adds compatibility for applications that use the pre 1.2 easing names 5 | * 6 | * Copyright (c) 2007 George Smith 7 | * Licensed under the MIT License: 8 | * http://www.opensource.org/licenses/mit-license.php 9 | */ 10 | 11 | jQuery.extend( jQuery.easing, 12 | { 13 | easeIn: function (x, t, b, c, d) { 14 | return jQuery.easing.easeInQuad(x, t, b, c, d); 15 | }, 16 | easeOut: function (x, t, b, c, d) { 17 | return jQuery.easing.easeOutQuad(x, t, b, c, d); 18 | }, 19 | easeInOut: function (x, t, b, c, d) { 20 | return jQuery.easing.easeInOutQuad(x, t, b, c, d); 21 | }, 22 | expoin: function(x, t, b, c, d) { 23 | return jQuery.easing.easeInExpo(x, t, b, c, d); 24 | }, 25 | expoout: function(x, t, b, c, d) { 26 | return jQuery.easing.easeOutExpo(x, t, b, c, d); 27 | }, 28 | expoinout: function(x, t, b, c, d) { 29 | return jQuery.easing.easeInOutExpo(x, t, b, c, d); 30 | }, 31 | bouncein: function(x, t, b, c, d) { 32 | return jQuery.easing.easeInBounce(x, t, b, c, d); 33 | }, 34 | bounceout: function(x, t, b, c, d) { 35 | return jQuery.easing.easeOutBounce(x, t, b, c, d); 36 | }, 37 | bounceinout: function(x, t, b, c, d) { 38 | return jQuery.easing.easeInOutBounce(x, t, b, c, d); 39 | }, 40 | elasin: function(x, t, b, c, d) { 41 | return jQuery.easing.easeInElastic(x, t, b, c, d); 42 | }, 43 | elasout: function(x, t, b, c, d) { 44 | return jQuery.easing.easeOutElastic(x, t, b, c, d); 45 | }, 46 | elasinout: function(x, t, b, c, d) { 47 | return jQuery.easing.easeInOutElastic(x, t, b, c, d); 48 | }, 49 | backin: function(x, t, b, c, d) { 50 | return jQuery.easing.easeInBack(x, t, b, c, d); 51 | }, 52 | backout: function(x, t, b, c, d) { 53 | return jQuery.easing.easeOutBack(x, t, b, c, d); 54 | }, 55 | backinout: function(x, t, b, c, d) { 56 | return jQuery.easing.easeInOutBack(x, t, b, c, d); 57 | } 58 | }); -------------------------------------------------------------------------------- /public/stylesheets/DV/components/ui-menu.css: -------------------------------------------------------------------------------- 1 | #DV-Controls{ 2 | background-color:#f0f4f5; 3 | height:37px; 4 | border-bottom:1px solid #ABABAB; 5 | border-top:1px solid #ABABAB; 6 | margin-top:10px; 7 | position:relative; 8 | } 9 | 10 | .DV-views{ 11 | list-style-type:none; 12 | float:left; 13 | display:inline; 14 | margin:0 0 0 10px; padding:0; 15 | } 16 | 17 | .DV-views div{ 18 | list-style-type:none; 19 | float:left; 20 | display:inline; 21 | margin:8px 0 0; padding:0; 22 | } 23 | 24 | .DV-ie6 .DV-views{ 25 | position:absolute; 26 | } 27 | 28 | .DV-views div span{ 29 | display:block; 30 | padding:8px 14px; 31 | background-color:#f4f4f4; 32 | border:1px solid #ababab; 33 | font-family:Arial,Helvetica,sans-serif; 34 | font-size:10px; 35 | text-decoration:none; 36 | height:12px; 37 | border-left:none; 38 | border-bottom:1px solid #ababab; 39 | text-transform:uppercase; 40 | color:#666; 41 | } 42 | 43 | .DV-ie6 .DV-views div span{ 44 | display:inline-block; 45 | padding-bottom:7px; 46 | } 47 | 48 | .DV-views div.DV-first span{ 49 | border-left:1px solid #ababab; 50 | } 51 | 52 | .DV-views div span:hover, 53 | .DV-viewDocument .DV-views #DV-documentView span, 54 | .DV-viewAnnotations .DV-views #DV-annotationView span, 55 | .DV-viewText .DV-views #DV-textView span, 56 | .DV-viewSearch .DV-views #DV-textView span{ 57 | text-decoration:none; 58 | background-color:#fff; 59 | color:#000; 60 | } 61 | 62 | .DV-views div a:focus{ 63 | outline:0; 64 | } 65 | 66 | .DV-viewDocument .DV-views #DV-documentView span, 67 | .DV-viewAnnotations .DV-views #DV-annotationView span, 68 | .DV-viewText .DV-views #DV-textView span, 69 | .DV-viewSearch .DV-views #DV-textView span{ 70 | border-bottom:1px solid #fff; 71 | font-weight:bold; 72 | } 73 | 74 | 75 | .DV-ie6.DV-viewDocument .DV-views #DV-documentView span, 76 | .DV-ie6.DV-viewAnnotations .DV-views #DV-annotationView span, 77 | .DV-ie6.DV-viewText .DV-views #DV-textView span, 78 | .DV-ie6.DV-viewSearch .DV-views #DV-textView span{ 79 | padding-bottom:8px; 80 | } -------------------------------------------------------------------------------- /public/javascripts/DV/lib/class.js: -------------------------------------------------------------------------------- 1 | // Inspired by base2 and Prototype 2 | (function(){ 3 | var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; 4 | 5 | // The base Class implementation (does nothing) 6 | DV.Class = function(){}; 7 | 8 | // Create a new Class that inherits from this class 9 | DV.Class.extend = function(prop) { 10 | var _super = this.prototype; 11 | 12 | // Instantiate a base class (but only create the instance, 13 | // don't run the init constructor) 14 | initializing = true; 15 | var prototype = new this(); 16 | initializing = false; 17 | 18 | // Copy the properties over onto the new prototype 19 | for (var name in prop) { 20 | // Check if we're overwriting an existing function 21 | prototype[name] = typeof prop[name] == "function" && 22 | typeof _super[name] == "function" && fnTest.test(prop[name]) ? 23 | (function(name, fn){ 24 | return function() { 25 | var tmp = this._super; 26 | 27 | // Add a new ._super() method that is the same method 28 | // but on the super-class 29 | this._super = _super[name]; 30 | 31 | // The method only need to be bound temporarily, so we 32 | // remove it when we're done executing 33 | var ret = fn.apply(this, arguments); 34 | this._super = tmp; 35 | 36 | return ret; 37 | }; 38 | })(name, prop[name]) : 39 | prop[name]; 40 | } 41 | 42 | // The dummy class constructor 43 | function Class() { 44 | // All construction is actually done in the init method 45 | if ( !initializing && this.init ) 46 | this.init.apply(this, arguments); 47 | } 48 | 49 | // Populate our constructed prototype object 50 | Class.prototype = prototype; 51 | 52 | // Enforce the constructor to be what we expect 53 | Class.constructor = Class; 54 | 55 | // And make this class extendable 56 | Class.extend = arguments.callee; 57 | 58 | return Class; 59 | }; 60 | })(); 61 | -------------------------------------------------------------------------------- /public/stylesheets/DV/components/structure.css: -------------------------------------------------------------------------------- 1 | /* Only global rule. Hide overflow. */ 2 | body, html{ 3 | overflow: hidden; 4 | } 5 | 6 | #DV-docViewer{ 7 | position: relative; 8 | text-align: left; 9 | line-height: normal; 10 | } 11 | 12 | #DV-docViewer-Container{ 13 | position:absolute; 14 | top: 39px; bottom: 0px; left: 0px; right: 0px; 15 | margin: 0; 16 | overflow: hidden; 17 | border: 1px solid #ababab; border-left: 0; border-right: 0; 18 | } 19 | 20 | #DV-bar{ 21 | width:1px; 22 | } 23 | 24 | #DV-docViewer table{ 25 | border-collapse:collapse; 26 | position:relative; 27 | } 28 | 29 | #DV-docViewer td{ 30 | position:relative; 31 | vertical-align:top; 32 | } 33 | 34 | #DV-annotations { 35 | padding: 0 60px; 36 | } 37 | 38 | #DV-well{ 39 | width:265px; 40 | position:absolute; 41 | border-left:1px solid #ababab; 42 | left: auto; top: 0; bottom: 0; right: 0; 43 | overflow-y:auto; 44 | background: white; 45 | } 46 | 47 | #DV-navControls{ 48 | background-color: #fff; 49 | background-repeat: repeat-x; 50 | background-image: url(../../../images/DV/embed/shadow-white.gif); 51 | } 52 | 53 | #DV-pages{ 54 | background-color:#ccc; 55 | overflow: auto; 56 | position: absolute; 57 | left: 0; right: 266px; top: 0; bottom: 0; 58 | z-index:10001; 59 | } 60 | 61 | #DV-pageCollection{ 62 | margin: 20px auto; 63 | position:relative; 64 | z-index:0; 65 | } 66 | 67 | #DV-pageCollection{ 68 | cursor: url(../../../images/DV/grab.cur), auto; 69 | cursor: -moz-grab; 70 | } 71 | 72 | #DV-pageCollection.DV-dragging { 73 | cursor: url(../../../images/DV/grabbing.cur), auto; 74 | cursor: -moz-grabbing; 75 | } 76 | 77 | #DV-loadingDocument { 78 | margin-top: 10px; 79 | text-align:center; 80 | } 81 | 82 | #DV-loadingDocument span{ 83 | font-family:Arial,Helvetica,sans-serif; 84 | font-weight:normal; 85 | font-size:12px; 86 | color:#666; 87 | padding:10px; 88 | font-style:oblique; 89 | padding-left:24px; 90 | margin: 10px auto; 91 | background:url(../../../images/DV/embed/spinner.gif) no-repeat left 8px; 92 | } 93 | 94 | #DV-loadingDocument strong{ 95 | font-weight:normal; 96 | color:#666; 97 | } -------------------------------------------------------------------------------- /public/javascripts/DV/states/states.js: -------------------------------------------------------------------------------- 1 | DV.Schema.states = { 2 | // state values 3 | isFocus: true, 4 | // IE activeElement tracker 5 | activeElement: null, 6 | observers: [], 7 | windowDimensions: {}, 8 | scrollPosition: null, 9 | checkTimer: {}, 10 | busy: false, 11 | annotationToLoadId: null, 12 | dragReporter: null, 13 | compiled: {}, 14 | tracker: {}, 15 | 16 | InitialLoad: { 17 | enter: function(sourceState){ 18 | // If we're in an unsupported browser ... bail. 19 | if (this.helpers.unsupportedBrowser()) return; 20 | 21 | // Insert the Document Viewer HTML into the DOM. 22 | this.helpers.renderViewer(); 23 | this.scrollBarWidth = ($j.browser.msie === true) ? 19 : 17; 24 | 25 | // Assign element references. 26 | this.events.elements = this.helpers.elements = this.elements = new DV.Elements(this.pendingElements); 27 | 28 | // Build the data models 29 | this.models.document.init(); 30 | this.models.pages.init(); 31 | this.models.chapters.init(); 32 | this.models.annotations.init(); 33 | 34 | // Render included components, and hide unused portions of the UI. 35 | this.helpers.renderComponents(); 36 | 37 | // Render chapters and notes navigation: 38 | this.helpers.renderNavigation(); 39 | 40 | // Instantiate pageset and build accordingly 41 | this.pageSet = new DV.pageSet(this); 42 | this.pageSet.buildPages(); 43 | 44 | // BindEvents 45 | this.helpers.bindEvents(this); 46 | }, 47 | InitialLoad: function(){ 48 | this.helpers.positionViewer(); 49 | this.models.document.computeOffsets(); 50 | this.helpers.addObserver('drawPages'); 51 | this.helpers.registerHashChangeEvents(); 52 | this.helpers.handleInitialState(); 53 | }, 54 | exit: function(destinationState){ 55 | this.dragReporter = new DV.dragReporter('#DV-pageCollection',$j.proxy(this.helpers.shift, this), { ignoreSelector: '.DV-annotationRegion,.DV-annotationContent' }); 56 | // Start polling every 100ms 57 | this.helpers.startCheckTimer(); 58 | } 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /public/javascripts/DV/vendor/jquery.scrollTo-min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery.ScrollTo - Easy element scrolling using jQuery. 3 | * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com 4 | * Dual licensed under MIT and GPL. 5 | * Date: 5/25/2009 6 | * @author Ariel Flesler 7 | * @version 1.4.2 8 | * 9 | * http://flesler.blogspot.com/2007/10/jqueryscrollto.html 10 | */ 11 | ;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); -------------------------------------------------------------------------------- /public/javascripts/DV/views/viewer.jst: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | <%= header %> 5 |
6 | 7 |
8 | 21 |
22 | 23 |
24 |
25 |
26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 |
34 | 35 |

36 |         
37 |
38 | <%= pages %> 39 |
40 |
41 | 42 | 43 | 66 |
67 | 68 |
69 | -------------------------------------------------------------------------------- /public/assets/plain.css: -------------------------------------------------------------------------------- 1 | #DV-docViewer.DV-embedded{border:1px solid #c3c3c3;}#DV-headerHat,#DV-title,.DV-contentsHeader{display:none!important;}#DV-header{padding:0;border-bottom:2px solid #979797;position:relative;z-index:20000;box-shadow:0 0 25px rgba(0,0,0,.5);-webkit-box-shadow:0 0 25px rgba(0,0,0,.5);-moz-box-shadow:0 0 25px rgba(0,0,0,.5);}#DV-Controls{margin-top:0;border:0;background:#d7d7d7;background:-webkit-gradient(linear,left top,left bottom,from(#EAEAEA),to(#C2C2C2));background:-moz-linear-gradient(top,#EAEAEA,#C2C2C2);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#EAEAEA',EndColorStr='#C2C2C2');text-shadow:0 1px 1px #fff;color:#2C2C2C;overflow:hidden;}#DV-searchInput{width:170px;border:1px solid #999;padding:3px 3px;-moz-border-radius:4px;}#DV-searchSubmit{background:#e7e7e7;color:#4F4F4F;height:auto;padding:3px 10px;font-weight:bold;border:1px solid #999;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#c4c4c4));background:-moz-linear-gradient(top,#fefefe,#c4c4c4);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FEFEFE',EndColorStr='#C4C4C4');text-shadow:0 1px 1px #fff;cursor:pointer;font-size:11px;}div.DV-ie #DV-searchSubmit{font-size:10px;padding:4px 3px 3px;}#DV-docViewer-Container{margin:0;border:0;}#DV-pages{padding-bottom:16px;background:#bbb;}#DV-well{padding-bottom:16px;}#DV-descriptionHead{text-transform:none;color:black;}#DV-descriptionText{background:white;padding:5px 14px 10px;}.DV-views{position:relative;z-index:10;}.DV-views div span{border-bottom:0!important;background:#e3e3e3;color:black!important;background:-webkit-gradient(linear,left top,left bottom,from(#E3E3E3),to(#C2C2C2));background:-moz-linear-gradient(top,#EAEAEA,#C2C2C2);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#EAEAEA',EndColorStr='#C2C2C2');}.DV-views #DV-documentView span{-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;}#DV-textView span{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;}.DV-viewDocument .DV-views #DV-documentView span,.DV-viewAnnotations .DV-views #DV-annotationView span,.DV-viewText .DV-views #DV-textView span,.DV-viewSearch .DV-views #DV-textView span{background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#a0a0a0));background:-moz-linear-gradient(top,#fff,#a0a0a0);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FFFFFF',EndColorStr='#A0A0A0');} -------------------------------------------------------------------------------- /public/assets/plain-datauri.css: -------------------------------------------------------------------------------- 1 | #DV-docViewer.DV-embedded{border:1px solid #c3c3c3;}#DV-headerHat,#DV-title,.DV-contentsHeader{display:none!important;}#DV-header{padding:0;border-bottom:2px solid #979797;position:relative;z-index:20000;box-shadow:0 0 25px rgba(0,0,0,.5);-webkit-box-shadow:0 0 25px rgba(0,0,0,.5);-moz-box-shadow:0 0 25px rgba(0,0,0,.5);}#DV-Controls{margin-top:0;border:0;background:#d7d7d7;background:-webkit-gradient(linear,left top,left bottom,from(#EAEAEA),to(#C2C2C2));background:-moz-linear-gradient(top,#EAEAEA,#C2C2C2);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#EAEAEA',EndColorStr='#C2C2C2');text-shadow:0 1px 1px #fff;color:#2C2C2C;overflow:hidden;}#DV-searchInput{width:170px;border:1px solid #999;padding:3px 3px;-moz-border-radius:4px;}#DV-searchSubmit{background:#e7e7e7;color:#4F4F4F;height:auto;padding:3px 10px;font-weight:bold;border:1px solid #999;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;background:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#c4c4c4));background:-moz-linear-gradient(top,#fefefe,#c4c4c4);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FEFEFE',EndColorStr='#C4C4C4');text-shadow:0 1px 1px #fff;cursor:pointer;font-size:11px;}div.DV-ie #DV-searchSubmit{font-size:10px;padding:4px 3px 3px;}#DV-docViewer-Container{margin:0;border:0;}#DV-pages{padding-bottom:16px;background:#bbb;}#DV-well{padding-bottom:16px;}#DV-descriptionHead{text-transform:none;color:black;}#DV-descriptionText{background:white;padding:5px 14px 10px;}.DV-views{position:relative;z-index:10;}.DV-views div span{border-bottom:0!important;background:#e3e3e3;color:black!important;background:-webkit-gradient(linear,left top,left bottom,from(#E3E3E3),to(#C2C2C2));background:-moz-linear-gradient(top,#EAEAEA,#C2C2C2);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#EAEAEA',EndColorStr='#C2C2C2');}.DV-views #DV-documentView span{-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;}#DV-textView span{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;}.DV-viewDocument .DV-views #DV-documentView span,.DV-viewAnnotations .DV-views #DV-annotationView span,.DV-viewText .DV-views #DV-textView span,.DV-viewSearch .DV-views #DV-textView span{background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#a0a0a0));background:-moz-linear-gradient(top,#fff,#a0a0a0);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FFFFFF',EndColorStr='#A0A0A0');} -------------------------------------------------------------------------------- /public/javascripts/DV/schema/schema.js: -------------------------------------------------------------------------------- 1 | DV.Schema = function(){ 2 | return{ 3 | models: {}, 4 | views: {}, 5 | states: {}, 6 | helpers: {}, 7 | events: {}, 8 | elements: {}, 9 | text: {}, 10 | data: { 11 | zoomLevel : 700, 12 | pageWidthPadding : 20, 13 | additionalPaddingOnPage : 30, 14 | state : { page: { previous: 0, current: 0, next: 1 } } 15 | }, 16 | 17 | // Imports the document's JSON representation into the DV.Schema form that 18 | // the models expect. 19 | importCanonicalDocument : function(json) { 20 | // Ensure at least empty arrays for sections. 21 | json.sections = json.sections || []; 22 | json.annotations = json.annotations || []; 23 | 24 | this.document = $j.extend(true, {}, json); 25 | // Everything after this line is for back-compatibility. 26 | this.data.title = json.title; 27 | this.data.totalPages = json.pages; 28 | this.data.totalAnnotations = json.annotations.length; 29 | this.data.sections = json.sections; 30 | this.data.chapters = []; 31 | this.data.annotationsById = {}; 32 | this.data.annotationsByPage = {}; 33 | _.each(json.annotations, $j.proxy(this.loadAnnotation, this)); 34 | }, 35 | 36 | // Load an annotation into the Schema, starting from the canonical format. 37 | loadAnnotation : function(anno) { 38 | if (anno.id) anno.server_id = anno.id; 39 | var idx = anno.page - 1; 40 | anno.id = _.uniqueId(); 41 | anno.title = anno.title || 'Untitled Note'; 42 | anno.text = anno.content || ''; 43 | anno.access = anno.access || 'public'; 44 | anno.type = anno.location && anno.location.image ? 'region' : 'page'; 45 | if (anno.type === 'region') { 46 | var loc = $j.map(anno.location.image.split(','), function(n, i) { return parseInt(n, 10); }); 47 | anno.y1 = loc[0]; anno.x2 = loc[1]; anno.y2 = loc[2]; anno.x1 = loc[3]; 48 | }else if(anno.type === 'page'){ 49 | anno.y1 = 0; anno.x2 = 0; anno.y2 = 0; anno.x1 = 0; 50 | } 51 | this.data.annotationsById[anno.id] = anno; 52 | var page = this.data.annotationsByPage[idx] = this.data.annotationsByPage[idx] || []; 53 | var insertionIndex = _.sortedIndex(page, anno, function(a){ return a.y1; }); 54 | page.splice(insertionIndex, 0, anno); 55 | return anno; 56 | } 57 | }; 58 | }(); 59 | -------------------------------------------------------------------------------- /public/javascripts/DV/views/annotation.jst: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
Close
5 |
6 | 7 |
8 | 9 | 10 |
11 | 12 |
13 |
14 | Previous 15 | Next 16 |
17 |
Go to Page <%= pageNumber %>
18 |
<%= title %>
19 | 20 | <% if (access == 'private') { %> 21 |
22 | <% } %> 23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 | 31 | 32 |
33 |
34 | 35 |
36 |
37 | 38 |
39 | <%= text %> 40 |
41 | 42 | 43 |
44 |
45 |
Delete
46 |
Save
47 |
Cancel
48 |
49 |
50 |
51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /public/javascripts/DV/tests/testsuite.css: -------------------------------------------------------------------------------- 1 | body, div, h1 { font-family: 'trebuchet ms', verdana, arial; margin: 0; padding: 0 } 2 | body {font-size: 10pt; } 3 | h1 { padding: 15px; font-size: large; background-color: #06b; color: white; } 4 | h1 a { color: white; } 5 | h2 { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal } 6 | 7 | .pass { color: green; } 8 | .fail { color: red; } 9 | p.result { margin-left: 1em; } 10 | 11 | #banner { height: 2em; border-bottom: 1px solid white; } 12 | h2.pass { background-color: green; } 13 | h2.fail { background-color: red; } 14 | 15 | div.testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; } 16 | 17 | ol#tests li strong { cursor:pointer; } 18 | 19 | div#fx-tests h4 { 20 | background: red; 21 | } 22 | 23 | div#fx-tests h4.pass { 24 | background: green; 25 | } 26 | 27 | div#fx-tests div.box { 28 | background: red url(data/cow.jpg) no-repeat; 29 | overflow: hidden; 30 | border: 2px solid #000; 31 | } 32 | 33 | div#fx-tests div.overflow { 34 | overflow: visible; 35 | } 36 | 37 | div.inline { 38 | display: inline; 39 | } 40 | 41 | div.autoheight { 42 | height: auto; 43 | } 44 | 45 | div.autowidth { 46 | width: auto; 47 | } 48 | 49 | div.autoopacity { 50 | opacity: auto; 51 | } 52 | 53 | div.largewidth { 54 | width: 100px; 55 | } 56 | 57 | div.largeheight { 58 | height: 100px; 59 | } 60 | 61 | div.largeopacity { 62 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); 63 | } 64 | 65 | div.medwidth { 66 | width: 50px; 67 | } 68 | 69 | div.medheight { 70 | height: 50px; 71 | } 72 | 73 | div.medopacity { 74 | opacity: 0.5; 75 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); 76 | } 77 | 78 | div.nowidth { 79 | width: 0px; 80 | } 81 | 82 | div.noheight { 83 | height: 0px; 84 | } 85 | 86 | div.noopacity { 87 | opacity: 0; 88 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); 89 | } 90 | 91 | div.hidden { 92 | display: none; 93 | } 94 | 95 | div#fx-tests div.widewidth { 96 | background-repeat: repeat-x; 97 | } 98 | 99 | div#fx-tests div.wideheight { 100 | background-repeat: repeat-y; 101 | } 102 | 103 | div#fx-tests div.widewidth.wideheight { 104 | background-repeat: repeat; 105 | } 106 | 107 | div#fx-tests div.noback { 108 | background-image: none; 109 | } 110 | 111 | div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; } 112 | div.chain div { position: absolute; top: 0px; left: 0px; } 113 | 114 | div.chain.test { background: red; } 115 | div.chain.test div { background: green; } 116 | 117 | div.chain.out { background: green; } 118 | div.chain.out div { background: red; display: none; } 119 | 120 | div#show-tests * { display: none; } 121 | -------------------------------------------------------------------------------- /public/stylesheets/DV/components/view-annotations.css: -------------------------------------------------------------------------------- 1 | .DV-viewAnnotations .DV-set, 2 | .DV-viewAnnotations #DV-text, 3 | .DV-viewAnnotations #DV-search, 4 | .DV-viewAnnotations #DV-bar{ 5 | display:none; 6 | } 7 | 8 | .DV-viewAnnotations #DV-annotations, 9 | .DV-viewAnnotations .DV-annotationContent{ 10 | display:block; 11 | } 12 | 13 | .DV-viewAnnotations .DV-annotationRegion{ 14 | position: absolute; 15 | left: -10000px; 16 | width: 0; height: 0; 17 | } 18 | 19 | .DV-viewAnnotations .DV-annotationTab{ 20 | 21 | filter:none; 22 | display:none !important; 23 | } 24 | 25 | .DV-viewAnnotations .DV-annotationGoto{ 26 | display:inline; 27 | } 28 | 29 | .DV-viewAnnotations .DV-pageNoteAnnotationTab{ 30 | display:none; 31 | } 32 | 33 | .DV-viewAnnotations .DV-annotationNext, 34 | .DV-viewAnnotations .DV-annotationPrevious{ 35 | display:none !important; 36 | } 37 | 38 | .DV-viewAnnotations .DV-annotationBG{ 39 | margin-top:0; 40 | position:relative; 41 | clear:left; 42 | } 43 | 44 | .DV-viewAnnotations .DV-annotation, 45 | .DV-getHeights .DV-annotation { 46 | position:relative; 47 | top:0 !important; 48 | display: inline-block; 49 | margin: 0 auto 25px; 50 | 51 | background: rgb(255, 227, 37); 52 | background: rgba(255, 227, 37, .9); 53 | 54 | -webkit-border-radius:4px; 55 | -moz-border-radius:4px; 56 | border-radius:4px; 57 | 58 | -webkit-box-shadow: 1px 1px 3px rgb(0,0,0); 59 | -webkit-box-shadow: 1px 1px 3px rgba(0,0,0,.2); 60 | 61 | -moz-box-shadow: 1px 1px 3px rgb(0,0,0); 62 | -moz-box-shadow: 1px 1px 3px rgba(0,0,0,.2); 63 | 64 | box-shadow: 1px 1px 3px rgb(0,0,0); 65 | box-shadow: 1px 1px 3px rgba(0,0,0,.2); 66 | } 67 | .DV-viewAnnotations .DV-annotation.DV-private { 68 | background: rgb(107, 194, 248); 69 | background: rgba(107, 194, 248, .9); 70 | } 71 | 72 | /*hack to control scrollbar width in webkit*/ 73 | .DV-viewAnnotations .DV-annotation:after { 74 | content: "."; 75 | display: block; 76 | height: 0; 77 | clear: both; 78 | visibility: hidden; 79 | } 80 | 81 | /* Hides from IE-mac \*/ 82 | * html .DV-viewAnnotations .DV-annotation {height: 1%;} 83 | .DV-viewAnnotations .DV-annotation {display: block;} 84 | /* End hide from IE-mac */ 85 | 86 | .DV-viewAnnotations #DV-currentPagePrefix, 87 | .DV-viewAnnotations #DV-totalPages{ 88 | display:none; 89 | } 90 | 91 | .DV-viewAnnotations #DV-currentAnnotationPrefix, 92 | .DV-viewAnnotations #DV-totalAnnotations{ 93 | display:inline; 94 | } 95 | 96 | 97 | .DV-ie .DV-viewAnnotations .DV-annotationLabel { 98 | float:none; 99 | left:0; 100 | position:absolute; 101 | top:7px; 102 | } 103 | 104 | .DV-viewAnnotations .DV-noChildren{ 105 | display:none !important; 106 | } 107 | 108 | .DV-viewAnnotations .DV-hasChildren{ 109 | display:block !important; 110 | } 111 | -------------------------------------------------------------------------------- /public/javascripts/DV/events/history.js: -------------------------------------------------------------------------------- 1 | _.extend(DV.Schema.events, { 2 | // [document-slug]#document/p[pageID] 3 | handleHashChangeViewDocumentPage: function(page){ 4 | var pageIndex = parseInt(page,10) - 1; 5 | if(this.application.state === 'ViewDocument'){ 6 | this.application.pageSet.cleanUp(); 7 | this.helpers.jump(pageIndex); 8 | }else{ 9 | this.models.document.setPageIndex(pageIndex); 10 | this.states.ViewDocument(); 11 | } 12 | }, 13 | // [document-slug]#p=1 14 | handleHashChangeLegacyViewDocumentPage: function(page){ 15 | var pageIndex = parseInt(page,10) - 1; 16 | this.handleHashChangeViewDocumentPage(page); 17 | }, 18 | // [document-slug]#document/p[pageID]/a[annotationID] 19 | handleHashChangeViewDocumentAnnotation: function(page,annotation){ 20 | var pageIndex = parseInt(page,10) - 1; 21 | var annotation = parseInt(annotation,10); 22 | 23 | if(this.application.state === 'ViewDocument'){ 24 | this.application.pageSet.showAnnotation(this.application.models.annotations.byId[annotation]); 25 | }else{ 26 | this.models.document.setPageIndex(pageIndex); 27 | this.application.pageSet.setActiveAnnotation(annotation); 28 | this.states.ViewDocument(); 29 | } 30 | 31 | }, 32 | // [document-slug]#annotation/a[annotationID] 33 | handleHashChangeViewAnnotationAnnotation: function(annotation){ 34 | 35 | var annotation = parseInt(annotation,10); 36 | var application = this.application; 37 | 38 | if(application.state === 'ViewAnnotation'){ 39 | application.pageSet.showAnnotation(this.application.models.annotations.byId[annotation]); 40 | }else{ 41 | application.activeAnnotationId = annotation; 42 | this.states.ViewAnnotation(); 43 | } 44 | }, 45 | // Default route if all else fails 46 | handleHashChangeDefault: function(){ 47 | 48 | this.application.pageSet.cleanUp(); 49 | this.models.document.setPageIndex(0); 50 | 51 | if(this.application.state === 'ViewDocument'){ 52 | this.helpers.jump(0); 53 | DV.history.save('document/p1'); 54 | }else{ 55 | this.states.ViewDocument(); 56 | } 57 | 58 | }, 59 | // [document-slug]#text/p[pageID] 60 | handleHashChangeViewText: function(page){ 61 | var pageIndex = parseInt(page,10) - 1; 62 | if(this.application.state === 'ViewText'){ 63 | this.events.loadText(pageIndex); 64 | }else{ 65 | this.models.document.setPageIndex(pageIndex); 66 | this.states.ViewText(); 67 | } 68 | }, 69 | // [document-slug]#search/[searchString] 70 | handleHashChangeViewSearchRequest: function(page,query){ 71 | var pageIndex = parseInt(page,10) - 1; 72 | this.elements.searchInput.val(decodeURIComponent(query)); 73 | 74 | if(this.application.state !== 'ViewSearch'){ 75 | this.models.document.setPageIndex(pageIndex); 76 | } 77 | this.states.ViewSearch(); 78 | }, 79 | handleHashChangeViewEntity: function(page, name, offset, length) { 80 | page = parseInt(page,10) - 1; 81 | name = decodeURIComponent(name); 82 | this.elements.searchInput.val(name); 83 | this.models.document.setPageIndex(page); 84 | this.states.ViewEntity(name, parseInt(offset, 10), parseInt(length, 10)); 85 | } 86 | }); 87 | -------------------------------------------------------------------------------- /public/javascripts/DV/helpers/annotations.js: -------------------------------------------------------------------------------- 1 | _.extend(DV.Schema.helpers, { 2 | getAnnotationModel : function(annoEl) { 3 | var annoId = parseInt(annoEl.attr('rel').match(/\d+/), 10); 4 | return this.models.annotations.getAnnotation(annoId); 5 | }, 6 | // Return the annotation Object that connects with the element in the DOM 7 | getAnnotationObject: function(annotation){ 8 | 9 | var annotation = $j(annotation); 10 | var annotationId = annotation.attr('id').replace(/DV\-annotation\-|DV\-listAnnotation\-/,''); 11 | var pageId = annotation.closest('div.DV-set').attr('id'); 12 | 13 | for(var i = 0; (annotationObject = this.application.pageSet.pages[pageId].annotations[i]); i++){ 14 | if(annotationObject.id == annotationId){ 15 | // cleanup 16 | annotation = null; 17 | return annotationObject; 18 | } 19 | } 20 | 21 | return false; 22 | 23 | }, 24 | // Set of bridges to access annotation methods 25 | // Toggle 26 | annotationBridgeToggle: function(e){ 27 | e.preventDefault(); 28 | var annotationObject = this.getAnnotationObject($j(e.target).closest(this.annotationClassName)); 29 | annotationObject.toggle(); 30 | }, 31 | // Show annotation 32 | annotationBridgeShow: function(e){ 33 | e.preventDefault(); 34 | var annotationObject = this.getAnnotationObject($j(e.target).closest(this.annotationClassName)); 35 | annotationObject.show(); 36 | }, 37 | // Hide annotation 38 | annotationBridgeHide: function(e){ 39 | e.preventDefault(); 40 | var annotationObject = this.getAnnotationObject($j(e.target).closest(this.annotationClassName)); 41 | annotationObject.hide(true); 42 | }, 43 | // Jump to the next annotation 44 | annotationBridgeNext: function(e){ 45 | e.preventDefault(); 46 | var annotationObject = this.getAnnotationObject($j(e.target).closest(this.annotationClassName)); 47 | annotationObject.next(); 48 | }, 49 | // Jump to the previous annotation 50 | annotationBridgePrevious: function(e){ 51 | e.preventDefault(); 52 | var annotationObject = this.getAnnotationObject($j(e.target).closest(this.annotationClassName)); 53 | annotationObject.previous(); 54 | }, 55 | // Update currentpage text to indicate current annotation 56 | setAnnotationPosition: function(_position){ 57 | this.elements.currentPage.text(_position); 58 | }, 59 | // Update active annotation limits 60 | setActiveAnnotationLimits: function(annotation){ 61 | var annotation = (annotation) ? annotation : this.application.activeAnnotation; 62 | 63 | if(!annotation || annotation == null){ 64 | return; 65 | } 66 | 67 | var elements = this.elements; 68 | var aPage = annotation.page; 69 | var aEl = annotation.annotationEl; 70 | var aPosTop = annotation.position.top; 71 | var _trackAnnotation = this.events.trackAnnotation; 72 | 73 | if(annotation.type === 'page'){ 74 | _trackAnnotation.h = aEl.find('div.DV-annotationBG').outerHeight()+aPage.getOffset(); 75 | _trackAnnotation.combined = (aPage.getOffset()) - elements.window.height(); 76 | }else{ 77 | _trackAnnotation.h = aEl.find('div.DV-annotationBG').height()+aPosTop+20+aPage.getOffset(); 78 | _trackAnnotation.combined = (aPosTop+20+aPage.getOffset()) - elements.window.height(); 79 | } 80 | 81 | 82 | } 83 | }); -------------------------------------------------------------------------------- /public/stylesheets/DV/components/dropShadow.css: -------------------------------------------------------------------------------- 1 | /* inset shadows */ 2 | .DV-ds-insetTop{ 3 | position:absolute; 4 | top:0; 5 | left:0; 6 | right:0; 7 | height:5px; 8 | z-index:3010; 9 | } 10 | 11 | .DV-ds-insetBottom{ 12 | position:absolute; 13 | bottom:0; 14 | left:0; 15 | right:0; 16 | height:5px; 17 | z-index:3010; 18 | } 19 | 20 | .DV-ds-insetLeft{ 21 | position:absolute; 22 | width:100%; 23 | top:0; 24 | left:0; 25 | width:5px; 26 | z-index:3010; 27 | } 28 | 29 | .DV-ds-insetRight{ 30 | position:absolute; 31 | top:0; 32 | right:0; 33 | width:5px; 34 | z-index:3010; 35 | } 36 | 37 | .DV-ie6 .DV-ds-insetRight{ 38 | right:-1px; 39 | } 40 | 41 | /* base shadow fade rules*/ 42 | .DV-ds{ 43 | position:absolute; 44 | background-color:#000; 45 | } 46 | 47 | .DV-ds-1{ 48 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=5)"; 49 | filter:progid:DXImageTransform.Microsoft.Alpha(opacity=5); 50 | opacity:.05; 51 | } 52 | 53 | .DV-ds-2{ 54 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=4)"; 55 | filter:progid:DXImageTransform.Microsoft.Alpha(opacity=4); 56 | opacity:.04; 57 | } 58 | 59 | .DV-ds-3{ 60 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=3)"; 61 | filter:progid:DXImageTransform.Microsoft.Alpha(opacity=3); 62 | opacity:.03; 63 | } 64 | 65 | .DV-ds-4{ 66 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=2)"; 67 | filter:progid:DXImageTransform.Microsoft.Alpha(opacity=2); 68 | opacity:.02; 69 | } 70 | 71 | .DV-ds-5{ 72 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=2)"; 73 | filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1); 74 | opacity:.01; 75 | } 76 | 77 | /* inset shadows - top */ 78 | .DV-ds-insetTop .DV-ds{ 79 | top:0; 80 | left:0; 81 | right:0; 82 | } 83 | 84 | /* inset shadows - bottom */ 85 | .DV-ds-insetBottom .DV-ds{ 86 | bottom:0; 87 | left:0; 88 | right:0; 89 | } 90 | 91 | /* top|bottom rules */ 92 | .DV-ds-insetBottom .DV-ds-1, 93 | .DV-ds-insetTop .DV-ds-1{ 94 | height: 1px; 95 | } 96 | 97 | .DV-ds-insetBottom .DV-ds-2, 98 | .DV-ds-insetTop .DV-ds-2{ 99 | height: 2px; 100 | } 101 | 102 | .DV-ds-insetBottom .DV-ds-3, 103 | .DV-ds-insetTop .DV-ds-3{ 104 | height: 3px; 105 | } 106 | 107 | .DV-ds-insetBottom .DV-ds-4, 108 | .DV-ds-insetTop .DV-ds-4{ 109 | height: 4px; 110 | } 111 | 112 | .DV-ds-insetBottom .DV-ds-5, 113 | .DV-ds-insetTop .DV-ds-5{ 114 | height: 5px; 115 | } 116 | 117 | /* inset shadows - left */ 118 | .DV-ds-insetLeft .DV-ds{ 119 | top:0; 120 | left:0; 121 | bottom:0; 122 | } 123 | 124 | /* inset shadows - bottom */ 125 | .DV-ds-insetRight .DV-ds{ 126 | top:0; 127 | right:0; 128 | bottom:0; 129 | } 130 | 131 | /* left|right rules */ 132 | .DV-ds-insetLeft .DV-ds-1, 133 | .DV-ds-insetRight .DV-ds-1{ 134 | width: 1px; 135 | } 136 | 137 | .DV-ds-insetLeft .DV-ds-2, 138 | .DV-ds-insetRight .DV-ds-2{ 139 | width: 2px; 140 | } 141 | 142 | .DV-ds-insetLeft .DV-ds-3, 143 | .DV-ds-insetRight .DV-ds-3{ 144 | width: 3px; 145 | } 146 | 147 | .DV-ds-insetLeft .DV-ds-4, 148 | .DV-ds-insetRight .DV-ds-4{ 149 | width: 4px; 150 | } 151 | 152 | .DV-ds-insetLeft .DV-ds-5, 153 | .DV-ds-insetRight .DV-ds-5{ 154 | width: 5px; 155 | } -------------------------------------------------------------------------------- /public/stylesheets/DV/components/pages.css: -------------------------------------------------------------------------------- 1 | #DV-documentCell{ 2 | background-color:#ccc; 3 | } 4 | 5 | #DV-documentCell.DV-coverVisible{ 6 | background-color:#444; 7 | } 8 | 9 | .DV-cover{ 10 | left:0; 11 | position:absolute; 12 | top:0; 13 | visibility:visible; 14 | z-index:1000; 15 | } 16 | 17 | .DV-pageMeta{ 18 | font-family:Arial,Helvetica,sans-serif; 19 | height:20px; 20 | width:100%; height: 0; 21 | left:0; 22 | top:0; 23 | position:absolute; 24 | z-index:20101; 25 | } 26 | 27 | .DV-pageNumber { 28 | display:inline; 29 | float:left; 30 | margin-left:0; 31 | margin-top:0; 32 | position:relative; 33 | z-index:12000; 34 | zoom:1; 35 | font-size:10px; 36 | font-weight:bold; 37 | padding-left:8px; 38 | } 39 | 40 | .DV-annotation .DV-pageNumber{ 41 | display:none; 42 | } 43 | 44 | .DV-pageNumber{ 45 | margin-top:20px; 46 | } 47 | 48 | .DV-layer-page .DV-pageNumber{ 49 | margin-left:10px; 50 | position:absolute; 51 | } 52 | 53 | .DV-viewAnnotations .DV-pageNumber{ 54 | display:inline; 55 | float:left; 56 | font-family:Arial,Helvetica,sans-serif; 57 | font-size:10px; 58 | margin-left:12px; 59 | margin-top:10px; 60 | position:relative; 61 | z-index:1200; 62 | } 63 | 64 | .DV-page{ 65 | position:relative; 66 | left:0; 67 | top:0; 68 | -moz-box-shadow: 0 0 1em #a9a9a9; 69 | -webkit-box-shadow: 0 0 1em #a9a9a9; 70 | background-color:#dfdfdf; 71 | overflow:visible; 72 | } 73 | 74 | .DV-pageImage{ 75 | visibility:hidden; 76 | position:absolute; 77 | z-index:1; 78 | top:0; 79 | left:0; 80 | } 81 | 82 | .DV-loaded .DV-pageImage{ 83 | visibility:visible; 84 | -moz-user-select:none; 85 | } 86 | 87 | .DV-pageImage, 88 | .DV-annotationExcerptImage, 89 | .DV-excerptHighLevel img{ 90 | -ms-interpolation-mode: bicubic; 91 | } 92 | 93 | #DV-pages.DV-coverVisible{ 94 | background-color:#444; 95 | cursor:pointer; 96 | } 97 | 98 | #DV-pages.DV-coverVisible .DV-page{ 99 | -moz-box-shadow: 0 0 1em #333; 100 | -webkit-box-shadow: 0 0 1em #333; 101 | background-color:#fff; 102 | } 103 | 104 | #DV-pages.DV-coverVisible .DV-pageImage{ 105 | opacity:.4; 106 | background-color:#000; 107 | } 108 | 109 | /* different opacity to handle IE opacity rendering bug */ 110 | .DV-ie #DV-pages.DV-coverVisible .DV-pageImage{ 111 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=45)"; 112 | filter: alpha(opacity=45); 113 | } 114 | 115 | .DV-coverVisible .DV-cover{ 116 | background-color:#000; 117 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=45)"; 118 | filter: alpha(opacity=55); 119 | opacity:.6; 120 | cursor:pointer !important; 121 | } 122 | 123 | .DV-coverVisible .DV-page, 124 | .DV-coverVisible #DV-pageCollection{ 125 | cursor:pointer !important; 126 | } 127 | 128 | .DV-loading .DV-pageImage{ 129 | visibility:hidden !important; 130 | } 131 | 132 | .DV-loading-top, 133 | .DV-loading-bottom{ 134 | right:0; 135 | top:0; 136 | position:absolute; 137 | padding:4px; 138 | background-color:#fff; 139 | color:#aaa; 140 | font-family:Arial,Helvetica,sans-serif; 141 | font-size:10px; 142 | text-align:center; 143 | } 144 | 145 | .DV-loaded .DV-loading-bottom{ 146 | bottom:0; 147 | } 148 | 149 | .DV-loaded .DV-loading-top, 150 | .DV-loaded .DV-loading-bottom{ 151 | display:none; 152 | } 153 | 154 | .DV-set{ 155 | position:absolute; 156 | top:0; 157 | left:0; 158 | padding-left:45px; 159 | } 160 | 161 | #p0, 162 | #p1, 163 | #p2{ 164 | display:none; 165 | padding-left:60px; 166 | z-index:15999; 167 | } 168 | 169 | .DV-activePage{ 170 | z-index:16000 !important; 171 | } 172 | -------------------------------------------------------------------------------- /public/stylesheets/DV/plain.css: -------------------------------------------------------------------------------- 1 | /* DocumentCloud overrides to the DocViewer CSS go here: */ 2 | 3 | /* Global rules, default for the plain style. */ 4 | body, html { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | #DV-docViewer { 10 | border: 1px solid #c3c3c3; 11 | } 12 | #DV-headerHat, #DV-title, .DV-contentsHeader { 13 | display: none !important; 14 | } 15 | #DV-header { 16 | padding: 0; 17 | border-bottom: 2px solid #979797; 18 | position: relative; 19 | z-index: 20000; 20 | box-shadow: 0 0 25px rgba(0,0,0,.5); -webkit-box-shadow: 0 0 25px rgba(0,0,0,.5); -moz-box-shadow: 0 0 25px rgba(0,0,0,.5); 21 | } 22 | #DV-Controls { 23 | margin-top: 0; 24 | border: 0; 25 | background: #d7d7d7; 26 | background: -webkit-gradient(linear, left top, left bottom, from(#EAEAEA), to(#C2C2C2)); 27 | background: -moz-linear-gradient(top, #EAEAEA, #C2C2C2); 28 | filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#EAEAEA', EndColorStr='#C2C2C2'); 29 | text-shadow: 0px 1px 1px #fff; 30 | color: #2C2C2C; 31 | overflow: hidden; 32 | } 33 | #DV-searchInput { 34 | width: 170px; 35 | border: 1px solid #999; 36 | padding: 3px 3px; 37 | -moz-border-radius: 4px; 38 | } 39 | #DV-searchSubmit { 40 | background: #e7e7e7; 41 | color: #4F4F4F; 42 | height: auto; 43 | padding: 3px 10px; 44 | font-weight: bold; 45 | border: 1px solid #999; 46 | border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; 47 | background: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#c4c4c4)); 48 | background: -moz-linear-gradient(top, #fefefe, #c4c4c4); 49 | filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FEFEFE', EndColorStr='#C4C4C4'); 50 | text-shadow: 0px 1px 1px #fff; 51 | cursor: pointer; 52 | font-size:11px; 53 | } 54 | div.DV-ie #DV-searchSubmit { 55 | font-size: 10px; 56 | padding: 4px 3px 3px; 57 | } 58 | 59 | #DV-docViewer-Container { 60 | margin: 0; 61 | border: 0; 62 | } 63 | #DV-pages { 64 | background: #bbb; 65 | } 66 | 67 | #DV-well { 68 | padding-bottom: 16px; 69 | } 70 | #DV-descriptionHead { 71 | text-transform: none; 72 | color: black; 73 | } 74 | #DV-descriptionText { 75 | background: white; 76 | padding: 5px 14px 10px; 77 | } 78 | 79 | .DV-views { 80 | position: relative; 81 | z-index: 10; 82 | } 83 | .DV-views div span { 84 | border-bottom: 0 !important; 85 | background: #e3e3e3; 86 | color: black !important; 87 | background: -webkit-gradient(linear, left top, left bottom, from(#E3E3E3), to(#C2C2C2)); 88 | background: -moz-linear-gradient(top, #EAEAEA, #C2C2C2); 89 | filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#EAEAEA', EndColorStr='#C2C2C2'); 90 | } 91 | .DV-views #DV-documentView span { 92 | -webkit-border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; 93 | } 94 | #DV-textView span { 95 | -webkit-border-top-right-radius: 5px; -moz-border-radius-topright: 5px; 96 | } 97 | .DV-viewDocument .DV-views #DV-documentView span, 98 | .DV-viewAnnotations .DV-views #DV-annotationView span, 99 | .DV-viewText .DV-views #DV-textView span, 100 | .DV-viewSearch .DV-views #DV-textView span { 101 | background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#a0a0a0)); 102 | background: -moz-linear-gradient(top, #fff, #a0a0a0); 103 | filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#FFFFFF', EndColorStr='#A0A0A0'); 104 | } 105 | -------------------------------------------------------------------------------- /public/javascripts/DV/lib/history.js: -------------------------------------------------------------------------------- 1 | // Handles JavaScript history management and callbacks. To use, register a 2 | // regexp that matches the history hash with its corresponding callback: 3 | // 4 | // dc.history.register(/^#search/, controller.runSearch); 5 | // 6 | // And then you can save arbitrary history fragments. 7 | // 8 | // dc.history.save('search/freedom/p3'); 9 | // 10 | DV.history = { 11 | 12 | // The interval at which the window location is polled. 13 | URL_CHECK_INTERVAL : 500, 14 | 15 | // We need to use an iFrame to save history if we're in an old version of IE. 16 | USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8, 17 | 18 | // The ordered list of history handlers matchers and callbacks. 19 | handlers : [], 20 | defaultCallback: null, 21 | 22 | // The current recorded window.location.hash. 23 | hash : window.location.hash, 24 | 25 | // Initialize history with an empty set of handlers. 26 | // Bind to the HTML5 'onhashchange' callback, if it exists. Otherwise, 27 | // start polling the window location. 28 | initialize : function() { 29 | _.bindAll(this, 'checkURL'); 30 | if (this.USE_IFRAME) this.iframe = jQuery('