Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'delint' of git://github.com/boneskull/angular-ui

* 'delint' of git://github.com/boneskull/angular-ui:
  bug 168: delinting
  • Loading branch information...
commit 2a69d470c66f6cec78bfce7f0b763d849677cfe0 2 parents 09778fd + 48fd730
@ProLoser ProLoser authored
View
26 common/ieshiv/ieshiv.js
@@ -7,10 +7,10 @@
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
var rv = -1; // Return value assumes failure.
- if (navigator.appName == 'Microsoft Internet Explorer') {
+ if (navigator.appName === 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
- var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
- if (re.exec(ua) != null) {
+ var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
+ if (re.exec(ua) !== null) {
rv = parseFloat(RegExp.$1);
}
}
@@ -45,17 +45,19 @@
moduleNames.push('ui.directives');
if (debug) console.log('moduleNames', moduleNames);
+ function pushDirectives(item) {
+ // only allow directives
+ if (item[1] === "directive") {
+ var dirname = item[2][0];
+ tags.push(dirname);
+ } else {
+ if (debug) console.log("skipping", item[1], item[2][0]);
+ }
+ }
+
for (var k = 0, mlen = moduleNames.length; k < mlen; k++) {
var modules = angular.module(moduleNames[k]); // will throw runtime exception
- angular.forEach(modules._invokeQueue, function (item) {
- // only allow directives
- if (item[1] === "directive") {
- var dirname = item[2][0];
- tags.push(dirname);
- } else {
- if (debug) console.log("skipping", item[1], item[2][0]);
- }
- });
+ angular.forEach(modules._invokeQueue, pushDirectives);
}
if (debug) console.log("tags found", tags);
View
2  modules/directives/currency/test/currencySpec.js
@@ -1,7 +1,5 @@
describe('uiCurrency', function () {
var scope;
- scope = null,
- uiConfig = {};
beforeEach(module('ui'));
beforeEach(inject(function ($rootScope) {
scope = $rootScope.$new();
View
2  modules/directives/event/event.js
@@ -19,7 +19,7 @@ angular.module('ui.directives').directive('uiEvent', ['$parse',
//Take out first paramater (event object);
params = params.splice(1);
scope.$apply(function () {
- fn(scope, {$event: evt, $params: params})
+ fn(scope, {$event: evt, $params: params});
});
});
});
View
8 modules/directives/event/test/eventSpec.js
@@ -1,5 +1,5 @@
describe('uiEvent', function () {
- var $scope, $rootScope, $compile
+ var $scope, $rootScope, $compile;
beforeEach(module('ui.directives'));
beforeEach(inject(function (_$rootScope_, _$compile_) {
@@ -13,8 +13,6 @@ describe('uiEvent', function () {
return $compile('<span ui-event="_uiEvent">')(scope);
}
- ;
-
describe('test', function () {
it('should work with dblclick event and assignment', function () {
$scope = $rootScope.$new();
@@ -42,7 +40,7 @@ describe('uiEvent', function () {
var elm = eventElement($scope, {
'click': 'amount=amount*2',
'mouseenter': 'amount=amount*4',
- 'keyup': 'amount=amount*3',
+ 'keyup': 'amount=amount*3'
});
elm.trigger('click');
expect($scope.amount).toBe(10);
@@ -75,7 +73,7 @@ describe('uiEvent', function () {
};
var elm = eventElement($scope, {'stuff': 'onStuff($event, $params)'});
$(elm).trigger('stuff', ['foo', 'bar']);
- })
+ });
});
});
View
11 modules/directives/jq/jq.js
@@ -19,9 +19,8 @@ angular.module('ui.directives').directive('uiJq', ['ui.config', function (uiConf
compile: function (tElm, tAttrs) {
if (!angular.isFunction(tElm[tAttrs.uiJq])) {
throw new Error('ui-jq: The "' + tAttrs.uiJq + '" function does not exist');
- return;
}
- var options = uiConfig['jq'] && uiConfig['jq'][tAttrs.uiJq];
+ var options = uiConfig.jq && uiConfig.jq[tAttrs.uiJq];
return function (scope, elm, attrs) {
var linkOptions = [], ngChange = 'change';
@@ -37,9 +36,11 @@ angular.module('ui.directives').directive('uiJq', ['ui.config', function (uiConf
if (linkOptions && angular.isObject(linkOptions[0]) && linkOptions[0].ngChange !== undefined) {
ngChange = linkOptions[0].ngChange;
}
- ngChange && elm.on(ngChange, function () {
- elm.trigger('input');
- });
+ if (ngChange) {
+ elm.on(ngChange, function () {
+ elm.trigger('input');
+ });
+ }
}
elm[attrs.uiJq].apply(elm, linkOptions);
};
View
2  modules/directives/map/map.js
@@ -97,8 +97,6 @@
}]);
}
- ;
-
mapOverlayDirective('uiMapMarker',
'animation_changed click clickable_changed cursor_changed ' +
'dblclick drag dragend draggable_changed dragstart flat_changed icon_changed ' +
View
6 modules/directives/map/test/mapSpec.js
@@ -1,5 +1,5 @@
describe('uiMap', function () {
- var scope, $rootScope, $compile
+ var scope, $rootScope, $compile;
beforeEach(module('ui.directives'));
beforeEach(inject(function (_$compile_, _$rootScope_) {
@@ -39,7 +39,7 @@ describe('uiMap', function () {
var center = new google.maps.LatLng(40, 40);
createMap({center: center});
expect(scope.gmap.getCenter()).toBe(center);
- })
+ });
it('should pass events to the element as "map-eventname"', function () {
scope.zoomy = false;
@@ -98,6 +98,6 @@ describe('uiMap', function () {
google.maps.event.trigger(scope.ginfo, 'closeclick');
expect(scope.closed).toBe(true);
});
- })
+ });
});
View
2  modules/directives/scrollfix/scrollfix.js
@@ -1,4 +1,4 @@
-/*global angular, $*/
+/*global angular, $, document*/
/**
* Adds a 'ui-scrollfix' class to the element when the page scrolls past it's position.
* @param [offset] {int} optional Y-offset to override the detected offset.
View
4 modules/directives/select2/select2.js
@@ -81,7 +81,7 @@ angular.module('ui.directives').directive('uiSelect2', ['ui.config', '$http', fu
controller.$setViewValue(value);
callback(value);
});
- }
+ };
}
}
}
@@ -97,7 +97,7 @@ angular.module('ui.directives').directive('uiSelect2', ['ui.config', '$http', fu
setTimeout(function () {
elm.select2(opts);
});
- }
+ };
}
};
}]);
View
2  modules/filters/unique/test/uniqueSpec.js
@@ -78,4 +78,4 @@ describe('unique', function () {
expect(uniqueFilter(arrayToFilter, false)).toEqual(arrayToFilter);
});
-})
+});
Please sign in to comment.
Something went wrong with that request. Please try again.