From f2fab498303e00d199cb3d19a008670e214d5c10 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 22 Oct 2013 14:41:21 -0700 Subject: style: make jshint happy --- src/ng/anchorScroll.js | 2 + src/ng/animate.js | 118 ++++++++++--------- src/ng/browser.js | 28 +++-- src/ng/cacheFactory.js | 20 ++-- src/ng/compile.js | 179 +++++++++++++++++------------ src/ng/controller.js | 6 +- src/ng/directive/a.js | 2 +- src/ng/directive/directives.js | 2 +- src/ng/directive/form.js | 2 +- src/ng/directive/input.js | 39 ++++--- src/ng/directive/ngBind.js | 5 +- src/ng/directive/ngClass.js | 5 +- src/ng/directive/ngIf.js | 4 +- src/ng/directive/ngInit.js | 2 +- src/ng/directive/ngRepeat.js | 14 +-- src/ng/directive/ngSwitch.js | 2 +- src/ng/directive/select.js | 43 ++++--- src/ng/filter.js | 22 +++- src/ng/filter/filter.js | 41 ++++--- src/ng/filter/filters.js | 6 +- src/ng/filter/limitTo.js | 2 +- src/ng/filter/orderBy.js | 2 +- src/ng/http.js | 225 +++++++++++++++++++----------------- src/ng/httpBackend.js | 5 +- src/ng/interpolate.js | 75 ++++++------ src/ng/interval.js | 8 +- src/ng/locale.js | 5 +- src/ng/location.js | 40 ++++--- src/ng/log.js | 28 ++--- src/ng/parse.js | 125 +++++++++++--------- src/ng/q.js | 19 +-- src/ng/rootScope.js | 182 ++++++++++++++++------------- src/ng/sce.js | 255 ++++++++++++++++++++++------------------- src/ng/sniffer.js | 6 +- src/ng/urlUtils.js | 3 +- 35 files changed, 863 insertions(+), 659 deletions(-) mode change 100755 => 100644 src/ng/directive/ngIf.js (limited to 'src/ng') diff --git a/src/ng/anchorScroll.js b/src/ng/anchorScroll.js index 263562bf..4cef2bdf 100644 --- a/src/ng/anchorScroll.js +++ b/src/ng/anchorScroll.js @@ -1,3 +1,5 @@ +'use strict'; + /** * @ngdoc function * @name ng.$anchorScroll diff --git a/src/ng/animate.js b/src/ng/animate.js index 1756e7d1..bb08410c 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -7,7 +7,8 @@ var $animateMinErr = minErr('$animate'); * @name ng.$animateProvider * * @description - * Default implementation of $animate that doesn't perform any animations, instead just synchronously performs DOM + * Default implementation of $animate that doesn't perform any animations, instead just + * synchronously performs DOM * updates and calls done() callbacks. * * In order to enable animations the ngAnimate module has to be loaded. @@ -16,6 +17,7 @@ var $animateMinErr = minErr('$animate'); */ var $AnimateProvider = ['$provide', function($provide) { + this.$$selectors = {}; @@ -25,12 +27,14 @@ var $AnimateProvider = ['$provide', function($provide) { * @methodOf ng.$animateProvider * * @description - * Registers a new injectable animation factory function. The factory function produces the animation object which - * contains callback functions for each event that is expected to be animated. + * Registers a new injectable animation factory function. The factory function produces the + * animation object which contains callback functions for each event that is expected to be + * animated. * - * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` must be called once the - * element animation is complete. If a function is returned then the animation service will use this function to - * cancel the animation whenever a cancel event is triggered. + * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` + * must be called once the element animation is complete. If a function is returned then the + * animation service will use this function to cancel the animation whenever a cancel event is + * triggered. * * *
@@ -46,7 +50,8 @@ var $AnimateProvider = ['$provide', function($provide) {
*
*
* @param {string} name The name of the animation.
- * @param {function} factory The factory function that will be executed to return the animation object.
+ * @param {function} factory The factory function that will be executed to return the animation
+ * object.
*/
this.register = function(name, factory) {
var key = name + '-animation';
@@ -59,36 +64,39 @@ var $AnimateProvider = ['$provide', function($provide) {
this.$get = ['$timeout', function($timeout) {
/**
+ *
* @ngdoc object
* @name ng.$animate
+ * @description The $animate service provides rudimentary DOM manipulation functions to
+ * insert, remove and move elements within the DOM, as well as adding and removing classes.
+ * This service is the core service used by the ngAnimate $animator service which provides
+ * high-level animation hooks for CSS and JavaScript.
*
- * @description
- * The $animate service provides rudimentary DOM manipulation functions to insert, remove and move elements within
- * the DOM, as well as adding and removing classes. This service is the core service used by the ngAnimate $animator
- * service which provides high-level animation hooks for CSS and JavaScript.
- *
- * $animate is available in the AngularJS core, however, the ngAnimate module must be included to enable full out
- * animation support. Otherwise, $animate will only perform simple DOM manipulation operations.
+ * $animate is available in the AngularJS core, however, the ngAnimate module must be included
+ * to enable full out animation support. Otherwise, $animate will only perform simple DOM
+ * manipulation operations.
*
- * To learn more about enabling animation support, click here to visit the {@link ngAnimate ngAnimate module page}
- * as well as the {@link ngAnimate.$animate ngAnimate $animate service page}.
+ * To learn more about enabling animation support, click here to visit the {@link ngAnimate
+ * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service
+ * page}.
*/
return {
/**
+ *
* @ngdoc function
* @name ng.$animate#enter
* @methodOf ng.$animate
* @function
- *
- * @description
- * Inserts the element into the DOM either after the `after` element or within the `parent` element. Once complete,
- * the done() callback will be fired (if provided).
- *
+ * @description Inserts the element into the DOM either after the `after` element or within
+ * the `parent` element. Once complete, the done() callback will be fired (if provided).
* @param {jQuery/jqLite element} element the element which will be inserted into the DOM
- * @param {jQuery/jqLite element} parent the parent element which will append the element as a child (if the after element is not present)
- * @param {jQuery/jqLite element} after the sibling element which will append the element after itself
- * @param {function=} done callback function that will be called after the element has been inserted into the DOM
+ * @param {jQuery/jqLite element} parent the parent element which will append the element as
+ * a child (if the after element is not present)
+ * @param {jQuery/jqLite element} after the sibling element which will append the element
+ * after itself
+ * @param {function=} done callback function that will be called after the element has been
+ * inserted into the DOM
*/
enter : function(element, parent, after, done) {
var afterNode = after && after[after.length - 1];
@@ -102,16 +110,16 @@ var $AnimateProvider = ['$provide', function($provide) {
},
/**
+ *
* @ngdoc function
* @name ng.$animate#leave
* @methodOf ng.$animate
* @function
- *
- * @description
- * Removes the element from the DOM. Once complete, the done() callback will be fired (if provided).
- *
+ * @description Removes the element from the DOM. Once complete, the done() callback will be
+ * fired (if provided).
* @param {jQuery/jqLite element} element the element which will be removed from the DOM
- * @param {function=} done callback function that will be called after the element has been removed from the DOM
+ * @param {function=} done callback function that will be called after the element has been
+ * removed from the DOM
*/
leave : function(element, done) {
element.remove();
@@ -119,19 +127,23 @@ var $AnimateProvider = ['$provide', function($provide) {
},
/**
+ *
* @ngdoc function
* @name ng.$animate#move
* @methodOf ng.$animate
* @function
- *
- * @description
- * Moves the position of the provided element within the DOM to be placed either after the `after` element or inside of the `parent` element.
- * Once complete, the done() callback will be fired (if provided).
- *
- * @param {jQuery/jqLite element} element the element which will be moved around within the DOM
- * @param {jQuery/jqLite element} parent the parent element where the element will be inserted into (if the after element is not present)
- * @param {jQuery/jqLite element} after the sibling element where the element will be positioned next to
- * @param {function=} done the callback function (if provided) that will be fired after the element has been moved to its new position
+ * @description Moves the position of the provided element within the DOM to be placed
+ * either after the `after` element or inside of the `parent` element. Once complete, the
+ * done() callback will be fired (if provided).
+ *
+ * @param {jQuery/jqLite element} element the element which will be moved around within the
+ * DOM
+ * @param {jQuery/jqLite element} parent the parent element where the element will be
+ * inserted into (if the after element is not present)
+ * @param {jQuery/jqLite element} after the sibling element where the element will be
+ * positioned next to
+ * @param {function=} done the callback function (if provided) that will be fired after the
+ * element has been moved to its new position
*/
move : function(element, parent, after, done) {
// Do not remove element before insert. Removing will cause data associated with the
@@ -140,47 +152,49 @@ var $AnimateProvider = ['$provide', function($provide) {
},
/**
+ *
* @ngdoc function
* @name ng.$animate#addClass
* @methodOf ng.$animate
* @function
- *
- * @description
- * Adds the provided className CSS class value to the provided element. Once complete, the done() callback will be fired (if provided).
- *
- * @param {jQuery/jqLite element} element the element which will have the className value added to it
+ * @description Adds the provided className CSS class value to the provided element. Once
+ * complete, the done() callback will be fired (if provided).
+ * @param {jQuery/jqLite element} element the element which will have the className value
+ * added to it
* @param {string} className the CSS class which will be added to the element
- * @param {function=} done the callback function (if provided) that will be fired after the className value has been added to the element
+ * @param {function=} done the callback function (if provided) that will be fired after the
+ * className value has been added to the element
*/
addClass : function(element, className, done) {
className = isString(className) ?
className :
isArray(className) ? className.join(' ') : '';
forEach(element, function (element) {
- JQLiteAddClass(element, className);
+ jqLiteAddClass(element, className);
});
done && $timeout(done, 0, false);
},
/**
+ *
* @ngdoc function
* @name ng.$animate#removeClass
* @methodOf ng.$animate
* @function
- *
- * @description
- * Removes the provided className CSS class value from the provided element. Once complete, the done() callback will be fired (if provided).
- *
- * @param {jQuery/jqLite element} element the element which will have the className value removed from it
+ * @description Removes the provided className CSS class value from the provided element.
+ * Once complete, the done() callback will be fired (if provided).
+ * @param {jQuery/jqLite element} element the element which will have the className value
+ * removed from it
* @param {string} className the CSS class which will be removed from the element
- * @param {function=} done the callback function (if provided) that will be fired after the className value has been removed from the element
+ * @param {function=} done the callback function (if provided) that will be fired after the
+ * className value has been removed from the element
*/
removeClass : function(element, className, done) {
className = isString(className) ?
className :
isArray(className) ? className.join(' ') : '';
forEach(element, function (element) {
- JQLiteRemoveClass(element, className);
+ jqLiteRemoveClass(element, className);
});
done && $timeout(done, 0, false);
},
diff --git a/src/ng/browser.js b/src/ng/browser.js
index 7a0e3fec..5e52b828 100644
--- a/src/ng/browser.js
+++ b/src/ng/browser.js
@@ -274,30 +274,35 @@ function Browser(window, document, $log, $sniffer) {
* It is not meant to be used directly, use the $cookie service instead.
*
* The return values vary depending on the arguments that the method was called with as follows:
- *
@@ -210,8 +214,8 @@ function $CacheFactoryProvider() {
*