Browse files

initial version

  • Loading branch information...
0 parents commit 5b11d4bb9fcd9096880cce4e0b5bfb3a585c3b3e @IgorMinar committed Dec 14, 2010
5 .gitignore
@@ -0,0 +1,5 @@
+**/.DS_Store
+nbproject
+manifest.mf
+build.xml
+
15 app/index.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html xmlns:ng="http://angularjs.org/">
+<head>
+ <title>Angular App</title>
+</head>
+<body>
+ <ng:include src="$route.current.template" scope="$route.current.scope"></ng:include>
+
+ <script src="../lib/angular/angular.min.js ng:autobind"></script>
+ <script src="services.js"></script>
+ <script src="controllers.js"></script>
+ <script src="filter.js"></script>
+ <script src="widgets.js"></script>
+</body>
+</html>
33 app/js/controllers.js
@@ -0,0 +1,33 @@
+AppCtrl.$inject = ['$route', '$resource'];
+function AppCtrl($route, $resource) {
+ $route.when('/myctrl1', {template:'partials/p1.html', controller:MyCtrl1});
+ $route.when('/myctrl2', {template:'partials/p2.html', controller:MyCtrl2});
+
+
+ this.Data = $resource('');
+
+
+ this.greet = function(name) {
+ return 'Hello ' + (name || 'world');
+ }
+}
+
+
+function MyCtrl1() {
+
+ this.action = function() {
+ return 'no action';
+ }
+
+}
+
+
+function MyCtrl2() {
+
+ var counter = 0;
+
+ this.incCounter = function() {
+ return counter++;
+ }
+
+}
3 app/js/filters.js
@@ -0,0 +1,3 @@
+angular.filter('bang', function(input) {
+ return input + '!';
+});
8 app/js/services.js
@@ -0,0 +1,8 @@
+angular.service('myAngularApp', function($route) {
+
+ this.$become(AppCtrl);
+
+ $route.when('/myctrl1', {template:'partials/p1.html', controller:MyCtrl1});
+ $route.when('/myctrl2', {template:'partials/p2.html', controller:MyCtrl2});
+
+}, {$inject:['$route']});
10 app/js/widgets.js
@@ -0,0 +1,10 @@
+angular.widget('my:time', function(compileElement){
+ compileElement.css('display', 'block');
+ return function(linkElement){
+ function update(){
+ linkElement.text('Current time is: ' + new Date());
+ setTimeout(update, 1000);
+ }
+ update();
+ };
+});
32 app/lib/angular/angular-ie-compat.js
@@ -0,0 +1,32 @@
+/*
+Content-Type: multipart/related; boundary="_"
+
+--_
+Content-Location:img0
+Content-Transfer-Encoding:base64
+
+R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7
+--_
+Content-Location:img1
+Content-Transfer-Encoding:base64
+
+R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7
+--_
+Content-Location:img2
+Content-Transfer-Encoding:base64
+
+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
+--_--
+*/
+(function(){
+ var jsUri = document.location.href.replace(/\/[^/]+(#.*)?$/, '/') + document.getElementById('ng-ie-compat').src;
+ var css = '#ng-callout .ng-arrow-left{*background-image:url("mhtml:' + jsUri + '!img0")}#ng-callout .ng-arrow-right{*background-image:url("mhtml:' + jsUri + '!img1")}.ng-input-indicator-wait {*background-image:url("mhtml:' + jsUri + '!img2")}'
+ var s = document.createElement('style');
+ s.setAttribute('type', 'text/css');
+ if (s.styleSheet) {
+ s.styleSheet.cssText = css;
+ } else {
+ s.appendChild(document.createTextNode(css));
+ }
+ document.getElementsByTagName('head')[0].appendChild(s);
+})();
8,611 app/lib/angular/angular.js
8,611 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
105 app/lib/angular/angular.min.js
@@ -0,0 +1,105 @@
+(function(H,V,tb){function u(a,b,c){var d;if(a)if(J(a))for(d in a)d!="prototype"&&d!=gc&&d!=hc&&a.hasOwnProperty(d)&&b.call(c,a[d],d);else if(a.forEach)a.forEach(b,c);else if(U(a)&&ua(a.length))for(d=0;d<a.length;d++)b.call(c,a[d],d);else for(d in a)b.call(c,a[d],d);return a}function ab(a,b,c){var d=[],e;for(e in a)d.push(e);d.sort();for(e=0;e<d.length;e++)b.call(c,a[d[e]],d[e]);return d}function bb(a){if(a instanceof ja)if(a.stack)a=a.stack;else if(a.sourceURL)a=a.message+"\n"+a.sourceURL+":"+a.line;
+return a}function D(a){u(arguments,function(b){b!==a&&u(b,function(c,d){a[d]=c})});return a}function ic(a,b){return D(new (D(function(){},{prototype:a})),b)}function E(){}function ka(a){return a}function Ia(a){return function(){return a}}function ca(a,b,c){var d;return a[b]||(d=a[b]=function(e,f,g){e=(c||ka)(e);if(F(f)){F(d[e])&&u(d[e],function(h,i){if(i.charAt(0)=="$"&&Z(f[i]))f[i]=h});d[e]=D(f,g||{})}return d[e]})}function jc(a){if(a)if(K(a)){var b=V.createElement("div");b.innerHTML=a;a=new la(b.childNodes)}else if(!(a instanceof
+la)&&Ja(a))a=new la(a);return a}function Z(a){return typeof a==ma}function F(a){return typeof a!=ma}function U(a){return a!=x&&typeof a==ub}function K(a){return typeof a==kc}function ua(a){return typeof a==lc}function fa(a){return a instanceof Array}function J(a){return typeof a==da}function va(a){return K(a)?a.replace(/^\s*/,"").replace(/\s*$/,""):a}function Ja(a){return a&&(a.nodeName||a instanceof la||cb&&a instanceof cb)}function db(a,b){this.html=a;this.get=P(b)=="unsafe"?Ia(a):function(){var c=
+[];mc(a,vb(c));return c.join("")}}function nc(a,b,c){var d=[];u(a,function(e,f,g){d.push(b.call(c,e,f,g))});return d}function wb(a,b){for(var c=0;c<a.length;c++)if(b===a[c])return true;return false}function Ka(a,b){for(var c=0;c<a.length;c++)if(b===a[c])return c;return-1}function oc(a){if(a)switch(a.nodeName){case "OPTION":case "PRE":case "TITLE":return true}return false}function S(a,b){if(b)if(fa(a)){for(;b.length;)b.pop();for(var c=0;c<a.length;c++)b.push(S(a[c]))}else{u(b,function(d,e){delete b[e]});
+for(c in a)b[c]=S(a[c])}else if(b=a)if(fa(a))b=S(a,[]);else if(a instanceof Date)b=new Date(a.getTime());else if(U(a))b=S(a,{});return b}function La(a,b){if(a==b)return true;var c=typeof a,d;if(c==typeof b&&c=="object")if(a instanceof Array){if((c=a.length)==b.length){for(d=0;d<c;d++)if(!La(a[d],b[d]))return false;return true}}else{c={};for(d in a){if(d.charAt(0)!=="$"&&!J(a[d])&&!La(a[d],b[d]))return false;c[d]=true}for(d in b)if(!c[d]&&d.charAt(0)!=="$"&&!J(b[d]))return false;return true}return false}
+function pc(a){return(a=a&&a[0]&&a[0].nodeName)&&a.charAt(0)!="#"&&!wb(["TR","COL","COLGROUP","TBODY","THEAD","TFOOT"],a)}function na(a,b,c){for(;!pc(a);)a=a.parent()||B(V.body);if(a[0].$NG_ERROR!==c)if(a[0].$NG_ERROR=c){a.addClass(b);a.attr(b,c)}else{a.removeClass(b);a.removeAttr(b)}}function Ma(a,b,c){return a.concat(Na.call(b,c,b.length))}function M(a,b){var c=arguments.length>2?Na.call(arguments,2,arguments.length):[];return typeof b==da?c.length?function(){return arguments.length?b.apply(a,c.concat(Na.call(arguments,
+0,arguments.length))):b.apply(a,c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}:b}function wa(a){if(a&&a.length!==0){a=P(""+a);a=!(a=="f"||a=="0"||a=="false"||a=="no"||a=="n"||a=="[]")}else a=false;return a}function xb(a,b){var c=new yb(eb,zb,L,W),d=B(a);return c.compile(d)(d,b)}function fb(a){var b={},c,d;u((a||"").split("&"),function(e){if(e){c=e.split("=");d=unescape(c[0]);b[d]=F(c[1])?unescape(c[1]):true}});return b}function Ab(a){var b=[];u(a,function(c,d){b.push(escape(d)+
+(c===true?"":"="+escape(c)))});return b.length?b.join("&"):""}function qc(a,b){var c=a.getElementsByTagName("script"),d;b=D({ie_compat_id:"ng-ie-compat"},b);for(var e=0;e<c.length;e++)if(d=(c[e].src||"").match(rc)){b.base_url=d[1];b.ie_compat=d[1]+"angular-ie-compat"+(d[2]||"")+".js";D(b,fb(d[6]));Oa(B(c[e]),function(f,g){if(/^ng:/.exec(g)){g=g.substring(3).replace(/-/g,"_");if(g=="autobind")f=true;b[g]=f}})}return b}function X(a,b){var c=[];gb(c,a,b?"\n ":x,[]);return c.join("")}function oa(a){if(!a)return a;
+try{var b=Pa(a,true),c=b.primary();b.assertAllConsumed();return c()}catch(d){Bb("fromJson error: ",a,d);throw d;}}function gb(a,b,c,d){if(U(b)){if(b===H){a.push("WINDOW");return}if(b===V){a.push("DOCUMENT");return}if(wb(d,b)){a.push("RECURSION");return}d.push(b)}if(b===x)a.push(Qa);else if(b instanceof RegExp)a.push(C.String.quoteUnicode(b.toString()));else if(J(b))return;else if(typeof b==sc)a.push(""+b);else if(ua(b))isNaN(b)?a.push(Qa):a.push(""+b);else if(K(b))return a.push(C.String.quoteUnicode(b));
+else if(U(b))if(fa(b)){a.push("[");for(var e=b.length,f=false,g=0;g<e;g++){var h=b[g];f&&a.push(",");!(h instanceof RegExp)&&(J(h)||Z(h))?a.push(Qa):gb(a,h,c,d);f=true}a.push("]")}else if(b instanceof Date)a.push(C.String.quoteUnicode(C.Date.toString(b)));else{a.push("{");c&&a.push(c);e=false;f=c?c+" ":false;g=[];for(h in b)b[h]!==T&&g.push(h);g.sort();for(h=0;h<g.length;h++){var i=g[h],j=b[i];if(typeof j!=da){if(e){a.push(",");c&&a.push(c)}a.push(C.String.quote(i));a.push(":");gb(a,j,f,d);e=true}}a.push("}")}U(b)&&
+d.pop()}function hb(a){this.paths=[];this.children=[];this.inits=[];this.priority=a;this.newScope=false}function tc(a){for(var b;a&&!(b=a.data(ib));)a=a.parent();return b}function yb(a,b,c,d){this.markup=a;this.attrMarkup=b;this.directives=c;this.widgets=d}function Cb(a,b){var c,d=a[0].childNodes||[],e;for(c=0;c<d.length;c++){var f=e=d[c];za(f)=="#text"||b(B(e),c)}}function Oa(a,b){var c,d=a[0].attributes||[],e,f,g={};for(c=0;c<d.length;c++){e=d[c];f=e.name;e=e.value;if(ga&&f=="href")e=decodeURIComponent(a[0].getAttribute(f,
+2));g[f]=e}ab(g,b)}function Aa(a,b,c){if(!b)return a;for(var d=b.split("."),e,f=a,g=d.length,h=0;h<g;h++){e=d[h];if(!e.match(/^[\$\w][\$\w\d]*$/))throw"Expression '"+b+"' is not a valid expression for accesing variables.";if(a){f=a;a=a[e]}if(Z(a)&&e.charAt(0)=="$"){var i=C.Global.typeOf(f);if(e=(i=C[i.charAt(0).toUpperCase()+i.substring(1)])?i[[e.substring(1)]]:T)return a=M(f,e,f)}}if(!c&&J(a))return M(f,a);return a}function Ra(a,b,c){b=b.split(".");for(var d=0;b.length>1;d++){var e=b.shift(),f=a[e];
+if(!f){f={};a[e]=f}a=f}return a[b.shift()]=c}function jb(a){var b=Db[a];if(b)return b;var c="var l, fn, t;\n";u(a.split("."),function(d){d=Eb[d]?'["'+d+'"]':"."+d;c+="if(!s) return s;\nl=s;\ns=s"+d+';\nif(typeof s=="function" && !(s instanceof RegExp)) s = function(){ return l'+d+".apply(l, arguments); };\n";if(d.charAt(1)=="$"){d=d.substr(2);c+='if(!s) {\n t = angular.Global.typeOf(l);\n fn = (angular[t.charAt(0).toUpperCase() + t.substring(1)]||{})["'+d+'"];\n if (fn) s = function(){ return fn.apply(l, [l].concat(Array.prototype.slice.call(arguments, 0, arguments.length))); };\n}\n'}});
+c+="return s;";b=Function("s",c);b.toString=function(){return c};return Db[a]=b}function pa(a){if(typeof a===da)return a;var b=Fb[a];if(!b){b=Pa(a);var c=b.statements();b.assertAllConsumed();b=Fb[a]=D(function(){return c(this)},{fnSelf:c})}return b}function qa(a,b,c){function d(){}a=d.prototype=a||{};var e=new d,f={sorted:[]};D(e,{"this":e,$id:uc++,$parent:a,$bind:M(e,M,e),$get:M(e,Aa,e),$set:M(e,Ra,e),$eval:function(g){var h=typeof g,i,j,k;if(h==ma){g=0;for(h=f.sorted.length;g<h;g++){k=f.sorted[g];
+j=k.length;for(i=0;i<j;i++)e.$tryEval(k[i].fn,k[i].handler)}}else if(h===da)return g.call(e);else if(h==="string")return pa(g).call(e)},$tryEval:function(g,h){var i=typeof g;try{if(i==da)return g.call(e);else if(i=="string")return pa(g).call(e)}catch(j){(e.$log||{error:Bb}).error(j);if(J(h))h(j);else if(h)na(h,Sa,F(j)?bb(j):j);else J(e.$exceptionHandler)&&e.$exceptionHandler(j)}},$watch:function(g,h,i,j){function k(n){var m=q.call(e),s=r;if(n||s!==m){r=m;e.$tryEval(function(){return h.call(e,m,s)},
+i)}}var q=pa(g),r=q.call(e);h=pa(h);e.$onEval(Gb,k);if(Z(j))j=true;j&&k(true)},$onEval:function(g,h,i){if(!ua(g)){i=h;h=g;g=0}var j=f[g];if(!j){j=f[g]=[];j.priority=g;f.sorted.push(j);f.sorted.sort(function(k,q){return k.priority-q.priority})}j.push({fn:pa(h),handler:i})},$become:function(g){if(J(g)){e.constructor=g;u(g.prototype,function(h,i){e[i]=M(e,h)});e.$inject.apply(e,Ma([g,e],arguments,1));J(g.prototype.init)&&e.init()}},$new:function(g){var h=qa(e);h.$become.apply(e,Ma([g],arguments,1));
+e.$onEval(h.$eval);return h}});if(!a.$root){e.$root=e;e.$parent=e;(e.$inject=Hb(e,b,c))()}return e}function Hb(a,b,c){b=b||kb;c=c||{};a=a||{};return function d(e,f){var g,h,i;if(K(e)){if(!c.hasOwnProperty(e)){h=b[e];if(!h)throw"Unknown provider for '"+e+"'.";c[e]=d(h,a)}g=c[e]}else if(fa(e)){g=[];u(e,function(j){g.push(d(j))})}else if(J(e)){g=d(e.$inject||[]);g=e.apply(f,Ma(g,arguments,2))}else if(U(e))u(b,function(j,k){i=j.$creation;i=="eager"&&d(k);i=="eager-published"&&Ra(e,k,d(k))});else g=d(a);
+return g}}function vc(a,b){function c(z){return z.indexOf(m)!=-1}function d(z){return"0"<=z&&z<="9"}function e(z,A,I){I=I||r;throw ja("Lexer Error: "+z+" at column"+(F(A)?"s "+A+"-"+r+" ["+a.substring(A,I)+"]":" "+I)+" in expression ["+a+"].");}function f(z,A,I){z=a.substr(r).match(z);var O={index:r},ra=r;z||e(I);r+=z[0].length;A(O,O.text=z[0],ra);k.push(O)}function g(){f(/^(\d+)?(\.\d+)?([eE][+-]?\d+)?/,function(z,A){z.text=A=1*A;z.json=true;z.fn=Ia(A)},"Not a valid number")}function h(){f(/^[\w_\$][\w_\$\d]*(\.[\w_\$][\w_\$\d]*)*/,
+function(z,A){t=Ba[A];if(!t){t=jb(A);t.isAssignable=A}z.fn=Ba[A]||D(jb(A),{assign:function(I,O){return Ra(I,A,O)}});z.json=Ba[A]})}function i(){f(/^(('(\\'|[^'])*')|("(\\"|[^"])*"))/,function(z,A,I){var O,ra=z.string=A.substr(1,A.length-2).replace(/(\\u(.?.?.?.?))|(\\(.))/g,function(Ib,Jb,sa,Kb,Ta){if(sa&&!sa.match(/[\da-fA-F]{4}/))O=O||M(null,e,"Invalid unicode escape [\\u"+sa+"]",I);return sa?String.fromCharCode(parseInt(sa,16)):wc[Ta]||Ta});(O||E)();z.json=true;z.fn=function(){return ra.length==
+j?C.String.toDate(ra):ra}},"Unterminated string")}for(var j=b?24:-1,k=[],q,r=0,n=[],m,s=":";r<a.length;){m=a.charAt(r);if(c("\"'"))i(m);else if(d(m)||c(".")&&d(r+1<a.length?a.charAt(r+1):false))g();else if("a"<=m&&m<="z"||"A"<=m&&m<="Z"||"_"==m||m=="$"){h();if("{,".indexOf(s)!=-1&&n[0]=="{"&&(q=k[k.length-1]))q.json=q.text.indexOf(".")==-1}else if(c("(){}[].,;:")){k.push({index:r,text:m,json:c("{}[]:,")});c("{[")&&n.unshift(m);c("}]")&&n.shift();r++}else if(m==" "||m=="\r"||m=="\t"||m=="\n"||m=="\u000b"||
+m=="\u00a0"){r++;continue}else{var o=m+(r+1<a.length?a.charAt(r+1):false),t=Ba[m],y=Ba[o];if(y){k.push({index:r,text:o,fn:y});r+=2}else if(t){k.push({index:r,text:m,fn:t,json:"[,:".indexOf(s)!=-1&&c("+-")});r+=1}else e("Unexpected next character ",r,r+1)}s=m}return k}function Pa(a,b){function c(l,p){throw ja("Parse Error: Token '"+p.text+"' "+l+" at column "+(p.index+1)+" of expression ["+a+"] starting at ["+a.substring(p.index)+"].");}function d(){if(ea.length===0)throw ja("Unexpected end of expression: "+
+a);return ea[0]}function e(l,p,v,w){if(ea.length>0){var G=ea[0],$=G.text;if($==l||$==p||$==v||$==w||!l&&!p&&!v&&!w)return G}return false}function f(l,p,v,w){if(l=e(l,p,v,w)){if(b&&!l.json){index=l.index;c("is not valid json",l)}ea.shift();return this.currentToken=l}return false}function g(l){f(l)||c("is unexpected, expecting ["+l+"]",e())}function h(l,p){return function(v){return l(v,p(v))}}function i(l,p,v){return function(w){return p(w,l(w),v(w))}}function j(){ea.length!==0&&c("is extra token not part of expression",
+ea[0])}function k(){for(var l=[];;){ea.length>0&&!e("}",")",";","]")&&l.push(q());if(!f(";"))return function(p){for(var v,w=0;w<l.length;w++){var G=l[w];if(G)v=G(p)}return v}}}function q(){for(var l=m(),p;;)if(p=f("|"))l=i(l,p.fn,r());else return l}function r(){return n(aa)}function n(l){for(var p=I(l),v=[];;)if(f(":"))v.push(m());else{var w=function(G,$){for(var Ca=[$],Da=0;Da<v.length;Da++)Ca.push(v[Da](G));return p.apply(G,Ca)};return function(){return w}}}function m(){var l=s(),p,v;if(v=f("=")){l.assign||
+c("implies assignment but ["+a.substring(0,v.index)+"] can not be assigned to",v);p=s();return function(w){return l.assign(w,p(w))}}else return l}function s(){for(var l=o(),p;;)if(p=f("||"))l=i(l,p.fn,o());else return l}function o(){var l=t(),p;if(p=f("&&"))l=i(l,p.fn,o());return l}function t(){var l=y(),p;if(p=f("==","!="))l=i(l,p.fn,t());return l}function y(){var l;l=z();for(var p;p=f("+","-");)l=i(l,p.fn,z());l=l;if(p=f("<",">","<=",">="))l=i(l,p.fn,y());return l}function z(){for(var l=A(),p;p=
+f("*","/","%");)l=i(l,p.fn,A());return l}function A(){var l;return f("+")?O():(l=f("-"))?i(xc,l.fn,A()):(l=f("!"))?h(l.fn,A()):O()}function I(l){var p=f(),v=p.text.split(".");l=l;for(var w,G=0;G<v.length;G++){w=v[G];if(l)l=l[w]}typeof l!=da&&c("should be a function",p);return l}function O(){var l;if(f("(")){l=q();g(")");l=l}else if(f("["))l=sa();else if(f("{"))l=Kb();else{var p=f();(l=p.fn)||c("not a primary expression",p)}for(;p=f("(","[",".");)if(p.text==="(")l=Jb(l);else if(p.text==="[")l=Ib(l);
+else if(p.text===".")l=ra(l);else c("IMPOSSIBLE");return l}function ra(l){var p=f().text,v=jb(p);return D(function(w){return v(l(w))},{assign:function(w,G){return Ra(l(w),p,G)}})}function Ib(l){var p=m();g("]");return D(function(v){var w=l(v);v=p(v);return w?w[v]:T},{assign:function(v,w){return l(v)[p(v)]=w}})}function Jb(l){var p=[];if(d().text!=")"){do p.push(m());while(f(","))}g(")");return function(v){for(var w=[],G=0;G<p.length;G++)w.push(p[G](v));G=l(v)||E;return G.apply?G.apply(v,w):G(w[0],
+w[1],w[2],w[3],w[4])}}function sa(){var l=[];if(d().text!="]"){do l.push(m());while(f(","))}g("]");return function(p){for(var v=[],w=0;w<l.length;w++)v.push(l[w](p));return v}}function Kb(){var l=[];if(d().text!="}"){do{var p=f();p=p.string||p.text;g(":");var v=m();l.push({key:p,value:v})}while(f(","))}g("}");return function(w){for(var G={},$=0;$<l.length;$++){var Ca=l[$],Da=Ca.value(w);G[Ca.key]=Da}return G}}function Ta(){var l=f().text;g(":");var p;if(d().text=="{"){g("{");p=k();g("}")}else p=m();
+return function(){return{name:l,fn:p}}}var xc=Ia(0),ea=vc(a,b);return{assertAllConsumed:j,primary:O,statements:k,validator:function(){return n(lb)},filter:r,watch:function(){for(var l=[];ea.length>0;){l.push(Ta());f(";")||j()}j();return function(p){for(var v=0;v<l.length;v++){var w=l[v](p);p.addListener(w.name,w.fn)}}}}}function Lb(a,b){this.template=a+="#";this.defaults=b||{};var c=this.urlParams={};u(a.split(/\W/),function(d){if(d&&a.match(RegExp(":"+d+"\\W")))c[d]=true})}function Ua(a){this.xhr=
+a}function yc(a,b,c,d,e,f){function g(o){try{o.apply(null,Na.call(arguments,1))}finally{j--;if(j===0)for(;k.length;)try{k.pop()()}catch(t){e.error(t)}}}var h=this;h.isMock=false;var i=0,j=0,k=[];h.xhr=function(o,t,y,z){if(J(y)){z=y;y=x}if(P(o)=="json"){var A="angular_"+Math.random()+"_"+i++;A=A.replace(/\d\./,"");o=b[0].createElement("script");o.type="text/javascript";o.src=t.replace("JSON_CALLBACK",A);H[A]=function(O){H[A]=T;z(200,O)};c.append(o)}else{var I=new d;I.open(o,t,true);I.setRequestHeader("Content-Type",
+"application/x-www-form-urlencoded");I.setRequestHeader("Accept","application/json, text/plain, */*");I.setRequestHeader("X-Requested-With","XMLHttpRequest");j++;I.onreadystatechange=function(){if(I.readyState==4)g(z,I.status||200,I.responseText)};I.send(y||"")}};h.notifyWhenNoOutstandingRequests=function(o){j===0?o():k.push(o)};var q=[];h.poll=function(){u(q,function(o){o()})};h.addPollFn=function(o){q.push(o);return o};h.startPoller=function(o,t){(function y(){h.poll();t(y,o)})()};h.setUrl=function(o){a.href.match(/#/);
+o.match(/#/)||(o+="#");a.href=o};h.getUrl=function(){return a.href};var r=b[0],n={},m="";h.cookies=function(o,t){var y,z,A;if(o)if(t===T)r.cookie=escape(o)+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(K(t)){r.cookie=escape(o)+"="+escape(t);y=o.length+t.length+1;y>4096&&e.warn("Cookie '"+o+"' possibly not set or overflowed because it was too large ("+y+" > 4096 bytes)!");n.length>20&&e.warn("Cookie '"+o+"' possibly not set or overflowed because too many cookies were already set ("+n.length+" > 20 )")}}else{if(r.cookie!==
+m){m=r.cookie;y=m.split("; ");n={};for(z=0;z<y.length;z++){A=y[z].split("=");if(A.length===2)n[unescape(A[0])]=unescape(A[1])}}return n}};h.defer=function(o){j++;f(function(){g(o)},0)};var s=E;h.hover=function(o){s=o};h.bind=function(){b.bind("mouseover",function(o){s(B(ga?o.srcElement:o.target),true);return true});b.bind("mouseleave mouseout click dblclick keypress keyup",function(o){s(B(o.target),false);return true})};h.addCss=function(o){var t=B(r.createElement("link"));t.attr("rel","stylesheet");
+t.attr("type","text/css");t.attr("href",o);c.append(t)};h.addJs=function(o,t){var y=B(r.createElement("script"));y.attr("type","text/javascript");y.attr("src",o);t&&y.attr("id",t);c.append(y)}}function mc(a,b){function c(i,j,k,q){j=P(j);if(Mb[j])for(;g.last()&&Nb[g.last()];)d("",g.last());Ob[j]&&g.last()==j&&d("",j);(q=Pb[j]||!!q)||g.push(j);var r={};k.replace(zc,function(n,m,s,o,t){r[m]=mb(s?s:o?o:t?t:Qb[m]?m:"")});b.start(j,r,q)}function d(i,j){var k=0,q;if(j=P(j))for(k=g.length-1;k>=0;k--)if(g[k]==
+j)break;if(k>=0){for(q=g.length-1;q>=k;q--)b.end(g[q]);g.length=k}}var e,f,g=[],h=a;for(g.last=function(){return g[g.length-1]};a;){f=true;if(!g.last()||!Rb[g.last()]){if(a.indexOf("<!--")===0){e=a.indexOf("--\>");if(e>=0){b.comment&&b.comment(a.substring(4,e));a=a.substring(e+3);f=false}}else if(Ac.test(a)){if(e=a.match(Sb)){a=a.substring(e[0].length);e[0].replace(Sb,d);f=false}}else if(Bc.test(a))if(e=a.match(Tb)){a=a.substring(e[0].length);e[0].replace(Tb,c);f=false}if(f){e=a.indexOf("<");f=e<
+0?a:a.substring(0,e);a=e<0?"":a.substring(e);b.chars(mb(f))}}else{a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+g.last()+"[^>]*>","i"),function(i,j){j=j.replace(Cc,"$1").replace(Dc,"$1");b.chars(mb(j));return""});d("",g.last())}if(a==h)throw"Parse Error: "+a;h=a}d()}function ha(a){var b={};a=a.split(",");var c;for(c=0;c<a.length;c++)b[a[c]]=true;return b}function mb(a){nb.innerHTML=a.replace(/</g,"&lt;");return nb.innerText||nb.textContent}function Ub(a){return a.replace(/&/g,"&amp;").replace(Ec,function(b){return"&#"+
+b.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vb(a){var b=false,c=M(a,a.push);return{start:function(d,e,f){d=P(d);if(!b&&Rb[d])b=d;if(!b&&Vb[d]==true){c("<");c(d);u(e,function(g,h){var i=P(h);if(Fc[i]==true&&(Wb[i]!==true||g.match(Gc))){c(" ");c(h);c('="');c(Ub(g));c('"')}});c(f?"/>":">")}},end:function(d){d=P(d);if(!b&&Vb[d]==true){c("</");c(d);c(">")}if(d==b)b=false},chars:function(d){b||c(Ub(d))}}}function Xb(a){var b=a[Ea],c=Va[b];if(c){u(c.bind||{},function(d,e){Hc(a,
+e,d)});delete Va[b];if(ga)a[Ea]="";else delete a[Ea]}}function Ic(a){var b={};a=a[0].style;var c,d;if(typeof a.length=="number")for(c=0;c<a.length;c++){d=a[c];b[d]=a[d]}else for(d in a){c=a[d];if(1*d!=d&&d!="cssText"&&c&&typeof c=="string"&&c!="false")b[d]=c}return b}function la(a){if(Ja(a)){this[0]=a;this.length=1}else if(F(a.length)&&a.item){for(var b=0;b<a.length;b++)this[b]=a[b];this.length=a.length}}function ta(a,b){C[a]=C[a]||{};u(b,function(c){D(C[a],c)})}function ba(a,b,c){var d="";if(a<0){d=
+"-";a=-a}for(a=""+a;a.length<b;)a="0"+a;if(c)a=a.substr(a.length-b);return d+a}function Q(a,b,c,d){return function(e){e=e["get"+a]();if(c>0||e>-c)e+=c;if(e===0&&c==-12)e=12;return ba(e,b,d)}}function xa(a,b){return{format:a,parse:b||a}}function Yb(a){return F(a)&&a!==x?""+a:a}function N(a,b,c,d){kb(a,b,{$inject:c,$creation:d})}function Zb(a,b,c){var d="^"+b.replace(/[\.\\\(\)\^\$]/g,"$1")+"$",e=[],f={};u(b.split(/\W/),function(h){if(h){var i=RegExp(":"+h+"([\\W])");if(d.match(i)){d=d.replace(i,"([^/]*)$1");
+e.push(h)}}});var g=a.match(RegExp(d));if(g){u(e,function(h,i){f[h]=g[i+1]});c&&this.$set(c,f)}return g?f:x}function $b(a){var b=ac[a];if(!b){var c=[];u(Wa(a),function(d){var e=Xa(d);c.push(e?function(f){var g,h=this.$tryEval(e,function(i){g=X(i)});na(f,Sa,g);return g?g:h}:function(){return d})});ac[a]=b=function(d){var e=[],f=this.hasOwnProperty(bc)?this.$element:T;this.$element=d;for(var g=0;g<c.length;g++){var h=c[g].call(this,d);if(Ja(h))h="";else if(U(h))h=X(h,true);e.push(h)}this.$element=f;
+return e.join("")}}return b}function ob(a){return function(b,c){var d=c[0].className+" ";return function(e){this.$onEval(function(){if(a(this.$index)){var f=this.$eval(b);if(fa(f))f=f.join(" ");e[0].className=va(d+f)}},e)}}}function Wa(a){for(var b=[],c=0,d;(d=a.indexOf("{{",c))>-1;){c<d&&b.push(a.substr(c,d-c));c=d;d=a.indexOf("}}",d);d=d<0?a.length:d+2;b.push(a.substr(c,d-c));c=d}c!=a.length&&b.push(a.substr(c,a.length-c));return b.length===0?[a]:b}function Xa(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?
+a[1]:x}function cc(a,b){var c=b.attr("name");if(!c)throw"Required field 'name' not found.";return{get:function(){return a.$eval(c)},set:function(d){if(d!==T)return a.$tryEval(c+"="+X(d),b)}}}function Fa(a,b){var c=cc(a,b),d=b.attr("ng:format")||pb,e=ia(d);if(!e)throw"Formatter named '"+d+"' not found.";return{get:function(){return e.format(c.get())},set:function(f){return c.set(e.parse(f))}}}function qb(a,b){function c(){var n=va(b.val());if(b[0].disabled||b[0].readOnly){na(b,Ga,x);r.markValid(b)}else{var m=
+ic(a,{$element:b});n=q&&!n?"Required":n?e(m,n):x;na(b,Ga,n);(k=n)?r.markInvalid(b):r.markValid(b)}}var d=b.attr("ng:validate")||pb,e=Pa(d).validator()(),f=b.attr("ng:required"),g=b.attr("ng:format")||pb,h=ia(g),i,j,k,q,r=a.$invalidWidgets||{markValid:E,markInvalid:E};if(!e)throw"Validator named '"+d+"' not found.";if(!h)throw"Formatter named '"+g+"' not found.";i=h.format;j=h.parse;if(f)a.$watch(f,function(n){q=n;c()});else q=f==="";b.data(rb,c);return{get:function(){k&&na(b,Ga,x);try{var n=j(b.val());
+c();return n}catch(m){k=m;na(b,Ga,m)}},set:function(n){var m=b.val();n=i(n);if(m!=n)b.val(n||"");c()}}}function sb(){return{get:E,set:E}}function Ya(a){return function(b,c){var d=c.get();if(!d&&F(a))d=S(a);Z(b.get())&&F(d)&&b.set(d)}}function ya(a,b,c,d){return function(e){var f=this,g=b(f,e),h=c(f,e),i=e.attr("ng:change")||"",j;d.call(f,g,h,e);this.$eval(e.attr("ng:init")||"");if(i||b!==sb)e.bind(a,function(){g.set(h.get());j=g.get();f.$tryEval(i,e);f.$root.$eval()});f.$watch(g.get,function(k){if(j!==
+k)h.set(j=k)})}}function Za(a){this.directives(true);return Jc[P(a[0].type)]||E}if(typeof V.getAttribute==ma)V.getAttribute=function(){};var P=function(a){return K(a)?a.toLowerCase():a},$a=function(a){return K(a)?a.toUpperCase():a},R=function(a){return K(a)?a.replace(/[A-Z]/g,function(b){b=b.charCodeAt(0)|32;return String.fromCharCode(b)}):a},Y=function(a){return K(a)?a.replace(/[a-z]/g,function(b){b=b.charCodeAt(0)&-33;return String.fromCharCode(b)}):a};if("i"!=="I".toLowerCase()){P=R;$a=Y}var T=
+undefined,x=null,bc="$element",ib="$scope",rb="$validate",sc="boolean",da="function",gc="length",hc="name",Qa="null",lc="number",ub="object",kc="string",ma="undefined",Sa="ng-exception",Ga="ng-validation-error",pb="noop",Gb=-1E3,Kc={FIRST:-99999,LAST:99999,WATCH:Gb},ja=H.Error,cb=H.jQuery||H.$,ga=parseInt((/msie (\d+)/.exec(P(navigator.userAgent))||[])[1],10),B=cb||jc,Na=Array.prototype.slice,Bb=H.console?M(H.console,H.console.error||E):E,C=H.angular||(H.angular={}),eb=ca(C,"markup"),zb=ca(C,"attrMarkup"),
+L=ca(C,"directive"),W=ca(C,"widget",P),lb=ca(C,"validator"),aa=ca(C,"filter"),ia=ca(C,"formatter"),kb=ca(C,"service");ca(C,"callbacks");var za,rc=/^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/;za=ga?function(a){a=a.nodeName?a:a[0];return a.scopeName&&a.scopeName!="HTML"?$a(a.scopeName+":"+a.nodeName):a.nodeName}:function(a){return a.nodeName?a.nodeName:a[0].nodeName};C.toJson=X;C.fromJson=oa;hb.prototype={init:function(a,b){var c={};this.collectInits(a,c,b);ab(c,function(d){u(d,function(e){e()})})},
+collectInits:function(a,b,c){var d=b[this.priority],e=c;d||(b[this.priority]=d=[]);a=B(a);if(this.newScope){e=qa(c);c.$onEval(e.$eval);a.data(ib,e)}u(this.inits,function(j){d.push(function(){e.$tryEval(function(){return e.$inject(j,e,a)},a)})});var f=a[0].childNodes,g=this.children,h=this.paths,i=h.length;for(c=0;c<i;c++)g[c].collectInits(f[h[c]],b,e)},addInit:function(a){a&&this.inits.push(a)},addChild:function(a,b){if(b){this.paths.push(a);this.children.push(b)}},empty:function(){return this.inits.length===
+0&&this.paths.length===0}};yb.prototype={compile:function(a){a=B(a);var b=0,c,d=a.parent();if(d&&d[0]){d=d[0];for(var e=0;e<d.childNodes.length;e++)if(d.childNodes[e]==a[0])b=e}c=this.templatize(a,b,0)||new hb;return function(f,g){f=B(f);var h=g&&g.$eval?g:qa(g);f.data(ib,h);return D(h,{$element:f,$init:function(){c.init(f,h);h.$eval();delete h.$init;return h}})}},templatize:function(a,b,c){var d=this,e,f,g=d.directives,h=true,i=true,j=za(a),k,q={compile:M(d,d.compile),comment:function(s){return B(V.createComment(s))},
+element:function(s){return B(V.createElement(s))},text:function(s){return B(V.createTextNode(s))},descend:function(s){if(F(s))h=s;return h},directives:function(s){if(F(s))i=s;return i},scope:function(s){if(F(s))k.newScope=k.newScope||s;return k.newScope}};try{c=a.attr("ng:eval-order")||c||0}catch(r){c=c||0}if(K(c))c=Kc[$a(c)]||parseInt(c,10);k=new hb(c);Oa(a,function(s,o){if(!e)if(e=d.widgets("@"+o)){a.addClass("ng-attr-widget");e=M(q,e,s,a)}});if(!e)if(e=d.widgets(j)){j.indexOf(":")>0&&a.addClass("ng-widget");
+e=M(q,e,a)}if(e){i=h=false;j=a.parent();k.addInit(e.call(q,a));if(j&&j[0])a=B(j[0].childNodes[b])}if(h)for(var n=0,m=a[0].childNodes;n<m.length;n++)za(m[n])=="#text"&&u(d.markup,function(s){if(n<m.length){var o=B(m[n]);s.call(q,o.text(),o,a)}});if(i){Oa(a,function(s,o){u(d.attrMarkup,function(t){t.call(q,s,o,a)})});Oa(a,function(s,o){if(f=g[o]){a.addClass("ng-directive");k.addInit(g[o].call(q,s,a))}})}h&&Cb(a,function(s,o){k.addChild(o,d.templatize(s,o,c))});return k.empty()?x:k}};var uc=0,Db={},
+Fb={},Eb={};u("abstract,boolean,break,byte,case,catch,char,class,const,continue,debugger,default,delete,do,double,else,enum,export,extends,false,final,finally,float,for,function,goto,if,implements,import,ininstanceof,intinterface,long,native,new,null,package,private,protected,public,return,short,static,super,switch,synchronized,this,throw,throws,transient,true,try,typeof,var,volatile,void,undefined,while,with".split(/,/),function(a){Eb[a]=true});var Ba={"null":function(){return x},"true":function(){return true},
+"false":function(){return false},$undefined:E,"+":function(a,b,c){return(F(b)?b:0)+(F(c)?c:0)},"-":function(a,b,c){return(F(b)?b:0)-(F(c)?c:0)},"*":function(a,b,c){return b*c},"/":function(a,b,c){return b/c},"%":function(a,b,c){return b%c},"^":function(a,b,c){return b^c},"=":E,"==":function(a,b,c){return b==c},"!=":function(a,b,c){return b!=c},"<":function(a,b,c){return b<c},">":function(a,b,c){return b>c},"<=":function(a,b,c){return b<=c},">=":function(a,b,c){return b>=c},"&&":function(a,b,c){return b&&
+c},"||":function(a,b,c){return b||c},"&":function(a,b,c){return b&c},"|":function(a,b,c){return c(a,b)},"!":function(a,b){return!b}},wc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'};Lb.prototype={url:function(a){var b=this,c=this.template;a=a||{};u(this.urlParams,function(e,f){c=c.replace(RegExp(":"+f+"(\\W)"),(a[f]||b.defaults[f]||"")+"$1")});c=c.replace(/\/?#$/,"");var d=[];ab(a,function(e,f){b.urlParams[f]||d.push(encodeURI(f)+"="+encodeURI(e))});c=c.replace(/\/*$/,"");return c+
+(d.length?"?"+d.join("&"):"")}};Ua.DEFAULT_ACTIONS={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:true},remove:{method:"DELETE"},"delete":{method:"DELETE"}};Ua.prototype={route:function(a,b,c){function d(h){var i={};u(b||{},function(j,k){i[k]=j.charAt&&j.charAt(0)=="@"?Aa(h,j.substr(1)):j});return i}function e(h){S(h||{},this)}var f=this,g=new Lb(a);c=D({},Ua.DEFAULT_ACTIONS,c);u(c,function(h,i){var j=h.method=="POST"||h.method=="PUT";e[i]=function(k,q,r){var n={},m,s=E;switch(arguments.length){case 3:s=
+r;case 2:if(J(q))s=q;else{n=k;m=q;break}case 1:if(J(k))s=k;else if(j)m=k;else n=k;break;case 0:break;default:throw"Expected between 0-3 arguments [params, data, callback], got "+arguments.length+" arguments.";}var o=this instanceof e?this:h.isArray?[]:new e(m);f.xhr(h.method,g.url(D({},h.params||{},d(m),n)),m,function(t,y){if(t==200){if(h.isArray){o.length=0;u(y,function(z){o.push(new e(z))})}else S(y,o);(s||E)(o)}else throw{status:t,response:y,message:t+": "+y};},h.verifyCache);return o};e.bind=
+function(k){return f.route(a,D({},b,k),c)};e.prototype["$"+i]=function(k,q){var r=d(this),n=E;switch(arguments.length){case 2:r=k;n=q;case 1:if(typeof k==da)n=k;else r=k;case 0:break;default:throw"Expected between 1-2 arguments [params, callback], got "+arguments.length+" arguments.";}e[i].call(this,r,j?this:T,n)}});return e}};var Lc=H.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}throw new ja("This browser does not support XMLHttpRequest.");
+},Tb=/^<\s*([\w:]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,Sb=/^<\s*\/\s*([\w:]+)[^>]*>/,zc=/(\w+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,Bc=/^</,Ac=/^<\s*\//,Cc=/<!--(.*?)--\>/g,Dc=/<!\[CDATA\[(.*?)]]\>/g,Gc=/^((ftp|https?):\/\/|mailto:|#)/,Ec=/([^\#-~| |!])/g,Pb=ha("area,br,col,hr,img"),Mb=ha("address,blockquote,center,dd,del,dir,div,dl,dt,hr,ins,li,map,menu,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul"),Nb=ha("a,abbr,acronym,b,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var"),
+Ob=ha("colgroup,dd,dt,li,p,td,tfoot,th,thead,tr"),Rb=ha("script,style"),Vb=D({},Pb,Mb,Nb,Ob),Qb=ha("compact,ismap,nohref,nowrap"),Wb=ha("background,href,longdesc,src,usemap"),Fc=D({},Qb,Wb,ha("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,coords,dir,face,headers,height,hreflang,hspace,lang,language,rel,rev,rows,rowspan,rules,scope,scrolling,shape,span,start,summary,target,title,type,valign,value,vspace,width")),nb=V.createElement("pre"),Va={},Ea="ng-"+(new Date).getTime(),
+Mc=1,Nc=H.document.attachEvent?function(a,b,c){a.attachEvent("on"+b,c)}:function(a,b,c){a.addEventListener(b,c,false)},Hc=H.document.detachEvent?function(a,b,c){a.detachEvent("on"+b,c)}:function(a,b,c){a.removeEventListener(b,c,false)};la.prototype={data:function(a,b){var c=this[0],d=c[Ea];d=Va[d||-1];if(F(b)){if(!d){c[Ea]=d=Mc++;d=Va[d]={}}d[a]=b}else return d?d[a]:x},removeData:function(){Xb(this[0])},dealoc:function(){(function a(b){Xb(b);var c=0;for(b=b.childNodes;c<b.length;c++)a(b[c])})(this[0])},
+bind:function(a,b){var c=this,d=c[0],e=c.data("bind"),f;e||this.data("bind",e={});u(a.split(" "),function(g){f=e[g];if(!f){e[g]=f=function(h){if(!h.preventDefault)h.preventDefault=function(){h.returnValue=false};if(!h.stopPropagation)h.stopPropagation=function(){h.cancelBubble=true};u(f.fns,function(i){i.call(c,h)})};f.fns=[];Nc(d,g,f)}f.fns.push(b)})},replaceWith:function(a){this[0].parentNode.replaceChild(B(a)[0],this[0])},children:function(){return new la(this[0].childNodes)},append:function(a){var b=
+this[0];a=B(a);u(a,function(c){b.appendChild(c)})},remove:function(){this.dealoc();var a=this[0].parentNode;a&&a.removeChild(this[0])},removeAttr:function(a){this[0].removeAttribute(a)},after:function(a){this[0].parentNode.insertBefore(B(a)[0],this[0].nextSibling)},hasClass:function(a){a=" "+a+" ";if((" "+this[0].className+" ").replace(/[\n\t]/g," ").indexOf(a)>-1)return true;return false},removeClass:function(a){this[0].className=va((" "+this[0].className+" ").replace(/[\n\t]/g," ").replace(" "+
+a+" ",""))},toggleClass:function(a,b){(b?this.addClass:this.removeClass).call(this,a)},addClass:function(a){if(!this.hasClass(a))this[0].className=va(this[0].className+" "+a)},css:function(a,b){var c=this[0].style;if(K(a))if(F(b))c[a]=b;else return c[a];else D(c,a)},attr:function(a,b){var c=this[0];if(U(a))u(a,function(d,e){c.setAttribute(e,d)});else if(F(b))c.setAttribute(a,b);else return c.getAttribute(a,2)},text:function(a){if(F(a))this[0].textContent=a;return this[0].textContent},val:function(a){if(F(a))this[0].value=
+a;return this[0].value},html:function(a){if(F(a)){for(var b=0,c=this[0].childNodes;b<c.length;b++)B(c[b]).dealoc();this[0].innerHTML=a}return this[0].innerHTML},parent:function(){return B(this[0].parentNode)},clone:function(){return B(this[0].cloneNode(true))}};ga&&D(la.prototype,{text:function(a){var b=this[0];if(b.nodeType==3){if(F(a))b.nodeValue=a;return b.nodeValue}else{if(F(a))b.innerText=a;return b.innerText}}});R={typeOf:function(a){if(a===x)return Qa;var b=typeof a;if(b==ub){if(a instanceof
+Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}};Y={copy:S,size:function(a){var b=0;if(a)if(ua(a.length))return a.length;else if(U(a))for(key in a)b++;return b},equals:La};var Oc={extend:D},Pc={indexOf:Ka,sum:function(a,b){for(var c=C.Function.compile(b),d=0,e=0;e<a.length;e++){var f=1*c(a[e]);isNaN(f)||(d+=f)}return d},remove:function(a,b){var c=Ka(a,b);c>=0&&a.splice(c,1);return b},filter:function(a,b){var c=[];c.check=function(i){for(var j=0;j<c.length;j++)if(!c[j](i))return false;
+return true};var d=function(i,j){if(j.charAt(0)==="!")return!d(i,j.substr(1));switch(typeof i){case "boolean":case "number":case "string":return(""+i).toLowerCase().indexOf(j)>-1;case "object":for(var k in i)if(k.charAt(0)!=="$"&&d(i[k],j))return true;return false;case "array":for(k=0;k<i.length;k++)if(d(i[k],j))return true;return false;default:return false}};switch(typeof b){case "boolean":case "number":case "string":b={$:b};case "object":for(var e in b)e=="$"?function(){var i=(""+b[e]).toLowerCase();
+i&&c.push(function(j){return d(j,i)})}():function(){var i=e,j=(""+b[e]).toLowerCase();j&&c.push(function(k){return d(Aa(k,i),j)})}();break;case da:c.push(b);break;default:return a}for(var f=[],g=0;g<a.length;g++){var h=a[g];c.check(h)&&f.push(h)}return f},add:function(a,b){a.push(Z(b)?{}:b);return a},count:function(a,b){if(!b)return a.length;var c=C.Function.compile(b),d=0;u(a,function(e){c(e)&&d++});return d},orderBy:function(a,b,c){function d(h,i){return wa(i)?function(j,k){return h(k,j)}:h}function e(h,
+i){var j=typeof h,k=typeof i;if(j==k){if(j=="string")h=h.toLowerCase();if(j=="string")i=i.toLowerCase();if(h===i)return 0;return h<i?-1:1}else return j<k?-1:1}b=fa(b)?b:[b];b=nc(b,function(h){var i=false,j=h||ka;if(K(h)){if(h.charAt(0)=="+"||h.charAt(0)=="-"){i=h.charAt(0)=="-";h=h.substring(1)}j=pa(h).fnSelf}return d(function(k,q){return e(j(k),j(q))},i)});for(var f=[],g=0;g<a.length;g++)f.push(a[g]);return f.sort(d(function(h,i){for(var j=0;j<b.length;j++){var k=b[j](h,i);if(k!==0)return k}return 0},
+c))},limitTo:function(a,b){b=parseInt(b,10);var c=[],d,e;if(b>0){d=0;e=b}else{d=a.length+b;e=a.length}for(;d<e;d++)c.push(a[d]);return c}},Qc=/^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d)(?:\:(\d\d)(?:\:(\d\d)(?:\.(\d{3}))?)?)?Z)?$/,dc={quote:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(a){a=C.String.quote(a);for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);
+if(d<128)b.push(a.charAt(c));else{d="000"+d.toString(16);b.push("\\u"+d.substring(d.length-4))}}return b.join("")},toDate:function(a){var b;if(K(a)&&(b=a.match(Qc))){a=new Date(0);a.setUTCFullYear(b[1],b[2]-1,b[3]);a.setUTCHours(b[4]||0,b[5]||0,b[6]||0,b[7]||0);return a}return a}},ec={toString:function(a){return!a?a:a.toISOString?a.toISOString():ba(a.getUTCFullYear(),4)+"-"+ba(a.getUTCMonth()+1,2)+"-"+ba(a.getUTCDate(),2)+"T"+ba(a.getUTCHours(),2)+":"+ba(a.getUTCMinutes(),2)+":"+ba(a.getUTCSeconds(),
+2)+"."+ba(a.getUTCMilliseconds(),3)+"Z"}};ta("Global",[R]);ta("Collection",[R,Y]);ta("Array",[R,Y,Pc]);ta("Object",[R,Y,Oc]);ta("String",[R,dc]);ta("Date",[R,ec]);C.Date.toString=ec.toString;ta("Function",[R,Y,{compile:function(a){return J(a)?a:a?pa(a).fnSelf:ka}}]);aa.currency=function(a){this.$element.toggleClass("ng-format-negative",a<0);return"$"+aa.number.apply(this,[a,2])};aa.number=function(a,b){if(isNaN(a)||!isFinite(a))return"";b=typeof b==ma?2:b;var c=a<0;a=Math.abs(a);var d=""+Math.round(a*
+Math.pow(10,b)),e=d.substring(0,d.length-b);e=e||"0";var f=d.substring(d.length-b);d=c?"-":"";for(c=0;c<e.length;c++){if((e.length-c)%3===0&&c!==0)d+=",";d+=e.charAt(c)}if(b>0){for(e=f.length;e<b;e++)f+="0";d+="."+f.substring(0,b)}return d};var Rc={yyyy:Q("FullYear",4),yy:Q("FullYear",2,0,true),MM:Q("Month",2,1),M:Q("Month",1,1),dd:Q("Date",2),d:Q("Date",1),HH:Q("Hours",2),H:Q("Hours",1),hh:Q("Hours",2,-12),h:Q("Hours",1,-12),mm:Q("Minutes",2),m:Q("Minutes",1),ss:Q("Seconds",2),s:Q("Seconds",1),a:function(a){return a.getHours()<
+12?"am":"pm"},Z:function(a){a=a.getTimezoneOffset();return ba(a/60,2)+ba(Math.abs(a%60),2)}},Sc=/([^yMdHhmsaZ]*)(y+|M+|d+|H+|h+|m+|s+|a|Z)(.*)/,Tc=/^\d+$/;aa.date=function(a,b){if(K(a))a=Tc.test(a)?parseInt(a,10):dc.toDate(a);if(ua(a))a=new Date(a);if(!(a instanceof Date))return a;var c=a.toLocaleDateString(),d;if(b&&K(b)){c="";for(var e=[];b;){e=Ma(e,Sc.exec(b),1);b=e.pop()}u(e,function(f){d=Rc[f];c+=d?d(a):f})}return c};aa.json=function(a){this.$element.addClass("ng-monospace");return X(a,true)};
+aa.lowercase=P;aa.uppercase=$a;aa.html=function(a,b){return new db(a,b)};aa.linky=function(a){if(!a)return a;for(var b=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/,c=a,d=[],e=vb(d),f,g;a=c.match(b);){f=a[0];if(a[2]==a[3])f="mailto:"+f;g=a.index;e.chars(c.substr(0,g));e.start("a",{href:f});e.chars(a[0].replace(/^mailto:/,""));e.end("a");c=c.substring(g+a[0].length)}e.chars(c);return new db(d.join(""))};var Uc=/^\s*[-+]?\d*(\.\d*)?\s*$/;ia.noop=xa(ka,ka);ia.json=xa(X,
+oa);ia["boolean"]=xa(Yb,wa);ia.number=xa(Yb,function(a){if(a==x||Uc.exec(a))return a===x||a===""?x:1*a;else throw"Not a number";});ia.list=xa(function(a){return a?a.join(", "):a},function(a){var b=[];u((a||"").split(","),function(c){(c=va(c))&&b.push(c)});return b});ia.trim=xa(function(a){return a?va(""+a):""});D(lb,{noop:function(){return x},regexp:function(a,b,c){return a.match(b)?x:c||"Value does not match expected format "+b+"."},number:function(a,b,c){var d=1*a;if(d==a){if(typeof b!=ma&&d<b)return"Value can not be less than "+
+b+".";if(typeof b!=ma&&d>c)return"Value can not be greater than "+c+".";return x}else return"Not a number"},integer:function(a,b,c){if(b=lb.number(a,b,c))return b;if(!(""+a).match(/^\s*[\d+]*\s*$/)||a!=Math.round(a))return"Not a whole number";return x},date:function(a){var b=(a=/^(\d\d?)\/(\d\d?)\/(\d\d\d\d)$/.exec(a))?new Date(a[3],a[1]-1,a[2]):0;return b&&b.getFullYear()==a[3]&&b.getMonth()==a[1]-1&&b.getDate()==a[2]?x:"Value is not a date. (Expecting format: 12/31/2009)."},email:function(a){if(a.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/))return x;
+return"Email needs to be in username@host.com format."},phone:function(a){if(a.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/))return x;if(a.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/))return x;return"Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly."},url:function(a){if(a.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/))return x;return"URL needs to be in http://server[:port]/path format."},json:function(a){try{oa(a);
+return x}catch(b){return b.toString()}},asynchronous:function(a,b,c){if(a){var d=this,e=d.$element,f=e.data("$asyncValidator");f||e.data("$asyncValidator",f={inputs:{}});f.current=a;var g=f.inputs[a];if(g)g.inFlight?d.$invalidWidgets.markInvalid(d.$element):(c||E)(g.response);else{f.inputs[a]=g={inFlight:true};d.$invalidWidgets.markInvalid(d.$element);e.addClass("ng-input-indicator-wait");b(a,function(h,i){g.response=i;g.error=h;g.inFlight=false;if(f.current==a){e.removeClass("ng-input-indicator-wait");
+d.$invalidWidgets.markValid(e)}e.data(rb)();d.$root.$eval()})}return g.error}}});var Vc=/^(file|ftp|http|https):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,Wc=/^([^\?]*)?(\?([^\?]*))?$/,fc={http:80,https:443,ftp:21};N("$window",M(H,ka,H),[],"eager-published");N("$document",function(a){return B(a.document)},["$window"],"eager-published");N("$location",function(a){function b(n){if(K(n)){var m=D,s=j,o={},t=Vc.exec(n);if(t){o.href=n.replace(/#$/,"");o.protocol=t[1];o.host=
+t[3]||"";o.port=t[5]||fc[o.protocol]||x;o.path=t[6]||"";o.search=fb(t[8]);o.hash=t[10]||"";D(o,h(o.hash))}m(s,o)}else{F(n.hash)&&D(n,h(n.hash));D(j,n);if(F(n.hashPath||n.hashSearch))j.hash=g(j);j.href=f(j)}}function c(){if(j.href==q){if(j.hash==r)j.hash=g(j);j.href=f(j)}b(j.href)}function d(){q=j.href;r=j.hash}function e(){c();if(j.href!=q){a.setUrl(k=j.href);d()}}function f(n){var m=Ab(n.search),s=n.port==fc[n.protocol]?x:n.port;return n.protocol+"://"+n.host+(s?":"+s:"")+n.path+(m?"?"+m:"")+(n.hash?
+"#"+n.hash:"")}function g(n){var m=Ab(n.hashSearch);return escape(n.hashPath).replace(/%21/gi,"!").replace(/%3A/gi,":").replace(/%24/gi,"$")+(m?"?"+m:"")}function h(n){var m={},s=Wc.exec(n);if(s){m.hash=n;m.hashPath=unescape(s[1]||"");m.hashSearch=fb(s[3])}return m}var i=this,j={toString:function(){c();return j.href},update:b,updateHash:function(n,m){var s={};if(K(n)){s.hashPath=n;if(F(m))s.hashSearch=m}else s.hashSearch=n;b(s)}},k=a.getUrl(),q,r;a.addPollFn(function(){if(k!=a.getUrl()){b(k=a.getUrl());
+d();i.$eval()}});this.$onEval(-99999,e);this.$onEval(99999,e);b(k);d();return j},["$browser"],"eager-published");N("$log",function(a){function b(c){var d=a.console||{},e=d[c]||d.log||E;return e.apply?function(){var f=[];u(arguments,function(g){f.push(bb(g))});return e.apply(d,f)}:e}return{log:b("log"),warn:b("warn"),info:b("info"),error:b("error")}},["$window"],"eager-published");N("$exceptionHandler",function(a){return function(b){a.error(b)}},["$log"],"eager-published");N("$hover",function(a,b){var c,
+d,e=B(b[0].body);a.hover(function(f,g){if(g&&(d=f.attr(Sa)||f.attr(Ga))){if(!c){c={callout:B('<div id="ng-callout"></div>'),arrow:B("<div></div>"),title:B('<div class="ng-title"></div>'),content:B('<div class="ng-content"></div>')};c.callout.append(c.arrow);c.callout.append(c.title);c.callout.append(c.content);e.append(c.callout)}var h=e[0].getBoundingClientRect(),i=f[0].getBoundingClientRect();h=h.right-i.right-10;c.title.text(f.hasClass("ng-exception")?"EXCEPTION:":"Validation error...");c.content.text(d);
+if(h<300){c.arrow.addClass("ng-arrow-right");c.arrow.css({left:"301px"});c.callout.css({position:"fixed",left:i.left-10-300-4+"px",top:i.top-3+"px",width:"300px"})}else{c.arrow.addClass("ng-arrow-left");c.callout.css({position:"fixed",left:i.right+10+"px",top:i.top-3+"px",width:"300px"})}}else if(c){c.callout.remove();c=x}})},["$browser","$document"],"eager");N("$invalidWidgets",function(){function a(c){if(c==H.document)return false;c=c.parentNode;return!c||a(c)}var b=[];b.markValid=function(c){c=
+Ka(b,c);c!=-1&&b.splice(c,1)};b.markInvalid=function(c){Ka(b,c)===-1&&b.push(c)};b.visible=function(){var c=0;u(b,function(d){var e=c;d=d[0].getBoundingClientRect();var f=d.height||d.bottom||0-d.top||0;c=e+((d.width||d.right||0-d.left||0)>0&&f>0?1:0)});return c};this.$onEval(99999,function(){for(var c=0;c<b.length;){var d=b[c];if(a(d[0])){b.splice(c,1);d.dealoc&&d.dealoc()}else c++}});return b},[],"eager-published");N("$route",function(a){var b={},c=[],d=this,e=0,f={routes:b,onChange:M(c,c.push),
+when:function(g,h){if(C.isUndefined(g))return b;var i=b[g];i||(i=b[g]={});h&&C.extend(i,h);e++;return i}};this.$watch(function(){return e+a.hash},function(){var g;f.current=x;C.foreach(b,function(h,i){if(!g){var j=Zb(a.hashPath,i);if(j){g=C.scope(d);f.current=C.extend({},h,{scope:g,params:C.extend({},a.hashSearch,j)})}}});C.foreach(c,d.$tryEval);g&&g.$become(f.current.controller)});return f},["$location"],"eager-published");N("$xhr",function(a,b,c){var d=this;return function(e,f,g,h){if(J(g)){h=g;
+g=x}if(g&&U(g))g=X(g);a.xhr(e,f,g,function(i,j){try{if(K(j)&&/^\s*[\[\{]/.exec(j)&&/[\}\]]\s*$/.exec(j))j=oa(j);i==200?h(i,j):b({method:e,url:f,data:g,callback:h},{status:i,body:j})}catch(k){c.error(k)}finally{d.$eval()}})}},["$browser","$xhr.error","$log"]);N("$xhr.error",function(a){return function(b,c){a.error("ERROR: XHR: "+b.url,b,c)}},["$log"]);N("$xhr.bulk",function(a,b,c){function d(f,g,h,i){if(J(h)){i=h;h=x}var j;u(d.urls,function(k){if(J(k.match)?k.match(g):k.match.exec(g))j=k});if(j){if(!j.requests)j.requests=
+[];j.requests.push({method:f,url:g,data:h,callback:i})}else a(f,g,h,i)}var e=this;d.urls={};d.flush=function(f){u(d.urls,function(g,h){var i=g.requests;if(i&&i.length){g.requests=[];g.callbacks=[];a("POST",h,{requests:i},function(j,k){u(k,function(q,r){try{q.status==200?(i[r].callback||E)(q.status,q.response):b(i[r],q)}catch(n){c.error(n)}});(f||E)()});e.$eval()}})};this.$onEval(99999,d.flush);return d},["$xhr","$xhr.error","$log"]);N("$defer",function(a,b){var c=this;return function(d){a.defer(function(){try{d()}catch(e){b(e)}finally{c.$eval()}})}},
+["$browser","$exceptionHandler"]);N("$xhr.cache",function(a,b){function c(f,g,h,i,j){if(J(h)){i=h;h=x}if(f=="GET"){var k;if(k=c.data[g]){b(function(){i(200,S(k.value))});if(!j)return}if(j=d[g])j.callbacks.push(i);else{d[g]={callbacks:[i]};c.delegate(f,g,h,function(q,r){if(q==200)c.data[g]={value:r};var n=d[g].callbacks;delete d[g];u(n,function(m){try{(m||E)(q,S(r))}catch(s){e.$log.error(s)}})})}}else{c.data={};c.delegate(f,g,h,i)}}var d={},e=this;c.data={};c.delegate=a;return c},["$xhr.bulk","$defer"]);
+N("$resource",function(a){a=new Ua(a);return M(a,a.route)},["$xhr.cache"]);N("$cookies",function(a){var b=this,c={},d={},e;a.addPollFn(function(){var f=a.cookies();if(e!=f){e=f;S(f,d);S(f,c);b.$eval()}})();this.$onEval(99999,function(){var f,g,h;for(f in d)Z(c[f])&&a.cookies(f,T);for(f in c)if(c[f]!==d[f]){a.cookies(f,c[f]);h=true}if(h){h=!h;g=a.cookies();for(f in c)if(c[f]!==g[f]){if(Z(g[f]))delete c[f];else c[f]=g[f];h=true}h&&b.$eval()}});return c},["$browser"],"eager-published");N("$cookieStore",
+function(a){return{get:function(b){return oa(a[b])},put:function(b,c){a[b]=X(c)},remove:function(b){delete a[b]}}},["$cookies"]);L("ng:init",function(a){return function(b){this.$tryEval(a,b)}});L("ng:controller",function(a){this.scope(true);return function(){var b=Aa(H,a,true)||Aa(this,a,true);if(!b)throw"Can not find '"+a+"' controller.";if(!J(b))throw"Reference '"+a+"' is not a class.";this.$become(b)}});L("ng:eval",function(a){return function(b){this.$onEval(a,b)}});L("ng:bind",function(a,b){b.addClass("ng-binding");
+return function(c){var d=E,e=E;this.$onEval(function(){var f,g,h,i,j;i=this.hasOwnProperty(bc)?this.$element:T;this.$element=c;g=this.$tryEval(a,function(k){f=bb(k)});this.$element=i;if(i=g instanceof db)g=(h=g).html;if(!(d===g&&e==f)){j=Ja(g);if(!i&&!j&&U(g))g=X(g);if(g!=d||f!=e){d=g;e=f;na(c,Sa,f);if(f)g=f;if(i)c.html(h.get());else if(j){c.html("");c.append(g)}else c.text(g===T?"":g)}}},c)}});var ac={};L("ng:bind-template",function(a,b){b.addClass("ng-binding");var c=$b(a);return function(d){var e;
+this.$onEval(function(){var f=c.call(this,d);if(f!=e){d.text(f);e=f}},d)}});var Xc={disabled:"disabled",readonly:"readOnly",checked:"checked",selected:"selected"};L("ng:bind-attr",function(a){return function(b){var c={},d=b.data("$update")||E;this.$onEval(function(){var e=this.$eval(a),f=E,g;for(g in e){var h=$b(e[g]).call(this,b),i=Xc[P(g)];if(c[g]!==h){c[g]=h;if(i){if(wa(h)){b.attr(i,i);b.attr("ng-"+i,h)}else{b.removeAttr(i);b.removeAttr("ng-"+i)}(b.data(rb)||E)()}else b.attr(g,h);f=d}}f()},b)}});
+L("ng:click",function(a){return function(b){var c=this;b.bind("click",function(d){c.$tryEval(a,b);c.$root.$eval();d.stopPropagation()})}});L("ng:submit",function(a){return function(b){var c=this;b.bind("submit",function(d){c.$tryEval(a,b);c.$root.$eval();d.preventDefault()})}});L("ng:watch",function(a){return function(b){var c=this;Pa(a).watch()({addListener:function(d,e){c.$watch(d,function(){return e(c)},b)}})}});L("ng:class",ob(function(){return true}));L("ng:class-odd",ob(function(a){return a%
+2===0}));L("ng:class-even",ob(function(a){return a%2===1}));L("ng:show",function(a){return function(b){this.$onEval(function(){b.css("display",wa(this.$eval(a))?"":"none")},b)}});L("ng:hide",function(a){return function(b){this.$onEval(function(){b.css("display",wa(this.$eval(a))?"none":"")},b)}});L("ng:style",function(a){return function(b){var c=Ic(b);this.$onEval(function(){var d=this.$eval(a)||{},e,f={};for(e in d){if(c[e]===T)c[e]="";f[e]=d[e]}for(e in c)f[e]=f[e]||c[e];b.css(f)},b)}});eb("{{}}",
+function(a,b,c){var d=Wa(a),e=this;if(d.length>1||Xa(d[0])!==x)if(oc(c[0]))c.attr("ng:bind-template",a);else{var f=b,g;u(Wa(a),function(h){var i=Xa(h);if(i){g=e.element("span");g.attr("ng:bind",i)}else g=e.text(h);if(ga&&h.charAt(0)==" "){g=B("<span>&nbsp;</span>");i=g.html();g.text(h.substr(1));g.html(i+g.html())}f.after(g);f=g});b.remove()}});eb("OPTION",function(a,b,c){if(za(c)=="OPTION"){b=V.createElement("select");b.insertBefore(c[0].cloneNode(true),x);b.innerHTML.match(/<option(\s.*\s|\s)value\s*=\s*.*>.*<\/\s*option\s*>/gi)||
+c.attr("value",a)}});var Yc={"ng:src":"src","ng:href":"href"};zb("{{}}",function(a,b,c){if(!(L(b)||L("@"+b))){if(ga&&b=="src")a=decodeURI(a);var d=Wa(a);if(d.length>1||Xa(d[0])!==x){c.removeAttr(b);d=oa(c.attr("ng:bind-attr")||"{}");d[Yc[b]||b]=a;c.attr("ng:bind-attr",X(d))}}});R=ya("keyup change",cc,qb,Ya());Y=ya("click",sb,sb,E);var Jc={text:R,textarea:R,hidden:R,password:R,button:Y,submit:Y,reset:Y,image:Y,checkbox:ya("click",Fa,function(a,b){var c=b[0];return{get:function(){return!!c.checked},
+set:function(d){c.checked=wa(d)}}},Ya(false)),radio:ya("click",Fa,function(a,b){var c=b[0];return{get:function(){return c.checked?c.value:x},set:function(d){c.checked=d==c.value}}},function(a,b,c){var d=a.get(),e=b.get();c=c[0];c.checked=false;c.name=this.$id+"@"+c.name;if(Z(d))a.set(d=x);d==x&&e!==x&&a.set(e);b.set(d)}),"select-one":ya("change",Fa,qb,Ya(x)),"select-multiple":ya("change",Fa,function(a,b){var c=b[0].options;return{get:function(){var d=[];u(c,function(e){e.selected&&d.push(e.value)});
+return d},set:function(d){var e={};u(d,function(f){e[f]=true});u(c,function(f){f.selected=e[f.value]})}}},Ya([]))};W("input",Za);W("textarea",Za);W("button",Za);W("select",function(a){this.descend(true);return Za.call(this,a)});W("option",function(){this.descend(true);this.directives(true);return function(a){var b=a.parent(),c=tc(b),d=Fa(c,b),e=qb(c,b),f=a.attr("value"),g=a.attr("ng-selected");a.data("$update",function(){var h=a.attr("value"),i=a.attr("ng-selected"),j=d.get();if(g!=i||f!=h){g=i;f=
+h;if(i||j==x||j==T)d.set(h);h==j&&e.set(f)}})}});W("ng:include",function(a){var b=this,c=a.attr("src"),d=a.attr("scope")||"",e=a[0].getAttribute("onload")||"";if(a[0]["ng:compiled"]){this.descend(true);this.directives(true)}else{a[0]["ng:compiled"]=true;return D(function(f,g){function h(){k++}var i=this,j,k=0,q=false;this.$watch(c,h);this.$watch(d,h);i.$onEval(function(){if(j&&!q){q=true;try{j.$eval()}finally{q=false}}});this.$watch(function(){return k},function(){var r=this.$eval(c),n=this.$eval(d);
+if(r)f("GET",r,function(m,s){g.html(s);j=n||qa(i);b.compile(g)(g,j);j.$init();i.$eval(e)});else{j=null;g.html("")}})},{$inject:["$xhr.cache"]})}});var Zc=W("ng:switch",function(a){var b=this,c=a.attr("on"),d=a.attr("using")||"equals",e=d.split(":"),f=Zc[e.shift()],g=a.attr("change")||"",h=[];if(!f)throw"Using expression '"+d+"' unknown.";if(!c)throw"Missing 'on' attribute.";Cb(a,function(i){var j=i.attr("ng:switch-when"),k={change:g,element:i,template:b.compile(i)};if(K(j)){k.when=function(q,r){var n=
+[r,j];u(e,function(m){n.push(m)});return f.apply(q,n)};h.unshift(k)}else if(K(i.attr("ng:switch-default"))){k.when=Ia(true);h.push(k)}});u(h,function(i){i.element.remove()});a.html("");return function(i){var j=this,k;this.$watch(c,function(q){var r=false;i.html("");k=qa(j);u(h,function(n){if(!r&&n.when(k,q)){r=true;var m=B(n.element[0].cloneNode(true));i.append(m);k.$tryEval(n.change,i);n.template(m,k);k.$init()}})});j.$onEval(function(){k&&k.$eval()})}},{equals:function(a,b){return""+a==b},route:Zb});
+W("a",function(){this.descend(true);this.directives(true);return function(a){a.attr("href")===""&&a.bind("click",function(b){b.preventDefault()})}});W("@ng:repeat",function(a,b){b.removeAttr("ng:repeat");b.replaceWith(this.comment("ng:repeat: "+a));var c=this.compile(b);return function(d){var e=a.match(/^\s*(.+)\s+in\s+(.*)\s*$/),f,g,h,i;if(!e)throw ja("Expected ng:repeat in form of 'item in collection' but got '"+a+"'.");f=e[1];g=e[2];e=f.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!e)throw ja("'item' in 'item in collection' should be identifier or (key, value) but got '"+
+keyValue+"'.");h=e[3]||e[1];i=e[2];var j=[],k=this;this.$onEval(function(){var q=0,r=j.length,n=d,m=this.$tryEval(g,d),s=fa(m),o=0,t,y;if(s)o=m.length;else for(y in m)m.hasOwnProperty(y)&&o++;for(y in m)if(!s||m.hasOwnProperty(y)){if(q<r){t=j[q];t[h]=m[y];if(i)t[i]=y}else{t=c(B(b[0].cloneNode(true)),qa(k));t[h]=m[y];if(i)t[i]=y;n.after(t.$element);t.$index=q;t.$position=q==0?"first":q==o-1?"last":"middle";t.$element.attr("ng:repeat-index",q);t.$init();j.push(t)}t.$eval();n=t.$element;q++}for(;j.length>
+q;)j.pop().$element.remove()},d)}});W("@ng:non-bindable",E);var Ha;kb("$browser",function(a){if(!Ha){Ha=new yc(H.location,B(H.document),B(H.document.getElementsByTagName("head")[0]),Lc,a,H.setTimeout);Ha.startPoller(50,function(b,c){setTimeout(b,c)});Ha.bind()}return Ha},{inject:["$log"]});D(C,{element:B,compile:xb,scope:qa,copy:S,extend:D,equals:La,foreach:u,injector:Hb,noop:E,bind:M,toJson:X,fromJson:oa,identity:ka,isUndefined:Z,isDefined:F,isString:K,isFunction:J,isObject:U,isNumber:ua,isArray:fa});
+H.onload=function(){try{tb&&tb()}catch(a){}var b=qc(V);if(b.autobind){var c=xb(H.document,x,{$config:b}),d=c.$inject("$browser");if(b.css)d.addCss(b.base_url+b.css);else ga<8&&d.addJs(b.base_url+b.ie_compat,b.ie_compat_id);c.$init()}}})(window,document,window.onload);document.write('<style type="text/css">@charset "UTF-8";.ng-format-negative{color:red;}.ng-exception{border:2px solid #FF0000;font-family:"Courier New",Courier,monospace;font-size:smaller;white-space:pre;}.ng-validation-error{border:2px solid #FF0000;}#ng-callout{margin:0;padding:0;border:0;outline:0;font-size:13px;font-weight:normal;font-family:Verdana,Arial,Helvetica,sans-serif;vertical-align:baseline;background:transparent;text-decoration:none;}#ng-callout .ng-arrow-left{background-image:url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7");background-repeat:no-repeat;background-position:left top;position:absolute;z-index:101;left:-12px;height:23px;width:10px;top:-3px;}#ng-callout .ng-arrow-right{background-image:url("data:image/gif;base64,R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7");background-repeat:no-repeat;background-position:left top;position:absolute;z-index:101;height:23px;width:11px;top:-2px;}#ng-callout{position:absolute;z-index:100;border:2px solid #CCCCCC;background-color:#fff;}#ng-callout .ng-content{padding:10px 10px 10px 10px;color:#333333;}#ng-callout .ng-title{background-color:#CCCCCC;text-align:left;padding-left:8px;padding-bottom:5px;padding-top:2px;font-weight:bold;}.ng-input-indicator-wait{background-image:url("data:image/png;base64,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");background-position:right;background-repeat:no-repeat;}</style>');
1 app/lib/angular/version.txt
@@ -0,0 +1 @@
+0.9.7
12 config/jsTestDriver.conf
@@ -0,0 +1,12 @@
+server: http://localhost:9876
+
+load:
+ - test/lib/jasmine/jasmine.js
+ - test/lib/jasmine-jstd-adapter/JasmineAdapter.js
+ - app/lib/angular/angular.js
+ - test/lib/angular-mocks.js
+ - src/*.js
+ - test/unit/*.js
+
+exclude:
+
2 logs/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
7 scripts/test-server.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+base_dir=`dirname $0`
+
+echo "Starting JSTD server..."
+
+java -jar "$base_dir/../lib-test/jstestdriver/JsTestDriver.jar" --port 9876 --browserTimeout 20000
10 scripts/test.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+base_dir=`dirname $0`
+
+tests=$1
+if [[ $tests = "" ]]; then
+ tests="all"
+fi
+
+java -jar "$base_dir/../lib-test/jstestdriver/JsTestDriver.jar" --tests "$tests"
16 scripts/watchr.rb
@@ -0,0 +1,16 @@
+#!/usr/bin/env watchr
+
+# config file for watchr http://github.com/mynyml/watchr
+# install: gem install watchr
+# run: watch watchr.rb
+# note: make sure that you have jstd server running (server.sh) and a browser captured
+
+log_file = File.expand_path(File.dirname(__FILE__) + '/../logs/jstd.log')
+
+puts "watcher started. log: #{log_file}"
+
+watch( '../(src|test)/' ) do
+ `echo "\n\ntest run started @ \`date\`" > #{log_file}`
+ `./test.sh &> #{log_file}`
+end
+
243 scripts/web-server.js
@@ -0,0 +1,243 @@
+#!/usr/bin/env node
+
+var sys = require('sys'),
+ http = require('http'),
+ fs = require('fs'),
+ url = require('url'),
+ events = require('events');
+
+var DEFAULT_PORT = 8000;
+
+function main(argv) {
+ new HttpServer({
+ 'GET': createServlet(StaticServlet),
+ 'HEAD': createServlet(StaticServlet)
+ }).start(Number(argv[2]) || DEFAULT_PORT);
+}
+
+function escapeHtml(value) {
+ return value.toString().
+ replace('<', '&lt;').
+ replace('>', '&gt').
+ replace('"', '&quot;');
+}
+
+function createServlet(Class) {
+ var servlet = new Class();
+ return servlet.handleRequest.bind(servlet);
+}
+
+/**
+ * An Http server implementation that uses a map of methods to decide
+ * action routing.
+ *
+ * @param {Object} Map of method => Handler function
+ */
+function HttpServer(handlers) {
+ this.handlers = handlers;
+ this.server = http.createServer(this.handleRequest_.bind(this));
+}
+
+HttpServer.prototype.start = function(port) {
+ this.port = port;
+ this.server.listen(port);
+ sys.puts('Http Server running at http://127.0.0.1:' + port + '/');
+};
+
+HttpServer.prototype.parseUrl_ = function(urlString) {
+ var parsed = url.parse(urlString);
+ parsed.pathname = url.resolve('/', parsed.pathname);
+ return url.parse(url.format(parsed), true);
+};
+
+HttpServer.prototype.handleRequest_ = function(req, res) {
+ var logEntry = req.method + ' ' + req.url;
+ if (req.headers['user-agent']) {
+ logEntry += ' ' + req.headers['user-agent'];
+ }
+ sys.puts(logEntry);
+ req.url = this.parseUrl_(req.url);
+ var handler = this.handlers[req.method];
+ if (!handler) {
+ res.writeHead(501);
+ res.end();
+ } else {
+ handler.call(this, req, res);
+ }
+};
+
+/**
+ * Handles static content.
+ */
+function StaticServlet() {}
+
+StaticServlet.MimeMap = {
+ 'txt': 'text/plain',
+ 'html': 'text/html',
+ 'css': 'text/css',
+ 'xml': 'application/xml',
+ 'json': 'application/json',
+ 'js': 'application/javascript',
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'gif': 'image/gif',
+ 'png': 'image/png'
+};
+
+StaticServlet.prototype.handleRequest = function(req, res) {
+ var self = this;
+ var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/, function(match, hex){
+ return String.fromCharCode(parseInt(hex, 16));
+ });
+ var parts = path.split('/');
+ if (parts[parts.length-1].charAt(0) === '.')
+ return self.sendForbidden_(req, res, path);
+ fs.stat(path, function(err, stat) {
+ if (err)
+ return self.sendMissing_(req, res, path);
+ if (stat.isDirectory())
+ return self.sendDirectory_(req, res, path);
+ return self.sendFile_(req, res, path);
+ });
+}
+
+StaticServlet.prototype.sendError_ = function(req, res, error) {
+ res.writeHead(500, {
+ 'Content-Type': 'text/html'
+ });
+ res.write('<!doctype html>\n');
+ res.write('<title>Internal Server Error</title>\n');
+ res.write('<h1>Internal Server Error</h1>');
+ res.write('<pre>' + escapeHtml(sys.inspect(error)) + '</pre>');
+ sys.puts('500 Internal Server Error');
+ sys.puts(sys.inspect(error));
+};
+
+StaticServlet.prototype.sendMissing_ = function(req, res, path) {
+ path = path.substring(1);
+ res.writeHead(404, {
+ 'Content-Type': 'text/html'
+ });
+ res.write('<!doctype html>\n');
+ res.write('<title>404 Not Found</title>\n');
+ res.write('<h1>Not Found</h1>');
+ res.write(
+ '<p>The requested URL ' +
+ escapeHtml(path) +
+ ' was not found on this server.</p>'
+ );
+ res.end();
+ sys.puts('404 Not Found: ' + path);
+};
+
+StaticServlet.prototype.sendForbidden_ = function(req, res, path) {
+ path = path.substring(1);
+ res.writeHead(403, {
+ 'Content-Type': 'text/html'
+ });
+ res.write('<!doctype html>\n');
+ res.write('<title>403 Forbidden</title>\n');
+ res.write('<h1>Forbidden</h1>');
+ res.write(
+ '<p>You do not have permission to access ' +
+ escapeHtml(path) + ' on this server.</p>'
+ );
+ res.end();
+ sys.puts('403 Forbidden: ' + path);
+};
+
+StaticServlet.prototype.sendRedirect_ = function(req, res, redirectUrl) {
+ res.writeHead(301, {
+ 'Content-Type': 'text/html',
+ 'Location': redirectUrl
+ });
+ res.write('<!doctype html>\n');
+ res.write('<title>301 Moved Permanently</title>\n');
+ res.write('<h1>Moved Permanently</h1>');
+ res.write(
+ '<p>The document has moved <a href="' +
+ redirectUrl +
+ '">here</a>.</p>'
+ );
+ res.end();
+ sys.puts('401 Moved Permanently: ' + redirectUrl);
+};
+
+StaticServlet.prototype.sendFile_ = function(req, res, path) {
+ var self = this;
+ var file = fs.createReadStream(path);
+ res.writeHead(200, {
+ 'Content-Type': StaticServlet.
+ MimeMap[path.split('.').pop()] || 'text/plain'
+ });
+ if (req.method === 'HEAD') {
+ res.end();
+ } else {
+ file.on('data', res.write.bind(res));
+ file.on('close', function() {
+ res.end();
+ });
+ file.on('error', function(error) {
+ self.sendError_(req, res, error);
+ });
+ }
+};
+
+StaticServlet.prototype.sendDirectory_ = function(req, res, path) {
+ var self = this;
+ if (path.match(/[^\/]$/)) {
+ req.url.pathname += '/';
+ var redirectUrl = url.format(url.parse(url.format(req.url)));
+ return self.sendRedirect_(req, res, redirectUrl);
+ }
+ fs.readdir(path, function(err, files) {
+ if (err)
+ return self.sendError_(req, res, error);
+
+ if (!files.length)
+ return self.writeDirectoryIndex_(req, res, path, []);
+
+ var remaining = files.length;
+ files.forEach(function(fileName, index) {
+ fs.stat(path + '/' + fileName, function(err, stat) {
+ if (err)
+ return self.sendError_(req, res, err);
+ if (stat.isDirectory()) {
+ files[index] = fileName + '/';
+ }
+ if (!(--remaining))
+ return self.writeDirectoryIndex_(req, res, path, files);
+ });
+ });
+ });
+};
+
+StaticServlet.prototype.writeDirectoryIndex_ = function(req, res, path, files) {
+ path = path.substring(1);
+ res.writeHead(200, {
+ 'Content-Type': 'text/html'
+ });
+ if (req.method === 'HEAD') {
+ res.end();
+ return;
+ }
+ res.write('<!doctype html>\n');
+ res.write('<title>' + escapeHtml(path) + '</title>\n');
+ res.write('<style>\n');
+ res.write(' ol { list-style-type: none; font-size: 1.2em; }\n');
+ res.write('</style>\n');
+ res.write('<h1>Directory: ' + escapeHtml(path) + '</h1>');
+ res.write('<ol>');
+ files.forEach(function(fileName) {
+ if (fileName.charAt(0) !== '.') {
+ res.write('<li><a href="' +
+ escapeHtml(fileName) + '">' +
+ escapeHtml(fileName) + '</a></li>');
+ }
+ });
+ res.write('</ol>');
+ res.end();
+};
+
+// Must be last,
+main(process.argv);
303 test/lib/angular/angular-mocks.js
@@ -0,0 +1,303 @@
+/**
+ * The MIT License
+ *
+ * Copyright (c) 2010 Adam Abrons and Misko Hevery http://getangular.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+/*
+
+ NUGGGGGH MUST TONGUE WANGS
+ \
+ .....
+ C C /
+ /< /
+ ___ __________/_#__=o
+ /(- /(\_\________ \
+ \ ) \ )_ \o \
+ /|\ /|\ |' |
+ | _|
+ /o __\
+ / ' |
+ / / |
+ /_/\______|
+ ( _( <
+ \ \ \
+ \ \ |
+ \____\____\
+ ____\_\__\_\
+ /` /` o\
+ |___ |_______|.. . b'ger
+
+
+ IN THE FINAL BUILD THIS FILE DOESN'T HAVE DIRECT ACCESS TO GLOBAL FUNCTIONS
+ DEFINED IN Angular.js YOU *MUST* REFER TO THEM VIA angular OBJECT
+ (e.g. angular.forEach(...)) AND MAKE SURE THAT THE GIVEN FUNCTION IS EXPORTED
+ TO THE angular NAMESPACE in AngularPublic.js
+
+ */
+
+
+function MockBrowser() {
+ var self = this,
+ expectations = {},
+ requests = [];
+
+ this.isMock = true;
+ self.url = "http://server";
+ self.pollFns = [];
+
+ self.xhr = function(method, url, data, callback) {
+ if (angular.isFunction(data)) {
+ callback = data;
+ data = null;
+ }
+ if (data && angular.isObject(data)) data = angular.toJson(data);
+ if (data && angular.isString(data)) url += "|" + data;
+ var expect = expectations[method] || {};
+ var response = expect[url];
+ if (!response) {
+ throw {
+ message: "Unexpected request for method '" + method + "' and url '" + url + "'.",
+ name: "Unexpected Request"
+ };
+ }
+ requests.push(function(){
+ callback(response.code, response.response);
+ });
+ };
+ self.xhr.expectations = expectations;
+ self.xhr.requests = requests;
+ self.xhr.expect = function(method, url, data) {
+ if (data && angular.isObject(data)) data = angular.toJson(data);
+ if (data && angular.isString(data)) url += "|" + data;
+ var expect = expectations[method] || (expectations[method] = {});
+ return {
+ respond: function(code, response) {
+ if (!angular.isNumber(code)) {
+ response = code;
+ code = 200;
+ }
+ expect[url] = {code:code, response:response};
+ }
+ };
+ };
+ self.xhr.expectGET = angular.bind(self, self.xhr.expect, 'GET');
+ self.xhr.expectPOST = angular.bind(self, self.xhr.expect, 'POST');
+ self.xhr.expectDELETE = angular.bind(self, self.xhr.expect, 'DELETE');
+ self.xhr.expectPUT = angular.bind(self, self.xhr.expect, 'PUT');
+ self.xhr.expectJSON = angular.bind(self, self.xhr.expect, 'JSON');
+ self.xhr.flush = function() {
+ while(requests.length) {
+ requests.pop()();
+ }
+ };
+
+ self.cookieHash = {};
+ self.lastCookieHash = {};
+ self.deferredFns = [];
+
+ self.defer = function(fn) {
+ self.deferredFns.push(fn);
+ };
+
+ self.defer.flush = function() {
+ while (self.deferredFns.length) self.deferredFns.shift()();
+ };
+}
+MockBrowser.prototype = {
+
+ poll: function poll(){
+ angular.foreach(this.pollFns, function(pollFn){
+ pollFn();
+ });
+ },
+
+ addPollFn: function(pollFn) {
+ this.pollFns.push(pollFn);
+ return pollFn;
+ },
+
+ hover: function(onHover) {
+ },
+
+ getUrl: function(){
+ return this.url;
+ },
+
+ setUrl: function(url){
+ this.url = url;
+ },
+
+ cookies: function(name, value) {
+ if (name) {
+ if (value == undefined) {
+ delete this.cookieHash[name];
+ } else {
+ if (angular.isString(value) && //strings only
+ value.length <= 4096) { //strict cookie storage limits
+ this.cookieHash[name] = value;
+ }
+ }
+ } else {
+ if (!angular.equals(this.cookieHash, this.lastCookieHash)) {
+ this.lastCookieHash = angular.copy(this.cookieHash);
+ this.cookieHash = angular.copy(this.cookieHash);
+ }
+ return this.cookieHash;
+ }
+ }
+};
+
+angular.service('$browser', function(){
+ return new MockBrowser();
+});
+
+
+/**
+ * Mock of the Date type which has its timezone specified via constroctor arg.
+ *
+ * The main purpose is to create Date-like instances with timezone fixed to the specified timezone
+ * offset, so that we can test code that depends on local timezone settings without dependency on
+ * the time zone settings of the machine where the code is running.
+ *
+ * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)
+ * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*
+ *
+ * @example
+ * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');
+ * newYearInBratislava.getTimezoneOffset() => -60;
+ * newYearInBratislava.getFullYear() => 2010;
+ * newYearInBratislava.getMonth() => 0;
+ * newYearInBratislava.getDate() => 1;
+ * newYearInBratislava.getHours() => 0;
+ * newYearInBratislava.getMinutes() => 0;
+ *
+ *
+ * !!!! WARNING !!!!!
+ * This is not a complete Date object so only methods that were implemented can be called safely.
+ * To make matters worse, TzDate instances inherit stuff from Date via a prototype.
+ *
+ * We do our best to intercept calls to "unimplemented" methods, but since the list of methods is
+ * incomplete we might be missing some non-standard methods. This can result in errors like:
+ * "Date.prototype.foo called on incompatible Object".
+ */
+function TzDate(offset, timestamp) {
+ if (angular.isString(timestamp)) {
+ var tsStr = timestamp;
+
+ this.origDate = angular.String.toDate(timestamp);
+
+ timestamp = this.origDate.getTime();
+ if (isNaN(timestamp))
+ throw {
+ name: "Illegal Argument",
+ message: "Arg '" + tsStr + "' passed into TzDate constructor is not a valid date string"
+ };
+ } else {
+ this.origDate = new Date(timestamp);
+ }
+
+ var localOffset = new Date(timestamp).getTimezoneOffset();
+ this.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
+ this.date = new Date(timestamp + this.offsetDiff);
+
+ this.getTime = function() {
+ return this.date.getTime() - this.offsetDiff;
+ };
+
+ this.toLocaleDateString = function() {
+ return this.date.toLocaleDateString();
+ };
+
+ this.getFullYear = function() {
+ return this.date.getFullYear();
+ };
+
+ this.getMonth = function() {
+ return this.date.getMonth();
+ };
+
+ this.getDate = function() {
+ return this.date.getDate();
+ };
+
+ this.getHours = function() {
+ return this.date.getHours();
+ };
+
+ this.getMinutes = function() {
+ return this.date.getMinutes();
+ };
+
+ this.getSeconds = function() {
+ return this.date.getSeconds();
+ };
+
+ this.getTimezoneOffset = function() {
+ return offset * 60;
+ };
+
+ this.getUTCFullYear = function() {
+ return this.origDate.getUTCFullYear();
+ };
+
+ this.getUTCMonth = function() {
+ return this.origDate.getUTCMonth();
+ };
+
+ this.getUTCDate = function() {
+ return this.origDate.getUTCDate();
+ };
+
+ this.getUTCHours = function() {
+ return this.origDate.getUTCHours();
+ };
+
+ this.getUTCMinutes = function() {
+ return this.origDate.getUTCMinutes();
+ };
+
+ this.getUTCSeconds = function() {
+ return this.origDate.getUTCSeconds();
+ };
+
+
+ //hide all methods not implemented in this mock that the Date prototype exposes
+ var unimplementedMethods = ['getDay', 'getMilliseconds', 'getTime', 'getUTCDay',
+ 'getUTCMilliseconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',
+ 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
+ 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',
+ 'setYear', 'toDateString', 'toJSON', 'toGMTString', 'toLocaleFormat', 'toLocaleString',
+ 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];
+
+ angular.foreach(unimplementedMethods, function(methodName) {
+ this[methodName] = function() {
+ throw {
+ name: "MethodNotImplemented",
+ message: "Method '" + methodName + "' is not implemented in the TzDate mock"
+ };
+ };
+ });
+}
+
+//make "tzDateInstance instanceof Date" return true
+TzDate.prototype = Date.prototype;
16,805 test/lib/angular/angular-scenario.js
16,805 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
2 test/lib/angular/version.txt
@@ -0,0 +1,2 @@
+0.9.7
+
111 test/lib/jasmine-jstd-adapter/JasmineAdapter.js
@@ -0,0 +1,111 @@
+/**
+ * @fileoverview Jasmine JsTestDriver Adapter.
+ * @author ibolmo@gmail.com (Olmo Maldonado)
+ * @author misko@hevery.com (Misko Hevery)
+ */
+
+(function() {
+
+ function bind(_this, _function){
+ return function(){
+ return _function.call(_this);
+ };
+ }
+
+ var currentFrame = frame(null, null);
+
+ function frame(parent, name){
+ var caseName = (parent && parent.caseName ? parent.caseName + " " : '') + (name ? name : '');
+ var frame = {
+ name: name,
+ caseName: caseName,
+ parent: parent,
+ testCase: TestCase(caseName),
+ before: [],
+ after: [],
+ runBefore: function(){
+ if (parent) parent.runBefore.apply(this);
+ for ( var i = 0; i < frame.before.length; i++) {
+ frame.before[i].apply(this);
+ }
+ },
+ runAfter: function(){
+ for ( var i = 0; i < frame.after.length; i++) {
+ frame.after[i].apply(this);
+ }
+ if (parent) parent.runAfter.apply(this);
+ }
+ };
+ return frame;
+ };
+
+ jasmine.Env.prototype.describe = (function(describe){
+ return function(description){
+ currentFrame = frame(currentFrame, description);
+ var val = describe.apply(this, arguments);
+ currentFrame = currentFrame.parent;
+ return val;
+ };
+
+ })(jasmine.Env.prototype.describe);
+
+ var id = 0;
+
+ jasmine.Env.prototype.it = (function(it){
+ return function(desc, itFn){
+ var self = this;
+ var spec = it.apply(this, arguments);
+ var currentSpec = this.currentSpec;
+ if (!currentSpec.$id) {
+ currentSpec.$id = id++;
+ }
+ var frame = this.jstdFrame = currentFrame;
+ var name = 'test that it ' + desc;
+ if (this.jstdFrame.testCase.prototype[name])
+ throw "Spec with name '" + desc + "' already exists.";
+ this.jstdFrame.testCase.prototype[name] = function(){
+ jasmine.getEnv().currentSpec = currentSpec;
+ frame.runBefore.apply(currentSpec);
+ try {
+ itFn.apply(currentSpec);
+ } finally {
+ frame.runAfter.apply(currentSpec);
+ }
+ };
+ return spec;
+ };
+
+ })(jasmine.Env.prototype.it);
+
+
+ jasmine.Env.prototype.beforeEach = (function(beforeEach){
+ return function(beforeEachFunction) {
+ beforeEach.apply(this, arguments);
+ currentFrame.before.push(beforeEachFunction);
+ };
+
+ })(jasmine.Env.prototype.beforeEach);
+
+
+ jasmine.Env.prototype.afterEach = (function(afterEach){
+ return function(afterEachFunction) {
+ afterEach.apply(this, arguments);
+ currentFrame.after.push(afterEachFunction);
+ };
+
+ })(jasmine.Env.prototype.afterEach);
+
+
+ jasmine.NestedResults.prototype.addResult = (function(addResult){
+ return function(result) {
+ addResult.call(this, result);
+ if (result.type != 'MessageResult' && !result.passed()) fail(result.message);
+ };
+
+ })(jasmine.NestedResults.prototype.addResult);
+
+ // Reset environment with overriden methods.
+ jasmine.currentEnv_ = null;
+ jasmine.getEnv();
+
+})();
1 test/lib/jasmine-jstd-adapter/version.txt
@@ -0,0 +1 @@
+head @ 2010-05-10
20 test/lib/jasmine/MIT.LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2008-2010 Pivotal Labs
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
180 test/lib/jasmine/index.js
@@ -0,0 +1,180 @@
+var fs = require('fs');
+var sys = require('sys');
+var path = require('path');
+
+var filename = __dirname + '/jasmine.js';
+global.window = {
+ setTimeout: setTimeout,
+ clearTimeout: clearTimeout,
+ setInterval: setInterval,
+ clearInterval: clearInterval
+};
+var src = fs.readFileSync(filename);
+var jasmine = process.compile(src + '\njasmine;', filename);
+delete global.window;
+
+function noop(){}
+
+jasmine.executeSpecsInFolder = function(folder, done, isVerbose, showColors, matcher){
+ var log = [];
+ var columnCounter = 0;
+ var start = 0;
+ var elapsed = 0;
+ var verbose = isVerbose || false;
+ var fileMatcher = new RegExp(matcher || "\.js$");
+ var colors = showColors || false;
+ var specs = jasmine.getAllSpecFiles(folder, fileMatcher);
+
+ var ansi = {
+ green: '\033[32m',
+ red: '\033[31m',
+ yellow: '\033[33m',
+ none: '\033[0m'
+ };
+
+ for (var i = 0, len = specs.length; i < len; ++i){
+ var filename = specs[i];
+ require(filename.replace(/\.*$/, ""));
+ }
+
+ var jasmineEnv = jasmine.getEnv();
+ jasmineEnv.reporter = {
+ log: function(str){
+ },
+
+ reportSpecStarting: function(runner) {
+ },
+
+ reportRunnerStarting: function(runner) {
+ sys.puts('Started');
+ start = Number(new Date);
+ },
+
+ reportSuiteResults: function(suite) {
+ var specResults = suite.results();
+ var path = [];
+ while(suite) {
+ path.unshift(suite.description);
+ suite = suite.parentSuite;
+ }
+ var description = path.join(' ');
+
+ if (verbose)
+ log.push('Spec ' + description);
+
+ specResults.items_.forEach(function(spec){
+ if (spec.failedCount > 0 && spec.description) {
+ if (!verbose)
+ log.push(description);
+ log.push(' it ' + spec.description);
+ spec.items_.forEach(function(result){
+ log.push(' ' + result.trace.stack + '\n');
+ });
+ }
+ });
+ },
+
+ reportSpecResults: function(spec) {
+ var result = spec.results();
+ var msg = '';
+ if (result.passed())
+ {
+ msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
+// } else if (result.skipped) { TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
+// msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
+ } else {
+ msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
+ }
+ sys.print(msg);
+ if (columnCounter++ < 50) return;
+ columnCounter = 0;
+ sys.print('\n');
+ },
+
+
+ reportRunnerResults: function(runner) {
+ elapsed = (Number(new Date) - start) / 1000;
+ sys.puts('\n');
+ log.forEach(function(log){
+ sys.puts(log);
+ });
+ sys.puts('Finished in ' + elapsed + ' seconds');
+
+ var summary = jasmine.printRunnerResults(runner);
+ if(colors)
+ {
+ if(runner.results().failedCount === 0 )
+ sys.puts(ansi.green + summary + ansi.none);
+ else
+ sys.puts(ansi.red + summary + ansi.none);
+ } else {
+ sys.puts(summary);
+ }
+ (done||noop)(runner, log);
+ }
+ };
+ jasmineEnv.execute();
+};
+
+jasmine.getAllSpecFiles = function(dir, matcher){
+ var specs = [];
+
+ if (fs.statSync(dir).isFile() && dir.match(matcher)) {
+ specs.push(dir);
+ } else {
+ var files = fs.readdirSync(dir);
+ for (var i = 0, len = files.length; i < len; ++i){
+ var filename = dir + '/' + files[i];
+ if (fs.statSync(filename).isFile() && filename.match(matcher)){
+ specs.push(filename);
+ }else if (fs.statSync(filename).isDirectory()){
+ var subfiles = this.getAllSpecFiles(filename, matcher);
+ subfiles.forEach(function(result){
+ specs.push(result);
+ });
+ }
+ }
+ }
+
+ return specs;
+};
+
+jasmine.printRunnerResults = function(runner){
+ var results = runner.results();
+ var suites = runner.suites();
+ var msg = '';
+ msg += suites.length + ' test' + ((suites.length === 1) ? '' : 's') + ', ';
+ msg += results.totalCount + ' assertion' + ((results.totalCount === 1) ? '' : 's') + ', ';
+ msg += results.failedCount + ' failure' + ((results.failedCount === 1) ? '' : 's') + '\n';
+ return msg;
+};
+
+function now(){
+ return new Date().getTime();
+}
+
+jasmine.asyncSpecWait = function(){
+ var wait = jasmine.asyncSpecWait;
+ wait.start = now();
+ wait.done = false;
+ (function innerWait(){
+ waits(10);
+ runs(function() {
+ if (wait.start + wait.timeout < now()) {
+ expect('timeout waiting for spec').toBeNull();
+ } else if (wait.done) {
+ wait.done = false;
+ } else {
+ innerWait();
+ }
+ });
+ })();
+};
+jasmine.asyncSpecWait.timeout = 4 * 1000;
+jasmine.asyncSpecDone = function(){
+ jasmine.asyncSpecWait.done = true;
+};
+
+for ( var key in jasmine) {
+ exports[key] = jasmine[key];
+}
188 test/lib/jasmine/jasmine-html.js
@@ -0,0 +1,188 @@
+jasmine.TrivialReporter = function(doc) {
+ this.document = doc || document;
+ this.suiteDivs = {};
+ this.logRunningSpecs = false;
+};
+
+jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
+ var el = document.createElement(type);
+
+ for (var i = 2; i < arguments.length; i++) {
+ var child = arguments[i];
+
+ if (typeof child === 'string') {
+ el.appendChild(document.createTextNode(child));
+ } else {
+ if (child) { el.appendChild(child); }
+ }
+ }
+
+ for (var attr in attrs) {
+ if (attr == "className") {
+ el[attr] = attrs[attr];
+ } else {
+ el.setAttribute(attr, attrs[attr]);
+ }
+ }
+
+ return el;
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
+ var showPassed, showSkipped;
+
+ this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
+ this.createDom('div', { className: 'banner' },
+ this.createDom('div', { className: 'logo' },
+ this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
+ this.createDom('span', { className: 'version' }, runner.env.versionString())),
+ this.createDom('div', { className: 'options' },
+ "Show ",
+ showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
+ this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
+ showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
+ this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
+ )
+ ),
+
+ this.runnerDiv = this.createDom('div', { className: 'runner running' },
+ this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
+ this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
+ this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
+ );
+
+ this.document.body.appendChild(this.outerDiv);
+
+ var suites = runner.suites();
+ for (var i = 0; i < suites.length; i++) {
+ var suite = suites[i];
+ var suiteDiv = this.createDom('div', { className: 'suite' },
+ this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
+ this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
+ this.suiteDivs[suite.id] = suiteDiv;
+ var parentDiv = this.outerDiv;
+ if (suite.parentSuite) {
+ parentDiv = this.suiteDivs[suite.parentSuite.id];
+ }
+ parentDiv.appendChild(suiteDiv);
+ }
+
+ this.startedAt = new Date();
+
+ var self = this;
+ showPassed.onclick = function(evt) {
+ if (showPassed.checked) {
+ self.outerDiv.className += ' show-passed';
+ } else {
+ self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
+ }
+ };
+
+ showSkipped.onclick = function(evt) {
+ if (showSkipped.checked) {
+ self.outerDiv.className += ' show-skipped';
+ } else {
+ self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
+ }
+ };
+};
+
+jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
+ var results = runner.results();
+ var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
+ this.runnerDiv.setAttribute("class", className);
+ //do it twice for IE
+ this.runnerDiv.setAttribute("className", className);
+ var specs = runner.specs();
+ var specCount = 0;
+ for (var i = 0; i < specs.length; i++) {
+ if (this.specFilter(specs[i])) {
+ specCount++;
+ }
+ }
+ var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
+ message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
+ this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
+
+ this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
+};
+
+jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
+ var results = suite.results();
+ var status = results.passed() ? 'passed' : 'failed';
+ if (results.totalCount == 0) { // todo: change this to check results.skipped
+ status = 'skipped';
+ }
+ this.suiteDivs[suite.id].className += " " + status;
+};
+
+jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
+ if (this.logRunningSpecs) {
+ this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
+ }
+};
+
+jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
+ var results = spec.results();
+ var status = results.passed() ? 'passed' : 'failed';
+ if (results.skipped) {
+ status = 'skipped';
+ }
+ var specDiv = this.createDom('div', { className: 'spec ' + status },
+ this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
+ this.createDom('a', {
+ className: 'description',
+ href: '?spec=' + encodeURIComponent(spec.getFullName()),
+ title: spec.getFullName()
+ }, spec.description));
+
+
+ var resultItems = results.getItems();
+ var messagesDiv = this.createDom('div', { className: 'messages' });
+ for (var i = 0; i < resultItems.length; i++) {
+ var result = resultItems[i];
+
+ if (result.type == 'log') {
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
+ } else if (result.type == 'expect' && result.passed && !result.passed()) {
+ messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
+
+ if (result.trace.stack) {
+ messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
+ }
+ }
+ }
+
+ if (messagesDiv.childNodes.length > 0) {
+ specDiv.appendChild(messagesDiv);
+ }
+
+ this.suiteDivs[spec.suite.id].appendChild(specDiv);
+};
+
+jasmine.TrivialReporter.prototype.log = function() {
+ var console = jasmine.getGlobal().console;
+ if (console && console.log) {
+ if (console.log.apply) {
+ console.log.apply(console, arguments);
+ } else {
+ console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
+ }
+ }
+};
+
+jasmine.TrivialReporter.prototype.getLocation = function() {
+ return this.document.location;
+};
+
+jasmine.TrivialReporter.prototype.specFilter = function(spec) {
+ var paramMap = {};
+ var params = this.getLocation().search.substring(1).split('&');
+ for (var i = 0; i < params.length; i++) {
+ var p = params[i].split('=');
+ paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
+ }
+
+ if (!paramMap["spec"]) return true;
+ return spec.getFullName().indexOf(paramMap["spec"]) == 0;
+};
166 test/lib/jasmine/jasmine.css
@@ -0,0 +1,166 @@
+body {
+ font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
+}
+
+
+.jasmine_reporter a:visited, .jasmine_reporter a {
+ color: #303;
+}
+
+.jasmine_reporter a:hover, .jasmine_reporter a:active {
+ color: blue;
+}
+
+.run_spec {
+ float:right;
+ padding-right: 5px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+.jasmine_reporter {
+ margin: 0 5px;
+}
+
+.banner {
+ color: #303;
+ background-color: #fef;
+ padding: 5px;
+}
+
+.logo {
+ float: left;
+ font-size: 1.1em;
+ padding-left: 5px;
+}
+
+.logo .version {
+ font-size: .6em;
+ padding-left: 1em;
+}
+
+.runner.running {
+ background-color: yellow;
+}
+
+
+.options {
+ text-align: right;
+ font-size: .8em;
+}
+
+
+
+
+.suite {
+ border: 1px outset gray;
+ margin: 5px 0;
+ padding-left: 1em;
+}
+
+.suite .suite {
+ margin: 5px;
+}
+
+.suite.passed {
+ background-color: #dfd;
+}
+
+.suite.failed {
+ background-color: #fdd;
+}
+
+.spec {
+ margin: 5px;
+ padding-left: 1em;
+ clear: both;
+}
+
+.spec.failed, .spec.passed, .spec.skipped {
+ padding-bottom: 5px;
+ border: 1px solid gray;
+}
+
+.spec.failed {
+ background-color: #fbb;
+ border-color: red;
+}
+
+.spec.passed {
+ background-color: #bfb;
+ border-color: green;
+}
+
+.spec.skipped {
+ background-color: #bbb;
+}
+
+.messages {
+ border-left: 1px dashed gray;
+ padding-left: 1em;
+ padding-right: 1em;
+}
+
+.passed {
+ background-color: #cfc;
+ display: none;
+}
+
+.failed {
+ background-color: #fbb;
+}
+
+.skipped {
+ color: #777;
+ background-color: #eee;
+ display: none;
+}
+
+
+/*.resultMessage {*/
+ /*white-space: pre;*/
+/*}*/
+
+.resultMessage span.result {
+ display: block;
+ line-height: 2em;
+ color: black;
+}
+
+.resultMessage .mismatch {
+ color: black;
+}
+
+.stackTrace {
+ white-space: pre;
+ font-size: .8em;
+ margin-left: 10px;
+ max-height: 5em;
+ overflow: auto;
+ border: 1px inset red;
+ padding: 1em;
+ background: #eef;
+}
+
+.finished-at {
+ padding-left: 1em;
+ font-size: .6em;
+}
+
+.show-passed .passed,
+.show-skipped .skipped {
+ display: block;
+}
+
+
+#jasmine_content {
+ position:fixed;
+ right: 100%;
+}
+
+.runner {
+ border: 1px solid gray;
+ display: block;
+ margin: 5px 0;
+ padding: 2px 0 2px 10px;
+}
2,421 test/lib/jasmine/jasmine.js
@@ -0,0 +1,2421 @@
+/**
+ * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
+ *
+ * @namespace
+ */
+var jasmine = {};
+
+/**
+ * @private
+ */
+jasmine.unimplementedMethod_ = function() {
+ throw new Error("unimplemented method");
+};
+
+/**
+ * Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
+ * a plain old variable and may be redefined by somebody else.
+ *
+ * @private
+ */
+jasmine.undefined = jasmine.___undefined___;
+
+/**
+ * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
+ *
+ */
+jasmine.DEFAULT_UPDATE_INTERVAL = 250;
+
+/**
+ * Default timeout interval in milliseconds for waitsFor() blocks.
+ */
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
+
+jasmine.getGlobal = function() {
+ function getGlobal() {
+ return this;
+ }
+
+ return getGlobal();
+};
+
+/**
+ * Allows for bound functions to be compared. Internal use only.
+ *
+ * @ignore
+ * @private
+ * @param base {Object} bound 'this' for the function
+ * @param name {Function} function to find
+ */
+jasmine.bindOriginal_ = function(base, name) {
+ var original = base[name];
+ if (original.apply) {
+ return function() {
+ return original.apply(base, arguments);
+ };
+ } else {
+ // IE support
+ return jasmine.getGlobal()[name];