diff options
| -rw-r--r-- | angular-minified.js | 66 | ||||
| -rw-r--r-- | angular.js | 25 |
2 files changed, 46 insertions, 45 deletions
diff --git a/angular-minified.js b/angular-minified.js index 86bb47b5..cbaa88dc 100644 --- a/angular-minified.js +++ b/angular-minified.js @@ -4,24 +4,24 @@ default:return false}}function ha(a,b){if(ga(a))if(U)a.innerText=b;else a.textCo b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c}function V(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a}function W(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=M(w(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&W(a[c],d)}}function ja(a){this.location=a;this.delay=25;this.setTimeout=function(b,c){o.setTimeout(b,c)};this.Ea=function(b){return b};this.N=a.href}function Ja(){var a=k.fn;a.scope=function(){for(var b= this;b&&b.get(0);){var c=b.data("scope");if(c)return c;b=b.parent()}return null};a.controller=function(){return this.data("controller")||R.Jb}}function Ka(a){if(a.Gc=="console"&&!Q){Q=y.createElement("div");Q.id="ng-console";y.getElementsByTagName("body")[0].appendChild(Q);L=function(){fa("ng-console-info",arguments)};console.error=function(){fa("ng-console-error",arguments)}}}function aa(a,b){var c={};p(b,function(d,e){c[e]=_(d).bind(a)});return c}function La(a,b){var c=new ka(b.server,b.database), d=new x(a[0],c,h,b.location,b);c=new S(a.find("body"),b.server,b.database);var e=b.database=="$MEMORY"?new ba(o):new la(b.server,k.getScript);e=new ma(e,new X(k(a.body)),function(){d.d()});var f=new na(e,c),g="/data/"+b.database,h=new Y(function(l,q){e.P("POST",g,l,q)},f,d.anchor);d.k=h;d.Va.push(function(){h.V()});var i=new v({$anchor:d.anchor,$updateView:_(d.d).bind(d),$config:b,$console:o.console,$datastore:aa(h,{load:h.load,loadMany:h.la,loadOrCreate:h.Ha,loadAll:h.Ga,save:h.save,remove:h.remove, -flush:h.V,query:h.Qa,entity:h.F,entities:h.entities,documentCountsByUser:h.xb,userDocumentIdsByEntity:h.sc,join:h.join}),$save:function(l){h.lc(i.w,l,d.anchor)},$window:o,$uid:function(){return""+(new Date).getTime()},$users:f},"ROOT");a.data("scope",i);d.F(i);d.compile();c.bind();(new A(a)).bind();var j=_(aa(i,{updateView:i.d,set:i.h,get:i.get,eval:i.eval})).extend({init:function(){b.location.listen(_(d.fc).bind(d));d.Na();d.Db();d.d();return j},element:a[0],config:b});return j}function G(a,b,c){var d= -_.last(b);p(c,function(e){d[e]=_[e]});m[a]=m[a]||{};p(b,function(e){B(m[a],e)})}function x(a,b,c,d,e){this.D=a;this.location=d;this.k=c;this.anchor={};this.xc=b;this.rb=e||{};this.Va=[]}function S(a,b,c){this.eb=a;this.ea=b;this.ja=c;this.ib=o;this.H=[]}function Y(a,b,c){this.post=a;this.Xa=b;this.K=[];this.fa={$collections:this.K};this.anchor=c;this.R=[]}function oa(a){return""+a}function w(a,b){var c=[];ca(c,a,b?"\n ":null,_([]));return c.join("")}function M(a){try{var b=new E(a,true),c=b.ca(); +flush:h.V,query:h.Qa,entity:h.G,entities:h.entities,documentCountsByUser:h.xb,userDocumentIdsByEntity:h.sc,join:h.join}),$save:function(l){h.lc(i.w,l,d.anchor)},$window:o,$uid:function(){return""+(new Date).getTime()},$users:f},"ROOT");a.data("scope",i);d.G(i);d.compile();c.bind();(new A(a)).bind();var j=_(aa(i,{updateView:i.d,set:i.h,get:i.get,eval:i.eval})).extend({init:function(){b.location.listen(_(d.fc).bind(d));d.Na();d.Db();d.d();return j},element:a[0],config:b});return j}function G(a,b,c){var d= +_.last(b);p(c,function(e){d[e]=_[e]});m[a]=m[a]||{};p(b,function(e){B(m[a],e)})}function x(a,b,c,d,e){this.F=a;this.location=d;this.k=c;this.anchor={};this.xc=b;this.rb=e||{};this.Va=[]}function S(a,b,c){this.eb=a;this.ea=b;this.ja=c;this.ib=o;this.H=[]}function Y(a,b,c){this.post=a;this.Xa=b;this.K=[];this.fa={$collections:this.K};this.anchor=c;this.R=[]}function oa(a){return""+a}function w(a,b){var c=[];ca(c,a,b?"\n ":null,_([]));return c.join("")}function M(a){try{var b=new E(a,true),c=b.ca(); b.L();return c()}catch(d){$("fromJson error: ",a,d);throw d;}}function ca(a,b,c,d){if(typeof b=="object"){if(d.include(b)){a.push("RECURSION");return}d.push(b)}var e=typeof b;if(b===null)a.push("null");else if(e==="function")return;else if(e==="boolean")a.push(""+b);else if(e==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(e==="string")return a.push(m.String.quoteUnicode(b));else if(e==="object")if(b instanceof Array){a.push("[");var f=b.length;e=false;for(var g=0;g<f;g++){var h=b[g];e&&a.push(","); typeof h=="function"||typeof h=="undefined"?a.push("null"):ca(a,h,c,d);e=true}a.push("]")}else if(b instanceof Date)a.push(m.String.quoteUnicode(m.Date.toString(b)));else{a.push("{");c&&a.push(c);e=false;g=c?c+" ":false;h=[];for(var i in b)i.indexOf("$$")!==0&&h.push(i);h.sort();for(i=0;i<h.length;i++){var j=h[i];try{f=b[j];if(typeof f!="function"){if(e){a.push(",");c&&a.push(c)}a.push(m.String.quote(j));a.push(":");ca(a,f,g,d);e=true}}catch(l){}}a.push("}")}typeof b=="object"&&d.pop()}function H(a, b){this.$$entity=a;this.$loadFrom(b||{});this.$entity=a.title;this.$migrate()}function F(a,b){this.text=a;this.vb=b?20:-1;this.i=[];this.index=0}function E(a,b){this.text=a;this.i=(new F(a,b)).parse();this.index=0}function v(a,b){this.Ya=[];this.ra={};this.name=b;a=a||{};function c(){}c.prototype=a;this.w=new c;this.w.$parent=a;if(b=="ROOT")this.w.$root=this.w}function la(a,b){this.url=a;this.Sb=0;this.getScript=b;this.tc="_"+(""+Math.random()).substr(2)+"_";this.ma=1800}function ba(a){this.frame= -a}function ma(a,b,c){this.wb=a;this.update=c;this.status=b}function na(a,b){this.nc=a;this.ha=b}function ka(a,b){this.Tb=0;this.ea=a;this.ja=b;this.ub=o.swfobject?o.swfobject.createSWF:function(){alert("ERROR: swfobject not loaded!")}}function T(a,b,c,d){this.view=a;this.rc=c;this.J=b;this.wa=d+"/_attachments";this.value=null;this.c=undefined}function R(a){this.view=a}function pa(a,b,c){this.view=a;this.G=c;this.exp=b;this.Q=a.getAttribute("ng-validate");this.kc=typeof a.attributes["ng-required"]!= -"undefined";this.Da=null;this.c=undefined;this.s=a.value;a.getAttribute("ng-widget")==="datepicker"&&k(a).Fc()}function qa(a,b,c){this.view=a;this.exp=b;this.c=undefined;this.G=c;this.s=a.checked?a.value:""}function ra(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=a.value}function sa(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=this.selected()}function ta(a,b){this.view=a;this.exp=b;this.c=this.ka=undefined;this.Ca=a.value;this.s=a.checked?a.value:null}function N(a,b){this.view=a;this.exp= -x.aa(b);this.B=false;this.mc={element:a}}function ua(a,b){this.view=a;this.nb=b}function va(a,b){this.view=a;this.exp=b;this.B=false}function wa(a,b){this.view=a;this.exp=b}function xa(a,b){this.view=a;this.exp=b}function ya(a,b){this.view=a;this.exp=b}function za(a,b){this.view=a;this.exp=b}function Aa(a,b){this.view=a;this.exp=b}function Ba(a,b){this.view=a;this.exp=b}function Ca(a,b,c,d){this.view=a;this.template=c;this.prefix=d;this.children=[];a=b.match(/^\s*(.+)\s+in\s+(.*)\s*$/);if(!a)throw"Expected ng-repeat in form of 'item in collection' but got '"+ -b+"'.";b=a[1];this.Y=a[2];a=b.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!a)throw"'item' in 'item in collection' should be identifier or (key, value) but get '"+b+"'.";this.vc=a[3]||a[1];this.Nb=a[2]}function A(a){this.D=a}function X(a){this.Ia=a.append(X.$a).find("#ng-loading");this.da=0}var da={A:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",yb:function(a){var b="",c,d,e,f,g,h,i=0;for(a=da.hb(a);i<a.length;){c=a.charCodeAt(i++);d=a.charCodeAt(i++);e=a.charCodeAt(i++); -f=c>>2;c=(c&3)<<4|d>>4;g=(d&15)<<2|e>>6;h=e&63;if(isNaN(d))g=h=64;else if(isNaN(e))h=64;b=b+this.A.charAt(f)+this.A.charAt(c)+this.A.charAt(g)+this.A.charAt(h)}return b},Hc:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;){c=this.A.indexOf(a.charAt(h++));d=this.A.indexOf(a.charAt(h++));f=this.A.indexOf(a.charAt(h++));g=this.A.indexOf(a.charAt(h++));c=c<<2|d>>4;d=(d&15)<<4|f>>2;e=(f&3)<<6|g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+= -String.fromCharCode(e)}return b=da.gb(b)},hb:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b+=String.fromCharCode(d);else{if(d>127&&d<2048)b+=String.fromCharCode(d>>6|192);else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128)}b+=String.fromCharCode(d&63|128)}}return b},gb:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1); -b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};if(typeof y.getAttribute=="undefined")y.getAttribute=K();if(typeof Node=="undefined")Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};o.console||(o.console= -{log:n,error:n});var Q,U,k=o.jQuery||o.$,p=_.each,B=_.extend,Da=_.identity,m=o.angular||(o.angular={}),Ea=m.validator||(m.validator={}),r=m.filter||(m.filter={}),ea=m.formatter||(m.formatter={}),O=m.callbacks||(m.callbacks={});m.alert||(m.alert=function(){L(arguments);o.alert.apply(o,arguments)});ja.prototype={Ob:function(a){this.Ea=a},watch:function(){var a=this;function b(){if(a.N!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.N.match(/#/)||(a.N+="#");a.location.href= -a.N;c="_iframe_notify_"+c[1];var d=O[c];delete O[c];try{(d||n)()}catch(e){alert(e)}}else{a.Ea(a.location.href);a.N=a.location.href}}a.setTimeout(b,a.delay)}b()},h:function(a){var b=this.location.href;b.match(/#/)||(b+="#");if(b!=a)this.location.href=a;this.Kc=a},get:function(){return o.location.href}};m.startUrlWatcher=function(){var a=new ja(o.location);a.watch();return aa(a,{listen:a.Ob,set:a.h,get:a.get})};m.compile=function(a,b){k=o.jQuery;U=k.browser.msie;b=_({server:"",location:{get:n,set:n, -listen:n}}).extend(b||{});Ka(b);Ja();return La(k(a),b)};var I={typeOf:function(a){if(a===null)return"null";var b=typeof a;if(b=="object"){if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}},Z={},Fa={includeIf:function(a,b,c){var d=_.indexOf(a,b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},sum:function(a,b){b=m.Function.compile(b);for(var c=0,d=0;d<a.length;d++){var e=1*b(a[d]);isNaN(e)||(c+=e)}return c},remove:function(a,b){var c= -_.indexOf(a,b);c>=0&&a.splice(c,1);return b},find:function(a,b,c){if(b){var d=m.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return m.zc.find(a,function(c){return c.Za==b},null)},filter:function(a,b){var c=[];c.qb=function(j){for(var l=0;l<c.length;l++)if(!c[l](j))return false;return true};var d=v.O;function e(j,l){if(l.charAt(0)==="!")return!e(j,l.substr(1));switch(typeof j){case "boolean":case "number":case "string":return(""+j).toLowerCase().indexOf(l)> --1;case "object":for(var q in j)if(q.charAt(0)!=="$"&&e(j[q],l))return true;return false;case "array":for(q=0;q<j.length;q++)if(e(j[q],l))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={yc:b};case "object":for(var f in b)f=="$"?function(){var j=(""+b[f]).toLowerCase();j&&c.push(function(l){return e(l,j)})}():function(){var j=f,l=(""+b[f]).toLowerCase();l&&c.push(function(q){return e(d(q,j),l)})}();break;case "function":c.push(b);break; -default:return a}for(var g=[],h=0;h<a.length;h++){var i=a[h];c.qb(i)&&g.push(i)}return g},add:function(a,b){a.push(_.isUndefined(b)?{}:b);return a},count:function(a,b){if(!b)return a.length;var c=m.Function.compile(b);return _.reduce(a,0,function(d,e){return d+(c(e)?1:0)})},orderBy:function(a,b,c){function d(f,g){return V(g)?function(h,i){return f(i,h)}:f}function e(f,g){var h=typeof f,i=typeof g;if(h==i){if(h=="string")f=f.toLowerCase();if(h=="string")g=g.toLowerCase();if(f===g)return 0;return f< +a}function ma(a,b,c){this.wb=a;this.update=c;this.status=b}function na(a,b){this.nc=a;this.ha=b}function ka(a,b){this.Tb=0;this.ea=a;this.ja=b;this.ub=o.swfobject?o.swfobject.createSWF:function(){alert("ERROR: swfobject not loaded!")}}function T(a,b,c,d){this.view=a;this.rc=c;this.J=b;this.wa=d+"/_attachments";this.value=null;this.c=undefined}function R(a){this.view=a}function pa(a,b,c){this.view=a;this.A=c;this.exp=b;this.Q=a.getAttribute("ng-validate");this.kc=typeof a.attributes["ng-required"]!= +"undefined";this.Da=null;this.c=undefined;this.s=this.A.parse(a.value);a.getAttribute("ng-widget")==="datepicker"&&k(a).Fc()}function qa(a,b,c){this.view=a;this.exp=b;this.c=undefined;this.A=c;this.s=this.A.parse(a.checked?a.value:"")}function ra(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=a.value}function sa(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=this.selected()}function ta(a,b){this.view=a;this.exp=b;this.c=this.ka=undefined;this.Ca=a.value;this.s=a.checked?a.value:null}function N(a, +b){this.view=a;this.exp=x.aa(b);this.C=false;this.mc={element:a}}function ua(a,b){this.view=a;this.nb=b}function va(a,b){this.view=a;this.exp=b;this.C=false}function wa(a,b){this.view=a;this.exp=b}function xa(a,b){this.view=a;this.exp=b}function ya(a,b){this.view=a;this.exp=b}function za(a,b){this.view=a;this.exp=b}function Aa(a,b){this.view=a;this.exp=b}function Ba(a,b){this.view=a;this.exp=b}function Ca(a,b,c,d){this.view=a;this.template=c;this.prefix=d;this.children=[];a=b.match(/^\s*(.+)\s+in\s+(.*)\s*$/); +if(!a)throw"Expected ng-repeat in form of 'item in collection' but got '"+b+"'.";b=a[1];this.Y=a[2];a=b.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!a)throw"'item' in 'item in collection' should be identifier or (key, value) but get '"+b+"'.";this.vc=a[3]||a[1];this.Nb=a[2]}function A(a){this.F=a}function X(a){this.Ia=a.append(X.$a).find("#ng-loading");this.da=0}var da={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",yb:function(a){var b="",c,d,e,f,g,h,i=0;for(a=da.hb(a);i< +a.length;){c=a.charCodeAt(i++);d=a.charCodeAt(i++);e=a.charCodeAt(i++);f=c>>2;c=(c&3)<<4|d>>4;g=(d&15)<<2|e>>6;h=e&63;if(isNaN(d))g=h=64;else if(isNaN(e))h=64;b=b+this.B.charAt(f)+this.B.charAt(c)+this.B.charAt(g)+this.B.charAt(h)}return b},Hc:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;){c=this.B.indexOf(a.charAt(h++));d=this.B.indexOf(a.charAt(h++));f=this.B.indexOf(a.charAt(h++));g=this.B.indexOf(a.charAt(h++));c=c<<2|d>>4;d=(d&15)<<4|f>>2;e=(f&3)<<6| +g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+=String.fromCharCode(e)}return b=da.gb(b)},hb:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b+=String.fromCharCode(d);else{if(d>127&&d<2048)b+=String.fromCharCode(d>>6|192);else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128)}b+=String.fromCharCode(d&63|128)}}return b},gb:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;){d=a.charCodeAt(c);if(d<128){b+= +String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};if(typeof y.getAttribute=="undefined")y.getAttribute=K();if(typeof Node=="undefined")Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10, +DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};o.console||(o.console={log:n,error:n});var Q,U,k=o.jQuery||o.$,p=_.each,B=_.extend,Da=_.identity,m=o.angular||(o.angular={}),Ea=m.validator||(m.validator={}),r=m.filter||(m.filter={}),ea=m.formatter||(m.formatter={}),O=m.callbacks||(m.callbacks={});m.alert||(m.alert=function(){L(arguments);o.alert.apply(o,arguments)});ja.prototype={Ob:function(a){this.Ea=a},watch:function(){var a=this;function b(){if(a.N!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/); +if(c){a.N.match(/#/)||(a.N+="#");a.location.href=a.N;c="_iframe_notify_"+c[1];var d=O[c];delete O[c];try{(d||n)()}catch(e){alert(e)}}else{a.Ea(a.location.href);a.N=a.location.href}}a.setTimeout(b,a.delay)}b()},h:function(a){var b=this.location.href;b.match(/#/)||(b+="#");if(b!=a)this.location.href=a;this.Kc=a},get:function(){return o.location.href}};m.startUrlWatcher=function(){var a=new ja(o.location);a.watch();return aa(a,{listen:a.Ob,set:a.h,get:a.get})};m.compile=function(a,b){k=o.jQuery;U=k.browser.msie; +b=_({server:"",location:{get:n,set:n,listen:n}}).extend(b||{});Ka(b);Ja();return La(k(a),b)};var I={typeOf:function(a){if(a===null)return"null";var b=typeof a;if(b=="object"){if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}},Z={},Fa={includeIf:function(a,b,c){var d=_.indexOf(a,b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},sum:function(a,b){b=m.Function.compile(b);for(var c=0,d=0;d<a.length;d++){var e=1*b(a[d]);isNaN(e)||(c+=e)}return c}, +remove:function(a,b){var c=_.indexOf(a,b);c>=0&&a.splice(c,1);return b},find:function(a,b,c){if(b){var d=m.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return m.zc.find(a,function(c){return c.Za==b},null)},filter:function(a,b){var c=[];c.qb=function(j){for(var l=0;l<c.length;l++)if(!c[l](j))return false;return true};var d=v.O;function e(j,l){if(l.charAt(0)==="!")return!e(j,l.substr(1));switch(typeof j){case "boolean":case "number":case "string":return(""+ +j).toLowerCase().indexOf(l)>-1;case "object":for(var q in j)if(q.charAt(0)!=="$"&&e(j[q],l))return true;return false;case "array":for(q=0;q<j.length;q++)if(e(j[q],l))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={yc:b};case "object":for(var f in b)f=="$"?function(){var j=(""+b[f]).toLowerCase();j&&c.push(function(l){return e(l,j)})}():function(){var j=f,l=(""+b[f]).toLowerCase();l&&c.push(function(q){return e(d(q,j),l)})}();break;case "function":c.push(b); +break;default:return a}for(var g=[],h=0;h<a.length;h++){var i=a[h];c.qb(i)&&g.push(i)}return g},add:function(a,b){a.push(_.isUndefined(b)?{}:b);return a},count:function(a,b){if(!b)return a.length;var c=m.Function.compile(b);return _.reduce(a,0,function(d,e){return d+(c(e)?1:0)})},orderBy:function(a,b,c){function d(f,g){return V(g)?function(h,i){return f(i,h)}:f}function e(f,g){var h=typeof f,i=typeof g;if(h==i){if(h=="string")f=f.toLowerCase();if(h=="string")g=g.toLowerCase();if(f===g)return 0;return f< g?-1:1}else return h<i?-1:1}b=_.isArray(b)?b:[b];b=_.map(b,function(f){var g=false;if(typeof f=="string"&&(f.charAt(0)=="+"||f.charAt(0)=="-")){g=f.charAt(0)=="-";f=f.substring(1)}var h=f?m.Function.compile(f):_.identity;return d(function(i,j){return e(h(i),h(j))},g)});return _.clone(a).sort(d(function(f,g){for(var h=0;h<b.length;h++){var i=b[h](f,g);if(i!==0)return i}return 0},c))},orderByToggle:function(a,b){var c=false,d=-1;_.detect(a,function(e,f){if(e==b){c=true;d=f;return true}if((e.charAt(0)== "+"||e.charAt(0)=="-")&&e.substring(1)==b){c=e.charAt(0)=="+";d=f;return true}});d>=0&&a.splice(d,1);a.unshift((c?"-":"+")+b);return a},orderByDirection:function(a,b,c,d){c=c||"ng-ascend";d=d||"ng-descend";a=a[0]||"";var e=true;if(a.charAt(0)=="-"){a=a.substring(1);e=false}else if(a.charAt(0)=="+")a=a.substring(1);return a==b?e?c:d:""},merge:function(a,b,c){var d=a[b];if(!d){d={};a[b]=d}W(c,d);return a}},Ma={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=m.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(typeof a=="string"&&(b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/))){a=new Date(0);a.setUTCFullYear(b[1],b[2]-1,b[3]);a.setUTCHours(b[4],b[5],b[6],0);return a}return a}}, @@ -29,8 +29,8 @@ Ga={toString:function(a){function b(c){return c<10?"0"+c:c}return a.getUTCFullYe "reduceRight","detect","select","reject","all","any","include","invoke","pluck","max","min","sortBy","sortedIndex","toArray","size"]);G("Array",[I,Z,Fa],["first","last","compact","flatten","without","uniq","intersect","zip","indexOf","lastIndexOf"]);G("Object",[I,Z,{}],["keys","values"]);G("String",[I,Ma],[]);G("Date",[I,Ga],[]);m.Date.toString=Ga.toString;G("Function",[I,Z,Na],["bind","bindAll","delay","defer","wrap","compose"]);x.aa=function(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};x.Ib=function(a){a=x.aa(a);return a.length>1||x.M(a[0])!==null};x.M=function(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?a[1]:null};x.prototype={gc:function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b},Na:function(){var a=this,b=this.location.get()|| "",c=b.indexOf("#");if(!(c<0)){b=this.gc(b.substring(c+1));p(a.anchor,function(d,e){delete a.anchor[e]});p(b,function(d,e){a.anchor[e]=d})}},fc:function(){this.Na();this.d()},qc:function(){var a=this.location.get()||"",b=a.indexOf("#");if(b>-1)a=a.substring(0,b);a+="#";b="";for(var c in this.anchor){var d=this.anchor[c];if(typeof d==="undefined"||d===null)delete this.anchor[c];else{a+=b+encodeURIComponent(c);if(d!==true)a+="="+encodeURIComponent(d);b="&"}}this.location.set(a);return a},d:function(){(new Date).getTime(); -var a=k(this.D).scope();a.h("$invalidWidgets",[]);a.d();(new Date).getTime();this.qc();_.each(this.Va,function(b){b()})},T:function(a){var b=k(this.D),c=b.find(a);if(b.is(a))c=c.andSelf();return c},Db:function(){this.T("[ng-init]").each(function(){var a=k(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+w(c,true))}})},F:function(a){var b=this;this.T("[ng-entity]").attr("ng-watch",function(){try{var c=k(this);return a.F(c.attr("ng-entity"),b.k)+ -(c.attr("ng-watch")||"")}catch(d){L(d);alert(d)}})},compile:function(){var a=k(this.D);if(this.rb.autoSubmit){var b=this.T(":submit").not("[ng-action]");b.attr("ng-action","$save()");b.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.Oa(this.D)(this.D,a.scope(),"");this.T("a[ng-action]").live("click",function(){var c=k(this),d=c.scope();try{d.eval(c.attr("ng-action"));c.removeAttr("ng-error");c.removeClass("ng-exception")}catch(e){c.addClass("ng-exception"); +var a=k(this.F).scope();a.h("$invalidWidgets",[]);a.d();(new Date).getTime();this.qc();_.each(this.Va,function(b){b()})},T:function(a){var b=k(this.F),c=b.find(a);if(b.is(a))c=c.andSelf();return c},Db:function(){this.T("[ng-init]").each(function(){var a=k(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+w(c,true))}})},G:function(a){var b=this;this.T("[ng-entity]").attr("ng-watch",function(){try{var c=k(this);return a.G(c.attr("ng-entity"),b.k)+ +(c.attr("ng-watch")||"")}catch(d){L(d);alert(d)}})},compile:function(){var a=k(this.F);if(this.rb.autoSubmit){var b=this.T(":submit").not("[ng-action]");b.attr("ng-action","$save()");b.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.Oa(this.F)(this.F,a.scope(),"");this.T("a[ng-action]").live("click",function(){var c=k(this),d=c.scope();try{d.eval(c.attr("ng-action"));c.removeAttr("ng-error");c.removeClass("ng-exception")}catch(e){c.addClass("ng-exception"); c.attr("ng-error",w(e,true))}d.get("$updateView")();return false})},pc:function(a,b,c){b=b.concat();var d=b.pop(),e=x.aa(a.nodeValue);if(e.length>1||x.M(e[0])){var f=a.parentNode;if(ga(f)){f.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,b:function(l){return new N(l,l.getAttribute("ng-bind-template"))}})}else for(var g=0;g<e.length;g++){var h=e[g],i=x.M(h),j;if(i){j=y.createElement("span");k(j).attr("ng-bind",i);g===0&&c.push({path:b.concat(d+g),b:this.Ma})}else if(U&&h.charAt(0)==" "){j= y.createElement("span");j.innerHTML=" "+h.substring(1)}else j=y.createTextNode(h);f.insertBefore(j,a)}f.removeChild(a)}},Oa:function(a){var b=[];this.Pa(a,[],b);return function(c,d,e){for(var f=b.length,g=0;g<f;g++){for(var h=b[g],i=c,j=h.path,l=0;l<j.length;l++)i=i.childNodes[j[l]];try{d.lb(h.b(i,d,e))}catch(q){alert(q)}}}},Pa:function(a,b,c){var d=a.nodeType;if(d==Node.TEXT_NODE)this.pc(a,b,c);else if(!(d!=Node.ELEMENT_NODE&&d!=Node.DOCUMENT_NODE))if(a.getAttribute){d=a.getAttribute("ng-non-bindable"); if(!(d||d==="")){if(d=a.attributes){var e=a.getAttribute("ng-bind-attr");a.removeAttribute("ng-bind-attr");e=e?M(e):{};for(var f=d.length,g=0;g<f;g++){var h=d[g],i=h.name;h=U&&i=="href"?decodeURI(a.getAttribute(i,2)):h.value;if(x.Ib(h))e[i]=h}d=w(e);d.length>2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||L(a);var j=a.getAttribute("ng-repeat");if(j){a.removeAttribute("ng-repeat");var l=this.Oa(a);d=y.createComment("ng-repeat: "+j);e=a.parentNode;e.insertBefore(d,a);e.removeChild(a);function q(s, @@ -40,12 +40,12 @@ a.text;d=a.childNodes;for(e=0;e<d.length;e++)this.Pa(d[e],b.concat(e),c)}}}},Yb: Xb:function(a){return new Aa(a,a.getAttribute("ng-class-odd"))},ac:function(a){return new Ba(a,a.getAttribute("ng-style"))},bc:function(a,b){b.watch(a.getAttribute("ng-watch"))}};S.Ac='<div><div class="ui-widget-overlay"></div><div id="ng-login" ng-non-bindable="true"><div class="ng-login-container"></div></div></div>';S.bb='<div ng-non-bindable="true" title="Permission Error:">Sorry, you do not have permission for this!</div>';S.prototype={bind:K(),Pb: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()))},Qb: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('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+d+'" src="'+this.ea+a+'" width="500" height="330"/></div>');this.eb.append(e);e.dialog({height:363, width:500,resizable:false,modal:true,title:'Authentication: <a href="http://www.getangular.com"><tt><angular/></tt></a>'});O["_iframe_notify_"+c]=function(){e.dialog("destroy");e.remove();p(b.H,function(f){f()});b.H=[]}},cc:function(){if(!this.Aa){this.Aa=k(S.bb);this.Aa.Ic({Cc:true,height:70,Mc:true})}}};Y.cb=B(K(),{all:function(){return[]},query:function(){return[]},load:function(){return{}},title:undefined});Y.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.C(["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.C(["GET",a.title],function(e){for(var f=0;f<e.length;f++){var g=a();g.$loadFrom(e[f]);d.push(c.S(g))}(b||n)(d)});return d},save:function(a,b){var c=this,d={};a.$saveTo(d);this.C(["POST","",d],function(e){a.$loadFrom(e);var f=c.S(a);_.each(c.K,function(g){g.$$accept(a)&&Fa.includeIf(g,f,true)});if(a.$$anchor)c.anchor[a.$$anchor]=a.$id;b&&b(a)})},remove:function(a,b){var c=this,d={};a.$saveTo(d);this.C(["DELETE", -"",d],function(e){delete c.fa[a.$entity+"/"+a.$id];_.each(c.K,function(f){for(var g=0;g<f.length;g++)f[g].$id==a.$id&&f.splice(g,1)});(b||n)(e)})},C:function(a,b,c){a.$$callback=b;a.$$failure=c||function(d){throw d;};this.R.push(a)},V:function(){function a(d,e){L("RESPONSE["+d+"]: ",e);if(e.$status_code==401)b.Xa.login(function(){b.post(c,a)});else if(e.$status_code)alert(w(e));else for(d=0;d<e.length;d++){var f=e[d],g=c[d],h=f.$status_code;if(h)h==403?b.Xa.notAuthorized():g.$$failure(f);else g.$$callback(f)}} -if(this.R.length!==0){var b=this,c=this.R;this.R=[];L("REQUEST:",c);this.post(c,a)}},lc:function(a,b){function c(){d--;d===0&&b&&b()}var d=1;for(var e in a){var f=a[e];if(f&&f.$save==H.prototype.$save){d++;f.$save(c)}}c()},Qa:function(a,b,c,d){var e=this,f=[];f.$$accept=P(false);this.K.push(f);this.C(["GET",a.title+"/"+b+"="+c],function(g){p(g,function(h){h=a().$loadFrom(h);f.push(e.S(h))});(d||n)(f)});return f},entities:function(a){var b=[],c=this;this.C(["GET","$entities"],function(d){p(d,function(e, -f){b.push(c.F(f))});b.sort(function(e,f){return e.title>f.title?1:-1});(a||n)(b)});return b},xb:function(){var a={};this.post([["GET","$users"]],function(b,c){B(a,c[0])});return a},sc:function(a){var b={};this.post([["GET","$users/"+a]],function(c,d){B(b,d[0])});return b},F:function(a,b){if(!a)return Y.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, -f){return c.Ha(d(),e,f)},all:function(e){return c.Ga(d,e)},query:function(e,f,g){return c.Qa(d,e,f,g)},properties:function(e){c.C(["GET",a+"/$properties"],e)}});return d},join:function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).Dc().map(function(d,e){return e}).sortBy(function(d){var e=[];do{if(_(e).include(d))throw"Infinite loop in join: "+e.join(" -> ");e.push(d);if(!a[d])throw _("Named entity '<%=name%>' is undefined.").template({name:d});d=a[d].Z? +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;f<e.length;f++){var g=a();g.$loadFrom(e[f]);d.push(c.S(g))}(b||n)(d)});return d},save:function(a,b){var c=this,d={};a.$saveTo(d);this.D(["POST","",d],function(e){a.$loadFrom(e);var f=c.S(a);_.each(c.K,function(g){g.$$accept(a)&&Fa.includeIf(g,f,true)});if(a.$$anchor)c.anchor[a.$$anchor]=a.$id;b&&b(a)})},remove:function(a,b){var c=this,d={};a.$saveTo(d);this.D(["DELETE", +"",d],function(e){delete c.fa[a.$entity+"/"+a.$id];_.each(c.K,function(f){for(var g=0;g<f.length;g++)f[g].$id==a.$id&&f.splice(g,1)});(b||n)(e)})},D:function(a,b,c){a.$$callback=b;a.$$failure=c||function(d){throw d;};this.R.push(a)},V:function(){function a(d,e){L("RESPONSE["+d+"]: ",e);if(e.$status_code==401)b.Xa.login(function(){b.post(c,a)});else if(e.$status_code)alert(w(e));else for(d=0;d<e.length;d++){var f=e[d],g=c[d],h=f.$status_code;if(h)h==403?b.Xa.notAuthorized():g.$$failure(f);else g.$$callback(f)}} +if(this.R.length!==0){var b=this,c=this.R;this.R=[];L("REQUEST:",c);this.post(c,a)}},lc:function(a,b){function c(){d--;d===0&&b&&b()}var d=1;for(var e in a){var f=a[e];if(f&&f.$save==H.prototype.$save){d++;f.$save(c)}}c()},Qa:function(a,b,c,d){var e=this,f=[];f.$$accept=P(false);this.K.push(f);this.D(["GET",a.title+"/"+b+"="+c],function(g){p(g,function(h){h=a().$loadFrom(h);f.push(e.S(h))});(d||n)(f)});return f},entities:function(a){var b=[],c=this;this.D(["GET","$entities"],function(d){p(d,function(e, +f){b.push(c.G(f))});b.sort(function(e,f){return e.title>f.title?1:-1});(a||n)(b)});return b},xb:function(){var a={};this.post([["GET","$users"]],function(b,c){B(a,c[0])});return a},sc: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 Y.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, +f){return c.Ha(d(),e,f)},all:function(e){return c.Ga(d,e)},query:function(e,f,g){return c.Qa(d,e,f,g)},properties:function(e){c.D(["GET",a+"/$properties"],e)}});return d},join:function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).Dc().map(function(d,e){return e}).sortBy(function(d){var e=[];do{if(_(e).include(d))throw"Infinite loop in join: "+e.join(" -> ");e.push(d);if(!a[d])throw _("Named entity '<%=name%>' is undefined.").template({name:d});d=a[d].Z? a[d].Z.substring(0,a[d].Z.indexOf(".")):undefined}while(d);return e.length}).value();if(_(c).select(function(d){return a[d].Z}).length!=c.length-1)throw"Exactly one entity needs to be primary.";b.query=function(d,e){var f=[],g=d?d.substring(0,d.indexOf(".")):undefined;if(g!=c[0])throw _("Named entity '<%=name%>' is not a primary entity.").template({name:g});var h=1;a[g].join.query(d.substring(d.indexOf(".")+1),e,function(i){var j=c[h++],l=a[j],q=l.Z,C={};_(i).each(function(s){var t={};f.push(t);t[g]= 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;c<e.length;c++){if((e.length-c)%3===0&&c!==0)a+=",";a+=e.charAt(c)}if(b>0){for(c=d.length;c<b;c++)d+="0";a+="."+d.substring(0,b)}return a},date:K(),json:function(a){k(this.element).addClass("ng-monospace");return w(a,true)},trackPackage:function(){var a=[{name:"UPS", @@ -75,10 +75,10 @@ b.text+"' at column '"+(b.index+1)+"' in '"+this.text+"' is not defined.";return return a},xa:function(a){var b=[];if(a){if(!this.a(")")){for(b.push(this.a().text);this.a(",");)b.push(this.a().text);this.j(")")}this.j(":")}var c=this.qa();this.j("}");return function(d){return function(e){var f=new v(d.scope.w);f.h("$",e);for(var g=0;g<b.length;g++)f.h(b[g],arguments[g]);return c({scope:f})}}},Eb:function(a){var b=this.a().text;function c(d){return v.O(a(d),b)}c.W=b;return c},dc:function(a){var b=this.q();this.j("]");if(this.a("=")){var c=this.q();return function(d){return a(d)[b(d)]= c(d)}}else return function(d){var e=a(d);d=b(d);return e?e[d]:undefined}},Gb:function(a){var b=[];if(this.ba().text!=")"){do b.push(this.q());while(this.a(","))}this.j(")");return function(c){for(var d=[],e=0;e<b.length;e++)d.push(b[e](c));e=a(c);if(typeof e==="function")return e.apply(c,d);else throw"Expression '"+a.W+"' is not a function.";}},mb:function(){var a=[];if(this.ba().text!="]"){do a.push(this.q());while(this.a(","))}this.j("]");return function(b){for(var c=[],d=0;d<a.length;d++)c.push(a[d](b)); return c}},object:function(){var a=[];if(this.ba().text!="}"){do{var b=this.a().text;this.j(":");var c=this.q();a.push({Mb:b,value:c})}while(this.a(","))}this.j("}");return function(d){for(var e={},f=0;f<a.length;f++){var g=a[f],h=g.value(d);e[g.Mb]=h}return e}},Bb:function(){for(var a=[];this.Ba();){a.push(this.Ab());this.a(";")||this.L()}return function(b){for(var c="",d=0;d<a.length;d++)c+=a[d](b);return c}},Ab:function(){var a=this.a().text,b,c;if(this.a("=")){b=a;a=this.a().text}if(this.a(":"))c= -this.ca()(null);return function(d){var e=d.k.F(a,c);d.scope.h(a,e);if(b){e=e();e.$$anchor=b;d.scope.h(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+m.String.quote(b)+";};"}else return""}},watch:function(){for(var a=[];this.Ba();){a.push(this.wc());this.a(";")||this.L()}this.L();return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.jb(d.name,d.b)}}},wc:function(){var a=this.a().text;this.j(":");var b;if(this.ba().text=="{"){this.j("{");b=this.qa();this.j("}")}else b= +this.ca()(null);return function(d){var e=d.k.G(a,c);d.scope.h(a,e);if(b){e=e();e.$$anchor=b;d.scope.h(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+m.String.quote(b)+";};"}else return""}},watch:function(){for(var a=[];this.Ba();){a.push(this.wc());this.a(";")||this.L()}this.L();return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.jb(d.name,d.b)}}},wc:function(){var a=this.a().text;this.j(":");var b;if(this.ba().text=="{"){this.j("{");b=this.qa();this.j("}")}else b= this.q();return function(){return{name:a,b:b}}}};v.U={};v.O=function(a,b){if(!b)return a;for(var c=b.split("."),d,e=a,f=c.length,g=0;g<f;g++){d=c[g];if(!d.match(/^[\$\w][\$\w\d]*$/))throw"Expression '"+b+"' is not a valid expression for accesing variables.";if(a){e=a;a=a[d]}if(_.isUndefined(a)&&d.charAt(0)=="$"){var h=m.Global.typeOf(e);if(d=(h=m[h.charAt(0).toUpperCase()+h.substring(1)])?h[[d.substring(1)]]:undefined)return a=_.bind(d,e,e)}}if(typeof a==="function"&&!a.$$factory)return Ia(e,a);return a}; v.prototype={d:function(){var a=this;this.Fb();_.each(this.Ya,function(b){a.l(b,"",{},function(){this.d(a)})})},lb:function(a){a&&this.Ya.push(a)},Kb:function(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c!="."&&!F.prototype.X(c))return false}return true},get:function(a){return v.O(this.w,a)},h:function(a,b){a=a.split(".");for(var c=this.w,d=0;a.length>1;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.B){a.B=false;k(a.view).removeClass("ng-exception").removeAttr("ng-error")}d&&d.apply(a,[f]);return true}catch(g){$("Eval Widget Error:",g);b=w(g,true);a.B=true;k(a.view).addClass("ng-exception").attr("ng-error",b);e&&e.apply(a,[g,b]);return false}},uc: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)},F:function(a,b){return(new E(a)).Bb()({scope:this, +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){$("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}},uc: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)).Bb()({scope:this, k:b})},Rb:function(a){this.w.$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:[],q:a};this.ra[a]=c}c.Fa.push(b)},Fb:function(){var a=this,b=false;p(this.ra,function(c){var d=a.eval(c.q);if(d!==c.c){p(c.Fa,function(e){e(d,c.c);b=true});c.c=d}});return b}};la.prototype={ob:function(a){return da.yb(a)},P:function(a,b,c,d){var e= this.tc+this.Sb++;a=this.ob(w({u:b,m:a,p:c}));b=Math.ceil(a.length/this.ma);c=this.url+"/$/"+e+"/"+b+"/";O[e]=function(h){delete O[e];d(200,h)};for(var f=0;f<b;f++){var g=a.substr(f*this.ma,this.ma);this.getScript(c+(f+1)+"?h="+g,n)}}};ba.Bc="$DATASET:";ba.prototype={P:K()};ma.prototype={P:function(a,b,c,d){var e=this;this.status.pb(c);this.wb.P(a,b,c,function(){e.status.zb();try{d.apply(this,arguments)}catch(f){alert(w(f))}e.update()})}};B(na.prototype,{fetchCurrentUser:function(a){var b=this;this.nc.P("GET", "/account.json",{},function(c,d){b.current=d.user;a(d.Oc)})},logout:function(a){var b=this;this.ha.Qb(function(){delete b.current;(a||n)()})},login:function(a){var b=this;this.ha.Pb(function(){b.fetchCurrentUser(function(){(a||n)()})})},notAuthorized:function(){this.ha.cc()}});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"&&d<b)return"Value can not be less than "+b+".";if(typeof b!= @@ -88,16 +88,16 @@ return null}catch(b){return b.toString()}}},function(a,b){Ea[b]=a});ka.prototype e,h);f="click"}else if(d=="select-one")c=new ra(a[0],e,h);else if(d=="select-multiple")c=new sa(a[0],e,h);else if(d=="file")c=this.tb(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},tb:function(a){var b="__uploadWidget_"+this.Tb++,c=T.template(b);a.after(c);b=this.ub({data:this.ea+"/admin/ServerAPI.swf",width:"95",height:"20",align:"top",wmode:"transparent"}, {flashvars:"uploadWidgetId="+b,allowScriptAccess:"always"},b);a.remove();a=new T(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");T.prototype[b].apply(d,c);_.defer(a.scope().get("$updateView"))};T.template=function(a){return k('<span class="ng-upload-widget"><input type="checkbox" ng-non-bindable="true"/><object id="'+a+'" /><a></a><span/></span>')};B(T.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.h(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.rc.uploadFile(this.wa)}});R.prototype={e:P(true),d:n};R.Jb=new R;var Oa=R;pa.prototype={e:function(a){var b=this.view.value; -if(this.c===b)return false;else{a.o(this.exp,this.G.parse(b));this.c=b;return true}},d:function(a){var b=this.view,c=this.G.format(a.get(this.exp));if(typeof c==="undefined"){c=this.s;a.o(this.exp,this.G.parse(c))}c=c?c:"";if(this.c!=c)this.c=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.kc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.Q&&c){e=a.uc(this.Q,c);d=!!e}if(this.Da!==e){this.Da=d;if(e!==null){b.setAttribute("ng-error",e);a.Rb(this)}k(b).toggleClass("ng-validation-error", -d)}}};qa.prototype={e:function(a){jstd.console.log("model");var b=this.view;b=b.checked?b.value:"";if(this.c===b)return false;else{a.o(this.exp,this.G.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.s;a.o(this.exp,this.G.parse(c))}c=this.G.format(c);b.checked=b.value==c}};ra.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.s;a.o(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};sa.prototype={selected:function(){for(var a=[],b=this.view.options,c=0;c<b.length;c++){var d=b[c];d.selected&&a.push(d.value)}return a},e:function(a){var b=this.selected();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.s;a.o(this.exp,c)}if(c!== -this.c){a=b.options;for(b=0;b<a.length;b++){var d=a[b];d.selected=_.include(c,d.value)}this.c=c}}};ta.prototype={e:function(a){var b=this.view;if(this.ka)return false;else{b.checked=true;this.c=a.o(this.exp,this.Ca);return this.ka=true}},d:function(a){var b=this.view,c=a.get(this.exp);if(this.s&&typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(this.c!=c){this.ka=b.checked=this.Ca==""+c;this.c=c}}};N.Ta=function(a){switch(typeof a){case "string":case "boolean":case "number":return D(a);case "function":return N.Ta(a()); +this.view.find("input").attr("checked")?this.value:null;if(this.c===b)return false;else{a.h(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.rc.uploadFile(this.wa)}});R.prototype={e:P(true),d:n};R.Jb=new R;var Oa=R;pa.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.s;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.kc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.Q&&c){e=a.uc(this.Q,c);d=!!e}if(this.Da!==e){this.Da=d;if(e!==null){b.setAttribute("ng-error",e);a.Rb(this)}k(b).toggleClass("ng-validation-error", +d)}}};qa.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.s;a.o(this.exp,c)}b.checked=this.A.parse(b.value)==c}};ra.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.s;a.o(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};sa.prototype={selected:function(){for(var a=[],b=this.view.options,c=0;c<b.length;c++){var d=b[c];d.selected&&a.push(d.value)}return a},e:function(a){var b=this.selected();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.s;a.o(this.exp,c)}if(c!==this.c){a= +b.options;for(b=0;b<a.length;b++){var d=a[b];d.selected=_.include(c,d.value)}this.c=c}}};ta.prototype={e:function(a){var b=this.view;if(this.ka)return false;else{b.checked=true;this.c=a.o(this.exp,this.Ca);return this.ka=true}},d:function(a){var b=this.view,c=a.get(this.exp);if(this.s&&typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(this.c!=c){this.ka=b.checked=this.Ca==""+c;this.c=c}}};N.Ta=function(a){switch(typeof a){case "string":case "boolean":case "number":return D(a);case "function":return N.Ta(a()); case "object":if(a&&a.tagName&&a.nodeName&&a.ownerDocument&&a.removeAttribute)return ia(a);else if(a instanceof m.filter.g){switch(typeof a.html){case "string":case "number":return a.html;case "function":return a.html();case "object":if(a.html&&a.html.tagName&&a.html.nodeName&&a.html.ownerDocument&&a.html.removeAttribute)return ia(a.html);default:break}switch(typeof a.text){case "string":case "number":return D(a.text);case "function":return D(a.text());default:break}}if(a===null)return"";return D(w(a, -true));default:return""}};N.prototype={e:n,d:function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var f=c[e],g=x.M(f);if(g){a.l(this,g,this.mc,function(h){b.push(N.Ta(h))},function(h,i){ha(this.view,i)});if(this.B)return}else b.push(D(f))}ha(this.view,b.join(""))}};ua.prototype={e:n,d:function(a){var b=k(this.view),c=this.nb;if(this.B){this.B=false;b.removeClass("ng-exception").removeAttr("ng-error")}var d=b.is("img");for(var e in c){for(var f=x.aa(c[e]),g=[],h=0;h<f.length;h++){var i=x.M(f[h]); -if(i)try{var j=a.eval(i,{element:b[0],attrName:e});if(j&&(j.constructor!==array||j.length!==0))g.push(j)}catch(l){this.B=true;$("BindAttrUpdater",l);i=w(l,true);g.push("["+i+"]");b.addClass("ng-exception").attr("ng-error",i)}else g.push(f[h])}f=g.length?g.join(""):null;if(d&&e=="src"&&!f)f=a.get("$config.blankImage");b.attr(e,f)}}};va.prototype={e:n,d:function(a){a.l(this,this.exp)}};wa.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=k(this.view);V(b)?c.hide():c.show()})}};xa.prototype= +true));default:return""}};N.prototype={e:n,d:function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var f=c[e],g=x.M(f);if(g){a.l(this,g,this.mc,function(h){b.push(N.Ta(h))},function(h,i){ha(this.view,i)});if(this.C)return}else b.push(D(f))}ha(this.view,b.join(""))}};ua.prototype={e:n,d:function(a){var b=k(this.view),c=this.nb;if(this.C){this.C=false;b.removeClass("ng-exception").removeAttr("ng-error")}var d=b.is("img");for(var e in c){for(var f=x.aa(c[e]),g=[],h=0;h<f.length;h++){var i=x.M(f[h]); +if(i)try{var j=a.eval(i,{element:b[0],attrName:e});if(j&&(j.constructor!==array||j.length!==0))g.push(j)}catch(l){this.C=true;$("BindAttrUpdater",l);i=w(l,true);g.push("["+i+"]");b.addClass("ng-exception").attr("ng-error",i)}else g.push(f[h])}f=g.length?g.join(""):null;if(d&&e=="src"&&!f)f=a.get("$config.blankImage");b.attr(e,f)}}};va.prototype={e:n,d:function(a){a.l(this,this.exp)}};wa.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=k(this.view);V(b)?c.hide():c.show()})}};xa.prototype= {e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=k(this.view);V(b)?c.show():c.hide()})}};ya.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){if(b!==null&&b!==undefined)this.view.className=b})}};za.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===1)})}};Aa.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===0)})}};Ba.prototype={e:n,d:function(a){a.l(this, this.exp,{},function(b){k(this.view).attr("style","").css(b)})}};Ca.prototype={e:n,d:function(a){a.l(this,this.Y,{},function(b){var c=this;if(!b){b=[];a.Kb(this.Y)&&a.h(this.Y,b)}var d=b.length,e=this.children.length,f=this.view,g=0,h=null,i=this.Nb,j=this.vc,l=0;p(b,function(C,s){if(l<e){h=c.children[l];h.scope.h(j,C)}else{var t=new v(a.w,c.prefix+j+" in "+c.Y+"["+l+"]");t.h("$index",l);i&&t.h(i,s);t.h(j,C);h={scope:t,element:c.template(t,c.prefix,l)};f.after(h.element);c.children.push(h)}f=h.element; C=(new Date).getTime();h.scope.d();g+=(new Date).getTime()-C;l++});for(b=e;b>d;--b){var q=this.children.pop().element[0];q.parentNode.removeChild(q)}if(h&&h.element[0].nodeName==="OPTION")if(d=k(h.element[0].parentNode).data("controller")){d.c=undefined;d.d(a)}})}};A.ta="mouseleave mouseout click dblclick keypress keyup";A.ec=function(){A.oa();var a=k(this);a.bind(A.ta,A.oa);var b=a.position(),c=y.documentElement,d=(self.innerWidth||c&&c.clientWidth||y.body.clientWidth)-b.left;c=a.hasClass("ng-exception")? -"EXCEPTION:":"Validation error...";a=a.attr("ng-error");d=d>375?"left":"right";c=k("<div id='ng-callout' style='width:300px'><div class='ng-arrow-"+d+"'/><div class='ng-title'>"+c+"</div><div class='ng-content'>"+a+"</div></div>");k("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.oa=function(){k("#ng-callout").unbind(A.ta,A.oa).remove();return true};A.prototype={bind:function(){this.D.find(".ng-validation-error,.ng-exception").live("mouseover", +"EXCEPTION:":"Validation error...";a=a.attr("ng-error");d=d>375?"left":"right";c=k("<div id='ng-callout' style='width:300px'><div class='ng-arrow-"+d+"'/><div class='ng-title'>"+c+"</div><div class='ng-content'>"+a+"</div></div>");k("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.oa=function(){k("#ng-callout").unbind(A.ta,A.oa).remove();return true};A.prototype={bind:function(){this.F.find(".ng-validation-error,.ng-exception").live("mouseover", A.ec)}};X.$a='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';X.prototype={pb:function(){this.da===0&&this.Ia.show();this.da++},zb:function(){this.da--;this.da===0&&this.Ia.hide("fold")}}})(window,document); @@ -3429,7 +3429,7 @@ function TextController(view, exp, formatter) { this.required = typeof view.attributes['ng-required'] != "undefined"; this.lastErrorText = null; this.lastValue = undefined; - this.initialValue = view.value; + this.initialValue = this.formatter['parse'](view.value); var widget = view.getAttribute('ng-widget'); if (widget === 'datepicker') { jQuery(view).datepicker(); @@ -3438,11 +3438,11 @@ function TextController(view, exp, formatter) { TextController.prototype = { updateModel: function(scope) { - var value = this.view.value; + var value = this.formatter['parse'](this.view.value); if (this.lastValue === value) { return false; } else { - scope.setEval(this.exp, this.formatter['parse'](value)); + scope.setEval(this.exp, value); this.lastValue = value; return true; } @@ -3450,16 +3450,17 @@ TextController.prototype = { updateView: function(scope) { var view = this.view; - var value = this.formatter['format'](scope.get(this.exp)); + var value = scope.get(this.exp); if (typeof value === "undefined") { value = this.initialValue; - scope.setEval(this.exp, this.formatter['parse'](value)); + scope.setEval(this.exp, value); } value = value ? value : ''; - if (this.lastValue != value) { - view.value = value; + if (!_(this.lastValue).isEqual(value)) { + view.value = this.formatter['format'](value); this.lastValue = value; } + var isValidationError = false; view.removeAttribute('ng-error'); if (this.required) { @@ -3489,14 +3490,15 @@ function CheckboxController(view, exp, formatter) { this.exp = exp; this.lastValue = undefined; this.formatter = formatter; - this.initialValue = view.checked ? view.value : ""; + this.initialValue = this.formatter['parse'](view.checked ? view.value : ""); }; CheckboxController.prototype = { updateModel: function(scope) { - jstd.console.log("model"); var input = this.view; var value = input.checked ? input.value : ''; + value = this.formatter['parse'](value); + value = this.formatter['format'](value); if (this.lastValue === value) { return false; } else { @@ -3511,10 +3513,9 @@ CheckboxController.prototype = { var value = scope.eval(this.exp); if (typeof value === "undefined") { value = this.initialValue; - scope.setEval(this.exp, this.formatter['parse'](value)); + scope.setEval(this.exp, value); } - value = this.formatter['format'](value); - input.checked = input.value == value; + input.checked = this.formatter['parse'](input.value) == value; } }; |
