From 6448bd281b26e0e85b465695dbeee01c70b3515a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 4 Oct 2014 19:51:40 +0200 Subject: update angular --- js/vendor/angular/.bower.json | 8 +- js/vendor/angular/angular.js | 474 ++++++++++++++++++++++++---------- js/vendor/angular/angular.min.js | 470 ++++++++++++++++----------------- js/vendor/angular/angular.min.js.gzip | Bin 39789 -> 44238 bytes js/vendor/angular/angular.min.js.map | 4 +- js/vendor/angular/bower.json | 2 +- 6 files changed, 583 insertions(+), 375 deletions(-) (limited to 'js/vendor/angular') diff --git a/js/vendor/angular/.bower.json b/js/vendor/angular/.bower.json index c62199eb3..66af47a13 100644 --- a/js/vendor/angular/.bower.json +++ b/js/vendor/angular/.bower.json @@ -1,14 +1,14 @@ { "name": "angular", - "version": "1.3.0-rc.3", + "version": "1.3.0-rc.4", "main": "./angular.js", "dependencies": {}, "homepage": "https://github.com/angular/bower-angular", - "_release": "1.3.0-rc.3", + "_release": "1.3.0-rc.4", "_resolution": { "type": "version", - "tag": "v1.3.0-rc.3", - "commit": "b35bc522b2bcc4258994d6738e3f7ad91e42cdc0" + "tag": "v1.3.0-rc.4", + "commit": "9086c430b6c8aef6d3a2d7e3542c9641413977e8" }, "_source": "git://github.com/angular/bower-angular.git", "_target": "~1.3.*", diff --git a/js/vendor/angular/angular.js b/js/vendor/angular/angular.js index ff96d85ea..f91161493 100644 --- a/js/vendor/angular/angular.js +++ b/js/vendor/angular/angular.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.3.0-rc.3 + * @license AngularJS v1.3.0-rc.4 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -71,7 +71,7 @@ function minErr(module, ErrorConstructor) { return match; }); - message = message + '\nhttp://errors.angularjs.org/1.3.0-rc.3/' + + message = message + '\nhttp://errors.angularjs.org/1.3.0-rc.4/' + (module ? module + '/' : '') + code; for (i = 2; i < arguments.length; i++) { message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' + @@ -2112,11 +2112,11 @@ function setupModuleLoader(window) { * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". */ var version = { - full: '1.3.0-rc.3', // all of these placeholder strings will be replaced by grunt's + full: '1.3.0-rc.4', // all of these placeholder strings will be replaced by grunt's major: 1, // package task minor: 3, dot: 0, - codeName: 'aggressive-pacifism' + codeName: 'unicorn-hydrafication' }; @@ -4653,8 +4653,6 @@ function Browser(window, document, $log, $sniffer) { if (replace) history.replaceState(null, '', url); else { history.pushState(null, '', url); - // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462 - baseElement.attr('href', baseElement.attr('href')); } } else { newLocation = url; @@ -5495,8 +5493,11 @@ function $TemplateCacheProvider() { * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. + * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass * `null` to the `link` fn if not found. + * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass + * `null` to the `link` fn if not found. * * * #### `controllerAs` @@ -5577,13 +5578,20 @@ function $TemplateCacheProvider() { * compile the content of the element and make it available to the directive. * Typically used with {@link ng.directive:ngTransclude * ngTransclude}. The advantage of transclusion is that the linking function receives a - * transclusion function which is pre-bound to the correct scope. In a typical setup the widget - * creates an `isolate` scope, but the transclusion is not a child, but a sibling of the `isolate` - * scope. This makes it possible for the widget to have private state, and the transclusion to - * be bound to the parent (pre-`isolate`) scope. + * transclusion function which is pre-bound to the scope of the position in the DOM from where + * it was taken. + * + * In a typical setup the widget creates an `isolate` scope, but the transcluded + * content has its own **transclusion scope**. While the **transclusion scope** is owned as a child, + * by the **isolate scope**, it prototypically inherits from the original scope from where the + * transcluded content was taken. * - * * `true` - transclude the content of the directive. - * * `'element'` - transclude the whole element including any directives defined at lower priority. + * This makes it possible for the widget to have private state, and the transclusion to + * be bound to the original (pre-`isolate`) scope. + * + * * `true` - transclude the content (i.e. the child nodes) of the directive's element. + * * `'element'` - transclude the whole of the directive's element including any directives on this + * element that defined at a lower priority than this directive. * *
* **Note:** When testing an element transclude directive you must not place the directive at the root of the @@ -5687,7 +5695,6 @@ function $TemplateCacheProvider() { * It is safe to do DOM transformation in the post-linking function on elements that are not waiting * for their async templates to be resolved. * - * * ### Attributes * * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the @@ -5725,7 +5732,7 @@ function $TemplateCacheProvider() { * } * ``` * - * Below is an example using `$compileProvider`. + * ## Example * *
* **Note**: Typically directives are registered with `module.directive`. The example below is @@ -5850,7 +5857,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { Suffix = 'Directive', COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/, CLASS_DIRECTIVE_REGEXP = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/, - ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'); + ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), + REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes // The assumption is that future DOM event attribute names will begin with @@ -6155,10 +6163,44 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { nodeName = nodeName_(this.$$element); - // sanitize a[href] and img[src] values if ((nodeName === 'a' && key === 'href') || (nodeName === 'img' && key === 'src')) { + // sanitize a[href] and img[src] values this[key] = value = $$sanitizeUri(value, key === 'src'); + } else if (nodeName === 'img' && key === 'srcset') { + // sanitize img[srcset] values + var result = ""; + + // first check if there are spaces because it's not the same pattern + var trimmedSrcset = trim(value); + // ( 999x ,| 999w ,| ,|, ) + var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; + var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; + + // split srcset into tuple of uri and descriptor except for the last item + var rawUris = trimmedSrcset.split(pattern); + + // for each tuples + var nbrUrisWith2parts = Math.floor(rawUris.length / 2); + for (var i=0; i ``` - */ + * @example + // Note: the suffix `.csp` in the example name triggers + // csp mode in our http server! + + +
+
+ + + {{ctrl.counter}} + +
+ +
+ + + {{ctrl.evilError}} + +
+
+
+ + angular.module('cspExample', []) + .controller('MainController', function() { + this.counter = 0; + this.inc = function() { + this.counter++; + }; + this.evil = function() { + // jshint evil:true + try { + eval('1+2'); + } catch (e) { + this.evilError = e.message; + } + }; + }); + + + var util, webdriver; + + var incBtn = element(by.id('inc')); + var counter = element(by.id('counter')); + var evilBtn = element(by.id('evil')); + var evilError = element(by.id('evilError')); + + function getAndClearSevereErrors() { + return browser.manage().logs().get('browser').then(function(browserLog) { + return browserLog.filter(function(logEntry) { + return logEntry.level.value > webdriver.logging.Level.WARNING.value; + }); + }); + } + + function clearErrors() { + getAndClearSevereErrors(); + } + + function expectNoErrors() { + getAndClearSevereErrors().then(function(filteredLog) { + expect(filteredLog.length).toEqual(0); + if (filteredLog.length) { + console.log('browser console errors: ' + util.inspect(filteredLog)); + } + }); + } + + function expectError(regex) { + getAndClearSevereErrors().then(function(filteredLog) { + var found = false; + filteredLog.forEach(function(log) { + if (log.message.match(regex)) { + found = true; + } + }); + if (!found) { + throw new Error('expected an error that matches ' + regex); + } + }); + } + + beforeEach(function() { + util = require('util'); + webdriver = require('protractor/node_modules/selenium-webdriver'); + }); + + // For now, we only test on Chrome, + // as Safari does not load the page with Protractor's injected scripts, + // and Firefox webdriver always disables content security policy (#6358) + if (browser.params.browser !== 'chrome') { + return; + } + + it('should not report errors when the page is loaded', function() { + // clear errors so we are not dependent on previous tests + clearErrors(); + // Need to reload the page as the page is already loaded when + // we come here + browser.driver.getCurrentUrl().then(function(url) { + browser.get(url); + }); + expectNoErrors(); + }); + + it('should evaluate expressions', function() { + expect(counter.getText()).toEqual('0'); + incBtn.click(); + expect(counter.getText()).toEqual('1'); + expectNoErrors(); + }); + + it('should throw and report an error when using "eval"', function() { + evilBtn.click(); + expect(evilError.getText()).toMatch(/Content Security Policy/); + expectError(/Content Security Policy/); + }); + +
+ */ // ngCsp is not implemented as a proper directive any more, because we need it be processed while we // bootstrap the system (before $parse is instantiated), for this reason we just have @@ -24600,6 +24809,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) { id: option.id, selected: option.selected }); + selectCtrl.addOption(option.label, element); if (lastElement) { lastElement.after(element); } else { @@ -24611,7 +24821,9 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) { // remove any excessive OPTIONs in a group index++; // increment since the existingOptions[0] is parent element not OPTION while(existingOptions.length > index) { - existingOptions.pop().element.remove(); + option = existingOptions.pop(); + selectCtrl.removeOption(option.label); + option.element.remove(); } } // remove any excessive OPTGROUPs from select @@ -24647,11 +24859,7 @@ var optionDirective = ['$interpolate', function($interpolate) { selectCtrl = parent.data(selectCtrlName) || parent.parent().data(selectCtrlName); // in case we are in optgroup - if (selectCtrl && selectCtrl.databound) { - // For some reason Opera defaults to true and if not overridden this messes up the repeater. - // We don't want the view to drive the initialization of the model anyway. - element.prop('selected', false); - } else { + if (!selectCtrl || !selectCtrl.databound) { selectCtrl = nullSelectCtrl; } diff --git a/js/vendor/angular/angular.min.js b/js/vendor/angular/angular.min.js index dae7873ec..530a6996b 100644 --- a/js/vendor/angular/angular.min.js +++ b/js/vendor/angular/angular.min.js @@ -1,242 +1,242 @@ /* - AngularJS v1.3.0-rc.3 + AngularJS v1.3.0-rc.4 (c) 2010-2014 Google, Inc. http://angularjs.org License: MIT */ -(function(O,Y,s){'use strict';function Q(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.3.0-rc.3/"+(b?b+"/":"")+a;for(a=1;a").append(b).html();try{return 3===b[0].nodeType?R(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+ -R(b)})}catch(d){return R(c)}}function gc(b){try{return decodeURIComponent(b)}catch(a){}}function hc(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=gc(c[0]),x(d)&&(b=x(c[1])?gc(c[1]):!0,Ab.call(a,d)?M(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Bb(b){var a=[];r(b,function(b,d){M(b)?r(b,function(b){a.push(Ca(d,!0)+(!0===b?"":"="+Ca(b,!0)))}):a.push(Ca(d,!0)+(!0===b?"":"="+Ca(b,!0)))});return a.length?a.join("&"):""}function gb(b){return Ca(b, -!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ca(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function wd(b,a){var c,d,e=hb.length;b=D(b);for(d=0;d/,">"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng"); -d=Cb(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;O&&e.test(O.name)&&(c.debugInfoEnabled=!0,O.name=O.name.replace(e,""));if(O&&!f.test(O.name))return d();O.name=O.name.replace(f,"");Da.resumeBootstrap=function(b){r(b,function(b){a.push(b)});d()}}function yd(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name;O.location.reload()}function zd(b){return Da.element(b).injector().get("$$testability")} -function Db(b,a){a=a||"_";return b.replace(Ad,function(b,d){return(d?a:"")+b.toLowerCase()})}function Bd(){var b;jc||((ma=O.jQuery)&&ma.fn.on?(D=ma,v(ma.fn,{scope:Ha.scope,isolateScope:Ha.isolateScope,controller:Ha.controller,injector:Ha.injector,inheritedData:Ha.inheritedData}),b=ma.cleanData,ma.cleanData=function(a){var c;if(Eb)Eb=!1;else for(var d=0,e;null!=(e=a[d]);d++)(c=ma._data(e,"events"))&&c.$destroy&&ma(e).triggerHandler("$destroy");b(a)}):D=T,Da.element=D,jc=!0)}function Fb(b,a,c){if(!b)throw Sa("areq", -a||"?",c||"required");return b}function ib(b,a,c){c&&M(b)&&(b=b[b.length-1]);Fb(F(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ia(b,a){if("hasOwnProperty"===b)throw Sa("badname",a);}function kc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g")+d[2];for(d=d[0];d--;)c=c.lastChild;f=fb(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)}); -return e}function T(b){if(b instanceof T)return b;var a;C(b)&&(b=ca(b),a=!0);if(!(this instanceof T)){if(a&&"<"!=b.charAt(0))throw Hb("nosel");return new T(b)}if(a){a=Y;var c;b=(c=Ue.exec(b))?[a.createElement(c[1])]:(c=uc(b,a))?c.childNodes:[]}vc(this,b)}function Ib(b){return b.cloneNode(!0)}function nb(b,a){a||ob(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d 4096 bytes)!"));else{if(k.cookie!==L)for(L=k.cookie,d=L.split("; "),K={},f=0;fl&&this.remove(q.key),b},get:function(a){if(l").parent()[0])});var f=K(a,b,a,c,d,e);X.$$addScopeClass(a);var h=null,g=a,k;return function(b,c,d,e,m){Fb(b,"scope");h||(h=(m=m&&m[0])?"foreignobject"!==pa(m)&&m.toString().match(/SVG/)?"svg":"html":"html");"html"!==h&&a[0]!==k&&(g=D(Nb(h,D("
").append(a).html())));k=a[0];m=c?Ha.clone.call(g): -g;if(d)for(var q in d)m.data("$"+q+"Controller",d[q].instance);X.$$addScopeInfo(m,b);c&&c(m,b);f&&f(b,m,m,e);return m}}function K(a,b,c,d,e,f){function h(a,c,d,e){var f,k,m,q,n,p,y;if(u)for(y=Array(c.length),q=0;qI.priority)break;if(W=I.scope)I.templateUrl||(S(W)?(Q("new/isolated scope",B||G,I,v),B=I):Q("new/isolated scope",B,I,v)),G=G||I;ka=I.name;!I.templateUrl&&I.controller&&(W=I.controller,A=A||{},Q("'"+ka+"' controller",A[ka],I,v),A[ka]=I);if(W=I.transclude)z=!0,I.$$tlb||(Q("transclusion",$,I,v),$=I),"element"==W?(w=!0,K=I.priority,W=v,v=e.$$element=D(Y.createComment(" "+ka+": "+e[ka]+ -" ")),d=v[0],fa(g,Ta.call(W,0),d),ya=X(W,f,K,h&&h.name,{nonTlbTranscludeDirective:$})):(W=D(Ib(d)).contents(),v.empty(),ya=X(W,f));if(I.template)if(V=!0,Q("template",L,I,v),L=I,W=F(I.template)?I.template(v,e):I.template,W=Z(W),I.replace){h=I;W=Gb.test(W)?D(Nb(I.templateNamespace,ca(W))):[];d=W[0];if(1!=W.length||1!==d.nodeType)throw ja("tplrt",ka,"");fa(g,v,d);xa={$attr:{}};W=P(d,[],xa);var aa=a.splice(R+1,a.length-(R+1));B&&tb(W);a=a.concat(W).concat(aa);x(e,xa);xa=a.length}else v.html(W);if(I.templateUrl)V= -!0,Q("template",L,I,v),L=I,I.replace&&(h=I),H=bf(a.splice(R,a.length-R),v,e,g,z&&ya,k,m,{controllerDirectives:A,newIsolateScopeDirective:B,templateDirective:L,nonTlbTranscludeDirective:$}),xa=a.length;else if(I.compile)try{O=I.compile(v,e,ya),F(O)?y(null,O,T,Pb):O&&y(O.pre,O.post,T,Pb)}catch(ba){c(ba,ta(v))}I.terminal&&(H.terminal=!0,K=Math.max(K,I.priority))}H.scope=G&&!0===G.scope;H.transcludeOnThisElement=z;H.elementTranscludeOnThisElement=w;H.templateOnThisElement=V;H.transclude=ya;n.hasElementTranscludeDirective= -w;return H}function tb(a){for(var b=0,c=a.length;bu.priority)&&-1!=u.restrict.indexOf(f)&&(k&&(u=dc(u,{$$start:k,$$end:m})),b.push(u),h=u)}catch(t){c(t)}}return h}function x(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]), -a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(B(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function bf(a,b,c,d,e,f,g,h){var k=[],q,n,u=b[0],p=a.sh