]> git.parisson.com Git - pdf.js.git/commitdiff
Fix lint warnings.
authorKalervo Kujala <kkujala@>
Tue, 27 Sep 2011 18:43:48 +0000 (21:43 +0300)
committerKalervo Kujala <kkujala@>
Tue, 27 Sep 2011 18:43:48 +0000 (21:43 +0300)
And name anonymous functions.

examples/helloworld/hello.js
pdf.js
test/driver.js
web/viewer.js

index 3b0f6dca7c2edb385bed545ce8b0f42416966f0d..9c653ca24744f9457f50e5815aa0575853a882b5 100644 (file)
@@ -7,7 +7,7 @@
 
 'use strict';
 
-getPdf('helloworld.pdf', function(data){  
+getPdf('helloworld.pdf', function getPdfHelloWorld(data) {
   //
   // Instantiate PDFDoc with PDF data
   //
diff --git a/pdf.js b/pdf.js
index 197c6e6d8cb1f741a796d900c302a4412d7fcd3e..cb4296c7917760848f35cb0ae3bd9af47c80360d 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -129,16 +129,16 @@ function getPdf(arg, callback) {
   xhr.mozResponseType = xhr.responseType = 'arraybuffer';
   xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200;
   xhr.onprogress = params.progress || undefined;
-  
-  xhr.onreadystatechange = function() {
+
+  xhr.onreadystatechange = function getPdfOnreadystatechange() {
     var data;
     if (xhr.readyState === 4 && xhr.status === xhr.expected) {
       data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
-                  xhr.responseArrayBuffer || xhr.response);
+              xhr.responseArrayBuffer || xhr.response);
       callback(data);
     }
   };
-  xhr.send(null);  
+  xhr.send(null);
 }
 
 var Stream = (function streamStream() {
@@ -4965,7 +4965,7 @@ var CanvasGraphics = (function canvasGraphics() {
       if (IsDict(extGState) && extGState.has(dictName.name)) {
         var gsState = this.xref.fetchIfRef(extGState.get(dictName.name));
         var self = this;
-        gsState.forEach(function(key, value) {
+        gsState.forEach(function canvasGraphicsSetGStateForEach(key, value) {
           switch (key) {
             case 'Type':
               break;
index e948835dd2cf334c3567c3051ecc94127a5d5059..7162af6f3a23621c2f2595ef9ea0540c56ca72dd 100644 (file)
@@ -73,7 +73,7 @@ function nextTask() {
 
   log('Loading file "' + task.file + '"\n');
 
-  getPdf(task.file, function(data){
+  getPdf(task.file, function nextTaskGetPdf(data) {
     var failure;
     try {
       task.pdfDoc = new PDFDoc(data);
index 2cc3aaa4f24b92304fc2fc4cfcf5cd1d94ac1be6..7515979f2aa2a8bdf3eb580e42fcdc36491590d2 100644 (file)
@@ -107,7 +107,7 @@ var PDFView = {
 
     document.title = url;
 
-    getPdf({url:url, progress:PDFView.progressLevel}, function(data) {
+    getPdf({url: url, progress: PDFView.progressLevel}, function(data) {
       document.getElementById('loading').style.display = 'none';
       PDFView.load(data, scale);
     });