-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NOTE: Had to upgrade bookviewer.js to use newer versions of jQuery/jQuery-UI and a few plugins. Future work will probably have to be done.
- Loading branch information
Trey Terrell
committed
Feb 25, 2014
1 parent
2f1b134
commit 665cbb1
Showing
61 changed files
with
8,085 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/assets/javascripts/bookreader/oregondigital_bookreader.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
jQuery -> | ||
window.BookReaderManager = new BookReaderManager | ||
class BookReaderManager | ||
constructor: -> | ||
return unless $("#BookReader").length > 0 | ||
@element = $("#BookReader") | ||
@br = this.initialize_bookreader() | ||
$('#BRtoolbar').find('.read').hide(); | ||
$('#textSrch').hide(); | ||
$('#btnSrch').hide(); | ||
initialize_bookreader: -> | ||
@br = new BookReader() | ||
@br.imagesBaseURL = "/assets/bookreader/images/" | ||
@br.getPageWidth = (index) -> 1000 | ||
@br.getPageHeight = (index) -> 1000 | ||
@br.getPageURI = this.getPageURI | ||
@br.getPageSide = this.getPageSide | ||
@br.getSpreadIndices = this.getSpreadIndices | ||
@br.getPageNum = (index) -> index+1 | ||
@br.numLeafs = @element.data("pages") | ||
@br.bookTitle = @element.data("title") | ||
@br.bookUrl = '' | ||
@br.getEmbedCode = -> return "Embedding is disabled." | ||
@br.init() | ||
return @br | ||
getPageURI: (index, reduce, rotate) => | ||
"#{@element.data("root")}/page-#{index+1}.png" | ||
getPageSide: (index) -> | ||
if 0 == (index & 0x1) | ||
return'R' | ||
else | ||
return'L' | ||
getSpreadIndices: (pindex) => | ||
spreadIndices = [null, null]; | ||
if 'rl' == @br.pageProgression | ||
if this.getPageSide(pindex) == 'R' | ||
spreadIndices[1] = pindex | ||
spreadIndices[0] = pindex + 1 | ||
else | ||
spreadIndices[0] = pindex | ||
spreadIndices[1] = pindex-1 | ||
else | ||
if this.getPageSide(pindex) == 'L' | ||
spreadIndices[0] = pindex | ||
spreadIndices[1] = pindex + 1; | ||
else | ||
spreadIndices[1] = pindex | ||
spreadIndices[0] = pindex-1 | ||
return spreadIndices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#document-viewer { | ||
position: relative; | ||
width: 800px; | ||
height: 600px; | ||
overflow: hidden; | ||
#BRnav { | ||
position: absolute; | ||
} | ||
#BRcontainer { | ||
margin-top: 41px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
class Document < GenericAsset | ||
makes_derivatives do |obj| | ||
obj.transform_datastream :content, {:pages => {:output_path => obj.pages_location}}, :processor => :docsplit_processor | ||
obj.save | ||
end | ||
|
||
def pages_location | ||
fd = OregonDigital::FileDistributor.new(pid) | ||
fd.base_path = APP_CONFIG["document_pages_path"] || Rails.root.join("media", "document_pages") | ||
fd.base_path = base_pages_path | ||
fd.extension = "" | ||
return Pathname.new(fd.path) | ||
end | ||
|
||
def base_pages_path | ||
Pathname.new(APP_CONFIG["document_pages_path"] || Rails.root.join("media", "document_pages")) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div align="center"> | ||
<div id="document-viewer"> | ||
TODO: Get document viewer back in | ||
<%= decorated_object.view_div %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This should be
/public/media
if we don't want to accidentally match something likespec/fixtures/public/media
Probably not horribly important, just a thought..