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/crlfchecker/',
'src/',
//'web/*.js',
//'test/*.js',
//'test/unit/*.js',
'web/*.js',
'test/*.js',
'test/unit/*.js',
'extensions/firefox/*.js',
'extensions/firefox/components/*.js',
'extensions/chrome/*.js'

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,8 @@
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
var TestReporter = function(browser, appPath) {
'use strict';
function send(action, json) {
var r = new XMLHttpRequest();
// (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 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals expect, it, describe, combineUrl, Dict, isDict, Name */
'use strict';

View File

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

View File

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

View File

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