Skip to content

Commit

Permalink
Merge branch 'feature/epub_reading_system' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Schneiderman committed Dec 19, 2013
2 parents 1a690c2 + ffaa618 commit e6fc9bd
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 289 deletions.
35 changes: 0 additions & 35 deletions host_app_reference_files/host_app_feedback.js

This file was deleted.

71 changes: 0 additions & 71 deletions host_app_reference_files/reader.css

This file was deleted.

162 changes: 0 additions & 162 deletions host_app_reference_files/reader.html

This file was deleted.

55 changes: 53 additions & 2 deletions js/readium_sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,63 @@ ReadiumSDK = {
PAGINATION_CHANGED: "PaginationChanged",
SETTINGS_APPLIED: "SettingsApplied",
CONTENT_DOCUMENT_LOADED: "ContentDocumentLoaded",
CURRENT_VIEW_PAGINATION_CHANGED: "CurrentViewPaginationChanged", // used internally
MEDIA_OVERLAY_STATUS_CHANGED: "MediaOverlayStatusChanged",
MEDIA_OVERLAY_TTS_SPEAK: "MediaOverlayTTSSpeak",
MEDIA_OVERLAY_TTS_STOP: "MediaOverlayTTSStop"
}
},

InternalEvents: {
CURRENT_VIEW_PAGINATION_CHANGED: "CurrentViewPaginationChanged",
}

};


//This is default implementation of reading system object that will be available for the publication's javascript to analyze at runtime
//To extend/modify/replace this object reading system should subscribe ReadiumSDK.Events.READER_INITIALIZED and apply changes in reaction to this event
navigator.epubReadingSystem = {
name: "",
version: "0.0.0",
layoutStyle: "paginated",

hasFeature: function (feature, version) {

// for now all features must be version 1.0 so fail fast if the user has asked for something else
if (version && version !== "1.0") {
return false;
}

if (feature === "dom-manipulation") {
// Scripts may make structural changes to the document’s DOM (applies to spine-level scripting only).
return true;
}
if (feature === "layout-changes") {
// Scripts may modify attributes and CSS styles that affect content layout (applies to spine-level scripting only).
return true;
}
if (feature === "touch-events") {
// The device supports touch events and the Reading System passes touch events to the content.
return false;
}
if (feature === "mouse-events") {
// The device supports mouse events and the Reading System passes mouse events to the content.
return true;
}
if (feature === "keyboard-events") {
// The device supports keyboard events and the Reading System passes keyboard events to the content.
return true;
}

if (feature === "spine-scripting") {
//Spine-level scripting is supported.
return true;
}

return false;
}
};


_.extend(ReadiumSDK, Backbone.Events);


18 changes: 10 additions & 8 deletions js/views/fixed_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ ReadiumSDK.Views.FixedView = Backbone.View.extend({

return new ReadiumSDK.Views.OnePageView({

iframeLoader: this.iframeLoader,
spine: this.spine,
bookStyles: this.bookStyles,
class: cssclass,
contentAlignment: contentAlignment
});
iframeLoader: this.iframeLoader,
spine: this.spine,
bookStyles: this.bookStyles,
class: cssclass,
contentAlignment: contentAlignment
});
},

isReflowable: function() {
Expand Down Expand Up @@ -166,7 +166,7 @@ ReadiumSDK.Views.FixedView = Backbone.View.extend({
this.updateContentMetaSize();
this.resizeBook();

this.trigger(ReadiumSDK.Events.CURRENT_VIEW_PAGINATION_CHANGED, { paginationInfo: this.getPaginationInfo(), initiator: initiator, spineItem: paginationRequest_spineItem, elementId: paginationRequest_elementId } );
this.trigger(ReadiumSDK.InternalEvents.CURRENT_VIEW_PAGINATION_CHANGED, { paginationInfo: this.getPaginationInfo(), initiator: initiator, spineItem: paginationRequest_spineItem, elementId: paginationRequest_elementId } );
},

onViewportResize: function() {
Expand Down Expand Up @@ -395,7 +395,9 @@ ReadiumSDK.Views.FixedView = Backbone.View.extend({
}

if(!pageView.isDisplaying()) {
this.$el.append(pageView.render().$el);
pageView.render();
this.$el.append(pageView.$el);

context.isElementAdded = true;
}

Expand Down
Loading

0 comments on commit e6fc9bd

Please sign in to comment.