';S.bb='Sorry, you do not have permission for this!
';S.prototype={bind:K(),Qb:function(a){this.H.push(a);this.H.length==1&&
this.ya("/user_session/new.mini?database="+encodeURIComponent(this.ja)+"&return_url="+encodeURIComponent(this.Wa()))},Rb:function(a){this.H.push(a);this.H.length==1&&this.ya("/user_session/do_destroy.mini")},Wa:function(){return this.ib.location.href.split("#")[0]},ya:function(a){var b=this,c=(new Date).getTime(),d=this.Wa()+"#$iframe_notify="+c,e=k('');this.eb.append(e);e.dialog({height:363,
width:500,resizable:false,modal:true,title:'Authentication: <angular/>'});O["_iframe_notify_"+c]=function(){e.dialog("destroy");e.remove();p(b.H,function(f){f()});b.H=[]}},dc:function(){if(!this.Aa){this.Aa=k(S.bb);this.Aa.Jc({Dc:true,height:70,Nc:true})}}};Z.cb=B(K(),{all:function(){return[]},query:function(){return[]},load:function(){return{}},title:undefined});Z.prototype={S:function(a){if(!a.k===this)throw"Parameter must be an instance of Entity! "+
w(a);var b=a.$entity+"/"+a.$id,c=this.fa[b];if(c)H.ia(a,c);else c=this.fa[b]=a;return c},load:function(a,b,c,d){if(b&&b!=="*"){var e=this;this.D(["GET",a.$entity+"/"+b],function(f){a.$loadFrom(f);a.$migrate();f=a.$$entity(a);e.S(f);(c||n)(a)},d)}return a},la:function(a,b,c){var d=this,e=[],f=0;p(b,function(g){e.push(d.load(a(),g,function(){f++;if(f==b.length)(c||n)(e)}))});return e},Ha:function(a,b,c){return this.load(a,b,c,function(d){if(d.$status_code==404){a.$id=b;(c||n)(a)}else throw d;})},Ga:function(a,
-b){var c=this,d=[];d.$$accept=function(e){return e.$entity==a.title};this.K.push(d);this.D(["GET",a.title],function(e){for(var f=0;ff.title?1:-1});(a||n)(b)});return b},yb:function(){var a={};this.post([["GET","$users"]],function(b,c){B(a,c[0])});return a},tc:function(a){var b={};this.post([["GET","$users/"+a]],function(c,d){B(b,d[0])});return b},G:function(a,b){if(!a)return Z.cb;var c=this,d=B(function(e){return new H(d,e)},{title:a,$$factory:true,k:this,defaults:b||{},load:function(e,f){return c.load(d(),e,f)},loadMany:function(e,f){return c.la(d,e,f)},loadOrCreate:function(e,
@@ -50,7 +50,7 @@ a[d].Z.substring(0,a[d].Z.indexOf(".")):undefined}while(d);return e.length}).val
s;s=v.O(t,q);C[s]=s});l.join.la(_.toArray(C),function(s){var t={};_(s).each(function(z){t[z.Za]=z});_(f).each(function(z){var J=v.O(z,q);z[j]=t[J]})})});return f};return b}};r.g=function(a){if(a)for(var b in a)this[b]=a[b]};r.g.get=function(a,b){b=b||"text";switch(typeof a){case "string":return b=="text"?a:undefined;case "object":if(a&&typeof a[b]!=="undefined")return a[b];return;default:return a}};var u;p({currency:function(a){k(this.element).toggleClass("ng-format-negative",a<0);return"$"+r.number.apply(this,
[a,2])},number:function(a,b){if(isNaN(a)||!isFinite(a))return"";b=typeof b=="undefined"?2:b;var c=a<0;a=Math.abs(a);var d=Math.pow(10,b);a=""+Math.round(a*d);var e=a.substring(0,a.length-b);e=e||"0";d=a.substring(a.length-b);a=c?"-":"";for(c=0;c0){for(c=d.length;c'+g+"",Oc:b});_.breakLoop()}});e&&_.breakLoop()});return e?e:b?c||new r.g({text:b+" is not recognized"}):null}}(),link:function(a,b){b=b||r.g.get(a);var c=r.g.get(a,"url")||r.g.get(a);if(c){if(m.Q.Kc(c)===null)c="mailto:"+c;a=''+b+"";return new r.g({text:b,url:c,html:a})}return a},bytes:function(){var a=
+"").replace(/ *$/,"");var d=b.replace(/ /g,""),e;p(a,function(f){p(f.pa,function(g){if(g.test(d)){g=f.name+": "+b;var h=f.url+b;e=new r.g({text:g,url:h,html:''+g+"",Oc:b});_.breakLoop()}});e&&_.breakLoop()});return e?e:b?c||new r.g({text:b+" is not recognized"}):null}}(),link:function(a,b){b=b||r.g.get(a);var c=r.g.get(a,"url")||r.g.get(a);if(c){if(m.Q.Kc(c)===null)c="mailto:"+c;a=''+b+"";return new r.g({text:b,url:c,html:a})}return a},bytes:function(){var a=
["bytes","KB","MB","GB","TB","PB"];return function(b){if(b===null)return"";for(var c=0;b>1E3;){b/=1024;c++}b=""+b;var d=b.indexOf(".");if(d>-1&&d+2"})}return null},lowercase:function(a){return(a=r.g.get(a))?(""+a).toLowerCase():a},uppercase:function(a){return(a=r.g.get(a))?
(""+a).toUpperCase():a},linecount:function(a){a=r.g.get(a);if(a===""||!a)return 1;return a.split(/\n|\f/).length},"if":function(a,b){return b?a:undefined},unless:function(a,b){return b?undefined:a},googleChartApi:B(function(a,b,c,d){b=b||{};a={cht:a,chco:u.collect(b,"color"),chtt:u.title(b),chdl:u.collect(b,"label"),chd:u.values(b),chf:"bg,s,FFFFFF00"};if(_.isArray(b.xLabels)){a.chxt="x";a.chxl="0:|"+b.Qc.join("|")}return u.encode(a,c,d)},{values:function(a){var b=[];p(a.series||[],function(c){var d=
[];p(c.values||[],function(e){d.push(e)});b.push(d.join(","))});a=b.join("|");return a===""?null:"t:"+a},title:function(a){var b=[];a=a.title||[];p(_.isArray(a)?a:[a],function(c){b.push(encodeURIComponent(c))});return b.join("|")},collect:function(a,b){var c=[],d=0;p(a.series||[],function(e){var f=[];e=e[b]||[];p(_.isArray(e)?e:[e],function(g){f.push(encodeURIComponent(g));d++});c.push(f.join("|"))});return d?c.join(","):null},encode:function(a,b,c){b=b||200;c=c||b;var d="http://chart.apis.google.com/chart?",
@@ -76,7 +76,7 @@ return a},xa:function(a){var b=[];if(a){if(!this.a(")")){for(b.push(this.a().tex
c(d)}}else return function(d){var e=a(d);d=b(d);return e?e[d]:undefined}},Hb:function(a){var b=[];if(this.ba().text!=")"){do b.push(this.s());while(this.a(","))}this.j(")");return function(c){for(var d=[],e=0;e1;d++){var e=a.shift(),f=c[e];if(!f){f={};c[e]=f}c=f}return c[a.shift()]=b},o:function(a,b){this.eval(a+"="+w(b))},eval:function(a,b){var c=
v.U[a];if(!c){var d=new E(a);c=d.qa();d.L();v.U[a]=c}b=b||{};b.scope=this;return c(b)},l:function(a,b,c,d,e){try{var f=this.eval(b,c);if(a.C){a.C=false;k(a.view).removeClass("ng-exception").removeAttr("ng-error")}d&&d.apply(a,[f]);return true}catch(g){ba("Eval Widget Error:",g);b=w(g,true);a.C=true;k(a.view).addClass("ng-exception").attr("ng-error",b);e&&e.apply(a,[g,b]);return false}},vc:function(a,b){var c=v.U[a];if(!c){c=(new E(a)).Q();v.U[a]=c}a={scope:this};return c(a)(a,b)},G:function(a,b){return(new E(a)).Cb()({scope:this,
k:b})},rb:function(){for(var a=this.q.$invalidWidgets;a.length>0;)a.pop()},Sb:function(a){this.q.$invalidWidgets.push(a)},watch:function(a){var b=this;(new E(a)).watch()({scope:this,jb:function(c,d){b.kb(c,function(e,f){try{return d({scope:b},e,f)}catch(g){alert(g)}})}})},kb:function(a,b){var c=this.ra[a];if(!c){c={Fa:[],s:a};this.ra[a]=c}c.Fa.push(b)},Gb:function(){var a=this,b=false;p(this.ra,function(c){var d=a.eval(c.s);if(d!==c.c){p(c.Fa,function(e){e(d,c.c);b=true});c.c=d}});return b}};na.prototype=
@@ -84,13 +84,13 @@ k:b})},rb:function(){for(var a=this.q.$invalidWidgets;a.length>0;)a.pop()},Sb:fu
B(pa.prototype,{fetchCurrentUser:function(a){var b=this;this.oc.P("GET","/account.json",{},function(c,d){b.current=d.user;a(d.Pc)})},logout:function(a){var b=this;this.ha.Rb(function(){delete b.current;(a||n)()})},login:function(a){var b=this;this.ha.Qb(function(){b.fetchCurrentUser(function(){(a||n)()})})},notAuthorized:function(){this.ha.dc()}});p({regexp:function(a,b,c){return a.match(b)?null:c||"Value does not match expected format "+b+"."},number:function(a,b,c){var d=1*a;if(d==a){if(typeof b!=
"undefined"&&dc)return"Value can not be greater than "+c+".";return null}else return"Value is not a number."},integer:function(a,b,c){b=Ga.number(a,b,c);if(b===null&&a!=Math.round(a))return"Value is not a whole number.";return b},date:function(a){if(a.match(/^\d\d?\/\d\d?\/\d\d\d\d$/))return null;return"Value is not a date. (Expecting format: 12/31/2009)."},ssn:function(a){if(a.match(/^\d\d\d-\d\d-\d\d\d\d$/))return null;return"SSN needs to be in 999-99-9999 format."},
email:function(a){if(a.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/))return null;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 null;if(a.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/))return null;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 null;
-return"URL needs to be in http://server[:port]/path format."},json:function(a){try{M(a);return null}catch(b){return b.toString()}}},function(a,b){Ga[b]=a});ma.prototype={tb:function(a,b){var c,d=a.attr("type").toLowerCase(),e=a.attr("name");if(e)e=e.split(":").pop();var f="change",g=true,h=ga[a.attr("ng-format")]||ga.noop;if(d=="button"||d=="submit"||d=="reset"||d=="image"){c=new Qa(a[0],e,h);f="click";g=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new ra(a[0],e,h);f="keyup change"}else if(d==
+return"URL needs to be in http://server[:port]/path format."},json:function(a){try{M(a);return null}catch(b){return b.toString()}}},function(a,b){Ga[b]=a});ma.prototype={tb:function(a,b){var c,d=a.attr("type").toLowerCase(),e=a.attr("name");if(e)e=e.split(":").pop();var f="change",g=true,h=ga[a.attr("ng-format")]||ga.noop;if(d=="button"||d=="submit"||d=="reset"||d=="image"){c=new Ra(a[0],e,h);f="click";g=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new ra(a[0],e,h);f="keyup change"}else if(d==
"checkbox"){c=new sa(a[0],e,h);f="click"}else if(d=="radio"){c=new va(a[0],e,h);f="click"}else if(d=="select-one")c=new ta(a[0],e,h);else if(d=="select-multiple")c=new ua(a[0],e,h);else if(d=="file")c=this.ub(a,e,h);else throw"Unknown type: "+d;a.data("controller",c);var i=b.get("$updateView");k(c.view,":input").bind(f,function(){if(c.e(b)){var j=k(c.view).attr("ng-action")||"";b.l(c,j)&&i(b)}return g});return c},ub:function(a){var b="__uploadWidget_"+this.Ub++,c=U.template(b);a.after(c);b=this.vb({data:this.ea+
"/admin/ServerAPI.swf",width:"95",height:"20",align:"top",wmode:"transparent"},{flashvars:"uploadWidgetId="+b,allowScriptAccess:"always"},b);a.remove();a=new U(c,a[0].name,b,this.ea+"/data/"+this.ja);k(b).data("controller",a);return a}};O.flashEvent=function(a,b,c){a=y.getElementById(a);a=k(a);var d=a.data("controller");U.prototype[b].apply(d,c);_.defer(a.scope().get("$updateView"))};U.template=function(a){return k('')};B(U.prototype,{cancel:n,complete:n,httpStatus:function(a){alert("httpStatus:"+this.J+" status:"+a)},ioError:function(){alert("ioError:"+this.J)},open:function(){alert("open:"+this.J)},progress:n,securityError:function(){alert("securityError:"+this.J)},uploadCompleteData:function(a){a=M(a);a.url=this.wa+"/"+a.id+"/"+a.text;this.view.find("input").attr("checked",true);var b=this.view.scope();this.value=a;this.e(b);this.value=null},select:function(a,b){this.name=a;this.view.find("a").text(a).attr("href",
a);this.view.find("span").text(m.filter.bytes(b));this.upload()},e:function(a){var b=this.view.find("input").attr("checked")?this.value:null;if(this.c===b)return false;else{a.i(this.J,b);return true}},d:function(a){if((a=a.get(this.J))&&this.value!==a){this.value=a;this.view.find("a").attr("href",this.value.url).text(this.value.text);this.view.find("span").text(m.filter.bytes(this.value.size))}this.view.find("input").attr("checked",!!a)},upload:function(){this.name&&this.sc.uploadFile(this.wa)}});
-R.prototype={e:P(true),d:n};R.Kb=new R;var Qa=R;ra.prototype={e:function(a){var b=this.A.parse(this.view.value);if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.w;a.o(this.exp,c)}c=c?c:"";if(!_(this.c).isEqual(c)){b.value=this.A.format(c);this.c=c}var d=false;b.removeAttribute("ng-error");if(this.lc)d=!(c&&$.trim(""+c).length>0);var e=d?"Required Value":null;if(!d&&this.Q&&c){e=a.vc(this.Q,c);d=
-!!e}if(this.Da!==e){this.Da=d;if(e!==null&&k(b).is(":visible")){b.setAttribute("ng-error",e);a.Sb(this)}k(b).toggleClass("ng-validation-error",d)}}};sa.prototype={e:function(a){var b=this.view;b=b.checked?b.value:"";b=this.A.parse(b);b=this.A.format(b);if(this.c===b)return false;else{a.o(this.exp,this.A.parse(b));this.c=b;return true}},d:function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.w;a.o(this.exp,c)}b.checked=this.A.parse(b.value)==c}};ta.prototype={e:function(a){if(this.view.selectedIndex<
+R.prototype={e:P(true),d:n};R.Kb=new R;var Ra=R;ra.prototype={e:function(a){var b=this.A.parse(this.view.value);if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.w;a.o(this.exp,c)}c=c?c:"";if(!_(this.c).isEqual(c)){b.value=this.A.format(c);this.c=c}var d=false;b.removeAttribute("ng-error");if(this.lc)d=!(c&&$.trim(""+c).length>0);var e=d?"Required Value":null;if(!d&&this.Q&&c){e=a.vc(this.Q,c);d=
+!!e}if(this.Da!==e){this.Da=d;if(e!==null&&Ha(b)){b.setAttribute("ng-error",e);a.Sb(this)}k(b).toggleClass("ng-validation-error",d)}}};sa.prototype={e:function(a){var b=this.view;b=b.checked?b.value:"";b=this.A.parse(b);b=this.A.format(b);if(this.c===b)return false;else{a.o(this.exp,this.A.parse(b));this.c=b;return true}},d:function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.w;a.o(this.exp,c)}b.checked=this.A.parse(b.value)==c}};ta.prototype={e:function(a){if(this.view.selectedIndex<
0)a.o(this.exp,null);else{var b=this.view.value;if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.w;a.o(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};ua.prototype={selected:function(){for(var a=[],b=this.view.options,c=0;c{{a}}').init();
+ scope.eval("$invalidWidgets.push({})");
expect(scope.set("a", 2)).toEqual(2);
expect(scope.get("a")).toEqual(2);
expect(scope.eval("a=3")).toEqual(3);
scope.updateView();
+ expect(scope.eval("$invalidWidgets")).toEqual([]);
expect($(scope.element).text()).toEqual('3');
});
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index cb1432f7..293553da 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -135,3 +135,6 @@ function assertThrows(error, fn){
}
assertEquals(error, exception);
}
+
+log = noop;
+error = noop;
\ No newline at end of file
--
cgit v1.2.3