1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

Fixed typo and built

This commit is contained in:
Fred Chasen 2013-06-30 23:32:39 -07:00
parent 3fef8b0091
commit 0cfaa9cf2e
6 changed files with 28 additions and 15 deletions

View file

@ -1,4 +1,4 @@
/*! FuturePress - v0.1.0 - 2013-06-25 */ /*! FuturePress - v0.1.0 - 2013-06-30 */
var EPUBJS = EPUBJS || {}; var EPUBJS = EPUBJS || {};
EPUBJS.VERSION = "0.1.5"; EPUBJS.VERSION = "0.1.5";
@ -592,17 +592,18 @@ EPUBJS.Book.prototype.fromStorage = function(stored) {
*/ */
EPUBJS.Book.prototype.setStyle = function(style, val, prefixed) { EPUBJS.Book.prototype.setStyle = function(style, val, prefixed) {
this.renderer.style(style, val, prefixed); this.renderer.setStyle(style, val, prefixed);
this.settings.styles[style] = val; this.settings.styles[style] = val;
} }
EPUBJS.Book.prototype.applyStyles = function() { EPUBJS.Book.prototype.removeStyle = function(style, val, prefixed) {
for (style in this.settings.styles) { this.renderer.removeStyle(style);
this.setStyle(style, this.settings.styles[style]);
} delete this.settings.styles[style] = '';
} }
//-- Get pre-registered hooks //-- Get pre-registered hooks
EPUBJS.Book.prototype.getHooks = function(){ EPUBJS.Book.prototype.getHooks = function(){
var book = this, var book = this,
@ -1605,8 +1606,6 @@ EPUBJS.Renderer.prototype.crossBrowserColumnCss = function(){
} }
EPUBJS.Renderer.prototype.setIframeSrc = function(url){ EPUBJS.Renderer.prototype.setIframeSrc = function(url){
var renderer = this, var renderer = this,
promise = new RSVP.Promise(); promise = new RSVP.Promise();
@ -1621,6 +1620,8 @@ EPUBJS.Renderer.prototype.setIframeSrc = function(url){
renderer.docEl = renderer.doc.documentElement; renderer.docEl = renderer.doc.documentElement;
renderer.bodyEl = renderer.doc.body; renderer.bodyEl = renderer.doc.body;
renderer.applyStyles();
renderer.formatSpread(); renderer.formatSpread();
//-- Trigger registered hooks before displaying //-- Trigger registered hooks before displaying
@ -1725,12 +1726,25 @@ EPUBJS.Renderer.prototype.fixedLayout = function(){
this.displayedPages = 1; this.displayedPages = 1;
} }
EPUBJS.Renderer.prototype.style = function(style, val, prefixed){ EPUBJS.Renderer.prototype.setStyle = function(style, val, prefixed){
if(prefixed) { if(prefixed) {
style = EPUBJS.core.prefixed(style); style = EPUBJS.core.prefixed(style);
} }
this.bodyEl.style[style] = val; if(this.bodyEl) this.bodyEl.style[style] = val;
}
EPUBJS.Renderer.prototype.removeStyle = function(style){
if(this.bodyEl) this.bodyEl.style[style] = '';
}
EPUBJS.Renderer.prototype.applyStyles = function() {
var styles = this.book.settings.styles;
for (style in styles) {
this.setStyle(style, styles[style]);
}
} }
EPUBJS.Renderer.prototype.gotoChapterEnd = function(){ EPUBJS.Renderer.prototype.gotoChapterEnd = function(){

View file

@ -1,4 +1,4 @@
/*! FuturePress - v0.1.0 - 2013-06-25 */ /*! FuturePress - v0.1.0 - 2013-06-30 */
EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chapter){ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chapter){

View file

@ -1,4 +1,4 @@
/*! FuturePress - v0.1.0 - 2013-06-25 */ /*! FuturePress - v0.1.0 - 2013-06-30 */
var EPUBJSR = EPUBJSR || {}; var EPUBJSR = EPUBJSR || {};

2
demo/js/epub.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -595,7 +595,6 @@ EPUBJS.Book.prototype.removeStyle = function(style, val, prefixed) {
delete this.settings.styles[style] = ''; delete this.settings.styles[style] = '';
} }
removeStyle
//-- Get pre-registered hooks //-- Get pre-registered hooks
EPUBJS.Book.prototype.getHooks = function(){ EPUBJS.Book.prototype.getHooks = function(){

View file

@ -301,7 +301,7 @@ EPUBJS.Renderer.prototype.removeStyle = function(style){
} }
EPUBJS.Renderer.prototype.applyStyles = function() { EPUBJS.Renderer.prototype.applyStyles = function() {
var style = this.book.settings.styles; var styles = this.book.settings.styles;
for (style in styles) { for (style in styles) {
this.setStyle(style, styles[style]); this.setStyle(style, styles[style]);
} }