diff --git a/.jshintrc b/.jshintrc index f4f57b8f56..fe01d3d406 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,13 +1,3 @@ { - "expr": true, - "browser": true, - "multistr": true, - "globals": { - "jQuery": true, - "ionic": true, - "angular": true, - "console": true, - "module": true, - "document": true - } + "expr": true } diff --git a/gulpfile.js b/gulpfile.js index b253e1067a..420ec4fe6e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -48,6 +48,7 @@ if (IS_RELEASE_BUILD) { gulp.task('default', ['build']); gulp.task('build', ['bundle', 'sass']); +gulp.task('validate', ['jshint', 'ddescribe-iit', 'karma']); gulp.task('docs', function(done) { var docVersion = argv['doc-version']; @@ -113,18 +114,21 @@ gulp.task('bundle', [ }); gulp.task('jshint', function() { - return gulp.src(['js/**/*.js', 'test/**/*.js']) + return gulp.src(['js/**/*.js']) .pipe(jshint('.jshintrc')) - .pipe(jshint.reporter('jshint-stylish')); + .pipe(jshint.reporter(require('jshint-summary')({ + fileColCol: ',bold', + positionCol: ',bold', + codeCol: 'green,bold', + reasonCol: 'cyan' + }))) + .pipe(jshint.reporter('fail')); }); gulp.task('ddescribe-iit', function() { return gulp.src(['test/**/*.js', 'js/**/*.js']) .pipe(notContains([ - 'ddescribe', - 'iit', - 'xit', - 'xdescribe' + 'ddescribe', 'iit', 'xit', 'xdescribe' ])); }); diff --git a/js/angular/directive/menuToggle.js b/js/angular/directive/menuToggle.js index 6ed0a0e38d..3328e50be8 100644 --- a/js/angular/directive/menuToggle.js +++ b/js/angular/directive/menuToggle.js @@ -36,5 +36,5 @@ IonicModule }); } }; -}]) +}]); diff --git a/js/angular/directive/slideBox.js b/js/angular/directive/slideBox.js index 9e421b43e3..d289d60d4d 100644 --- a/js/angular/directive/slideBox.js +++ b/js/angular/directive/slideBox.js @@ -119,10 +119,10 @@ function($timeout, $compile, $ionicSlideBoxDelegate) { slider.load(); }); }], - template: '
', + template: '', link: function($scope, $element, $attr, slideBoxCtrl) { // If the pager should show, append it to the slide box diff --git a/js/animation/gl-matrix.js b/js/animation/gl-matrix.js index 75e7d0df82..3b22c7979a 100644 --- a/js/animation/gl-matrix.js +++ b/js/animation/gl-matrix.js @@ -627,7 +627,7 @@ vec2.str = function (a) { if(typeof(exports) !== 'undefined') { exports.vec2 = vec2; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -1120,23 +1120,23 @@ vec3.transformQuat = function(out, a, q) { * @returns {vec3} out */ vec3.rotateX = function(out, a, b, c){ - var p = [], r=[]; - //Translate point to the origin - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; - //perform rotation - r[0] = p[0]; - r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c); - r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c); + //perform rotation + r[0] = p[0]; + r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c); + r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c); - //translate to correct position - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; - return out; + return out; }; /* @@ -1148,23 +1148,23 @@ vec3.rotateX = function(out, a, b, c){ * @returns {vec3} out */ vec3.rotateY = function(out, a, b, c){ - var p = [], r=[]; - //Translate point to the origin - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; - //perform rotation - r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c); - r[1] = p[1]; - r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c); + //perform rotation + r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c); + r[1] = p[1]; + r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c); - //translate to correct position - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; - return out; + return out; }; /* @@ -1176,23 +1176,23 @@ vec3.rotateY = function(out, a, b, c){ * @returns {vec3} out */ vec3.rotateZ = function(out, a, b, c){ - var p = [], r=[]; - //Translate point to the origin - p[0] = a[0] - b[0]; - p[1] = a[1] - b[1]; - p[2] = a[2] - b[2]; + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; - //perform rotation - r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c); - r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c); - r[2] = p[2]; + //perform rotation + r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c); + r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c); + r[2] = p[2]; - //translate to correct position - out[0] = r[0] + b[0]; - out[1] = r[1] + b[1]; - out[2] = r[2] + b[2]; + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; - return out; + return out; }; /** @@ -1249,7 +1249,7 @@ vec3.str = function (a) { if(typeof(exports) !== 'undefined') { exports.vec3 = vec3; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -1774,7 +1774,7 @@ vec4.str = function (a) { if(typeof(exports) !== 'undefined') { exports.vec4 = vec4; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -2017,7 +2017,7 @@ mat2.str = function (a) { * @returns {Number} Frobenius norm */ mat2.frob = function (a) { - return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2))) + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2))); }; /** @@ -2039,7 +2039,7 @@ mat2.LDU = function (L, D, U, a) { if(typeof(exports) !== 'undefined') { exports.mat2 = mat2; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -2291,13 +2291,13 @@ mat2d.str = function (a) { * @returns {Number} Frobenius norm */ mat2d.frob = function (a) { - return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1)) + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1)); }; if(typeof(exports) !== 'undefined') { exports.mat2d = mat2d; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -2781,14 +2781,14 @@ mat3.str = function (a) { * @returns {Number} Frobenius norm */ mat3.frob = function (a) { - return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2))) + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2))); }; if(typeof(exports) !== 'undefined') { exports.mat3 = mat3; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -3693,14 +3693,14 @@ mat4.str = function (a) { * @returns {Number} Frobenius norm */ mat4.frob = function (a) { - return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) )) + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) )); }; if(typeof(exports) !== 'undefined') { exports.mat4 = mat4; } -; + /* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -4230,7 +4230,7 @@ quat.str = function (a) { if(typeof(exports) !== 'undefined') { exports.quat = quat; } -; + diff --git a/js/animation/timing-functions.js b/js/animation/timing-functions.js index 5fba8c0347..a34fb114e2 100644 --- a/js/animation/timing-functions.js +++ b/js/animation/timing-functions.js @@ -8,27 +8,27 @@ 'linear': function(duration) { return function(t) { return ionic.Animation.Bezier.linear(t, duration); - } + }; }, 'ease': function(duration) { return function(t) { return ionic.Animation.Bezier.ease(t, duration); - } + }; }, 'ease-in': function(duration) { return function(t) { return ionic.Animation.Bezier.easeIn(t, duration); - } + }; }, 'ease-out': function(duration) { return function(t) { return ionic.Animation.Bezier.easeOut(t, duration); - } + }; }, 'ease-in-out': function(duration) { return function(t) { return ionic.Animation.Bezier.easeInOut(t, duration); - } + }; } }; })(window); diff --git a/js/utils/utils.js b/js/utils/utils.js index 5e2009e841..96e2a82113 100644 --- a/js/utils/utils.js +++ b/js/utils/utils.js @@ -117,7 +117,7 @@ // `parent`'s constructor function. var Surrogate = function(){ this.constructor = child; }; Surrogate.prototype = parent.prototype; - child.prototype = new Surrogate; + child.prototype = new Surrogate(); // Add prototype properties (instance properties) to the subclass, // if supplied. diff --git a/js/utils/viewport.js b/js/utils/viewport.js index 372185c4f0..23e14a25cd 100644 --- a/js/utils/viewport.js +++ b/js/utils/viewport.js @@ -25,7 +25,7 @@ function viewportLoadTag() { var props = viewportTag.content.toLowerCase().replace(/\s+/g, '').split(','); var keyValue; for(x=0; x