Upgrade to angular.js 1.3.13

This commit is contained in:
Tankred Hase 2015-02-16 15:22:41 +01:00
parent 9c6d618ddc
commit 10cd2795f3
4 changed files with 1963 additions and 1862 deletions

View File

@ -1,5 +1,5 @@
/** /**
* @license AngularJS v1.3.7 * @license AngularJS v1.3.13
* (c) 2010-2014 Google, Inc. http://angularjs.org * (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
@ -839,7 +839,8 @@ angular.module('ngAnimate', ['ng'])
* promise that was returned when the animation was started. * promise that was returned when the animation was started.
* *
* ```js * ```js
* var promise = $animate.addClass(element, 'super-long-animation').then(function() { * var promise = $animate.addClass(element, 'super-long-animation');
* promise.then(function() {
* //this will still be called even if cancelled * //this will still be called even if cancelled
* }); * });
* *
@ -1332,8 +1333,7 @@ angular.module('ngAnimate', ['ng'])
} else if (lastAnimation.event == 'setClass') { } else if (lastAnimation.event == 'setClass') {
animationsToCancel.push(lastAnimation); animationsToCancel.push(lastAnimation);
cleanup(element, className); cleanup(element, className);
} } else if (runningAnimations[className]) {
else if (runningAnimations[className]) {
var current = runningAnimations[className]; var current = runningAnimations[className];
if (current.event == animationEvent) { if (current.event == animationEvent) {
skipAnimation = true; skipAnimation = true;
@ -1874,7 +1874,7 @@ angular.module('ngAnimate', ['ng'])
return; return;
} }
if (!staggerTime && styles) { if (!staggerTime && styles && Object.keys(styles).length > 0) {
if (!timings.transitionDuration) { if (!timings.transitionDuration) {
element.css('transition', timings.animationDuration + 's linear all'); element.css('transition', timings.animationDuration + 's linear all');
appliedStyles.push('transition'); appliedStyles.push('transition');

View File

@ -1,5 +1,5 @@
/** /**
* @license AngularJS v1.3.7 * @license AngularJS v1.3.13
* (c) 2010-2014 Google, Inc. http://angularjs.org * (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
@ -250,31 +250,31 @@ angular.mock.$ExceptionHandlerProvider = function() {
* *
* @param {string} mode Mode of operation, defaults to `rethrow`. * @param {string} mode Mode of operation, defaults to `rethrow`.
* *
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
* is a bug in the application or test, so this mock will make these tests fail.
* - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log` * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`
* mode stores an array of errors in `$exceptionHandler.errors`, to allow later * mode stores an array of errors in `$exceptionHandler.errors`, to allow later
* assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
* {@link ngMock.$log#reset reset()} * {@link ngMock.$log#reset reset()}
* - `rethrow`: If any errors are passed to the handler in tests, it typically means that there
* is a bug in the application or test, so this mock will make these tests fail.
* For any implementations that expect exceptions to be thrown, the `rethrow` mode
* will also maintain a log of thrown errors.
*/ */
this.mode = function(mode) { this.mode = function(mode) {
switch (mode) {
case 'rethrow':
handler = function(e) {
throw e;
};
break;
case 'log':
var errors = [];
switch (mode) {
case 'log':
case 'rethrow':
var errors = [];
handler = function(e) { handler = function(e) {
if (arguments.length == 1) { if (arguments.length == 1) {
errors.push(e); errors.push(e);
} else { } else {
errors.push([].slice.call(arguments, 0)); errors.push([].slice.call(arguments, 0));
} }
if (mode === "rethrow") {
throw e;
}
}; };
handler.errors = errors; handler.errors = errors;
break; break;
default: default:
@ -1283,7 +1283,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers. * @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1297,7 +1297,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers. * @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1311,7 +1311,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {(Object|function(Object))=} headers HTTP headers. * @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1327,7 +1327,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected. * data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers. * @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1343,7 +1343,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {(string|RegExp|function(string))=} data HTTP request body or function that receives * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives
* data string and returns true if the data is as expected. * data string and returns true if the data is as expected.
* @param {(Object|function(Object))=} headers HTTP headers. * @param {(Object|function(Object))=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1356,7 +1356,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* *
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1377,7 +1377,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* is in JSON format. * is in JSON format.
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
* object and returns true if the headers match the current expectation. * object and returns true if the headers match the current expectation.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
* *
@ -1412,7 +1412,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. See #expect for more info. * order to change how a matched request is handled. See #expect for more info.
*/ */
@ -1426,7 +1426,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1440,7 +1440,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1457,7 +1457,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* receives data string and returns true if the data is as expected, or Object if request body * receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format. * is in JSON format.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1474,7 +1474,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* receives data string and returns true if the data is as expected, or Object if request body * receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format. * is in JSON format.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1491,7 +1491,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* receives data string and returns true if the data is as expected, or Object if request body * receives data string and returns true if the data is as expected, or Object if request body
* is in JSON format. * is in JSON format.
* @param {Object=} headers HTTP headers. * @param {Object=} headers HTTP headers.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -1504,7 +1504,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
* *
* @param {string|RegExp|function(string)} url HTTP url or function that receives the url * @param {string|RegExp|function(string)} url HTTP url or function that receives the url
* and returns true if the url match the current definition. * and returns true if the url match the current definition.
* @returns {requestHandler} Returns an object with `respond` method that control how a matched * @returns {requestHandler} Returns an object with `respond` method that controls how a matched
* request is handled. You can save this object for later use and invoke `respond` again in * request is handled. You can save this object for later use and invoke `respond` again in
* order to change how a matched request is handled. * order to change how a matched request is handled.
*/ */
@ -2134,18 +2134,32 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
if (window.jasmine || window.mocha) { if (window.jasmine || window.mocha) {
var currentSpec = null, var currentSpec = null,
annotatedFunctions = [],
isSpecRunning = function() { isSpecRunning = function() {
return !!currentSpec; return !!currentSpec;
}; };
angular.mock.$$annotate = angular.injector.$$annotate;
angular.injector.$$annotate = function(fn) {
if (typeof fn === 'function' && !fn.$inject) {
annotatedFunctions.push(fn);
}
return angular.mock.$$annotate.apply(this, arguments);
};
(window.beforeEach || window.setup)(function() { (window.beforeEach || window.setup)(function() {
annotatedFunctions = [];
currentSpec = this; currentSpec = this;
}); });
(window.afterEach || window.teardown)(function() { (window.afterEach || window.teardown)(function() {
var injector = currentSpec.$injector; var injector = currentSpec.$injector;
annotatedFunctions.forEach(function(fn) {
delete fn.$inject;
});
angular.forEach(currentSpec.$modules, function(module) { angular.forEach(currentSpec.$modules, function(module) {
if (module && module.$$hashKey) { if (module && module.$$hashKey) {
module.$$hashKey = undefined; module.$$hashKey = undefined;

View File

@ -1,5 +1,5 @@
/** /**
* @license AngularJS v1.3.7 * @license AngularJS v1.3.13
* (c) 2010-2014 Google, Inc. http://angularjs.org * (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT * License: MIT
*/ */
@ -482,21 +482,15 @@ function $RouteProvider() {
* definitions will be interpolated into the location's path, while * definitions will be interpolated into the location's path, while
* remaining properties will be treated as query params. * remaining properties will be treated as query params.
* *
* @param {Object} newParams mapping of URL parameter names to values * @param {!Object<string, string>} newParams mapping of URL parameter names to values
*/ */
updateParams: function(newParams) { updateParams: function(newParams) {
if (this.current && this.current.$$route) { if (this.current && this.current.$$route) {
var searchParams = {}, self=this;
angular.forEach(Object.keys(newParams), function(key) {
if (!self.current.pathParams[key]) searchParams[key] = newParams[key];
});
newParams = angular.extend({}, this.current.params, newParams); newParams = angular.extend({}, this.current.params, newParams);
$location.path(interpolate(this.current.$$route.originalPath, newParams)); $location.path(interpolate(this.current.$$route.originalPath, newParams));
$location.search(angular.extend({}, $location.search(), searchParams)); // interpolate modifies newParams, only query params are left
} $location.search(newParams);
else { } else {
throw $routeMinErr('norout', 'Tried updating route when with no current route'); throw $routeMinErr('norout', 'Tried updating route when with no current route');
} }
} }

File diff suppressed because it is too large Load Diff