mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Switched to Gulp, Basic Scrolling Renderer
This commit is contained in:
parent
b1b98f9d57
commit
d73133e2c7
12 changed files with 4826 additions and 186 deletions
|
@ -1,10 +1,12 @@
|
|||
EPUBJS.Layout = function(){};
|
||||
|
||||
/**
|
||||
* Reconciles the current chapters layout properies with
|
||||
* the global layout properities.
|
||||
* Takes: global layout settings object, chapter properties string
|
||||
* Returns: Object with layout properties
|
||||
*/
|
||||
EPUBJS.Renderer.prototype.reconcileLayoutSettings = function(global, chapter){
|
||||
EPUBJS.Layout.prototype.reconcileLayoutSettings = function(global, chapter){
|
||||
var settings = {};
|
||||
|
||||
//-- Get the global defaults
|
||||
|
@ -35,7 +37,7 @@ EPUBJS.Renderer.prototype.reconcileLayoutSettings = function(global, chapter){
|
|||
* Takes: Layout settings object
|
||||
* Returns: String of appropriate for EPUBJS.Layout function
|
||||
*/
|
||||
EPUBJS.Renderer.prototype.determineLayout = function(settings){
|
||||
EPUBJS.Layout.prototype.determineLayout = function(settings){
|
||||
// Default is layout: reflowable & spread: auto
|
||||
var spreads = this.determineSpreads(this.minSpreadWidth);
|
||||
var layoutMethod = spreads ? "ReflowableSpreads" : "Reflowable";
|
||||
|
@ -67,7 +69,7 @@ EPUBJS.Renderer.prototype.determineLayout = function(settings){
|
|||
|
||||
//-- STYLES
|
||||
|
||||
EPUBJS.Renderer.prototype.applyStyles = function(styles) {
|
||||
EPUBJS.Layout.prototype.applyStyles = function(styles) {
|
||||
for (var style in styles) {
|
||||
for (var view in this.views) {
|
||||
view.setStyle(style, styles[style]);
|
||||
|
@ -75,20 +77,20 @@ EPUBJS.Renderer.prototype.applyStyles = function(styles) {
|
|||
}
|
||||
};
|
||||
|
||||
EPUBJS.Renderer.prototype.setStyle = function(style, val, prefixed){
|
||||
EPUBJS.Layout.prototype.setStyle = function(style, val, prefixed){
|
||||
for (var view in this.views) {
|
||||
view.setStyle(style, val, prefixed);
|
||||
}
|
||||
};
|
||||
|
||||
EPUBJS.Renderer.prototype.removeStyle = function(style){
|
||||
EPUBJS.Layout.prototype.removeStyle = function(style){
|
||||
for (var view in this.views) {
|
||||
view.removeStyle(style);
|
||||
}
|
||||
};
|
||||
|
||||
//-- HEAD TAGS
|
||||
EPUBJS.Renderer.prototype.applyHeadTags = function(headTags) {
|
||||
EPUBJS.Layout.prototype.applyHeadTags = function(headTags) {
|
||||
for ( var headTag in headTags ) {
|
||||
this.render.addHeadTag(headTag, headTags[headTag]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue