Adds web/* and test/* for jshint target

This commit is contained in:
Yury Delendik 2013-02-04 12:01:19 -06:00
parent bf8b10c961
commit 81f8f92696
18 changed files with 53 additions and 25 deletions

View File

@ -1004,9 +1004,9 @@ target.jshint = function() {
'external/builder/', 'external/builder/',
'external/crlfchecker/', 'external/crlfchecker/',
'src/', 'src/',
//'web/*.js', 'web/*.js',
//'test/*.js', 'test/*.js',
//'test/unit/*.js', 'test/unit/*.js',
'extensions/firefox/*.js', 'extensions/firefox/*.js',
'extensions/firefox/components/*.js', 'extensions/firefox/components/*.js',
'extensions/chrome/*.js' 'extensions/chrome/*.js'

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals PDFJS, getPdf, combineUrl, StatTimer, SpecialPowers */
'use strict'; 'use strict';

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint node:true */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor, runs */
'use strict'; 'use strict';

View File

@ -1,5 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, calculateMD5, ARCFourCipher, Name,
CipherTransformFactory */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, PartialEvaluator, StringStream */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, CFFCompiler, CFFParser, CFFIndex, CFFStrings */
'use strict'; 'use strict';
@ -32,7 +33,7 @@ describe('font', function() {
fontData.push(parseInt(hex, 16)); fontData.push(parseInt(hex, 16));
} }
var bytes = new Uint8Array(fontData); var bytes = new Uint8Array(fontData);
fontData = {getBytes: function() { return bytes}}; fontData = {getBytes: function() { return bytes; }};
function bytesToString(bytesArray) { function bytesToString(bytesArray) {
var str = ''; var str = '';

View File

@ -1,5 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, beforeEach, isArray, StringStream,
PostScriptParser, PostScriptLexer, PostScriptEvaluator */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, Metadata */
'use strict'; 'use strict';

View File

@ -1,5 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, beforeEach, Name, Dict, Ref, RefSet, Cmd,
jasmine */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, StringStream, Lexer */
'use strict'; 'use strict';

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, beforeEach, Stream, PredictorStream, Dict */
'use strict'; 'use strict';

View File

@ -2,6 +2,8 @@
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
var TestReporter = function(browser, appPath) { var TestReporter = function(browser, appPath) {
'use strict';
function send(action, json) { function send(action, json) {
var r = new XMLHttpRequest(); var r = new XMLHttpRequest();
// (The POST URI is ignored atm.) // (The POST URI is ignored atm.)

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, combineUrl, Dict, isDict, Name */
'use strict'; 'use strict';

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals VBArray */
'use strict'; 'use strict';
@ -85,9 +86,9 @@
return; return;
Object.create = function objectCreate(proto) { Object.create = function objectCreate(proto) {
var constructor = function objectCreateConstructor() {}; function Constructor() {}
constructor.prototype = proto; Constructor.prototype = proto;
return new constructor(); return new Constructor();
}; };
})(); })();
@ -334,7 +335,7 @@
function changeList(element, itemName, add, remove) { function changeList(element, itemName, add, remove) {
var s = element.className || ''; var s = element.className || '';
var list = s.split(/\s+/g); var list = s.split(/\s+/g);
if (list[0] == '') list.shift(); if (list[0] === '') list.shift();
var index = list.indexOf(itemName); var index = list.indexOf(itemName);
if (index < 0 && add) if (index < 0 && add)
list.push(itemName); list.push(itemName);
@ -380,18 +381,18 @@
// Check console compatability // Check console compatability
(function checkConsoleCompatibility() { (function checkConsoleCompatibility() {
if (typeof console == 'undefined') { if (!('console' in window)) {
console = { window.console = {
log: function() {}, log: function() {},
error: function() {} error: function() {}
}; };
} else if (!('bind' in console.log)) { } else if (!('bind' in console.log)) {
// native functions in IE9 might not have bind // native functions in IE9 might not have bind
console.log = (function(fn) { console.log = (function(fn) {
return function(msg) { return fn(msg); } return function(msg) { return fn(msg); };
})(console.log); })(console.log);
console.error = (function(fn) { console.error = (function(fn) {
return function(msg) { return fn(msg); } return function(msg) { return fn(msg); };
})(console.error); })(console.error);
} }
})(); })();

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals PDFJS */
'use strict'; 'use strict';
@ -271,7 +272,7 @@ var Stepper = (function StepperClosure() {
else else
self.breakPoints.splice(self.breakPoints.indexOf(x), 1); self.breakPoints.splice(self.breakPoints.indexOf(x), 1);
StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints);
} };
})(i); })(i);
breakCell.appendChild(cbox); breakCell.appendChild(cbox);
@ -376,7 +377,7 @@ var Stats = (function Stats() {
wrapper.appendChild(title); wrapper.appendChild(title);
wrapper.appendChild(statsDiv); wrapper.appendChild(statsDiv);
stats.push({ pageNumber: pageNumber, div: wrapper }); stats.push({ pageNumber: pageNumber, div: wrapper });
stats.sort(function(a, b) { return a.pageNumber - b.pageNumber}); stats.sort(function(a, b) { return a.pageNumber - b.pageNumber; });
clear(this.panel); clear(this.panel);
for (var i = 0, ii = stats.length; i < ii; ++i) for (var i = 0, ii = stats.length; i < ii; ++i)
this.panel.appendChild(stats[i].div); this.panel.appendChild(stats[i].div);

View File

@ -14,6 +14,8 @@
*/ */
var FirefoxCom = (function FirefoxComClosure() { var FirefoxCom = (function FirefoxComClosure() {
'use strict';
return { return {
/** /**
* Creates an event that the extension is listening for and will * Creates an event that the extension is listening for and will

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals PDFJS, PDFBug, FirefoxCom, Stats */
'use strict'; 'use strict';
@ -64,7 +65,8 @@ function scrollIntoView(element, spot) {
// producing the error. See also animationStartedClosure. // producing the error. See also animationStartedClosure.
var parent = element.offsetParent, offsetY = element.offsetTop; var parent = element.offsetParent, offsetY = element.offsetTop;
if (!parent) { if (!parent) {
error('offsetParent is not set -- cannot scroll'); console.error('offsetParent is not set -- cannot scroll');
return;
} }
while (parent.clientHeight == parent.scrollHeight) { while (parent.clientHeight == parent.scrollHeight) {
offsetY += parent.offsetTop; offsetY += parent.offsetTop;
@ -2042,8 +2044,9 @@ var PageView = function pageView(container, pdfPage, id, scale,
}; };
this.draw = function pageviewDraw(callback) { this.draw = function pageviewDraw(callback) {
if (this.renderingState !== RenderingStates.INITIAL) if (this.renderingState !== RenderingStates.INITIAL) {
error('Must be in new state before drawing'); console.error('Must be in new state before drawing');
}
this.renderingState = RenderingStates.RUNNING; this.renderingState = RenderingStates.RUNNING;
@ -2217,7 +2220,7 @@ var PageView = function pageView(container, pdfPage, id, scale,
console.error(error); console.error(error);
// Tell the printEngine that rendering this canvas/page has failed. // Tell the printEngine that rendering this canvas/page has failed.
// This will make the print proces stop. // This will make the print proces stop.
if ('abort' in object) if ('abort' in obj)
obj.abort(); obj.abort();
else else
obj.done(); obj.done();
@ -2299,7 +2302,7 @@ var ThumbnailView = function thumbnailView(container, pdfPage, id) {
this.hasImage = false; this.hasImage = false;
this.renderingState = RenderingStates.INITIAL; this.renderingState = RenderingStates.INITIAL;
this.resume = null; this.resume = null;
} };
function getPageDrawContext() { function getPageDrawContext() {
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
@ -2329,8 +2332,9 @@ var ThumbnailView = function thumbnailView(container, pdfPage, id) {
}; };
this.draw = function thumbnailViewDraw(callback) { this.draw = function thumbnailViewDraw(callback) {
if (this.renderingState !== RenderingStates.INITIAL) if (this.renderingState !== RenderingStates.INITIAL) {
error('Must be in new state before drawing'); console.error('Must be in new state before drawing');
}
this.renderingState = RenderingStates.RUNNING; this.renderingState = RenderingStates.RUNNING;
if (this.hasImage) { if (this.hasImage) {
@ -3076,7 +3080,7 @@ window.addEventListener('hashchange', function webViewerHashchange(evt) {
window.addEventListener('change', function webViewerChange(evt) { window.addEventListener('change', function webViewerChange(evt) {
var files = evt.target.files; var files = evt.target.files;
if (!files || files.length == 0) if (!files || files.length === 0)
return; return;
// Read the local file into a Uint8Array. // Read the local file into a Uint8Array.
@ -3271,7 +3275,7 @@ window.addEventListener('keydown', function keydown(evt) {
curElement = curElement.parentNode; curElement = curElement.parentNode;
} }
if (cmd == 0) { // no control key pressed at all. if (cmd === 0) { // no control key pressed at all.
switch (evt.keyCode) { switch (evt.keyCode) {
case 38: // up arrow case 38: // up arrow
case 33: // pg up case 33: // pg up
@ -3279,12 +3283,14 @@ window.addEventListener('keydown', function keydown(evt) {
if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') { if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') {
break; break;
} }
// in fullscreen mode falls throw here /* in fullscreen mode */
/* falls through */
case 37: // left arrow case 37: // left arrow
// horizontal scrolling using arrow keys // horizontal scrolling using arrow keys
if (PDFView.isHorizontalScrollbarEnabled) { if (PDFView.isHorizontalScrollbarEnabled) {
break; break;
} }
/* falls through */
case 75: // 'k' case 75: // 'k'
case 80: // 'p' case 80: // 'p'
PDFView.page--; PDFView.page--;
@ -3296,12 +3302,13 @@ window.addEventListener('keydown', function keydown(evt) {
if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') { if (!PDFView.isFullscreen && PDFView.currentScaleValue !== 'page-fit') {
break; break;
} }
// in fullscreen mode falls throw here /* falls through */
case 39: // right arrow case 39: // right arrow
// horizontal scrolling using arrow keys // horizontal scrolling using arrow keys
if (PDFView.isHorizontalScrollbarEnabled) { if (PDFView.isHorizontalScrollbarEnabled) {
break; break;
} }
/* falls through */
case 74: // 'j' case 74: // 'j'
case 78: // 'n' case 78: // 'n'
PDFView.page++; PDFView.page++;