From be37aed9f5d923fe16e264c6ffc97db08503b791 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 27 Jan 2015 09:23:03 +0100 Subject: more clientside updates (angular 1.4 beta, es6-shim, momentjs --- js/bower.json | 12 +- js/vendor/angular-animate/.bower.json | 12 +- js/vendor/angular-animate/angular-animate.js | 4 +- js/vendor/angular-animate/angular-animate.min.js | 4 +- js/vendor/angular-animate/bower.json | 4 +- js/vendor/angular-animate/package.json | 2 +- js/vendor/angular-mocks/.bower.json | 12 +- js/vendor/angular-mocks/angular-mocks.js | 20 +- js/vendor/angular-mocks/bower.json | 4 +- js/vendor/angular-mocks/package.json | 2 +- js/vendor/angular-route/.bower.json | 12 +- js/vendor/angular-route/angular-route.js | 6 +- js/vendor/angular-route/angular-route.min.js | 4 +- js/vendor/angular-route/angular-route.min.js.map | 2 +- js/vendor/angular-route/bower.json | 4 +- js/vendor/angular-route/package.json | 2 +- js/vendor/angular-sanitize/.bower.json | 12 +- js/vendor/angular-sanitize/angular-sanitize.js | 4 +- js/vendor/angular-sanitize/angular-sanitize.min.js | 4 +- js/vendor/angular-sanitize/bower.json | 4 +- js/vendor/angular-sanitize/package.json | 2 +- js/vendor/angular/.bower.json | 10 +- js/vendor/angular/angular.js | 2211 +++++++------ js/vendor/angular/angular.min.js | 494 +-- js/vendor/angular/angular.min.js.map | 6 +- js/vendor/angular/bower.json | 2 +- js/vendor/angular/package.json | 2 +- js/vendor/es6-shim/.bower.json | 10 +- js/vendor/es6-shim/CHANGELOG.md | 76 +- js/vendor/es6-shim/Gruntfile.js | 20 +- js/vendor/es6-shim/README.md | 26 +- js/vendor/es6-shim/bower.json | 2 +- js/vendor/es6-shim/component.json | 2 +- js/vendor/es6-shim/es6-sham.js | 197 +- js/vendor/es6-shim/es6-sham.map | 2 +- js/vendor/es6-shim/es6-sham.min.js | 11 +- js/vendor/es6-shim/es6-shim.js | 3438 +++++++++++--------- js/vendor/es6-shim/es6-shim.map | 2 +- js/vendor/es6-shim/es6-shim.min.js | 11 +- js/vendor/es6-shim/package.json | 55 +- js/vendor/es6-shim/test-sham/set-prototype-of.js | 17 +- 41 files changed, 3589 insertions(+), 3137 deletions(-) diff --git a/js/bower.json b/js/bower.json index b4b8f3ed3..5ce083745 100644 --- a/js/bower.json +++ b/js/bower.json @@ -23,13 +23,13 @@ "tests" ], "dependencies": { - "angular": "~1.3.*", - "angular-route": "~1.3.*", - "angular-mocks": "~1.3.*", - "angular-sanitize": "~1.3.*", + "angular": "~1.4.*", + "angular-route": "~1.4.*", + "angular-mocks": "~1.4.*", + "angular-sanitize": "~1.4.*", + "angular-animate": "~1.4.*", "jquery": "~2.*", "momentjs": "~2.9.*", - "es6-shim": "~0.18.*", - "angular-animate": "~1.3.*" + "es6-shim": "~0.*" } } diff --git a/js/vendor/angular-animate/.bower.json b/js/vendor/angular-animate/.bower.json index 940c0582a..a80204612 100644 --- a/js/vendor/angular-animate/.bower.json +++ b/js/vendor/angular-animate/.bower.json @@ -1,19 +1,19 @@ { "name": "angular-animate", - "version": "1.3.11", + "version": "1.4.0-build.3807+sha.b3a9bd3", "main": "./angular-animate.js", "ignore": [], "dependencies": { - "angular": "1.3.11" + "angular": "1.4.0-build.3807+sha.b3a9bd3" }, "homepage": "https://github.com/angular/bower-angular-animate", - "_release": "1.3.11", + "_release": "1.4.0-build.3807+sha.b3a9bd3", "_resolution": { "type": "version", - "tag": "v1.3.11", - "commit": "3e2694925902184bd5372d55fae7deaf2002429c" + "tag": "v1.4.0-build.3807+sha.b3a9bd3", + "commit": "6fe772fe6020fb2cc483395df8c6f05e2af5757e" }, "_source": "git://github.com/angular/bower-angular-animate.git", - "_target": "~1.3.*", + "_target": "~1.4.*", "_originalSource": "angular-animate" } \ No newline at end of file diff --git a/js/vendor/angular-animate/angular-animate.js b/js/vendor/angular-animate/angular-animate.js index 56c7e9498..c963356f2 100644 --- a/js/vendor/angular-animate/angular-animate.js +++ b/js/vendor/angular-animate/angular-animate.js @@ -1,6 +1,6 @@ /** - * @license AngularJS v1.3.11 - * (c) 2010-2014 Google, Inc. http://angularjs.org + * @license AngularJS v1.4.0-build.3807+sha.b3a9bd3 + * (c) 2010-2015 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular, undefined) {'use strict'; diff --git a/js/vendor/angular-animate/angular-animate.min.js b/js/vendor/angular-animate/angular-animate.min.js index e9da562d6..90952c50b 100644 --- a/js/vendor/angular-animate/angular-animate.min.js +++ b/js/vendor/angular-animate/angular-animate.min.js @@ -1,6 +1,6 @@ /* - AngularJS v1.3.11 - (c) 2010-2014 Google, Inc. http://angularjs.org + AngularJS v1.4.0-build.3807+sha.b3a9bd3 + (c) 2010-2015 Google, Inc. http://angularjs.org License: MIT */ (function(N,f,W){'use strict';f.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(X,C,g){g=g.ngAnimateChildren;f.isString(g)&&0===g.length?C.data("$$ngAnimateChildren",!0):X.$watch(g,function(f){C.data("$$ngAnimateChildren",!!f)})}}).factory("$$animateReflow",["$$rAF","$document",function(f,C){return function(g){return f(function(){g()})}}]).config(["$provide","$animateProvider",function(X,C){function g(f){for(var n=0;n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it), + * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it), * then you are also responsible for calling `$destroy` on the transclusion scope. * * @@ -8897,7 +8897,7 @@ function $HttpProvider() { * To add or overwrite these defaults, simply add or remove a property from these configuration * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`. * * The defaults can also be set at runtime via the `$http.defaults` object in the same * fashion. For example: @@ -9165,7 +9165,7 @@ function $HttpProvider() { * - **data** – `{string|Object}` – Data to be sent as the request message data. * - **headers** – `{Object}` – Map of strings or functions which return strings representing * HTTP headers to send to the server. If the return value of a function is null, the - * header will not be sent. + * header will not be sent. Functions accept a config object as an argument. * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. * - **transformRequest** – @@ -9384,12 +9384,12 @@ function $HttpProvider() { : $q.reject(resp); } - function executeHeaderFns(headers) { + function executeHeaderFns(headers, config) { var headerContent, processedHeaders = {}; forEach(headers, function(headerFn, header) { if (isFunction(headerFn)) { - headerContent = headerFn(); + headerContent = headerFn(config); if (headerContent != null) { processedHeaders[header] = headerContent; } @@ -9423,7 +9423,7 @@ function $HttpProvider() { } // execute if header value is a function for merged headers - return executeHeaderFns(reqHeaders); + return executeHeaderFns(reqHeaders, shallowCopy(config)); } } @@ -10510,7 +10510,7 @@ function parseAbsoluteUrl(absoluteUrl, locationObj) { locationObj.$$protocol = parsedUrl.protocol; locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; + locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; } @@ -11320,7 +11320,7 @@ function $LocationProvider() { // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) // currently we open nice url link and redirect then - if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return; + if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.which == 2 || event.button == 2) return; var elm = jqLite(event.target); @@ -12272,7 +12272,7 @@ Parser.prototype = { }, { assign: function(scope, value, locals) { var o = object(scope, locals); - if (!o) object.assign(scope, o = {}, locals); + if (!o) object.assign(scope, o = {}); return getter.assign(o, value); } }); @@ -12298,7 +12298,7 @@ Parser.prototype = { var key = ensureSafeMemberName(indexFn(self, locals), expression); // prevent overwriting of Function.constructor which would break ensureSafeObject check var o = ensureSafeObject(obj(self, locals), expression); - if (!o) obj.assign(self, o = {}, locals); + if (!o) obj.assign(self, o = {}); return o[key] = value; } }); @@ -12408,19 +12408,18 @@ Parser.prototype = { // Parser helper functions ////////////////////////////////////////////////// -function setter(obj, locals, path, setValue, fullExp) { +function setter(obj, path, setValue, fullExp) { ensureSafeObject(obj, fullExp); - ensureSafeObject(locals, fullExp); var element = path.split('.'), key; for (var i = 0; element.length > 1; i++) { key = ensureSafeMemberName(element.shift(), fullExp); - var propertyObj = (i === 0 && locals && locals[key]) || obj[key]; + var propertyObj = ensureSafeObject(obj[key], fullExp); if (!propertyObj) { propertyObj = {}; obj[key] = propertyObj; } - obj = ensureSafeObject(propertyObj, fullExp); + obj = propertyObj; } key = ensureSafeMemberName(element.shift(), fullExp); ensureSafeObject(obj[key], fullExp); @@ -12547,8 +12546,8 @@ function getterFn(path, options, fullExp) { } fn.sharedGetter = true; - fn.assign = function(self, value, locals) { - return setter(self, locals, path, value, path); + fn.assign = function(self, value) { + return setter(self, path, value, path); }; getterFnCache[path] = fn; return fn; @@ -15923,7 +15922,7 @@ function $SnifferProvider() { this.$get = ['$window', '$document', function($window, $document) { var eventSupport = {}, android = - int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), boxee = /Boxee/i.test(($window.navigator || {}).userAgent), document = $document[0] || {}, vendorPrefix, @@ -15950,8 +15949,8 @@ function $SnifferProvider() { animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); if (android && (!transitions || !animations)) { - transitions = isString(document.body.style.webkitTransition); - animations = isString(document.body.style.webkitAnimation); + transitions = isString(bodyStyle.webkitTransition); + animations = isString(bodyStyle.webkitAnimation); } } @@ -16007,7 +16006,7 @@ var $compileMinErr = minErr('$compile'); * @param {string} tpl The HTTP request template URL * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty * - * @return {Promise} the HTTP Promise for the given. + * @return {Promise} a promise for the HTTP response data of the given URL. * * @property {number} totalPendingRequests total amount of pending template requests being downloaded. */ @@ -16036,12 +16035,14 @@ function $TemplateRequestProvider() { handleRequestFn.totalPendingRequests--; }) .then(function(response) { + $templateCache.put(tpl, response.data); return response.data; }, handleError); function handleError(resp) { if (!ignoreRequestError) { - throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl); + throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})', + tpl, resp.status, resp.statusText); } return $q.reject(resp); } @@ -16171,6 +16172,7 @@ function $$TestabilityProvider() { function $TimeoutProvider() { this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', function($rootScope, $browser, $q, $$q, $exceptionHandler) { + var deferreds = {}; @@ -16183,15 +16185,18 @@ function $TimeoutProvider() { * block and delegates any exceptions to * {@link ng.$exceptionHandler $exceptionHandler} service. * - * The return value of registering a timeout function is a promise, which will be resolved when - * the timeout is reached and the timeout function is executed. + * The return value of calling `$timeout` is a promise, which will be resolved when + * the delay has passed and the timeout function, if provided, is executed. * * To cancel a timeout request, call `$timeout.cancel(promise)`. * * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to * synchronously flush the queue of deferred functions. * - * @param {function()} fn A function, whose execution should be delayed. + * If you only want a promise that will be resolved after some specified delay + * then you can call `$timeout` without the `fn` function. + * + * @param {function()=} fn A function, whose execution should be delayed. * @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. @@ -16200,6 +16205,12 @@ function $TimeoutProvider() { * */ function timeout(fn, delay, invokeApply) { + if (!isFunction(fn)) { + invokeApply = delay; + delay = fn; + fn = noop; + } + var skipApply = (isDefined(invokeApply) && !invokeApply), deferred = (skipApply ? $$q : $q).defer(), promise = deferred.promise, @@ -16858,6 +16869,8 @@ function currencyFilter($locale) { * * If the input is not a number an empty string is returned. * + * If the input is an infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned. + * * @param {number|string} number Number to format. * @param {(number|string)=} fractionSize Number of decimal places to round the number to. * If this is not provided then the fraction size is computed from the current locale's number @@ -16914,16 +16927,22 @@ function numberFilter($locale) { var DECIMAL_SEP = '.'; function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - if (!isFinite(number) || isObject(number)) return ''; + if (isObject(number)) return ''; var isNegative = number < 0; number = Math.abs(number); + + var isInfinity = number === Infinity; + if (!isInfinity && !isFinite(number)) return ''; + var numStr = number + '', formatedText = '', + hasExponent = false, parts = []; - var hasExponent = false; - if (numStr.indexOf('e') !== -1) { + if (isInfinity) formatedText = '\u221e'; + + if (!isInfinity && numStr.indexOf('e') !== -1) { var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); if (match && match[2] == '-' && match[3] > fractionSize + 1) { number = 0; @@ -16933,7 +16952,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { } } - if (!hasExponent) { + if (!isInfinity && !hasExponent) { var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; // determine fractionSize if it is not specified @@ -17205,13 +17224,13 @@ function dateFilter($locale) { timeSetter = match[8] ? date.setUTCHours : date.setHours; if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); + tzHour = toInt(match[9] + match[10]); + tzMin = toInt(match[9] + match[11]); } - dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); - var h = int(match[4] || 0) - tzHour; - var m = int(match[5] || 0) - tzMin; - var s = int(match[6] || 0); + dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3])); + var h = toInt(match[4] || 0) - tzHour; + var m = toInt(match[5] || 0) - tzMin; + var s = toInt(match[6] || 0); var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); timeSetter.call(date, h, m, s, ms); return date; @@ -17228,14 +17247,14 @@ function dateFilter($locale) { format = format || 'mediumDate'; format = $locale.DATETIME_FORMATS[format] || format; if (isString(date)) { - date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date); + date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date); } if (isNumber(date)) { date = new Date(date); } - if (!isDate(date)) { + if (!isDate(date) || !isFinite(date.getTime())) { return date; } @@ -17342,7 +17361,8 @@ var uppercaseFilter = valueFn(uppercase); * @param {string|number} limit The length of the returned array or string. If the `limit` number * is positive, `limit` number of items from the beginning of the source array/string are copied. * If the number is negative, `limit` number of items from the end of the source array/string - * are copied. The `limit` will be trimmed if it exceeds `array.length` + * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined, + * the input will be returned unchanged. * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array * had less than `limit` elements. * @@ -17415,21 +17435,17 @@ var uppercaseFilter = valueFn(uppercase); */ function limitToFilter() { return function(input, limit) { - if (isNumber(input)) input = input.toString(); - if (!isArray(input) && !isString(input)) return input; - if (Math.abs(Number(limit)) === Infinity) { limit = Number(limit); } else { - limit = int(limit); + limit = toInt(limit); } + if (isNaN(limit)) return input; - //NaN check on limit - if (limit) { - return limit > 0 ? input.slice(0, limit) : input.slice(limit); - } else { - return isString(input) ? "" : []; - } + if (isNumber(input)) input = input.toString(); + if (!isArray(input) && !isString(input)) return input; + + return limit >= 0 ? input.slice(0, limit) : input.slice(limit); }; } @@ -17665,9 +17681,6 @@ var htmlAnchorDirective = valueFn({ compile: function(element, attr) { if (!attr.href && !attr.xlinkHref && !attr.name) { return function(scope, element) { - // If the linked element is not an anchor tag anymore, do nothing - if (element[0].nodeName.toLowerCase() !== 'a') return; - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 'xlink:href' : 'href'; @@ -18023,22 +18036,34 @@ var htmlAnchorDirective = valueFn({ var ngAttributeAliasDirectives = {}; - // boolean attrs are evaluated forEach(BOOLEAN_ATTR, function(propName, attrName) { // binding to multiple is not supported if (propName == "multiple") return; + function defaultLinkFn(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + } + var normalized = directiveNormalize('ng-' + attrName); + var linkFn = defaultLinkFn; + + if (propName === 'checked') { + linkFn = function(scope, element, attr) { + // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input + if (attr.ngModel !== attr[normalized]) { + defaultLinkFn(scope, element, attr); + } + }; + } + ngAttributeAliasDirectives[normalized] = function() { return { restrict: 'A', priority: 100, - link: function(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } + link: linkFn }; }; }); @@ -18172,8 +18197,8 @@ function FormController(element, attrs, $scope, $animate, $interpolate) { var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl; // init state - form.$error = {}; - form.$$success = {}; + form.$error = createMap(); + form.$$success = createMap(); form.$pending = undefined; form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); form.$dirty = false; @@ -18597,19 +18622,19 @@ var formDirectiveFactory = function(isNgForm) { alias = controller.$name; if (alias) { - setter(scope, null, alias, controller, alias); + setter(scope, alias, controller, alias); attr.$observe(attr.name ? 'name' : 'ngForm', function(newValue) { if (alias === newValue) return; - setter(scope, null, alias, undefined, alias); + setter(scope, alias, undefined, alias); alias = newValue; - setter(scope, null, alias, controller, alias); + setter(scope, alias, controller, alias); parentFormCtrl.$$renameControl(controller, alias); }); } formElement.on('$destroy', function() { parentFormCtrl.$removeControl(controller); if (alias) { - setter(scope, null, alias, undefined, alias); + setter(scope, alias, undefined, alias); } extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards }); @@ -18686,21 +18711,19 @@ var inputType = {
- Single word: + Single word: Required! Single word only! - text = {{example.text}}
+ text = {{text}}
myForm.input.$valid = {{myForm.input.$valid}}
myForm.input.$error = {{myForm.input.$error}}
myForm.$valid = {{myForm.$valid}}
@@ -18708,9 +18731,9 @@ var inputType = {
- var text = element(by.binding('example.text')); + var text = element(by.binding('text')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.text')); + var input = element(by.model('text')); it('should initialize to model', function() { expect(text.getText()).toContain('guest'); @@ -18772,20 +18795,18 @@ var inputType = {
Pick a date in 2013: - Required! Not a valid date! - value = {{example.value | date: "yyyy-MM-dd"}}
+ value = {{value | date: "yyyy-MM-dd"}}
myForm.input.$valid = {{myForm.input.$valid}}
myForm.input.$error = {{myForm.input.$error}}
myForm.$valid = {{myForm.$valid}}
@@ -18793,9 +18814,9 @@ var inputType = {
- var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); + var value = element(by.binding('value | date: "yyyy-MM-dd"')); var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('example.value')); + var input = element(by.model('value')); // currently protractor/webdriver does not support // sending keys to all known HTML5 input controls @@ -18865,20