1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Fixed lint errors

This commit is contained in:
fchasen 2015-06-22 23:12:49 -04:00
parent 82fb23daab
commit 2a387cc433
12 changed files with 3978 additions and 3974 deletions

7868
dist/epub.js vendored

File diff suppressed because it is too large Load diff

6
dist/epub.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -331,14 +331,16 @@ EPUBJS.Continuous.prototype.trim = function(){
var lastIndex = this.views.indexOf(last);
var above = this.views.slice(0, firstIndex);
var below = this.views.slice(lastIndex+1);
// Erase all but last above
for (var i = 0; i < above.length-1; i++) {
this.erase(above[i], above);
};
for (var i = 1; i < below.length; i++) {
this.erase(below[i]);
};
}
// Erase all except first below
for (var j = 1; j < below.length; j++) {
this.erase(below[j]);
}
task.resolve();
return task.promise;
@ -559,7 +561,7 @@ EPUBJS.Continuous.prototype.currentLocation = function(){
var visible = this.visible();
var startPage, endPage;
var container = this.container.getBoundingClientRect()
var container = this.container.getBoundingClientRect();
if(visible.length === 1) {
return this.map.page(visible[0]);
@ -573,7 +575,7 @@ EPUBJS.Continuous.prototype.currentLocation = function(){
return {
start: startPage.start,
end: endPage.end
}
};
}
};

View file

@ -448,16 +448,16 @@ EPUBJS.core.bounds = function(el) {
widthProps.forEach(function(prop){
width += parseFloat(style[prop]) || 0;
})
});
heightProps.forEach(function(prop){
height += parseFloat(style[prop]) || 0;
})
});
return {
height: height,
width: width
}
};
};
@ -472,16 +472,16 @@ EPUBJS.core.borders = function(el) {
widthProps.forEach(function(prop){
width += parseFloat(style[prop]) || 0;
})
});
heightProps.forEach(function(prop){
height += parseFloat(style[prop]) || 0;
})
});
return {
height: height,
width: width
}
};
};
@ -497,7 +497,7 @@ EPUBJS.core.windowBounds = function() {
bottom: height,
width: width,
height: height
}
};
};

View file

@ -509,4 +509,4 @@ EPUBJS.EpubCFI.prototype.isCfiString = function(target) {
}
return false;
}
};

View file

@ -19,7 +19,7 @@ EPUBJS.Hook.prototype.register = function(func){
EPUBJS.Hook.prototype.trigger = function(){
var args = arguments;
var context = this.context;
var promises = []
var promises = [];
this.hooks.forEach(function(task, i) {
var executing = task.apply(context, args);

View file

@ -52,7 +52,7 @@ EPUBJS.Map.prototype.findRanges = function(view){
start: this.findStart(view.document.body, start, end),
end: this.findEnd(view.document.body, start, end)
});
};
}
return columns;
};
@ -68,7 +68,7 @@ EPUBJS.Map.prototype.findStart = function(root, start, end){
found = this.walk($el, function(node){
var left, right;
var elPos
var elPos;
var elRange;
@ -117,7 +117,7 @@ EPUBJS.Map.prototype.findEnd = function(root, start, end){
found = this.walk($el, function(node){
var left, right;
var elPos
var elPos;
var elRange;
@ -133,7 +133,7 @@ EPUBJS.Map.prototype.findEnd = function(root, start, end){
right = elPos.right;
if(left > end && $prev) {
return $prev
return $prev;
} else if(right > end) {
return node;
} else {
@ -172,7 +172,7 @@ EPUBJS.Map.prototype.findTextStartRange = function(node, start, end){
prev = range;
};
}
return ranges[0];
};
@ -196,7 +196,7 @@ EPUBJS.Map.prototype.findTextEndRange = function(node, start, end){
prev = range;
};
}
// Ends before limit
return ranges[ranges.length-1];
@ -266,7 +266,7 @@ EPUBJS.Map.prototype.rangePairToCfiPair = function(section, rangePair){
return {
start: startCfi,
end: endCfi
}
};
};
@ -279,7 +279,7 @@ EPUBJS.Map.prototype.rangeListToCfiList = function(view, columns){
map.push(cifPair);
};
}
return map;
};

View file

@ -192,7 +192,7 @@ EPUBJS.Paginate.prototype.currentLocation = function(){
var visible = this.visible();
var startA, startB, endA, endB;
var pageLeft, pageRight;
var container = this.container.getBoundingClientRect()
var container = this.container.getBoundingClientRect();
if(visible.length === 1) {
startA = container.left - visible[0].position().left;
@ -217,7 +217,7 @@ EPUBJS.Paginate.prototype.currentLocation = function(){
return {
start: pageLeft.start,
end: pageRight.end
}
};
}
};

View file

@ -10,7 +10,7 @@ EPUBJS.Queue.prototype.enqueue = function() {
var deferred, promise;
var queued;
var task = [].shift.call(arguments);
var args = arguments
var args = arguments;
// Handle single args without context
// if(args && !Array.isArray(args)) {

View file

@ -237,14 +237,14 @@ EPUBJS.Rendition.prototype.render = function(view, show) {
return this.hooks.layout.trigger(view, this);
}.bind(this))
.then(function(){
return view.display()
return view.display();
}.bind(this))
.then(function(){
return this.hooks.render.trigger(view, this);
}.bind(this))
.then(function(){
if(show != false && this.hidden === false) {
if(show !== false && this.hidden === false) {
this.q.enqueue(function(view){
view.show();
}, view);
@ -516,7 +516,7 @@ EPUBJS.Rendition.prototype.visible = function(){
visible.push(view);
}
};
}
return visible;
@ -542,7 +542,7 @@ EPUBJS.Rendition.prototype.displayed = function(){
if(view.displayed){
displayed.push(view);
}
};
}
return displayed;
};
@ -553,7 +553,7 @@ EPUBJS.Rendition.prototype.show = function(){
if(view.displayed){
view.show();
}
};
}
this.hidden = false;
};
@ -564,7 +564,7 @@ EPUBJS.Rendition.prototype.hide = function(){
if(view.displayed){
view.hide();
}
};
}
this.hidden = true;
};

View file

@ -27,7 +27,7 @@ EPUBJS.Spine.prototype.load = function(_package) {
if(manifestItem.properties.length){
item.properties.push.apply(item.properties, manifestItem.properties)
item.properties.push.apply(item.properties, manifestItem.properties);
}
}

View file

@ -154,7 +154,7 @@ EPUBJS.View.prototype.expand = function(force) {
// Otherwise assume content height hasn't changed
width = this._contentWidth;
}
};
}
// Expand Vertically
if(width && !height) {
@ -190,7 +190,7 @@ EPUBJS.View.prototype.contentWidth = function(min) {
// Reset iframe size back
this.iframe.style.width = prev;
return width;
}
};
EPUBJS.View.prototype.contentHeight = function(min) {
var prev;
@ -201,7 +201,7 @@ EPUBJS.View.prototype.contentHeight = function(min) {
height = this.document.body.scrollHeight;
this.iframe.style.height = prev;
return height;
}
};
EPUBJS.View.prototype.textWidth = function() {
var width;