mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Fixed single example, added example links to readme
This commit is contained in:
parent
27e9046cdc
commit
134b73fc14
6 changed files with 20 additions and 12 deletions
|
@ -51,10 +51,16 @@ Render Methods
|
||||||
|
|
||||||
Single: `book.renderTo("area");`
|
Single: `book.renderTo("area");`
|
||||||
|
|
||||||
|
[View example](https://s3.amazonaws.com/epubjs/examples/single.html)
|
||||||
|
|
||||||
Continuous: `book.renderTo("area", { method: "continuous", width: "100%", height: "100%" });`
|
Continuous: `book.renderTo("area", { method: "continuous", width: "100%", height: "100%" });`
|
||||||
|
|
||||||
|
[View example](https://s3.amazonaws.com/epubjs/examples/continuous.html)
|
||||||
|
|
||||||
Paginate: `book.renderTo("area", { method: "paginate", width: "900", height: "600" });`
|
Paginate: `book.renderTo("area", { method: "paginate", width: "900", height: "600" });`
|
||||||
|
|
||||||
|
[View example](https://s3.amazonaws.com/epubjs/examples/pages.html)
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
11
dist/epub.js
vendored
11
dist/epub.js
vendored
|
@ -2589,10 +2589,10 @@ EPUBJS.core.defaults = function(obj) {
|
||||||
EPUBJS.core.extend = function(target) {
|
EPUBJS.core.extend = function(target) {
|
||||||
var sources = [].slice.call(arguments, 1);
|
var sources = [].slice.call(arguments, 1);
|
||||||
sources.forEach(function (source) {
|
sources.forEach(function (source) {
|
||||||
Object.getOwnPropertyNames(source).forEach(function(propName) {
|
if(!source) return;
|
||||||
Object.defineProperty(target, propName,
|
Object.getOwnPropertyNames(source).forEach(function(propName) {
|
||||||
Object.getOwnPropertyDescriptor(source, propName));
|
Object.defineProperty(target, propName, Object.getOwnPropertyDescriptor(source, propName));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return target;
|
return target;
|
||||||
};
|
};
|
||||||
|
@ -4895,6 +4895,7 @@ EPUBJS.Infinite.prototype.scrollTo = function(x, y, silent){
|
||||||
|
|
||||||
RSVP.EventTarget.mixin(EPUBJS.Infinite.prototype);
|
RSVP.EventTarget.mixin(EPUBJS.Infinite.prototype);
|
||||||
EPUBJS.Rendition = function(book, options) {
|
EPUBJS.Rendition = function(book, options) {
|
||||||
|
|
||||||
this.settings = EPUBJS.core.extend(this.settings || {}, {
|
this.settings = EPUBJS.core.extend(this.settings || {}, {
|
||||||
infinite: true,
|
infinite: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
@ -5280,7 +5281,7 @@ EPUBJS.Continuous = function(book, options) {
|
||||||
EPUBJS.Continuous.prototype = Object.create(EPUBJS.Rendition.prototype);
|
EPUBJS.Continuous.prototype = Object.create(EPUBJS.Rendition.prototype);
|
||||||
EPUBJS.Continuous.prototype.constructor = EPUBJS.Continuous;
|
EPUBJS.Continuous.prototype.constructor = EPUBJS.Continuous;
|
||||||
|
|
||||||
EPUBJS.Rendition.prototype.attachListeners = function(){
|
EPUBJS.Continuous.prototype.attachListeners = function(){
|
||||||
|
|
||||||
// Listen to window for resize event
|
// Listen to window for resize event
|
||||||
window.addEventListener("resize", this.onResized.bind(this), false);
|
window.addEventListener("resize", this.onResized.bind(this), false);
|
||||||
|
|
4
dist/epub.min.js
vendored
4
dist/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -25,7 +25,7 @@ EPUBJS.Continuous = function(book, options) {
|
||||||
EPUBJS.Continuous.prototype = Object.create(EPUBJS.Rendition.prototype);
|
EPUBJS.Continuous.prototype = Object.create(EPUBJS.Rendition.prototype);
|
||||||
EPUBJS.Continuous.prototype.constructor = EPUBJS.Continuous;
|
EPUBJS.Continuous.prototype.constructor = EPUBJS.Continuous;
|
||||||
|
|
||||||
EPUBJS.Rendition.prototype.attachListeners = function(){
|
EPUBJS.Continuous.prototype.attachListeners = function(){
|
||||||
|
|
||||||
// Listen to window for resize event
|
// Listen to window for resize event
|
||||||
window.addEventListener("resize", this.onResized.bind(this), false);
|
window.addEventListener("resize", this.onResized.bind(this), false);
|
||||||
|
|
|
@ -357,10 +357,10 @@ EPUBJS.core.defaults = function(obj) {
|
||||||
EPUBJS.core.extend = function(target) {
|
EPUBJS.core.extend = function(target) {
|
||||||
var sources = [].slice.call(arguments, 1);
|
var sources = [].slice.call(arguments, 1);
|
||||||
sources.forEach(function (source) {
|
sources.forEach(function (source) {
|
||||||
Object.getOwnPropertyNames(source).forEach(function(propName) {
|
if(!source) return;
|
||||||
Object.defineProperty(target, propName,
|
Object.getOwnPropertyNames(source).forEach(function(propName) {
|
||||||
Object.getOwnPropertyDescriptor(source, propName));
|
Object.defineProperty(target, propName, Object.getOwnPropertyDescriptor(source, propName));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return target;
|
return target;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
EPUBJS.Rendition = function(book, options) {
|
EPUBJS.Rendition = function(book, options) {
|
||||||
|
|
||||||
this.settings = EPUBJS.core.extend(this.settings || {}, {
|
this.settings = EPUBJS.core.extend(this.settings || {}, {
|
||||||
infinite: true,
|
infinite: true,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue