1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fix small lint warnings.

This commit is contained in:
Kalervo Kujala 2011-09-15 23:32:44 +03:00
parent 3006c090ad
commit 07254bb0a5
11 changed files with 77 additions and 63 deletions

View file

@ -8,6 +8,7 @@
'use strict';
var appPath, browser, canvas, currentTaskIdx, manifest, stdout;
var inFlightRequests = 0;
function queryParams() {
var qs = window.location.search.substring(1);
@ -42,7 +43,8 @@ function load() {
if (r.readyState == 4) {
log('done\n');
manifest = JSON.parse(r.responseText);
currentTaskIdx = 0, nextTask();
currentTaskIdx = 0;
nextTask();
}
};
r.send(null);
@ -73,7 +75,8 @@ function nextTask() {
failure = 'load PDF doc : ' + e.toString();
}
task.pageNum = 1, nextPage(task, failure);
task.pageNum = 1;
nextPage(task, failure);
}
};
r.send(null);
@ -89,7 +92,8 @@ function nextPage(task, loadError) {
if (!task.pdfDoc) {
sendTaskResult(canvas.toDataURL('image/png'), task, failure);
log('done' + (failure ? ' (failed !: ' + failure + ')' : '') + '\n');
++currentTaskIdx, nextTask();
++currentTaskIdx;
nextTask();
return;
}
@ -98,7 +102,8 @@ function nextPage(task, loadError) {
log(' Round ' + (1 + task.round) + '\n');
task.pageNum = 1;
} else {
++currentTaskIdx, nextTask();
++currentTaskIdx;
nextTask();
return;
}
}
@ -123,7 +128,7 @@ function nextPage(task, loadError) {
page.startRendering(
ctx,
function(e) {
snapshotCurrentPage(page, task, (!failure && e) ?
snapshotCurrentPage(task, (!failure && e) ?
('render : ' + e) : failure);
}
);
@ -135,11 +140,11 @@ function nextPage(task, loadError) {
if (failure) {
// Skip right to snapshotting if there was a failure, since the
// fonts might be in an inconsistent state.
snapshotCurrentPage(page, task, failure);
snapshotCurrentPage(task, failure);
}
}
function snapshotCurrentPage(page, task, failure) {
function snapshotCurrentPage(task, failure) {
log('done, snapshotting... ');
sendTaskResult(canvas.toDataURL('image/png'), task, failure);
@ -149,7 +154,8 @@ function snapshotCurrentPage(page, task, failure) {
var backoff = (inFlightRequests > 0) ? inFlightRequests * 10 : 0;
setTimeout(
function() {
++task.pageNum, nextPage(task);
++task.pageNum;
nextPage(task);
},
backoff
);
@ -182,7 +188,6 @@ function done() {
}
}
var inFlightRequests = 0;
function sendTaskResult(snapshot, task, failure) {
var result = { browser: browser,
id: task.id,
@ -201,7 +206,7 @@ function sendTaskResult(snapshot, task, failure) {
if (r.readyState == 4) {
inFlightRequests--;
}
}
};
document.getElementById('inFlightCount').innerHTML = inFlightRequests++;
r.send(JSON.stringify(result));
}