angular-rails-engine 1.2.5.0 → 1.2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +1 -1
- data/app/assets/javascripts/angular/angular-animate.js +461 -195
- data/app/assets/javascripts/angular/angular-animate.min.js +23 -18
- data/app/assets/javascripts/angular/angular-cookies.js +1 -1
- data/app/assets/javascripts/angular/angular-cookies.min.js +2 -1
- data/app/assets/javascripts/angular/angular-loader.js +2 -2
- data/app/assets/javascripts/angular/angular-loader.min.js +3 -2
- data/app/assets/javascripts/angular/angular-mocks.js +54 -34
- data/app/assets/javascripts/angular/angular-resource.js +36 -5
- data/app/assets/javascripts/angular/angular-resource.min.js +9 -8
- data/app/assets/javascripts/angular/angular-route.js +25 -15
- data/app/assets/javascripts/angular/angular-route.min.js +10 -9
- data/app/assets/javascripts/angular/angular-sanitize.js +35 -32
- data/app/assets/javascripts/angular/angular-sanitize.min.js +3 -2
- data/app/assets/javascripts/angular/angular-scenario.js +1472 -966
- data/app/assets/javascripts/angular/angular-touch.js +1 -1
- data/app/assets/javascripts/angular/angular-touch.min.js +2 -1
- data/app/assets/javascripts/angular/angular.js +1470 -965
- data/app/assets/javascripts/angular/angular.min.js +200 -196
- data/app/assets/stylesheets/angular/angular-csp.css +18 -0
- data/gem-public_cert.pem +11 -10
- data/lib/angular-rails-engine.rb +1 -1
- data/lib/angular-rails-engine/version.rb +1 -1
- metadata +14 -13
- metadata.gz.sig +0 -0
- data/app/assets/stylesheets/angular-csp.css +0 -24
@@ -1,22 +1,27 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
2
|
+
AngularJS v1.2.13
|
3
3
|
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(
|
7
|
-
|
8
|
-
(
|
9
|
-
a
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
""
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
function
|
20
|
-
|
21
|
-
"
|
22
|
-
b;
|
6
|
+
(function(z,f,T){'use strict';f.module("ngAnimate",["ng"]).factory("$$animateReflow",["$window","$timeout","$document",function(f,h,d){var n=f.requestAnimationFrame||f.webkitRequestAnimationFrame||function(d){return h(d,10,!1)},w=f.cancelAnimationFrame||f.webkitCancelAnimationFrame||function(d){return h.cancel(d)};return function(d){var f=n(function(){d()});return function(){w(f)}}}]).factory("$$asyncQueueBuffer",["$timeout",function(f){var h,d=[];return function(n){f.cancel(h);d.push(n);h=f(function(){for(var f=
|
7
|
+
0;f<d.length;f++)d[f]();d=[]},0,!1)}}]).config(["$provide","$animateProvider",function($,h){function d(d){for(var f=0;f<d.length;f++){var l=d[f];if(l.nodeType==da)return l}}function n(l){return f.element(d(l))}var w=f.noop,D=f.forEach,ia=h.$$selectors,da=1,l="$$ngAnimateState",U="ng-animate",s={running:!0};$.decorator("$animate",["$delegate","$injector","$sniffer","$rootElement","$$asyncQueueBuffer","$rootScope","$document",function(x,z,ca,F,J,B,T){function V(a){if(a){var c=[],e={};a=a.substr(1).split(".");
|
8
|
+
(ca.transitions||ca.animations)&&a.push("");for(var A=0;A<a.length;A++){var d=a[A],f=ia[d];f&&!e[d]&&(c.push(z.get(f)),e[d]=!0)}return c}}function t(a,c,e,d,k,C,s){function t(b){var g=e.data(l);b=b||!g||!g.active[c]||m&&g.active[c].event!=a;K();!0===b?G():(g.active[c].done=G,n(L,"after",G))}function n(b,g,ja){"after"==g?H():x();var fa=g+"End";D(b,function(d,f){var A=function(){a:{var a=g+"Complete",c=b[f];c[a]=!0;(c[fa]||w)();for(c=0;c<b.length;c++)if(!b[c][a])break a;ja()}};"before"!=g||"enter"!=
|
9
|
+
a&&"move"!=a?d[g]?d[fa]=F?d[g](e,E,z,A):m?d[g](e,c,A):d[g](e,A):A():A()})}function h(b){var g="$animate:"+b;u&&(u[g]&&0<u[g].length)&&J(function(){e.triggerHandler(g,{event:a,className:c})})}function x(){h("before")}function H(){h("after")}function B(){h("close");s&&J(function(){s()})}function K(){K.hasBeenRun||(K.hasBeenRun=!0,C())}function G(){if(!G.hasBeenRun){G.hasBeenRun=!0;var b=e.data(l);b&&(m?M(e,c):(J(function(){var b=e.data(l)||{};Q==b.index&&M(e,c,a)}),e.data(l,b)));B()}}var E,z,F="setClass"==
|
10
|
+
a;F&&(E=c[0],z=c[1],c=E+" "+z);var v,y=e[0];y&&(v=y.className,v=v+" "+c);if(y&&W(v)){var u=f.element._data(y),u=u&&u.events,y=(" "+v).replace(/\s+/g,".");d||(d=k?k.parent():e.parent());var q=V(y),m="addClass"==a||"removeClass"==a||F,I=e.data(l)||{};k=I.active||{};y=I.totalActive||0;v=I.last;if(R(e,d)||0===q.length)K(),x(),H(),G();else{var L=[];m&&(I.disabled||v&&!v.classBased)||D(q,function(b){if(!b.allowCancel||b.allowCancel(e,a,c)){var g=b[a];"leave"==a?(b=g,g=null):b=b["before"+a.charAt(0).toUpperCase()+
|
11
|
+
a.substr(1)];L.push({before:b,after:g})}});if(0===L.length)K(),x(),H(),B();else{d=!1;if(0<y){q=[];if(m)"setClass"==v.event?(q.push(v),M(e,c)):k[c]&&(N=k[c],N.event==a?d=!0:(q.push(N),M(e,c)));else if("leave"==a&&k["ng-leave"])d=!0;else{for(var N in k)q.push(k[N]),M(e,N);k={};y=0}0<q.length&&f.forEach(q,function(b){(b.done||w)(!0);X(b.animations)})}!m||(F||d)||(d="addClass"==a==e.hasClass(c));if(d)x(),H(),B();else{e.addClass(U);var Q=S++;v={classBased:m,event:a,animations:L,done:t};y++;k[c]=v;e.data(l,
|
12
|
+
{last:v,active:k,index:Q,totalActive:y});n(L,"before",t)}}}}else K(),x(),H(),B()}function Y(a){a=d(a);D(a.querySelectorAll("."+U),function(a){a=f.element(a);(a=a.data(l))&&a.active&&f.forEach(a.active,function(a){(a.done||w)(!0);X(a.animations)})})}function X(a){D(a,function(a){a.beforeComplete||(a.beforeEnd||w)(!0);a.afterComplete||(a.afterEnd||w)(!0)})}function M(a,c){if(d(a)==d(F))s.disabled||(s.running=!1,s.structural=!1);else if(c){var e=a.data(l)||{},f=!0===c;!f&&(e.active&&e.active[c])&&(e.totalActive--,
|
13
|
+
delete e.active[c]);if(f||!e.totalActive)a.removeClass(U),a.removeData(l)}}function R(a,c){if(s.disabled)return!0;if(d(a)==d(F))return s.disabled||s.running;do{if(0===c.length)break;var e=d(c)==d(F),f=e?s:c.data(l),f=f&&(!!f.disabled||f.running||0<f.totalActive);if(e||f)return f;if(e)break}while(c=c.parent());return!0}var S=0;F.data(l,s);B.$$postDigest(function(){B.$$postDigest(function(){s.running=!1})});var Z=h.classNameFilter(),W=Z?function(a){return Z.test(a)}:function(){return!0};return{enter:function(a,
|
14
|
+
c,e,d){this.enabled(!1,a);x.enter(a,c,e);B.$$postDigest(function(){a=n(a);t("enter","ng-enter",a,c,e,w,d)})},leave:function(a,c){Y(a);this.enabled(!1,a);B.$$postDigest(function(){a=n(a);t("leave","ng-leave",a,null,null,function(){x.leave(a)},c)})},move:function(a,c,e,d){Y(a);this.enabled(!1,a);x.move(a,c,e);B.$$postDigest(function(){a=n(a);t("move","ng-move",a,c,e,w,d)})},addClass:function(a,c,d){a=n(a);t("addClass",c,a,null,null,function(){x.addClass(a,c)},d)},removeClass:function(a,c,d){a=n(a);
|
15
|
+
t("removeClass",c,a,null,null,function(){x.removeClass(a,c)},d)},setClass:function(a,c,d,f){a=n(a);t("setClass",[c,d],a,null,null,function(){x.setClass(a,c,d)},f)},enabled:function(a,c){switch(arguments.length){case 2:if(a)M(c);else{var d=c.data(l)||{};d.disabled=!0;c.data(l,d)}break;case 1:s.disabled=!a;break;default:a=!s.disabled}return!!a}}}]);h.register("",["$window","$sniffer","$timeout","$$animateReflow",function(l,s,h,n){function J(b,g){I&&I();m.push(g);I=n(function(){D(m,function(b){b()});
|
16
|
+
m=[];I=null;u={}})}function B(b,g){var a=Date.now()+1E3*g;if(!(a<=N)){h.cancel(L);var c=d(b);b=f.element(c);Q.push(b);N=a;L=h(function(){U(Q);Q=[]},g,!1)}}function U(b){D(b,function(b){(b=b.data(E))&&(b.closeAnimationFn||w)()})}function V(b,g){var a=g?u[g]:null;if(!a){var c=0,d=0,f=0,e=0,k,p,r,h;D(b,function(b){if(b.nodeType==da){b=l.getComputedStyle(b)||{};r=b[O+ea];c=Math.max(t(r),c);h=b[O+H];k=b[O+ha];d=Math.max(t(k),d);p=b[P+ha];e=Math.max(t(p),e);var g=t(b[P+ea]);0<g&&(g*=parseInt(b[P+K],10)||
|
17
|
+
1);f=Math.max(g,f)}});a={total:0,transitionPropertyStyle:h,transitionDurationStyle:r,transitionDelayStyle:k,transitionDelay:d,transitionDuration:c,animationDelayStyle:p,animationDelay:e,animationDuration:f};g&&(u[g]=a)}return a}function t(b){var g=0;b=f.isString(b)?b.split(/\s*,\s*/):[];D(b,function(b){g=Math.max(parseFloat(b)||0,g)});return g}function Y(b){var g=b.parent(),a=g.data(G);a||(g.data(G,++q),a=q);return a+"-"+d(b).className}function X(b,g,a,c){var e=Y(g),k=e+" "+a,l=u[k]?++u[k].total:
|
18
|
+
0,h={};if(0<l){var p=a+"-stagger",h=e+" "+p;(e=!u[h])&&g.addClass(p);h=V(g,h);e&&g.removeClass(p)}c=c||function(b){return b()};g.addClass(a);var p=g.data(E)||{},r=c(function(){return V(g,k)});c=r.transitionDuration;e=r.animationDuration;if(0===c&&0===e)return g.removeClass(a),!1;g.data(E,{running:p.running||0,itemIndex:l,stagger:h,timings:r,closeAnimationFn:f.noop});b=0<p.running||"setClass"==b;0<c&&M(g,a,b);0<e&&(d(g).style[P]="none 0s");return!0}function M(b,a,c){"ng-enter"!=a&&("ng-move"!=a&&"ng-leave"!=
|
19
|
+
a)&&c?b.addClass(ga):d(b).style[O+H]="none"}function R(b,a){var c=O+H,e=d(b);e.style[c]&&0<e.style[c].length&&(e.style[c]="");b.removeClass(ga)}function S(b){var a=P;b=d(b);b.style[a]&&0<b.style[a].length&&(b.style[a]="")}function Z(b,a,c,e){function f(b){a.off(w,k);a.removeClass(l);A(a,c);b=d(a);for(var e in q)b.style.removeProperty(q[e])}function k(b){b.stopPropagation();var a=b.originalEvent||b;b=a.$manualTimeStamp||a.timeStamp||Date.now();a=parseFloat(a.elapsedTime.toFixed($));Math.max(b-x,0)>=
|
20
|
+
u&&a>=s&&e()}var h=d(a);b=a.data(E);if(-1!=h.className.indexOf(c)&&b){var l="";D(c.split(" "),function(b,a){l+=(0<a?" ":"")+b+"-active"});var p=b.stagger,r=b.timings,n=b.itemIndex,s=Math.max(r.transitionDuration,r.animationDuration),t=Math.max(r.transitionDelay,r.animationDelay),u=t*y,x=Date.now(),w=ba+" "+aa,m="",q=[];if(0<r.transitionDuration){var z=r.transitionPropertyStyle;-1==z.indexOf("all")&&(m+=C+"transition-property: "+z+";",m+=C+"transition-duration: "+r.transitionDurationStyle+";",q.push(C+
|
21
|
+
"transition-property"),q.push(C+"transition-duration"))}0<n&&(0<p.transitionDelay&&0===p.transitionDuration&&(m+=C+"transition-delay: "+W(r.transitionDelayStyle,p.transitionDelay,n)+"; ",q.push(C+"transition-delay")),0<p.animationDelay&&0===p.animationDuration&&(m+=C+"animation-delay: "+W(r.animationDelayStyle,p.animationDelay,n)+"; ",q.push(C+"animation-delay")));0<q.length&&(r=h.getAttribute("style")||"",h.setAttribute("style",r+" "+m));a.on(w,k);a.addClass(l);b.closeAnimationFn=function(){f();
|
22
|
+
e()};h=(n*(Math.max(p.animationDelay,p.transitionDelay)||0)+(t+s)*v)*y;b.running++;B(a,h);return f}e()}function W(b,a,c){var d="";D(b.split(","),function(b,e){d+=(0<e?",":"")+(c*a+parseInt(b,10))+"s"});return d}function a(b,a,c,d){if(X(b,a,c,d))return function(b){b&&A(a,c)}}function c(b,a,c,d){if(a.data(E))return Z(b,a,c,d);A(a,c);d()}function e(b,g,d,e){var f=a(b,g,d);if(f){var h=f;J(g,function(){R(g,d);S(g);h=c(b,g,d,e)});return function(b){(h||w)(b)}}e()}function A(b,a){b.removeClass(a);var c=
|
23
|
+
b.data(E);c&&(c.running&&c.running--,c.running&&0!==c.running||b.removeData(E))}function k(b,a){var c="";b=f.isArray(b)?b:b.split(/\s+/);D(b,function(b,d){b&&0<b.length&&(c+=(0<d?" ":"")+b+a)});return c}var C="",O,aa,P,ba;z.ontransitionend===T&&z.onwebkittransitionend!==T?(C="-webkit-",O="WebkitTransition",aa="webkitTransitionEnd transitionend"):(O="transition",aa="transitionend");z.onanimationend===T&&z.onwebkitanimationend!==T?(C="-webkit-",P="WebkitAnimation",ba="webkitAnimationEnd animationend"):
|
24
|
+
(P="animation",ba="animationend");var ea="Duration",H="Property",ha="Delay",K="IterationCount",G="$$ngAnimateKey",E="$$ngAnimateCSS3Data",ga="ng-animate-block-transitions",$=3,v=1.5,y=1E3,u={},q=0,m=[],I,L=null,N=0,Q=[];return{enter:function(b,a){return e("enter",b,"ng-enter",a)},leave:function(b,a){return e("leave",b,"ng-leave",a)},move:function(a,c){return e("move",a,"ng-move",c)},beforeSetClass:function(b,c,d,e){var f=k(d,"-remove")+" "+k(c,"-add"),h=a("setClass",b,f,function(a){var e=b.attr("class");
|
25
|
+
b.removeClass(d);b.addClass(c);a=a();b.attr("class",e);return a});if(h)return J(b,function(){R(b,f);S(b);e()}),h;e()},beforeAddClass:function(b,c,d){var e=a("addClass",b,k(c,"-add"),function(a){b.addClass(c);a=a();b.removeClass(c);return a});if(e)return J(b,function(){R(b,c);S(b);d()}),e;d()},setClass:function(a,d,e,f){e=k(e,"-remove");d=k(d,"-add");return c("setClass",a,e+" "+d,f)},addClass:function(a,d,e){return c("addClass",a,k(d,"-add"),e)},beforeRemoveClass:function(b,c,d){var e=a("removeClass",
|
26
|
+
b,k(c,"-remove"),function(a){var d=b.attr("class");b.removeClass(c);a=a();b.attr("class",d);return a});if(e)return J(b,function(){R(b,c);S(b);d()}),e;d()},removeClass:function(a,d,e){return c("removeClass",a,k(d,"-remove"),e)}}}])}])})(window,window.angular);
|
27
|
+
//# sourceMappingURL=angular-animate.min.js.map
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
2
|
+
AngularJS v1.2.13
|
3
3
|
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
6
|
(function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&d.$apply())})();k=!0;d.$watch(function(){var a,e,d;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)(e=c[a],f.isString(e))?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(m(e[a])?delete c[a]:c[a]=e[a])});
|
7
7
|
return c}]).factory("$cookieStore",["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular);
|
8
|
+
//# sourceMappingURL=angular-cookies.min.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.2.
|
2
|
+
* @license AngularJS v1.2.13
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -69,7 +69,7 @@ function minErr(module) {
|
|
69
69
|
return match;
|
70
70
|
});
|
71
71
|
|
72
|
-
message = message + '\nhttp://errors.angularjs.org/1.2.
|
72
|
+
message = message + '\nhttp://errors.angularjs.org/1.2.13/' +
|
73
73
|
(module ? module + '/' : '') + code;
|
74
74
|
for (i = 2; i < arguments.length; i++) {
|
75
75
|
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
|
@@ -1,8 +1,9 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
2
|
+
AngularJS v1.2.13
|
3
3
|
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(){'use strict';function d(a){return function(){var c=arguments[0],b,c="["+(a?a+":":"")+c+"] http://errors.angularjs.org/1.2.
|
6
|
+
(function(){'use strict';function d(a){return function(){var c=arguments[0],b,c="["+(a?a+":":"")+c+"] http://errors.angularjs.org/1.2.13/"+(a?a+"/":"")+c;for(b=1;b<arguments.length;b++)c=c+(1==b?"?":"&")+"p"+(b-1)+"="+encodeURIComponent("function"==typeof arguments[b]?arguments[b].toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof arguments[b]?"undefined":"string"!=typeof arguments[b]?JSON.stringify(arguments[b]):arguments[b]);return Error(c)}}(function(a){var c=d("$injector"),b=d("ng");a=a.angular||
|
7
7
|
(a.angular={});a.$$minErr=a.$$minErr||d;return a.module||(a.module=function(){var a={};return function(e,d,f){if("hasOwnProperty"===e)throw b("badname","module");d&&a.hasOwnProperty(e)&&(a[e]=null);return a[e]||(a[e]=function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return g}}if(!d)throw c("nomod",e);var b=[],h=[],k=a("$injector","invoke"),g={_invokeQueue:b,_runBlocks:h,requires:d,name:e,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide",
|
8
8
|
"service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animateProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:k,run:function(a){h.push(a);return this}};f&&k(f);return g}())}}())})(window)})(window);
|
9
|
+
//# sourceMappingURL=angular-loader.min.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.2.
|
2
|
+
* @license AngularJS v1.2.13
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -386,7 +386,7 @@ angular.mock.$LogProvider = function() {
|
|
386
386
|
*
|
387
387
|
* @example
|
388
388
|
* <pre>
|
389
|
-
* $log.
|
389
|
+
* $log.error('Some Error');
|
390
390
|
* var first = $log.error.logs.unshift();
|
391
391
|
* </pre>
|
392
392
|
*/
|
@@ -511,6 +511,7 @@ angular.mock.$IntervalProvider = function() {
|
|
511
511
|
};
|
512
512
|
|
513
513
|
$interval.cancel = function(promise) {
|
514
|
+
if(!promise) return false;
|
514
515
|
var fnIndex;
|
515
516
|
|
516
517
|
angular.forEach(repeatFns, function(fn, index) {
|
@@ -763,40 +764,40 @@ angular.mock.TzDate = function (offset, timestamp) {
|
|
763
764
|
angular.mock.TzDate.prototype = Date.prototype;
|
764
765
|
/* jshint +W101 */
|
765
766
|
|
766
|
-
angular.mock.animate = angular.module('
|
767
|
+
angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
|
767
768
|
|
768
769
|
.config(['$provide', function($provide) {
|
770
|
+
var reflowQueue = [];
|
771
|
+
|
772
|
+
$provide.value('$$animateReflow', function(fn) {
|
773
|
+
reflowQueue.push(fn);
|
774
|
+
return angular.noop;
|
775
|
+
});
|
769
776
|
|
770
777
|
$provide.decorator('$animate', function($delegate) {
|
771
778
|
var animate = {
|
772
779
|
queue : [],
|
773
780
|
enabled : $delegate.enabled,
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
if (!tick) throw new Error('No animation to be flushed');
|
778
|
-
if(tick.method !== name) {
|
779
|
-
throw new Error('The next animation is not "' + name +
|
780
|
-
'", but is "' + tick.method + '"');
|
781
|
+
triggerReflow : function() {
|
782
|
+
if(reflowQueue.length === 0) {
|
783
|
+
throw new Error('No animation reflows present');
|
781
784
|
}
|
782
|
-
|
783
|
-
|
785
|
+
angular.forEach(reflowQueue, function(fn) {
|
786
|
+
fn();
|
787
|
+
});
|
788
|
+
reflowQueue = [];
|
784
789
|
}
|
785
790
|
};
|
786
791
|
|
787
|
-
angular.forEach(
|
792
|
+
angular.forEach(
|
793
|
+
['enter','leave','move','addClass','removeClass','setClass'], function(method) {
|
788
794
|
animate[method] = function() {
|
789
|
-
var params = arguments;
|
790
795
|
animate.queue.push({
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
parent : angular.isElement(params[1]) && params[1],
|
795
|
-
after : angular.isElement(params[2]) && params[2],
|
796
|
-
fn : function() {
|
797
|
-
$delegate[method].apply($delegate, params);
|
798
|
-
}
|
796
|
+
event : method,
|
797
|
+
element : arguments[0],
|
798
|
+
args : arguments
|
799
799
|
});
|
800
|
+
$delegate[method].apply($delegate, arguments);
|
800
801
|
};
|
801
802
|
});
|
802
803
|
|
@@ -966,18 +967,18 @@ angular.mock.dump = function(object) {
|
|
966
967
|
*
|
967
968
|
* # Flushing HTTP requests
|
968
969
|
*
|
969
|
-
* The $httpBackend used in production
|
970
|
-
* If we preserved this behavior in unit testing
|
971
|
-
* hard to write,
|
970
|
+
* The $httpBackend used in production always responds to requests with responses asynchronously.
|
971
|
+
* If we preserved this behavior in unit testing we'd have to create async unit tests, which are
|
972
|
+
* hard to write, understand, and maintain. However, the testing mock can't respond
|
972
973
|
* synchronously because that would change the execution of the code under test. For this reason the
|
973
974
|
* mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending
|
974
|
-
* requests and thus
|
975
|
+
* requests and thus preserve the async api of the backend while allowing the test to execute
|
975
976
|
* synchronously.
|
976
977
|
*
|
977
978
|
*
|
978
979
|
* # Unit testing with mock $httpBackend
|
979
|
-
* The following code shows how to setup and use the mock backend
|
980
|
-
* First we create the controller under test
|
980
|
+
* The following code shows how to setup and use the mock backend when unit testing a controller.
|
981
|
+
* First we create the controller under test:
|
981
982
|
*
|
982
983
|
<pre>
|
983
984
|
// The controller code
|
@@ -1002,7 +1003,7 @@ angular.mock.dump = function(object) {
|
|
1002
1003
|
}
|
1003
1004
|
</pre>
|
1004
1005
|
*
|
1005
|
-
* Now we setup the mock backend and create the test specs
|
1006
|
+
* Now we setup the mock backend and create the test specs:
|
1006
1007
|
*
|
1007
1008
|
<pre>
|
1008
1009
|
// testing controller
|
@@ -1579,6 +1580,10 @@ function MockHttpExpectation(method, url, data, headers) {
|
|
1579
1580
|
};
|
1580
1581
|
}
|
1581
1582
|
|
1583
|
+
function createMockXhr() {
|
1584
|
+
return new MockXhr();
|
1585
|
+
}
|
1586
|
+
|
1582
1587
|
function MockXhr() {
|
1583
1588
|
|
1584
1589
|
// hack for testing $http, $httpBackend
|
@@ -1702,7 +1707,7 @@ angular.mock.$RootElementProvider = function() {
|
|
1702
1707
|
* In addition, ngMock also extends various core ng services such that they can be
|
1703
1708
|
* inspected and controlled in a synchronous manner within test code.
|
1704
1709
|
*
|
1705
|
-
* {@installModule
|
1710
|
+
* {@installModule mock}
|
1706
1711
|
*
|
1707
1712
|
* <div doc-module-components="ngMock"></div>
|
1708
1713
|
*
|
@@ -1916,12 +1921,11 @@ angular.mock.clearDataCache = function() {
|
|
1916
1921
|
};
|
1917
1922
|
|
1918
1923
|
|
1919
|
-
|
1920
1924
|
if(window.jasmine || window.mocha) {
|
1921
1925
|
|
1922
1926
|
var currentSpec = null,
|
1923
1927
|
isSpecRunning = function() {
|
1924
|
-
return currentSpec
|
1928
|
+
return !!currentSpec;
|
1925
1929
|
};
|
1926
1930
|
|
1927
1931
|
|
@@ -2082,10 +2086,24 @@ if(window.jasmine || window.mocha) {
|
|
2082
2086
|
*
|
2083
2087
|
* @param {...Function} fns any number of functions which will be injected using the injector.
|
2084
2088
|
*/
|
2089
|
+
|
2090
|
+
|
2091
|
+
|
2092
|
+
var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {
|
2093
|
+
this.message = e.message;
|
2094
|
+
this.name = e.name;
|
2095
|
+
if (e.line) this.line = e.line;
|
2096
|
+
if (e.sourceId) this.sourceId = e.sourceId;
|
2097
|
+
if (e.stack && errorForStack)
|
2098
|
+
this.stack = e.stack + '\n' + errorForStack.stack;
|
2099
|
+
if (e.stackArray) this.stackArray = e.stackArray;
|
2100
|
+
};
|
2101
|
+
ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;
|
2102
|
+
|
2085
2103
|
window.inject = angular.mock.inject = function() {
|
2086
2104
|
var blockFns = Array.prototype.slice.call(arguments, 0);
|
2087
2105
|
var errorForStack = new Error('Declaration Location');
|
2088
|
-
return isSpecRunning() ? workFn() : workFn;
|
2106
|
+
return isSpecRunning() ? workFn.call(currentSpec) : workFn;
|
2089
2107
|
/////////////////////
|
2090
2108
|
function workFn() {
|
2091
2109
|
var modules = currentSpec.$modules || [];
|
@@ -2102,7 +2120,9 @@ if(window.jasmine || window.mocha) {
|
|
2102
2120
|
injector.invoke(blockFns[i] || angular.noop, this);
|
2103
2121
|
/* jshint +W040 */
|
2104
2122
|
} catch (e) {
|
2105
|
-
if(e.stack && errorForStack)
|
2123
|
+
if (e.stack && errorForStack) {
|
2124
|
+
throw new ErrorAddingDeclarationLocationStack(e, errorForStack);
|
2125
|
+
}
|
2106
2126
|
throw e;
|
2107
2127
|
} finally {
|
2108
2128
|
errorForStack = null;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.2.
|
2
|
+
* @license AngularJS v1.2.13
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -40,7 +40,7 @@ function shallowClearAndCopy(src, dst) {
|
|
40
40
|
});
|
41
41
|
|
42
42
|
for (var key in src) {
|
43
|
-
if (src.hasOwnProperty(key) && key.
|
43
|
+
if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
|
44
44
|
dst[key] = src[key];
|
45
45
|
}
|
46
46
|
}
|
@@ -242,7 +242,7 @@ function shallowClearAndCopy(src, dst) {
|
|
242
242
|
newCard.name = "Mike Smith";
|
243
243
|
newCard.$save();
|
244
244
|
// POST: /user/123/card {number:'0123', name:'Mike Smith'}
|
245
|
-
// server returns: {id:789, number:'
|
245
|
+
// server returns: {id:789, number:'0123', name: 'Mike Smith'};
|
246
246
|
expect(newCard.id).toEqual(789);
|
247
247
|
* </pre>
|
248
248
|
*
|
@@ -277,6 +277,35 @@ function shallowClearAndCopy(src, dst) {
|
|
277
277
|
});
|
278
278
|
});
|
279
279
|
</pre>
|
280
|
+
|
281
|
+
* # Creating a custom 'PUT' request
|
282
|
+
* In this example we create a custom method on our resource to make a PUT request
|
283
|
+
* <pre>
|
284
|
+
* var app = angular.module('app', ['ngResource', 'ngRoute']);
|
285
|
+
*
|
286
|
+
* // Some APIs expect a PUT request in the format URL/object/ID
|
287
|
+
* // Here we are creating an 'update' method
|
288
|
+
* app.factory('Notes', ['$resource', function($resource) {
|
289
|
+
* return $resource('/notes/:id', null,
|
290
|
+
* {
|
291
|
+
* 'update': { method:'PUT' }
|
292
|
+
* });
|
293
|
+
* }]);
|
294
|
+
*
|
295
|
+
* // In our controller we get the ID from the URL using ngRoute and $routeParams
|
296
|
+
* // We pass in $routeParams and our Notes factory along with $scope
|
297
|
+
* app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
|
298
|
+
function($scope, $routeParams, Notes) {
|
299
|
+
* // First get a note object from the factory
|
300
|
+
* var note = Notes.get({ id:$routeParams.id });
|
301
|
+
* $id = note.id;
|
302
|
+
*
|
303
|
+
* // Now call update passing in the ID first then the object you are updating
|
304
|
+
* Notes.update({ id:$id }, note);
|
305
|
+
*
|
306
|
+
* // This will PUT /notes/ID with the note object in the request payload
|
307
|
+
* }]);
|
308
|
+
* </pre>
|
280
309
|
*/
|
281
310
|
angular.module('ngResource', ['ng']).
|
282
311
|
factory('$resource', ['$http', '$q', function($http, $q) {
|
@@ -363,7 +392,9 @@ angular.module('ngResource', ['ng']).
|
|
363
392
|
val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
|
364
393
|
if (angular.isDefined(val) && val !== null) {
|
365
394
|
encodedVal = encodeUriSegment(val);
|
366
|
-
url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"),
|
395
|
+
url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
|
396
|
+
return encodedVal + p1;
|
397
|
+
});
|
367
398
|
} else {
|
368
399
|
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
|
369
400
|
leadingSlashes, tail) {
|
@@ -377,7 +408,7 @@ angular.module('ngResource', ['ng']).
|
|
377
408
|
});
|
378
409
|
|
379
410
|
// strip trailing slashes and set the url
|
380
|
-
url = url.replace(/\/+$/, '');
|
411
|
+
url = url.replace(/\/+$/, '') || '/';
|
381
412
|
// then replace collapse `/.` if found in the last URL path segment before the query
|
382
413
|
// E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
|
383
414
|
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
|
@@ -1,12 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
2
|
+
AngularJS v1.2.13
|
3
3
|
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(H,a,
|
7
|
-
b.charAt(0)){
|
8
|
-
|
9
|
-
|
10
|
-
var
|
11
|
-
|
12
|
-
(
|
6
|
+
(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)!p.hasOwnProperty(c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&&
|
7
|
+
b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f<c&&k!==A;f++){var g=a[f];k=null!==k?k[g]:A}}else k=b;e[d]=k});return e}function e(a){return a.resource}function f(a){D(a||{},this)}var F=new c(n);l=x({},B,l);s(l,function(h,d){var c=/^(POST|PUT|PATCH)$/i.test(h.method);f[d]=function(b,d,k,w){var q={},n,l,y;switch(arguments.length){case 4:y=w,l=k;case 3:case 2:if(u(d)){if(u(b)){l=
|
8
|
+
b;y=d;break}l=d;y=k}else{q=b;n=d;l=k;break}case 1:u(b)?l=b:c?n=b:q=b;break;case 0:break;default:throw v("badargs",arguments.length);}var t=this instanceof f,m=t?n:h.isArray?[]:new f(n),z={},B=h.interceptor&&h.interceptor.response||e,C=h.interceptor&&h.interceptor.responseError||A;s(h,function(a,b){"params"!=b&&("isArray"!=b&&"interceptor"!=b)&&(z[b]=G(a))});c&&(z.data=n);F.setUrlParams(z,x({},r(n,h.params||{}),q),h.url);q=p(z).then(function(b){var d=b.data,k=m.$promise;if(d){if(a.isArray(d)!==!!h.isArray)throw v("badcfg",
|
9
|
+
h.isArray?"array":"object",a.isArray(d)?"array":"object");h.isArray?(m.length=0,s(d,function(b){m.push(new f(b))})):(D(d,m),m.$promise=k)}m.$resolved=!0;b.resource=m;return b},function(b){m.$resolved=!0;(y||E)(b);return g.reject(b)});q=q.then(function(b){var a=B(b);(l||E)(a,b.headers);return a},C);return t?q:(m.$promise=q,m.$resolved=!1,m)};f.prototype["$"+d]=function(b,a,k){u(b)&&(k=a,a=b,b={});b=f[d].call(this,b,this,a,k);return b.$promise||b}});f.bind=function(a){return t(n,x({},w,a),l)};return f}
|
10
|
+
var B={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},E=a.noop,s=a.forEach,x=a.extend,G=a.copy,u=a.isFunction;c.prototype={setUrlParams:function(c,g,l){var r=this,e=l||r.template,f,p,h=r.urlParams={};s(e.split(/\W/),function(a){if("hasOwnProperty"===a)throw v("badname");!/^\d+$/.test(a)&&(a&&RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(e))&&(h[a]=!0)});e=e.replace(/\\:/g,":");g=g||{};s(r.urlParams,function(d,c){f=g.hasOwnProperty(c)?
|
11
|
+
g[c]:r.defaults[c];a.isDefined(f)&&null!==f?(p=encodeURIComponent(f).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),e=e.replace(RegExp(":"+c+"(\\W|$)","g"),function(a,c){return p+c})):e=e.replace(RegExp("(/?):"+c+"(\\W|$)","g"),function(a,c,d){return"/"==d.charAt(0)?d:c+d})});e=e.replace(/\/+$/,"")||"/";e=e.replace(/\/\.(?=\w+($|\?))/,".");c.url=e.replace(/\/\\\./,"/.");s(g,function(a,
|
12
|
+
e){r.urlParams[e]||(c.params=c.params||{},c.params[e]=a)})}};return t}])})(window,window.angular);
|
13
|
+
//# sourceMappingURL=angular-resource.min.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license AngularJS v1.2.
|
2
|
+
* @license AngularJS v1.2.13
|
3
3
|
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -190,7 +190,7 @@ function $RouteProvider(){
|
|
190
190
|
|
191
191
|
path = path
|
192
192
|
.replace(/([().])/g, '\\$1')
|
193
|
-
.replace(/(\/)?:(\w+)([
|
193
|
+
.replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option){
|
194
194
|
var optional = option === '?' ? option : null;
|
195
195
|
var star = option === '*' ? option : null;
|
196
196
|
keys.push({ name: key, optional: !!optional });
|
@@ -350,17 +350,17 @@ function $RouteProvider(){
|
|
350
350
|
}
|
351
351
|
</file>
|
352
352
|
|
353
|
-
<file name="
|
353
|
+
<file name="protractorTest.js">
|
354
354
|
it('should load and compile correct template', function() {
|
355
|
-
element('
|
356
|
-
var content = element('.doc-example-live [ng-view]').
|
355
|
+
element(by.linkText('Moby: Ch1')).click();
|
356
|
+
var content = element(by.css('.doc-example-live [ng-view]')).getText();
|
357
357
|
expect(content).toMatch(/controller\: ChapterCntl/);
|
358
358
|
expect(content).toMatch(/Book Id\: Moby/);
|
359
359
|
expect(content).toMatch(/Chapter Id\: 1/);
|
360
360
|
|
361
|
-
element('
|
362
|
-
|
363
|
-
content = element('.doc-example-live [ng-view]').
|
361
|
+
element(by.partialLinkText('Scarlet')).click();
|
362
|
+
|
363
|
+
content = element(by.css('.doc-example-live [ng-view]')).getText();
|
364
364
|
expect(content).toMatch(/controller\: BookCntl/);
|
365
365
|
expect(content).toMatch(/Book Id\: Scarlet/);
|
366
366
|
});
|
@@ -375,7 +375,7 @@ function $RouteProvider(){
|
|
375
375
|
* @eventType broadcast on root scope
|
376
376
|
* @description
|
377
377
|
* Broadcasted before a route change. At this point the route services starts
|
378
|
-
* resolving all of the dependencies needed for the route change to
|
378
|
+
* resolving all of the dependencies needed for the route change to occur.
|
379
379
|
* Typically this involves fetching the view template as well as any dependencies
|
380
380
|
* defined in `resolve` route property. Once all of the dependencies are resolved
|
381
381
|
* `$routeChangeSuccess` is fired.
|
@@ -669,6 +669,15 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
|
|
669
669
|
*
|
670
670
|
* @scope
|
671
671
|
* @priority 400
|
672
|
+
* @param {string=} onload Expression to evaluate whenever the view updates.
|
673
|
+
*
|
674
|
+
* @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
|
675
|
+
* $anchorScroll} to scroll the viewport after the view is updated.
|
676
|
+
*
|
677
|
+
* - If the attribute is not set, disable scrolling.
|
678
|
+
* - If the attribute is set without value, enable scrolling.
|
679
|
+
* - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
|
680
|
+
* as an expression yields a truthy value.
|
672
681
|
* @example
|
673
682
|
<example module="ngViewExample" deps="angular-route.js" animations="true">
|
674
683
|
<file name="index.html">
|
@@ -785,16 +794,17 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
|
|
785
794
|
}
|
786
795
|
</file>
|
787
796
|
|
788
|
-
<file name="
|
797
|
+
<file name="protractorTest.js">
|
789
798
|
it('should load and compile correct template', function() {
|
790
|
-
element('
|
791
|
-
var content = element('.doc-example-live [ng-view]').
|
799
|
+
element(by.linkText('Moby: Ch1')).click();
|
800
|
+
var content = element(by.css('.doc-example-live [ng-view]')).getText();
|
792
801
|
expect(content).toMatch(/controller\: ChapterCntl/);
|
793
802
|
expect(content).toMatch(/Book Id\: Moby/);
|
794
803
|
expect(content).toMatch(/Chapter Id\: 1/);
|
795
804
|
|
796
|
-
element('
|
797
|
-
|
805
|
+
element(by.partialLinkText('Scarlet')).click();
|
806
|
+
|
807
|
+
content = element(by.css('.doc-example-live [ng-view]')).getText();
|
798
808
|
expect(content).toMatch(/controller\: BookCntl/);
|
799
809
|
expect(content).toMatch(/Book Id\: Scarlet/);
|
800
810
|
});
|
@@ -842,7 +852,7 @@ function ngViewFactory( $route, $anchorScroll, $animate) {
|
|
842
852
|
var locals = $route.current && $route.current.locals,
|
843
853
|
template = locals && locals.$template;
|
844
854
|
|
845
|
-
if (template) {
|
855
|
+
if (angular.isDefined(template)) {
|
846
856
|
var newScope = scope.$new();
|
847
857
|
var current = $route.current;
|
848
858
|
|