diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-17 14:54:59 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-17 14:55:29 +0100 |
commit | 92bfd77cdee76e8cf117fc41c360eb700ba84fb9 (patch) | |
tree | 598e591c6d427ce4553c69df2a32df1f390a3d72 /js/vendor/angular/angular.js | |
parent | 61ac159882052c2c9bdef927a80b58f14e8de3bd (diff) |
update angular
Diffstat (limited to 'js/vendor/angular/angular.js')
-rw-r--r-- | js/vendor/angular/angular.js | 193 |
1 files changed, 153 insertions, 40 deletions
diff --git a/js/vendor/angular/angular.js b/js/vendor/angular/angular.js index d2beecf03..72673ba79 100644 --- a/js/vendor/angular/angular.js +++ b/js/vendor/angular/angular.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.4.0-build.3887+sha.41fdb3d + * @license AngularJS v1.4.0-build.3911+sha.e57138d * (c) 2010-2015 Google, Inc. http://angularjs.org * License: MIT */ @@ -57,7 +57,7 @@ function minErr(module, ErrorConstructor) { return match; }); - message += '\nhttp://errors.angularjs.org/1.4.0-build.3887+sha.41fdb3d/' + + message += '\nhttp://errors.angularjs.org/1.4.0-build.3911+sha.e57138d/' + (module ? module + '/' : '') + code; for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') { @@ -157,6 +157,7 @@ function minErr(module, ErrorConstructor) { createMap: true, NODE_TYPE_ELEMENT: true, + NODE_TYPE_ATTRIBUTE: true, NODE_TYPE_TEXT: true, NODE_TYPE_COMMENT: true, NODE_TYPE_DOCUMENT: true, @@ -431,8 +432,6 @@ function baseExtend(dst, objs, deep) { * * @param {Object} dst Destination object. * @param {...Object} src Source object(s). - * @param {boolean=} deep if the last parameter is set to `true`, objects are recursively merged - * (deep copy). Defaults to `false`. * @returns {Object} Reference to `dst`. */ function extend(dst) { @@ -1808,6 +1807,7 @@ function createMap() { } var NODE_TYPE_ELEMENT = 1; +var NODE_TYPE_ATTRIBUTE = 2; var NODE_TYPE_TEXT = 3; var NODE_TYPE_COMMENT = 8; var NODE_TYPE_DOCUMENT = 9; @@ -2006,6 +2006,18 @@ function setupModuleLoader(window) { */ constant: invokeLater('$provide', 'constant', 'unshift'), + /** + * @ngdoc method + * @name angular.Module#decorator + * @module ng + * @param {string} The name of the service to decorate. + * @param {Function} This function will be invoked when the service needs to be + * instantiated and should return the decorated service instance. + * @description + * See {@link auto.$provide#decorator $provide.decorator()}. + */ + decorator: invokeLater('$provide', 'decorator'), + /** * @ngdoc method * @name angular.Module#animation @@ -2223,6 +2235,7 @@ function toDebugString(obj) { $FilterProvider, $InterpolateProvider, $IntervalProvider, + $$HashMapProvider, $HttpProvider, $HttpBackendProvider, $LocationProvider, @@ -2262,7 +2275,7 @@ function toDebugString(obj) { * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". */ var version = { - full: '1.4.0-build.3887+sha.41fdb3d', // all of these placeholder strings will be replaced by grunt's + full: '1.4.0-build.3911+sha.e57138d', // all of these placeholder strings will be replaced by grunt's major: 1, // package task minor: 4, dot: 0, @@ -2399,12 +2412,24 @@ function publishExternalAPI(angular) { $$rAF: $$RAFProvider, $$asyncCallback: $$AsyncCallbackProvider, $$jqLite: $$jqLiteProvider, + $$HashMap: $$HashMapProvider, $$cookieReader: $$CookieReaderProvider }); } ]); } +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* global JQLitePrototype: true, addEventListenerFn: true, removeEventListenerFn: true, @@ -2992,6 +3017,10 @@ forEach({ }, attr: function(element, name, value) { + var nodeType = element.nodeType; + if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) { + return; + } var lowercasedName = lowercase(name); if (BOOLEAN_ATTR[lowercasedName]) { if (isDefined(value)) { @@ -3504,6 +3533,12 @@ HashMap.prototype = { } }; +var $$HashMapProvider = [function() { + this.$get = [function() { + return HashMap; + }]; +}]; + /** * @ngdoc function * @module ng @@ -5717,7 +5752,7 @@ function $CacheFactoryProvider() { * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE, * element with ng-app attribute), otherwise the template will be ignored. * - * Adding via the $templateCache service: + * Adding via the `$templateCache` service: * * ```js * var myApp = angular.module('myApp', []); @@ -5745,6 +5780,17 @@ function $TemplateCacheProvider() { }]; } +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! * * DOM-related variables: @@ -7712,13 +7758,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { for (i in elementControllers) { controller = elementControllers[i]; var controllerResult = controller(); - if (controllerResult !== controller.instance && - controller === controllerForBindings) { - // Remove and re-install bindToController bindings - thisLinkFn.$$destroyBindings(); - thisLinkFn.$$destroyBindings = - initializeDirectiveBindings(scope, attrs, controllerResult, - bindings, scopeDirective); + if (controllerResult !== controller.instance) { + controller.instance = controllerResult; + $element.data('$' + directive.name + 'Controller', controllerResult); + if (controller === controllerForBindings) { + // Remove and re-install bindToController bindings + thisLinkFn.$$destroyBindings(); + thisLinkFn.$$destroyBindings = + initializeDirectiveBindings(scope, attrs, controllerResult, bindings, scopeDirective); + } } } } @@ -10414,6 +10462,7 @@ function $IntervalProvider() { * indefinitely. * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @param {...*=} Pass additional parameters to the executed function. * @returns {promise} A promise which will be notified on each iteration. * * @example @@ -10507,7 +10556,9 @@ function $IntervalProvider() { * </example> */ function interval(fn, delay, count, invokeApply) { - var setInterval = $window.setInterval, + var hasParams = arguments.length > 4, + args = hasParams ? sliceArgs(arguments, 4) : [], + setInterval = $window.setInterval, clearInterval = $window.clearInterval, iteration = 0, skipApply = (isDefined(invokeApply) && !invokeApply), @@ -10516,7 +10567,9 @@ function $IntervalProvider() { count = isDefined(count) ? count : 0; - promise.then(null, null, fn); + promise.then(null, null, (!hasParams) ? fn : function() { + fn.apply(null, args); + }); promise.$$intervalId = setInterval(function tick() { deferred.notify(iteration++); @@ -10620,7 +10673,15 @@ function $LocaleProvider() { mediumDate: 'MMM d, y', shortDate: 'M/d/yy', mediumTime: 'h:mm:ss a', - shortTime: 'h:mm a' + shortTime: 'h:mm a', + ERANAMES: [ + "Before Christ", + "Anno Domini" + ], + ERAS: [ + "BC", + "AD" + ] }, pluralCat: function(num) { @@ -11631,6 +11692,7 @@ function $LocationProvider() { <button ng-click="$log.warn(message)">warn</button> <button ng-click="$log.info(message)">info</button> <button ng-click="$log.error(message)">error</button> + <button ng-click="$log.debug(message)">debug</button> </div> </file> </example> @@ -11761,6 +11823,17 @@ function $LogProvider() { }]; } +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + var $parseMinErr = minErr('$parse'); // Sandboxing Angular Expressions @@ -14334,9 +14407,27 @@ function $RootScopeProvider() { return TTL; }; + function createChildScopeClass(parent) { + function ChildScope() { + this.$$watchers = this.$$nextSibling = + this.$$childHead = this.$$childTail = null; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$$watchersCount = 0; + this.$id = nextUid(); + this.$$ChildScope = null; + } + ChildScope.prototype = parent; + return ChildScope; + } + this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', function($injector, $exceptionHandler, $parse, $browser) { + function destroyChildScope($event) { + $event.currentScope.$$destroyed = true; + } + /** * @ngdoc type * @name $rootScope.Scope @@ -14460,16 +14551,7 @@ function $RootScopeProvider() { // Only create a child scope class if somebody asks for one, // but cache it to allow the VM to optimize lookups. if (!this.$$ChildScope) { - this.$$ChildScope = function ChildScope() { - this.$$watchers = this.$$nextSibling = - this.$$childHead = this.$$childTail = null; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$watchersCount = 0; - this.$id = nextUid(); - this.$$ChildScope = null; - }; - this.$$ChildScope.prototype = this; + this.$$ChildScope = createChildScopeClass(this); } child = new this.$$ChildScope(); } @@ -14487,13 +14569,9 @@ function $RootScopeProvider() { // prototypically. In all other cases, this property needs to be set // when the parent scope is destroyed. // The listener needs to be added after the parent is set - if (isolate || parent != this) child.$on('$destroy', destroyChild); + if (isolate || parent != this) child.$on('$destroy', destroyChildScope); return child; - - function destroyChild() { - child.$$destroyed = true; - } }, /** @@ -15663,6 +15741,17 @@ function $$SanitizeUriProvider() { }; } +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + var $sceMinErr = minErr('$sce'); var SCE_CONTEXTS = { @@ -17007,6 +17096,7 @@ function $TimeoutProvider() { * @param {number=} [delay=0] Delay in milliseconds. * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @param {...*=} Pass additional parameters to the executed function. * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this * promise will be resolved with is the return value of the `fn` function. * @@ -17018,14 +17108,15 @@ function $TimeoutProvider() { fn = noop; } - var skipApply = (isDefined(invokeApply) && !invokeApply), + var args = sliceArgs(arguments, 3), + skipApply = (isDefined(invokeApply) && !invokeApply), deferred = (skipApply ? $$q : $q).defer(), promise = deferred.promise, timeoutId; timeoutId = $browser.defer(function() { try { - deferred.resolve(fn()); + deferred.resolve(fn.apply(null, args)); } catch (e) { deferred.reject(e); $exceptionHandler(e); @@ -17963,6 +18054,14 @@ function ampmGetter(date, formats) { return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; } +function eraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; +} + +function longEraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1]; +} + var DATE_FORMATS = { yyyy: dateGetter('FullYear', 4), yy: dateGetter('FullYear', 2, 0, true), @@ -17989,10 +18088,14 @@ var DATE_FORMATS = { a: ampmGetter, Z: timeZoneGetter, ww: weekGetter(2), - w: weekGetter(1) + w: weekGetter(1), + G: eraGetter, + GG: eraGetter, + GGG: eraGetter, + GGGG: longEraGetter }; -var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/, +var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, NUMBER_STRING = /^\-?\d+$/; /** @@ -18029,6 +18132,8 @@ var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year + * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') + * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') * * `format` string can also be one of the following predefined * {@link guide/i18n localizable formats}: @@ -25117,6 +25222,11 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { selectValueMap: selectValueMap, getOptionFromViewValue: function(value) { return selectValueMap[getTrackByValue(value, getLocals(value))]; + }, + getViewValueFromOption: function(option) { + // If the viewValue could be an object that may be mutated by the application, + // we need to make a copy and not return the reference to the value on the option. + return trackBy ? angular.copy(option.viewValue) : option.viewValue; } }; } @@ -25210,7 +25320,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { if (selectedOption && !selectedOption.disabled) { removeEmptyOption(); removeUnknownOption(); - return selectedOption.viewValue; + return options.getViewValueFromOption(selectedOption); } return null; }; @@ -25244,7 +25354,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { forEach(selectedValues, function(value) { var option = options.selectValueMap[value]; - if (!option.disabled) selections.push(option.viewValue); + if (!option.disabled) selections.push(options.getViewValueFromOption(option)); }); return selections; @@ -25275,6 +25385,10 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { // We will re-render the option elements if the option values or labels change scope.$watchCollection(ngOptions.getWatchables, updateOptions); + // We also need to watch to see if the internals of the model changes, since + // ngModel only watches for object identity change + scope.$watch(attr.ngModel, function() { ngModelCtrl.$render(); }, true); + // ------------------------------------------------------------------ // @@ -25606,7 +25720,6 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, IS_WHEN = /^when(Minus)?(.+)$/; return { - restrict: 'EA', link: function(scope, element, attr) { var numberExp = attr.count, whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs @@ -25699,8 +25812,8 @@ var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, * <div ng-repeat="(key, value) in myObj"> ... </div> * ``` * - * You need to be aware that the JavaScript specification does not define what order - * it will return the keys for an object. (To mitigate this in Angular 1.3 the `ngRepeat` directive + * You need to be aware that the JavaScript specification does not define the order of keys + * returned for an object. (To mitigate this in Angular 1.3 the `ngRepeat` directive * used to sort the keys alphabetically.) * * Version 1.4 removed the alphabetic sorting. We now rely on the order returned by the browser |