diff --git a/.jshintrc b/.jshintrc index 7136edbda9..b36c317d67 100644 --- a/.jshintrc +++ b/.jshintrc @@ -8,7 +8,23 @@ "eqnull": true, "quotmark": "single", "trailing": true, + "undef": true, + "browser": true, + "jquery": true, "globals": { - "angular": true + "angular": false, + + // For Jasmine + "after" : false, + "afterEach" : false, + "before" : false, + "beforeEach" : false, + "describe" : false, + "expect" : false, + "jasmine" : false, + "module" : false, + "spyOn" : false, + "inject" : false, + "it" : false } } \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 7d7412b99d..9bf4425f07 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,4 @@ +/* jshint node: true */ var markdown = require('node-markdown').Markdown; module.exports = function(grunt) { diff --git a/src/datepicker/test/datepicker.spec.js b/src/datepicker/test/datepicker.spec.js index 1eb14a434d..b673d162da 100644 --- a/src/datepicker/test/datepicker.spec.js +++ b/src/datepicker/test/datepicker.spec.js @@ -1602,7 +1602,7 @@ describe('datepicker directive', function () { beforeEach(inject(function() { $rootScope.date = new Date('August 11, 2013'); $rootScope.mode = 'month'; - wrapElement = $compile('
')($rootScope); + var wrapElement = $compile('')($rootScope); $rootScope.$digest(); assignElements(wrapElement); })); diff --git a/src/dropdown/docs/demo.js b/src/dropdown/docs/demo.js index 47955a320e..321d493e16 100644 --- a/src/dropdown/docs/demo.js +++ b/src/dropdown/docs/demo.js @@ -1,4 +1,4 @@ -angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope) { +angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope, $log) { $scope.items = [ 'The first choice!', 'And another choice for you.', @@ -10,7 +10,7 @@ angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope) }; $scope.toggled = function(open) { - console.log('Dropdown is now: ', open); + $log.log('Dropdown is now: ', open); }; $scope.toggleDropdown = function($event) { diff --git a/src/pagination/docs/demo.js b/src/pagination/docs/demo.js index 6f4fab5a20..9791aab8ec 100644 --- a/src/pagination/docs/demo.js +++ b/src/pagination/docs/demo.js @@ -1,4 +1,4 @@ -angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope) { +angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope, $log) { $scope.totalItems = 64; $scope.currentPage = 4; @@ -7,7 +7,7 @@ angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($ }; $scope.pageChanged = function() { - console.log('Page changed to: ' + $scope.currentPage); + $log.log('Page changed to: ' + $scope.currentPage); }; $scope.maxSize = 5; diff --git a/src/progressbar/test/progressbar.spec.js b/src/progressbar/test/progressbar.spec.js index bae03b6ea5..c4d4f2a78a 100644 --- a/src/progressbar/test/progressbar.spec.js +++ b/src/progressbar/test/progressbar.spec.js @@ -1,5 +1,5 @@ describe('progressbar directive', function () { - var $rootScope, element; + var $rootScope, $compile, element; beforeEach(module('ui.bootstrap.progressbar')); beforeEach(module('template/progressbar/progressbar.html', 'template/progressbar/progress.html', 'template/progressbar/bar.html')); beforeEach(inject(function(_$compile_, _$rootScope_) { diff --git a/src/rating/test/rating.spec.js b/src/rating/test/rating.spec.js index 31ef5d2377..c841783944 100644 --- a/src/rating/test/rating.spec.js +++ b/src/rating/test/rating.spec.js @@ -1,5 +1,5 @@ describe('rating directive', function () { - var $rootScope, element; + var $rootScope, $compile, element; beforeEach(module('ui.bootstrap.rating')); beforeEach(module('template/rating/rating.html')); beforeEach(inject(function(_$compile_, _$rootScope_) { diff --git a/src/tabs/docs/demo.js b/src/tabs/docs/demo.js index d8879ff2bf..f3d64fd7cf 100644 --- a/src/tabs/docs/demo.js +++ b/src/tabs/docs/demo.js @@ -1,4 +1,4 @@ -angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope) { +angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope, $window) { $scope.tabs = [ { title:'Dynamic Title 1', content:'Dynamic content 1' }, { title:'Dynamic Title 2', content:'Dynamic content 2', disabled: true } @@ -6,7 +6,7 @@ angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope) $scope.alertMe = function() { setTimeout(function() { - alert('You\'ve selected the alert tab!'); + $window.alert('You\'ve selected the alert tab!'); }); }; }); diff --git a/src/timepicker/docs/demo.js b/src/timepicker/docs/demo.js index 3769ee7b86..8c9ade2bae 100644 --- a/src/timepicker/docs/demo.js +++ b/src/timepicker/docs/demo.js @@ -1,4 +1,4 @@ -angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope) { +angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope, $log) { $scope.mytime = new Date(); $scope.hstep = 1; @@ -22,7 +22,7 @@ angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($ }; $scope.changed = function () { - console.log('Time changed to: ' + $scope.mytime); + $log.log('Time changed to: ' + $scope.mytime); }; $scope.clear = function() { diff --git a/src/timepicker/test/timepicker.spec.js b/src/timepicker/test/timepicker.spec.js index 7958b2d463..de1ba9254e 100644 --- a/src/timepicker/test/timepicker.spec.js +++ b/src/timepicker/test/timepicker.spec.js @@ -1,5 +1,5 @@ describe('timepicker directive', function () { - var $rootScope, element; + var $rootScope, $compile, element; beforeEach(module('ui.bootstrap.timepicker')); beforeEach(module('template/timepicker/timepicker.html')); @@ -792,7 +792,7 @@ describe('timepicker directive', function () { describe('when model is not a Date', function() { beforeEach(inject(function() { - eelement = $compile('