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

@ -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++;