mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Correct the coding style according to gjslint.
And remove stray tabs.
This commit is contained in:
parent
1a0141b225
commit
f656e841ac
3 changed files with 190 additions and 190 deletions
|
@ -41,15 +41,15 @@ var PDFView = {
|
|||
|
||||
set page(val) {
|
||||
var pages = this.pages;
|
||||
var input = document.getElementById("pageNumber");
|
||||
var input = document.getElementById('pageNumber');
|
||||
if (val <= 0 || val > pages.length) {
|
||||
input.value = this.page;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
document.location.hash = val;
|
||||
document.getElementById("previous").disabled = (val == 1);
|
||||
document.getElementById("next").disabled = (val == pages.length);
|
||||
document.getElementById('previous').disabled = (val == 1);
|
||||
document.getElementById('next').disabled = (val == pages.length);
|
||||
if (input.value == val)
|
||||
return;
|
||||
|
||||
|
@ -62,7 +62,7 @@ var PDFView = {
|
|||
},
|
||||
|
||||
open: function(url, scale) {
|
||||
if (url.indexOf("http") == 0)
|
||||
if (url.indexOf('http') == 0)
|
||||
return;
|
||||
|
||||
document.title = url;
|
||||
|
@ -106,7 +106,7 @@ var PDFView = {
|
|||
var page = pdf.getPage(i);
|
||||
pages.push(new PageView(container, page, i, page.width, page.height, page.stats));
|
||||
thumbnails.push(new ThumbnailView(sidebar, pages[i - 1]));
|
||||
};
|
||||
}
|
||||
|
||||
this.scale = (scale || kDefaultScale);
|
||||
this.page = parseInt(document.location.hash.substring(1)) || 1;
|
||||
|
@ -136,7 +136,7 @@ var PDFView = {
|
|||
}
|
||||
|
||||
return visiblePages;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
var PageView = function(container, content, id, width, height, stats) {
|
||||
|
@ -157,7 +157,7 @@ var PageView = function(container, content, id, width, height, stats) {
|
|||
|
||||
this.update = function(scale) {
|
||||
this.scale = scale || this.scale;
|
||||
div.style.width = (this.width * this.scale)+ 'px';
|
||||
div.style.width = (this.width * this.scale) + 'px';
|
||||
div.style.height = (this.height * this.scale) + 'px';
|
||||
|
||||
while (div.hasChildNodes())
|
||||
|
@ -192,7 +192,7 @@ var PageView = function(container, content, id, width, height, stats) {
|
|||
|
||||
this.updateStats = function() {
|
||||
var t1 = stats.compile, t2 = stats.fonts, t3 = stats.render;
|
||||
var str = 'Time to compile/fonts/render: ' +
|
||||
var str = 'Time to compile/fonts/render: ' +
|
||||
(t1 - stats.begin) + '/' + (t2 - t1) + '/' + (t3 - t2) + ' ms';
|
||||
document.getElementById('info').innerHTML = str;
|
||||
};
|
||||
|
@ -270,11 +270,11 @@ window.addEventListener('scroll', function(evt) {
|
|||
PDFView.page = firstPage.id;
|
||||
}, true);
|
||||
|
||||
window.addEventListener("hashchange", function(evt) {
|
||||
window.addEventListener('hashchange', function(evt) {
|
||||
PDFView.page = PDFView.page;
|
||||
});
|
||||
|
||||
window.addEventListener("change", function(evt) {
|
||||
window.addEventListener('change', function(evt) {
|
||||
var files = evt.target.files;
|
||||
if (!files || files.length == 0)
|
||||
return;
|
||||
|
@ -300,7 +300,7 @@ window.addEventListener("change", function(evt) {
|
|||
document.location.hash = 1;
|
||||
}, true);
|
||||
|
||||
window.addEventListener("transitionend", function(evt) {
|
||||
window.addEventListener('transitionend', function(evt) {
|
||||
var pageIndex = 0;
|
||||
var pagesCount = PDFView.pages.length;
|
||||
|
||||
|
@ -308,7 +308,7 @@ window.addEventListener("transitionend", function(evt) {
|
|||
container._interval = window.setInterval(function() {
|
||||
if (pageIndex >= pagesCount)
|
||||
return window.clearInterval(container._interval);
|
||||
|
||||
|
||||
PDFView.thumbnails[pageIndex++].draw();
|
||||
}, 500);
|
||||
}, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue