diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Rakefile | 33 | ||||
| -rw-r--r-- | angular-minified.js | 231 | ||||
| -rw-r--r-- | angular.js | 789 | ||||
| -rw-r--r-- | example/calculator-manual_init.html | 3 | ||||
| -rw-r--r-- | example/calculator-minified_init.html | 21 | ||||
| -rw-r--r-- | src/API.js | 72 | ||||
| -rw-r--r-- | src/DataStore.js | 2 | ||||
| -rw-r--r-- | src/Filters.js | 2 | ||||
| -rw-r--r-- | src/JSON.js | 6 | ||||
| -rw-r--r-- | src/Loader.js | 47 | ||||
| -rw-r--r-- | src/Parser.js | 8 | ||||
| -rw-r--r-- | src/Scope.js | 2 | ||||
| -rw-r--r-- | src/Widgets.js | 16 | ||||
| -rw-r--r-- | src/test/Runner.js | 2 | ||||
| -rw-r--r-- | src/test/_namespace.js | 10 |
16 files changed, 343 insertions, 903 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..90a1eea4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +angular-minified.map +externs.js @@ -1,12 +1,39 @@ include FileUtils +desc 'Generate Externs' +task :compileexterns do + out = File.new("externs.js", "w") + + out.write("function _(){};\n") + file = File.new("lib/underscore/underscore.js", "r") + while (line = file.gets) + if line =~ /^\s*_\.(\w+)\s*=.*$/ + out.write("_.#{$1}=function(){};\n") + end + end + file.close + + out.write("function jQuery(){};\n") + file = File.new("lib/jquery/jquery-1.3.2.js", "r") + while (line = file.gets) + if line =~ /^\s*(\w+)\s*:\s*function.*$/ + out.write("jQuery.#{$1}=function(){};\n") + end + end + file.close + out.write("jQuery.scope=function(){};\n") + out.write("jQuery.controller=function(){};\n") + + out.close +end + desc 'Compile JavaScript' task :compile do + Rake::Task['compileexterns'].execute + concat = %x(cat \ - lib/underscore/underscore.js \ src/angular.prefix \ lib/webtoolkit/webtoolkit.base64.js \ - lib/swfobject.js/swfobject.js \ src/Loader.js \ src/API.js \ src/Binder.js \ @@ -30,6 +57,8 @@ task :compile do %x(java -jar lib/compiler-closure/compiler.jar \ --compilation_level ADVANCED_OPTIMIZATIONS \ --js angular.js \ + --externs externs.js \ + --create_source_map ./angular-minified.map \ --js_output_file angular-minified.js) end diff --git a/angular-minified.js b/angular-minified.js index a9faa563..ce5155f2 100644 --- a/angular-minified.js +++ b/angular-minified.js @@ -1,122 +1,109 @@ -function u(){return function(s){return s}}function x(){return function(){}}function y(s){return function(v){this[s]=v}}function z(s){return function(){return s}} -(function(){var s=this,v=s.Ma;function w(f){this.$=f}var a=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=s.Ma=function(f){return new w(f)};if(typeof exports!=="undefined")exports.Ma=b;var c=Array.prototype.slice,d=Array.prototype.unshift,e=Object.prototype.toString,g=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;b.Ce="0.5.1";b.b=function(f,h,j){try{if(f.forEach)f.forEach(h,j);else if(b.q(f)||b.Lb(f))for(var k=0,m=f.length;k<m;k++)h.call(j,f[k],k,f);else{var q= -b.ia(f);m=q.length;for(k=0;k<m;k++)h.call(j,f[q[k]],q[k],f)}}catch(t){if(t!=a)throw t;}return f};b.map=function(f,h,j){if(f&&b.K(f.map))return f.map(h,j);var k=[];b.b(f,function(m,q,t){k.push(h.call(j,m,q,t))});return k};b.reduce=function(f,h,j,k){if(f&&b.K(f.reduce))return f.reduce(b.B(j,k),h);b.b(f,function(m,q,t){h=j.call(k,h,m,q,t)});return h};b.reduceRight=function(f,h,j,k){if(f&&b.K(f.reduceRight))return f.reduceRight(b.B(j,k),h);var m=b.ua(b.A(f)).reverse();b.b(m,function(q,t){h=j.call(k,h, -q,t,f)});return h};b.xb=function(f,h,j){var k;b.b(f,function(m,q,t){if(h.call(j,m,q,t)){k=m;b.qa()}});return k};b.select=function(f,h,j){if(f&&b.K(f.filter))return f.filter(h,j);var k=[];b.b(f,function(m,q,t){h.call(j,m,q,t)&&k.push(m)});return k};b.Pf=function(f,h,j){var k=[];b.b(f,function(m,q,t){!h.call(j,m,q,t)&&k.push(m)});return k};b.all=function(f,h,j){h=h||b.ga;if(f&&b.K(f.every))return f.every(h,j);var k=true;b.b(f,function(m,q,t){(k=k&&h.call(j,m,q,t))||b.qa()});return k};b.Hc=function(f, -h,j){h=h||b.ga;if(f&&b.K(f.some))return f.some(h,j);var k=false;b.b(f,function(m,q,t){if(k=h.call(j,m,q,t))b.qa()});return k};b.ya=function(f,h){if(b.q(f))return b.indexOf(f,h)!=-1;var j=false;b.b(f,function(k){if(j=k===h)b.qa()});return j};b.rf=function(f,h){var j=b.L(arguments,2);return b.map(f,function(k){return(h?k[h]:k).apply(k,j)})};b.bb=function(f,h){return b.map(f,function(j){return j[h]})};b.max=function(f,h,j){if(!h&&b.q(f))return Math.max.apply(Math,f);var k={ca:-Infinity};b.b(f,function(m, -q,t){q=h?h.call(j,m,q,t):m;q>=k.ca&&(k={value:m,ca:q})});return k.value};b.min=function(f,h,j){if(!h&&b.q(f))return Math.min.apply(Math,f);var k={ca:Infinity};b.b(f,function(m,q,t){q=h?h.call(j,m,q,t):m;q<k.ca&&(k={value:m,ca:q})});return k.value};b.$d=function(f,h,j){return b.bb(b.map(f,function(k,m,q){return{value:k,vb:h.call(j,k,m,q)}}).sort(function(k,m){k=k.vb;m=m.vb;return k<m?-1:k>m?1:0}),"value")};b.Sf=function(f,h,j){j=j||b.ga;for(var k=0,m=f.length;k<m;){var q=k+m>>1;j(f[q])<j(h)?(k=q+1): -(m=q)}return k};b.A=function(f){if(!f)return[];if(f.A)return f.A();if(b.q(f))return f;if(b.Lb(f))return c.call(f);return b.map(f,u())};b.size=function(f){return b.A(f).length};b.gd=function(f,h,j){return h&&!j?c.call(f,0,h):f[0]};b.L=function(f,h,j){return c.call(f,b.H(h)||j?1:h)};b.wd=function(f){return f[f.length-1]};b.compact=function(f){return b.select(f,function(h){return!!h})};b.hd=function(f){return b.reduce(f,[],function(h,j){if(b.q(j))return h.concat(b.hd(j));h.push(j);return h})};b.dg=function(f){var h= -b.L(arguments);return b.select(f,function(j){return!b.ya(h,j)})};b.fe=function(f,h){return b.reduce(f,[],function(j,k,m){if(0==m||(h===true?b.wd(j)!=k:!b.ya(j,k)))j.push(k);return j})};b.qf=function(f){var h=b.L(arguments);return b.select(b.fe(f),function(j){return b.all(h,function(k){return b.indexOf(k,j)>=0})})};b.gg=function(){for(var f=b.A(arguments),h=b.max(b.bb(f,"length")),j=new Array(h),k=0;k<h;k++)j[k]=b.bb(f,String(k));return j};b.indexOf=function(f,h){if(f.indexOf)return f.indexOf(h);for(var j= -0,k=f.length;j<k;j++)if(f[j]===h)return j;return-1};b.lastIndexOf=function(f,h){if(f.lastIndexOf)return f.lastIndexOf(h);for(var j=f.length;j--;)if(f[j]===h)return j;return-1};b.Rd=function(f,h,j){var k=b.A(arguments),m=k.length<=1;f=m?0:k[0];h=m?k[0]:k[1];j=k[2]||1;k=Math.ceil((h-f)/j);if(k<=0)return[];k=new Array(k);m=f;for(var q=0;;m+=j){if((j>0?m-h:h-m)>=0)return k;k[q++]=m}};b.B=function(f,h){var j=b.L(arguments,2);return function(){return f.apply(h||s,j.concat(b.A(arguments)))}};b.Ne=function(f){var h= -b.L(arguments);if(h.length==0)h=b.Ua(f);b.b(h,function(j){f[j]=b.B(f[j],f)});return f};b.Ta=function(f,h){var j=b.L(arguments,2);return setTimeout(function(){return f.apply(f,j)},h)};b.defer=function(f){return b.Ta.apply(b,[f,1].concat(b.L(arguments)))};b.fg=function(f,h){return function(){var j=[f].concat(b.A(arguments));return h.apply(h,j)}};b.Ze=function(){var f=b.A(arguments);return function(){for(var h=b.A(arguments),j=f.length-1;j>=0;j--)h=[f[j].apply(this,h)];return h[0]}};b.ia=function(f){if(b.q(f))return b.Rd(0, -f.length);var h=[];for(var j in f)g.call(f,j)&&h.push(j);return h};b.gb=function(f){return b.map(f,b.ga)};b.Ua=function(f){return b.select(b.ia(f),function(h){return b.K(f[h])}).sort()};b.extend=function(f,h){for(var j in h)f[j]=h[j];return f};b.ua=function(f){if(b.q(f))return f.slice(0);return b.extend({},f)};b.isEqual=function(f,h){if(f===h)return true;var j=typeof f;if(j!=typeof h)return false;if(f==h)return true;if(!f&&h||f&&!h)return false;if(f.isEqual)return f.isEqual(h);if(b.pd(f)&&b.pd(h))return f.getTime()=== -h.getTime();if(b.Mb(f)&&b.Mb(h))return true;if(b.rd(f)&&b.rd(h))return f.source===h.source&&f.global===h.global&&f.ignoreCase===h.ignoreCase&&f.multiline===h.multiline;if(j!=="object")return false;if(f.length&&f.length!==h.length)return false;j=b.ia(f);var k=b.ia(h);if(j.length!=k.length)return false;for(var m in f)if(!b.isEqual(f[m],h[m]))return false;return true};b.tf=function(f){return b.ia(f).length==0};b.sf=function(f){return!!(f&&f.nodeType==1)};b.Lb=function(f){return f&&b.ha(f.length)&&!b.q(f)&& -!i.call(f,"length")};b.Mb=function(f){return b.ha(f)&&isNaN(f)};b.uf=function(f){return f===null};b.H=function(f){return typeof f=="undefined"};for(var l=["Array","Date","Function","Number","RegExp","String"],n=0,o=l.length;n<o;n++)(function(){var f="[object "+l[n]+"]";b["is"+l[n]]=function(h){return e.call(h)==f}})();b.Df=function(){s.Ma=v;return this};b.ga=u();b.qa=function(){throw a;};var p=0;b.$f=function(f){var h=p++;return f?f+h:h};b.V=function(f,h){f=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+ -f.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return h?f(h):f};b.forEach=b.b;b.kf=b.of=b.reduce;b.lf=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.Hc;b.Ib=b.gd;b.Wf=b.L;b.Af=b.Ua;function r(f,h){return h?b(f).rb():f}b.b(b.Ua(b),function(f){var h=b[f];w.prototype[f]=function(){d.call(arguments,this.$);return r(h.apply(b, -arguments),this.Na)}});b.b(["pop","push","reverse","shift","sort","splice","unshift"],function(f){var h=Array.prototype[f];w.prototype[f]=function(){h.apply(this.$,arguments);return r(this.$,this.Na)}});b.b(["concat","join","slice"],function(f){var h=Array.prototype[f];w.prototype[f]=function(){return r(h.apply(this.$,arguments),this.Na)}});w.prototype.rb=function(){this.Na=true;return this};w.prototype.value=function(){return this.$}})(); -(function(s,v){var w={I:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",wa:function(a){var b="",c,d,e,g,i,l,n=0;for(a=w.Cc(a);n<a.length;){c=a.charCodeAt(n++);d=a.charCodeAt(n++);e=a.charCodeAt(n++);g=c>>2;c=(c&3)<<4|d>>4;i=(d&15)<<2|e>>6;l=e&63;if(isNaN(d))i=l=64;else if(isNaN(e))l=64;b=b+this.I.charAt(g)+this.I.charAt(c)+this.I.charAt(i)+this.I.charAt(l)}return b},ef:function(a){var b="",c,d,e,g,i,l=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<a.length;){c=this.I.indexOf(a.charAt(l++)); -d=this.I.indexOf(a.charAt(l++));g=this.I.indexOf(a.charAt(l++));i=this.I.indexOf(a.charAt(l++));c=c<<2|d>>4;d=(d&15)<<4|g>>2;e=(g&3)<<6|i;b+=String.fromCharCode(c);if(g!=64)b+=String.fromCharCode(d);if(i!=64)b+=String.fromCharCode(e)}return b=w.Bc(b)},Cc: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},Bc: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 v.getAttribute=="undefined")v.getAttribute=x();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};if(_.H(s.Cf))nglr={};if(_.H(s.Fe))angular={};if(_.H(angular.j))angular.j={};if(_.H(angular.filter))angular.filter={};if(_.H(s.console))s.console={log:x(),error:x()};if(_.H(alert))alert=function(){console.log(arguments);s.alert.apply(s,arguments)};consoleLog=function(a,b){var c=v.createElement("div");c.className=a; -for(var d=a="",e=0;e<b.length;e++){var g=b[e];a+=d+(typeof g=="string"?g:toJson(g));d=" "}c.appendChild(v.createTextNode(a));consoleNode.appendChild(c)};isNode=function(a){return a&&a.tagName&&a.nodeName&&a.ownerDocument&&a.removeAttribute};isLeafNode=function(a){switch(a.nodeName){case "OPTION":case "PRE":case "TITLE":return true;default:return false}};noop=x();setHtml=function(a,b){if(isLeafNode(a))if(msie)a.innerText=b;else a.textContent=b;else a.innerHTML=b};escapeHtml=function(a){if(!a||!a.replace)return a; -return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")};escapeAttr=function(a){if(!a||!a.replace)return a;return a.replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""")};bind=function(a,b){if(!a)throw"Missing this";if(!_.K(b))throw"Missing function";return function(){return b.apply(a,arguments)}};shiftBind=function(a,b){return function(){for(var c=[this],d=0;d<arguments.length;d++)c.push(arguments[d]);return b.apply(a,c)}};outerHTML=function(a){var b=v.createElement("div"); -b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c};trim=function(a){return a.replace(/^ */,"").replace(/ *$/,"")};toBoolean=function(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a};merge=function(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=fromJson(toJson(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&merge(a[c],d)}};Loader=function(a,b,c){this.document=jQuery(a);this.Ib=jQuery(b);this.o=c;this.location= -s.location};Loader.prototype.load=function(){this.Rc();this.Qb("/stylesheets/jquery-ui/smoothness/jquery-ui-1.7.1.css");this.Qb("/stylesheets/css");console.log("Server: "+this.o.M);msie=jQuery.Oe.Bf;this.Qc();this.Pc();this.Mc()};Loader.prototype.Qc=function(){console.log("Loader.configureJQueryPlugins()");jQuery.c.removeNode=function(){var a=this.h(0);a.parentNode.removeChild(a)};jQuery.c.scope=function(){for(var a=this;a&&a.h(0);){var b=a.data("scope");if(b)return b;a=a.parent()}return null};jQuery.c.$e= -function(){return this.data("controller")||NullController.nd}};Loader.prototype.ee=function(){return""+(new Date).getTime()};Loader.prototype.Pc=function(){var a=this.o;if(!a.T){var b=a.M.match(/https?:\/\/([\w]*)/);a.T=b?b[1]:"$MEMORY"}};Loader.prototype.Mc=function(){function a(){i.Bb(function(p){!p&&c.find("[ng-auth=eager]").length&&i.Ca()})}console.log("Loader.bindHtml()");var b=new UrlWatcher(this.location),c=this.document,d=new WidgetFactory(this.o.M,this.o.T),e=new Binder(c[0],d,b,this.o); -d.Nd=shiftBind(e,e.i);d=new ControlBar(c.find("body"),this.o.M);var g=this.o.T=="$MEMORY"?new FrameServer(this.window):new Server(this.o.M,jQuery.Fb);g=new VisualServer(g,new Status(jQuery(c.body)),function(){e.d()});var i=new Users(g,d),l="/data/"+this.o.T,n=new DataStore(function(p,r){g.la("POST",l,p,r)},i,e.anchor);e.lc.push(function(){n.Db()});var o=new Scope({pe:e.anchor,qe:e,re:this.o,se:s.console,te:n,pa:function(p){n.Wd(o.F,p,e.anchor)},ze:s,xe:this.ee,ye:i},"ROOT");jQuery.b(["get","set", -"eval","addWatchListener","updateView"],function(p,r){angular[r]=bind(o,o[r])});c.data("scope",o);console.log("$binder.entity()");e.da(o);console.log("$binder.compile()");e.compile();console.log("ControlBar.bind()");d.B();console.log("$users.fetchCurrentUser()");a();console.log("PopUp.bind()");(new PopUp(c)).B();console.log("$binder.parseAnchor()");e.Zb();console.log("$binder.executeInit()");e.dd();console.log("$binder.updateView()");e.d();b.Ob=bind(e,e.Pd,b);b.Ef=function(){alert("update")};b.watch(); -c.find("body").cb();console.log("ready()")};Loader.prototype.Rc=function(){var a=s.location.href+"#";a=a.split("#")[1];var b={Xc:null};a=a.split("&");for(var c=0;c<a.length;c++){var d=(a[c]+"=").split("=");b[d[0]]=d[1]}if(b.Xc=="console"){consoleNode=v.createElement("div");consoleNode.id="ng-console";v.getElementsByTagName("body")[0].appendChild(consoleNode);console.log=function(){consoleLog("ng-console-info",arguments)};console.error=function(){consoleLog("ng-console-error",arguments)}}};Loader.prototype.Qb= -function(a){var b=v.createElement("link");b.rel="stylesheet";b.type="text/css";a.match(/^http:/)||(a=this.o.M+a);b.href=a;this.Ib[0].appendChild(b)};UrlWatcher=function(a){this.location=a;this.Ta=25;this.setTimeout=function(b,c){s.setTimeout(b,c)};this.Ob=u();this.ea=a.href};UrlWatcher.prototype.watch=function(){var a=this;function b(){if(a.ea!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.ea.match(/#/)||(a.ea+="#");a.location.href=a.ea;c="_iframe_notify_"+c[1]; -var d=nglr[c];delete nglr[c];try{(d||noop)()}catch(e){alert(e)}}else{a.Ob(a.location.href);a.ea=a.location.href}}a.setTimeout(b,a.Ta)}b()};UrlWatcher.prototype.Zd=function(a){var b=s.location.href;b.match(/#/)||(b+="#");if(b!=a)s.location.href=a;self.ff=a};UrlWatcher.prototype.Gb=function(){return s.location.href};angular.compile=function(a,b){b=b||{};(new Loader(a,jQuery("head"),_({M:""}).extend(b))).load();return jQuery(a).scope()};angular.Y={de:function(a){var b=typeof a;switch(b){case "object":if(a=== -null)return"null";if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}};angular.La={};angular.xc={};angular.Ka={md:function(a,b,c){var d=_.indexOf(a,b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},Vf:function(a,b){b=angular.X.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=angular.X.compile(b); -_.xb(a,function(e){if(d(e)){c=e;return true}});return c}},gf:function(a,b){return angular.Ka.find(a,function(c){return c.N==b},null)},filter:function(a,b){var c=[];c.Nc=function(o){for(var p=0;p<c.length;p++)if(!c[p](o))return false;return true};var d=Scope.fa;function e(o,p){if(p.charAt(0)==="!")return!e(o,p.substr(1));switch(typeof o){case "boolean":case "number":case "string":return(""+o).toLowerCase().indexOf(p)>-1;case "object":for(var r in o)if(r.charAt(0)!=="$"&&e(o[r],p))return true;return false; -case "array":for(r=0;r<o.length;r++)if(e(o[r],p))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={oe:b};case "object":for(var g in b)g=="$"?function(){var o=(""+b[g]).toLowerCase();o&&c.push(function(p){return e(p,o)})}():function(){var o=g,p=(""+b[g]).toLowerCase();p&&c.push(function(r){return e(d(r,o),p)})}();break;case "function":c.push(b);break;default:return a}for(var i=[],l=0;l<a.length;l++){var n=a[l];c.Nc(n)&&i.push(n)}return i}, -add:function(a,b){a.push(_.H(b)?{}:b);return a},af:function(a,b){if(!b)return a.length;var c=angular.X.compile(b);return _.reduce(a,0,function(d,e){return d+(c(e)?1:0)})},Ff:function(a,b,c){function d(g,i){return toBoolean(i)?function(l,n){return g(n,l)}:g}function e(g,i){var l=typeof g,n=typeof i;if(l==n){if(l=="string")g=g.toLowerCase();if(l=="string")i=i.toLowerCase();if(g===i)return 0;return g<i?-1:1}else return l<n?-1:1}b=_.q(b)?b:[b];b=_.map(b,function(g){var i=false;if(typeof g=="string"&& -(g.charAt(0)=="+"||g.charAt(0)=="-")){i=g.charAt(0)=="-";g=g.substring(1)}var l=g?angular.X.compile(g):_.ga;return d(function(n,o){return e(l(n),l(o))},i)});return _.ua(a).sort(d(function(g,i){for(var l=0;l<b.length;l++){var n=b[l](g,i);if(n!=0)return n}return 0},c))},Hf:function(a,b){var c=false,d=-1;_.xb(a,function(e,g){if(e==b){c=true;d=g;return true}if((e.charAt(0)=="+"||e.charAt(0)=="-")&&e.substring(1)==b){c=e.charAt(0)=="+";d=g;return true}});d>=0&&a.splice(d,1);a.unshift((c?"-":"+")+b);return a}, -Gf: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:""},zf:function(a,b,c){var d=a[b];if(!d){d={};a[b]=d}merge(c,d);return a}};angular.O={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")+'"'},cc:function(a){a=angular.O.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("")},be: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}};angular.tc={toString:function(a){function b(c){return c<10?"0"+c:c}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+ -"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())+"Z"}};angular.X={compile:function(a){if(_.K(a))return a;else if(a){var b=new Scope;return function(c){b.F=c;return b.eval(a)}}else return u()}};(function(){function a(b,c,d){_.extend(b,c);_.b(d||[],function(e){b[e]=_[e]})}a(angular.Y,{},["extend","clone","isEqual","isElement","isArray","isFunction","isUndefined"]);a(angular.La,angular.Y,["each","map","reduce","reduceRight","detect","select","reject","all","any","include","invoke", -"pluck","max","min","sortBy","sortedIndex","toArray","size"]);a(angular.Ka,angular.La,["first","last","compact","flatten","without","uniq","intersect","zip","indexOf","lastIndexOf"]);a(angular.xc,angular.La,["keys","values"]);a(angular.O,angular.Y);a(angular.X,angular.Y,["bind","bindAll","delay","defer","wrap","compose"])})();Binder=function(a,b,c,d){this.Q=a;this.fb=c;this.anchor={};this.me=b;this.o=d||{};this.lc=[]};Binder.Ea=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};Binder.ld=function(a){a=Binder.Ea(a);return a.length>1||Binder.ba(a[0])!==null};Binder.ba=function(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?a[1]:null};Binder.prototype.Qd=function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b};Binder.prototype.Zb=function(a){var b= -this;a=a||this.fb.Gb();var c=a.indexOf("#");if(!(c<0)){a=this.Qd(a.substring(c+1));jQuery.b(b.anchor,function(d){delete b.anchor[d]});jQuery.b(a,function(d,e){b.anchor[d]=e})}};Binder.prototype.Pd=function(a){console.log("URL change detected",a);this.Zb(a);this.d()};Binder.prototype.ge=function(){var a=this.fb.Gb(),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.fb.Zd(a);return a};Binder.prototype.d=function(){(new Date).getTime();var a=jQuery(this.Q).scope();a.s("$invalidWidgets",[]);a.d();(new Date).getTime();this.ge();_.b(this.lc,function(b){b()})};Binder.prototype.va=function(a){var b=jQuery(this.Q),c=b.find(a);if(b.od(a))c=c.Ee();return c};Binder.prototype.dd=function(){this.va("[ng-init]").b(function(){var a=jQuery(this),b=a.scope();try{b.eval(a.g("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.g("ng-init")+ -"\n"+toJson(c,true))}})};Binder.prototype.da=function(a){this.va("[ng-entity]").g("ng-watch",function(){try{var b=jQuery(this);return a.da(b.g("ng-entity"))+(b.g("ng-watch")||"")}catch(c){alert(c)}})};Binder.prototype.compile=function(){var a=jQuery(this.Q),b=this;if(this.o.He){var c=this.va(":submit").Yb("[ng-action]");c.g("ng-action","$save()");c.Yb(":disabled").Yb("ng-bind-attr").g("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.ac(this.Q)(this.Q,a.scope(),"");this.va("a[ng-action]").xd("click", -function(){var d=jQuery(this);try{d.scope().eval(d.g("ng-action"));d.fc("ng-error");d.gc("ng-exception")}catch(e){d.Oa("ng-exception");d.g("ng-error",toJson(e,true))}b.d();return false})};Binder.prototype.ce=function(a,b,c){b=b.concat();var d=b.pop(),e=Binder.Ea(a.nodeValue);if(e.length>1||Binder.ba(e[0])){var g=a.parentNode;if(isLeafNode(g)){g.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,c:function(p){return new BindUpdater(p,p.getAttribute("ng-bind-template"))}})}else for(var i=0;i< -e.length;i++){var l=e[i],n=Binder.ba(l),o;if(n){o=v.createElement("span");jQuery(o).g("ng-bind",n);i===0&&c.push({path:b.concat(d+i),c:Binder.prototype.Xb})}else if(msie&&l.charAt(0)==" "){o=v.createElement("span");o.innerHTML=" "+l.substring(1)}else o=v.createTextNode(l);g.insertBefore(o,a)}g.removeChild(a)}};Binder.prototype.ac=function(a){var b=[];this.bc(a,[],b);return function(c,d,e){for(var g=b.length,i=0;i<g;i++){for(var l=b[i],n=c,o=l.path,p=0;p<o.length;p++)n=n.childNodes[o[p]];try{d.Fc(l.c(n, -d,e))}catch(r){alert(r)}}}};Binder.prototype.bc=function(a,b,c){var d=a.nodeType;if(d==Node.TEXT_NODE)this.ce(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?fromJson(e):{};for(var g=d.length,i=0;i<g;i++){var l=d[i],n=l.name;l=msie&&n=="href"?decodeURI(a.getAttribute(n,2)):l.value;if(Binder.ld(l))e[n]=l}d=toJson(e);d.length> -2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||console.log(a);var o=a.getAttribute("ng-repeat");if(o){a.removeAttribute("ng-repeat");var p=this.ac(a);d=v.createComment("ng-repeat: "+o);e=a.parentNode;e.insertBefore(d,a);e.removeChild(a);var r=function(h,j,k){var m=jQuery(a).ua();m.Sa("display","");m.g("ng-repeat-index",""+k);m.data("scope",h);p(m[0],h,j+k+":");return m};c.push({path:b,c:function(h,j,k){return new RepeaterUpdater(jQuery(h),o,r,k)}})}else{a.getAttribute("ng-eval")&&c.push({path:b, -c:this.Hd});a.getAttribute("ng-bind")&&c.push({path:b,c:this.Xb});a.getAttribute("ng-bind-attr")&&c.push({path:b,c:this.Dd});a.getAttribute("ng-hide")&&c.push({path:b,c:this.Id});a.getAttribute("ng-show")&&c.push({path:b,c:this.Jd});a.getAttribute("ng-class")&&c.push({path:b,c:this.Ed});a.getAttribute("ng-class-odd")&&c.push({path:b,c:this.Gd});a.getAttribute("ng-class-even")&&c.push({path:b,c:this.Fd});a.getAttribute("ng-style")&&c.push({path:b,c:this.Kd});a.getAttribute("ng-watch")&&c.push({path:b, -c:this.Ld});d=a.nodeName;if(d=="INPUT"||d=="TEXTAREA"||d=="SELECT"||d=="BUTTON"){var f=this;c.push({path:b,c:function(h,j,k){h.name=k+h.name.split(":").pop();return f.me.Sc(jQuery(h),j)}})}if(d=="OPTION")if(!jQuery("<select/>").append(jQuery(a).ua()).w().match(/<option(\s.*\s|\s)value\s*=\s*.*>.*<\/\s*option\s*>/gi))a.value=a.text;d=a.childNodes;for(e=0;e<d.length;e++)this.bc(d[e],b.concat(e),c)}}}};Binder.prototype.Hd=function(a){return new EvalUpdater(a,a.getAttribute("ng-eval"))};Binder.prototype.Xb= -function(a){return new BindUpdater(a,"{{"+a.getAttribute("ng-bind")+"}}")};Binder.prototype.Dd=function(a){return new BindAttrUpdater(a,fromJson(a.getAttribute("ng-bind-attr")))};Binder.prototype.Id=function(a){return new HideUpdater(a,a.getAttribute("ng-hide"))};Binder.prototype.Jd=function(a){return new ShowUpdater(a,a.getAttribute("ng-show"))};Binder.prototype.Ed=function(a){return new ClassUpdater(a,a.getAttribute("ng-class"))};Binder.prototype.Fd=function(a){return new ClassEvenUpdater(a,a.getAttribute("ng-class-even"))}; -Binder.prototype.Gd=function(a){return new ClassOddUpdater(a,a.getAttribute("ng-class-odd"))};Binder.prototype.Kd=function(a){return new StyleUpdater(a,a.getAttribute("ng-style"))};Binder.prototype.Ld=function(a,b){b.watch(a.getAttribute("ng-watch"))};ControlBar=function(a,b){this.document=a;this.Ia=b;this.window=s;this.S=[]};ControlBar.prototype.B=x();ControlBar.Ae='<div><div class="ui-widget-overlay"></div><div id="ng-login" ng-non-bindable="true"><div class="ng-login-container"></div></div></div>'; -ControlBar.prototype.Ca=function(a){this.S.push(a);this.S.length==1&&this.zb("/user_session/new.mini?return_url="+encodeURIComponent(this.mc()))};ControlBar.prototype.Vb=function(a){this.S.push(a);this.S.length==1&&this.zb("/user_session/do_destroy.mini")};ControlBar.prototype.mc=function(){return this.window.location.href.split("#")[0]};ControlBar.prototype.zb=function(a){var b=this,c=(new Date).getTime(),d=this.mc();d+="#$iframe_notify="+c;var e=jQuery('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+ -d+'" src="'+this.Ia+a+'" width="500" height="330"/></div>');this.document.append(e);e.yb({height:363,width:500,Qf:false,Ad:true,title:'Authentication: <a href="http://www.getangular.com"><tt><angular/></tt></a>'});nglr["_iframe_notify_"+c]=function(){e.yb("destroy");e.remove();jQuery.b(b.S,function(g,i){i()});b.S=[]}};ControlBar.vc='<div ng-non-bindable="true" title="Permission Error:">Sorry, you do not have permission for this!</div>';ControlBar.prototype.Za=function(){if(!this.Eb){this.Eb= -jQuery(ControlBar.vc);this.Eb.yb({Me:true,height:70,Ad:true})}};DataStore=function(a,b,c){this.$b=a;this.nc=b;this.P={na:[]};this.anchor=c;this.ra=[]};DataStore.prototype.sa=function(a){if(a.constructor!=Model)throw"Parameter must be an instance of Entity! "+toJson(a);var b=a.oa+"/"+a.N,c=this.P[b];if(c)Model.Ra(a,c);else c=this.P[b]=a;return c};DataStore.prototype.load=function(a,b,c,d){if(b&&b!=="*"){var e=this;this.R(["GET",a.oa+"/"+b],function(g){a.W(g);a.kb();g=a.ma(a);e.sa(g);(c||noop)(a)}, -d)}return a};DataStore.prototype.Wa=function(a,b,c){var d=this,e=[],g=0;jQuery.b(b,function(i,l){e.push(d.load(a(),l,function(){g++;if(g==b.length)(c||noop)(e)}))});return e};DataStore.prototype.Rb=function(a,b,c){return this.load(a,b,c,function(d){if(d.Ja==404){a.N=b;(c||noop)(a)}else throw d;})};DataStore.prototype.yd=function(a,b){var c=this,d=[];d.ib=function(e){return e.oa==a.title};this.P.na.push(d);this.R(["GET",a.title],function(e){for(var g=0;g<e.length;g++){var i=a();i.W(e[g]);d.push(c.sa(i))}(b|| -noop)(d)});return d};DataStore.prototype.save=function(a,b){var c=this,d={};a.lb(d);this.R(["POST","",d],function(e){a.W(e);var g=c.sa(a);_.b(c.P.na,function(i){i.ib(a)&&angular.Ka.md(i,g,true)});if(a.jb)c.anchor[a.jb]=a.N;b&&b(a)})};DataStore.prototype.remove=function(a,b){var c=this,d={};a.lb(d);this.R(["DELETE","",d],function(e){delete c.P[a.oa+"/"+a.N];_.b(c.P.na,function(g){for(var i=0;i<g.length;i++)g[i].N==a.N&&g.splice(i,1)});(b||noop)(e)})};DataStore.prototype.R=function(a,b,c){a.pc=b;a.rc= -c||function(d){throw d;};this.ra.push(a)};DataStore.prototype.Db=function(){function a(d,e){console.log("RESPONSE["+d+"]: ",e);if(e.Ja==401)b.nc.Ca(function(){b.$b(c,a)});else if(e.Ja)alert(toJson(e));else for(var g=0;g<e.length;g++){var i=e[g],l=c[g];if(d=i.Ja)d==403?b.nc.Za():l.rc(i);else l.pc(i)}}if(this.ra.length!==0){var b=this,c=this.ra;this.ra=[];console.log("REQUEST:",c);this.$b(c,a)}};DataStore.prototype.Wd=function(a,b){function c(){d--;d===0&&b&&b()}var d=1;for(var e in a){var g=a[e];if(g&& -g.pa==Model.prototype.pa){d++;g.pa(c)}}c()};DataStore.prototype.ja=function(a,b,c,d){var e=this,g=[];g.ib=z(false);this.P.na.push(g);this.R(["GET",a.title+"/"+b+"="+c],function(i){for(var l=0;l<i.length;l++){var n=(new a).W(i[l]);g.push(e.sa(n))}d&&d(g)});return g};DataStore.Z=x();DataStore.Z.all=function(){return[]};DataStore.Z.ja=function(){return[]};DataStore.Z.load=function(){return{}};DataStore.Z.title=undefined;DataStore.prototype.da=function(a,b){if(!a)return DataStore.Z;var c=this;function d(e){return new Model(d, -e)}d.title=a;d.qc=true;d.wb=this;d.Yc=b||{};d.load=function(e,g){return c.load(d(),e,g)};d.Wa=function(e,g){return c.Wa(d,e,g)};d.Rb=function(e,g){return c.Rb(d(),e,g)};d.all=function(e){return c.yd(d,e)};d.ja=function(e,g,i){return c.ja(d,e,g,i)};d.Nf=function(e){c.R(["GET",a+"/$properties"],e)};return d};DataStore.prototype.join=function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).rb().map(function(d,e){return e}).$d(function(d){var e=[];do{if(_(e).ya(d))throw"Infinite loop in join: "+ -e.join(" -> ");e.push(d);if(!a[d])throw _("Named entity '<%=name%>' is undefined.").V({name:d});d=a[d].Da?a[d].Da.substring(0,a[d].Da.indexOf(".")):undefined}while(d);return e.length}).value();if(_(c).select(function(d){return a[d].Da}).length!=c.length-1)throw"Exactly one entity needs to be primary.";b.ja=function(d,e){var g=[],i=d?d.substring(0,d.indexOf(".")):undefined;if(i!=c[0])throw _("Named entity '<%=name%>' is not a primary entity.").V({name:i});var l=1;a[i].join.ja(d.substring(d.indexOf(".")+ -1),e,function(n){var o=c[l++],p=a[o],r=p.Da,f={};_(n).b(function(h){var j={};g.push(j);j[i]=h;h=Scope.fa(j,r);f[h]=h});p.join.Wa(_.A(f),function(h){var j={};_(h).b(function(k){j[k.N]=k});_(g).b(function(k){var m=Scope.fa(k,r);k[o]=j[m]})})});return g};return b};angular.filter.m=function(a){if(a)for(var b in a)this[b]=a[b]};angular.filter.m.h=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}}; -angular.filter.bf=function(a){jQuery(this.element).eb("ng-format-negative",a<0);return"$"+angular.filter.$a.apply(this,[a,2])};angular.filter.$a=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}; -angular.filter.Vc=x();angular.filter.td=function(a){jQuery(this.element).Oa("ng-monospace");return toJson(a,true)};angular.filter.jc=function(a,b){a=trim(a);for(var c=a.replace(/ /g,""),d=angular.filter.jc.wc,e=0;e<d.length;e++)for(var g=d[e],i=0;i<g.ka.length;i++)if(g.ka[i].test(c)){b=g.name+": "+a;g=g.url+a;return new angular.filter.m({text:b,url:g,w:'<a href="'+escapeAttr(g)+'">'+b+"</a>",Xf:a})}return a?b||new angular.filter.m({text:a+" is not recognized"}):null};angular.filter.jc.wc=[{name:"UPS", -url:"http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&track.x=0&track.y=0&InquiryNumber1=",ka:[/^1Z[0-9A-Z]{16}$/i]},{name:"FedEx",url:"http://www.fedex.com/Tracking?tracknumbers=",ka:[/^96\d{10}?$/i,/^96\d{17}?$/i,/^96\d{20}?$/i,/^\d{15}$/i,/^\d{12}$/i]},{name:"USPS",url:"http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=",ka:[/^(91\d{20})$/i,/^(91\d{18})$/i]}];angular.filter.link=function(a,b){b= -b||angular.filter.m.h(a);var c=angular.filter.m.h(a,"url")||angular.filter.m.h(a);if(c){if(angular.j.$c(c)===null)c="mailto:"+c;a='<a href="'+escapeHtml(c)+'">'+b+"</a>";return new angular.filter.m({text:b,url:c,w:a})}return a};angular.filter.Pa=function(a){if(a===null)return"";for(var b=0;a>1E3;){a/=1024;b++}a=""+a;var c=a.indexOf(".");if(c>-1&&c+2<a.length)a=a.substring(0,c+2);return a+" "+angular.filter.Pa.yc[b]};angular.filter.Pa.yc=["bytes","KB","MB","GB","TB","PB"];angular.filter.nf=function(a, -b,c){if(a&&a.url){var d="";if(b)d=' style="max-width: '+b+"px; max-height: "+(c||b)+'px;"';return new angular.filter.m({url:a.url,text:a.url,w:'<img src="'+a.url+'"'+d+"/>"})}return null};angular.filter.xf=function(a){return(a=angular.filter.m.h(a))?(""+a).toLowerCase():a};angular.filter.cg=function(a){return(a=angular.filter.m.h(a))?(""+a).toUpperCase():a};angular.filter.wf=function(a){a=angular.filter.m.h(a);if(a===""||!a)return 1;return a.split(/\n|\f/).length};angular.filter["if"]=function(a, -b){return b?a:undefined};angular.filter.ag=function(a,b){return b?undefined:a};angular.filter.k=function(a,b,c,d){b=b||{};var e=angular.filter.k;a={Oc:a,Qe:e.tb(b,"color"),We:e.title(b),Se:e.tb(b,"label"),Re:e.gb(b),Te:"bg,s,FFFFFF00"};if(_.q(b.ne)){a.Ye="x";a.Xe="0:|"+b.ne.join("|")}return angular.filter.k.wa(a,c,d)};angular.filter.k.gb=function(a){var b=[];_.b(a.Yd||[],function(c){var d=[];_.b(c.gb||[],function(e){d.push(e)});b.push(d.join(","))});a=b.join("|");return a===""?null:"t:"+a};angular.filter.k.title= -function(a){var b=[];a=a.title||[];_.b(_.q(a)?a:[a],function(c){b.push(encodeURIComponent(c))});return b.join("|")};angular.filter.k.tb=function(a,b){var c=[],d=0;_.b(a.Yd||[],function(e){var g=[];e=e[b]||[];_.b(_.q(e)?e:[e],function(i){g.push(encodeURIComponent(i));d++});c.push(g.join("|"))});return d?c.join(","):null};angular.filter.k.wa=function(a,b,c){b=b||200;c=c||b;var d="http://chart.apis.google.com/chart?",e=[];a.Ve=b+"x"+c;for(var g in a){var i=a[g];i&&e.push(g+"="+i)}e.sort();d+=e.join("&"); -return new angular.filter.m({url:d,text:i,w:'<img width="'+b+'" height="'+c+'" src="'+d+'"/>'})};angular.filter.Of=function(a,b,c){return angular.filter.k.wa({Oc:"qr",Ue:encodeURIComponent(a)},b,c)};angular.filter.Pe={Kf:function(a,b,c){return angular.filter.k("p",a,b,c)},Lf:function(a,b,c){return angular.filter.k("p3",a,b,c)},Mf:function(a,b,c){return angular.filter.k("pc",a,b,c)},Je:function(a,b,c){return angular.filter.k("bhs",a,b,c)},Ie:function(a,b,c){return angular.filter.k("bhg",a,b,c)},Le:function(a, -b,c){return angular.filter.k("bvs",a,b,c)},Ke:function(a,b,c){return angular.filter.k("bvg",a,b,c)},vf:function(a,b,c){return angular.filter.k("lc",a,b,c)},Tf:function(a,b,c){return angular.filter.k("ls",a,b,c)},Rf:function(a,b,c){return angular.filter.k("s",a,b,c)}};angular.filter.w=function(a){return new angular.filter.m({w:a})};array=[].constructor;toJson=function(a,b){var c=[];toJsonArray(c,a,b?"\n ":null);return c.join("")};toPrettyJson=function(a){return toJson(a,true)};fromJson=function(a){try{var b= -new Parser(a,true),c=b.Ga();b.aa();return c()}catch(d){console.error("fromJson error: ",a,d);throw d;}};toJsonArray=function(a,b,c){var d=typeof b;if(b===null)a.push("null");else if(d!=="function")if(d==="boolean")a.push(""+b);else if(d==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(d==="string")return a.push(angular.O.cc(b));else if(d==="object")if(b instanceof Array){a.push("[");var e=b.length;d=false;for(var g=0;g<e;g++){var i=b[g];d&&a.push(",");typeof i=="function"||typeof i=="undefined"? -a.push("null"):toJsonArray(a,i,c);d=true}a.push("]")}else if(b instanceof Date)a.push(angular.O.cc(angular.tc.toString(b)));else{a.push("{");c&&a.push(c);d=false;g=c?c+" ":false;i=[];for(var l in b)l.indexOf("$$")!==0&&i.push(l);i.sort();for(l=0;l<i.length;l++){var n=i[l];try{e=b[n];if(typeof e!="function"){if(d){a.push(",");c&&a.push(c)}a.push(angular.O.quote(n));a.push(":");toJsonArray(a,e,g);d=true}}catch(o){}}a.push("}")}};Model=function(a,b){this.ma=a;this.W(b||{});this.oa=a.title;this.kb()}; -Model.Ra=function(a,b){if(!(a===b||!a||!b)){var c=function(e,g,i){return i.substring(0,2)!=="$$"&&typeof e[i]!=="function"&&typeof g[i]!=="function"};for(var d in b)c(a,b,d)&&delete b[d];for(d in a)if(c(a,b,d))b[d]=a[d]}};Model.prototype.kb=function(){merge(this.ma.Yc,this);return this};Model.prototype.pa=function(a){this.ma.wb.save(this,a===true?undefined:a);a===true&&this.ma.wb.Db();return this};Model.prototype.W=function(a){Model.Ra(a,this);return this};Model.prototype.lb=function(a){Model.Ra(this, -a);return this};Lexer=function(a,b){this.text=a;this.Wc=b?20:-1;this.l=[];this.index=0};Lexer.mb={"null":z(null),"true":z(true),"false":z(false),"+":function(a,b,c){return(b||0)+(c||0)},"-":function(a,b,c){return(b||0)-(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},"=":function(a,b,c){return a.scope.s(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 b&c},"|":function(a,b,c){return c(a,b)},"!":function(a,b){return!b}};Lexer.prototype.U=function(){return this.index+1<this.text.length?this.text.charAt(this.index+1):false};Lexer.prototype.parse=function(){for(var a=this.l,b=Lexer.mb,c=true;this.index<this.text.length;){var d=this.text.charAt(this.index);if(d=='"'||d=="'"){this.Ud(d); -c=true}else if(d=="("||d=="["){a.push({index:this.index,text:d});this.index++}else if(d=="{"){c=this.U();if(c==":"||c=="("){a.push({index:this.index,text:d+c});this.index++}else a.push({index:this.index,text:d});this.index++;c=true}else if(d==")"||d=="]"||d=="}"){a.push({index:this.index,text:d});this.index++;c=false}else if(d==":"||d=="."||d==","||d==";"){a.push({index:this.index,text:d});this.index++;c=true}else if(c&&d=="/"){this.Td();c=false}else if(this.ha(d)){this.Sd();c=false}else if(this.Aa(d)){this.dc(); -c=false}else if(this.sd(d))this.index++;else{c=d+this.U();var e=b[d],g=b[c];if(g){a.push({index:this.index,text:c,c:g});this.index+=2}else if(e){a.push({index:this.index,text:d,c:e});this.index+=1}else throw"Lexer Error: Unexpected next character ["+this.text.substring(this.index)+"] in expression '"+this.text+"' at column '"+(this.index+1)+"'.";c=true}}return a};Lexer.prototype.ha=function(a){return"0"<=a&&a<="9"};Lexer.prototype.sd=function(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"}; -Lexer.prototype.Aa=function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"};Lexer.prototype.Sd=function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.ha(c))a+=c;else break;this.index++}a=1*a;this.l.push({index:b,text:a,c:function(){return a}})};Lexer.prototype.dc=function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.Aa(c)||this.ha(c))a+=c;else break;this.index++}c= -Lexer.mb[a];if(!c){c=function(d){return d.scope.h(a)};c.za=a}this.l.push({index:b,text:a,c:c})};Lexer.uc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'};Lexer.prototype.Ud=function(a){var b=this.index,c=this.Wc;this.index++;for(var d="",e=false;this.index<this.text.length;){var g=this.text.charAt(this.index);if(e){if(g=="u"){g=this.text.substring(this.index+1,this.index+5);this.index+=4;d+=String.fromCharCode(parseInt(g,16))}else{e=Lexer.uc[g];d+=e?e:g}e=false}else if(g=="\\")e=true; -else if(g==a){this.index++;this.l.push({index:b,text:d,c:function(){return d.length==c?angular.O.be(d):d}});return}else d+=g;this.index++}throw"Lexer Error: Unterminated quote ["+this.text.substring(b)+"] starting at column '"+(b+1)+"' in expression '"+this.text+"'.";};Lexer.prototype.Td=function(){var a=this.index;this.index++;for(var b="",c=false;this.index<this.text.length;){var d=this.text.charAt(this.index);if(c){b+=d;c=false}else if(d==="\\"){b+=d;c=true}else if(d==="/"){this.index++;c="";if(this.Aa(this.text.charAt(this.index))){this.dc(); -c=this.l.pop().text}var e=new RegExp(b,c);this.l.push({index:a,text:b,hf:c,c:function(){return e}});return}else b+=d;this.index++}throw"Lexer Error: Unterminated RegExp ["+this.text.substring(a)+"] starting at column '"+(a+1)+"' in expression '"+this.text+"'.";};Parser=function(a,b){this.text=a;this.l=(new Lexer(a,b)).parse();this.index=0};Parser.zc=z(0);Parser.prototype.error=function(a,b){throw"Token '"+b.text+"' is "+a+" at column='"+(b.index+1)+"' of expression '"+this.text+"' starting at '"+ -this.text.substring(b.index)+"'.";};Parser.prototype.Fa=function(){if(this.l.length===0)throw"Unexpected end of expression: "+this.text;return this.l[0]};Parser.prototype.U=function(a,b,c,d){var e=this.l;if(e.length>0){e=e[0];var g=e.text;if(g==a||g==b||g==c||g==d||!a&&!b&&!c&&!d)return e}return false};Parser.prototype.a=function(a,b,c,d){if(a=this.U(a,b,c,d)){this.l.shift();return this.cf=a}return false};Parser.prototype.p=function(a){if(!this.a(a)){var b=this.U();throw"Expecting '"+a+"' at column '"+ -(b.index+1)+"' in '"+this.text+"' got '"+this.text.substring(b.index)+"'.";}};Parser.prototype.Ac=function(a,b){var c=b.apply(this);return function(d){return a(d,c(d))}};Parser.prototype.G=function(a,b,c){var d=c.apply(this);return function(e){return b(e,a(e),d(e))}};Parser.prototype.Hb=function(){return this.l.length>0};Parser.prototype.aa=function(){if(this.l.length!==0)throw"Did not understand '"+this.text.substring(this.l[0].index)+"' while evaluating '"+this.text+"'.";};Parser.prototype.db=function(){for(var a= -[];;){this.l.length>0&&!this.U("}",")",";","]")&&a.push(this.Cb());if(!this.a(";"))return function(b){for(var c,d=0;d<a.length;d++){var e=a[d];if(e)c=e(b)}return c}}};Parser.prototype.Cb=function(){for(var a=this.C(),b;;)if(b=this.a("|"))a=this.G(a,b.c,this.filter);else return a};Parser.prototype.filter=function(){return this.ob(angular.filter)};Parser.prototype.j=function(){return this.ob(angular.j)};Parser.prototype.ob=function(a){for(var b=this.kd(a),c=[];;)if(this.a(":"))c.push(this.C());else{var d= -function(e,g){g=[g];for(var i=0;i<c.length;i++)g.push(c[i](e));return b.apply(e,g)};return function(){return d}}};Parser.prototype.C=function(){return this.ae()};Parser.prototype.ae=function(){if(this.a("throw")){var a=this.qb();return function(b){throw a(b);}}else return this.qb()};Parser.prototype.qb=function(){var a=this.Ub(),b;if(b=this.a("=")){if(!a.za)throw"Left hand side '"+this.text.substring(0,b.index)+"' of assignment '"+this.text.substring(b.index)+"' is not assignable.";return this.G(function(){return a.za}, -b.c,this.Ub)}else return a};Parser.prototype.Ub=function(){for(var a=this.Tb(),b;;)if(b=this.a("||"))a=this.G(a,b.c,this.Tb);else return a};Parser.prototype.Tb=function(){for(var a=this.Wb(),b;;)if(b=this.a("&&"))a=this.G(a,b.c,this.Wb);else return a};Parser.prototype.Wb=function(){var a;return(a=this.a("!"))?this.Ac(a.c,this.Ab):this.Ab()};Parser.prototype.Ab=function(){for(var a=this.ec(),b;;)if(b=this.a("==","!="))a=this.G(a,b.c,this.ec);else return a};Parser.prototype.ec=function(){for(var a= -this.pb(),b;;)if(b=this.a("<",">","<=",">="))a=this.G(a,b.c,this.pb);else return a};Parser.prototype.pb=function(){for(var a=this.Ya(),b;b=this.a("+","-");)a=this.G(a,b.c,this.Ya);return a};Parser.prototype.Ya=function(){for(var a=this.kc(),b;b=this.a("*","/","%");)a=this.G(a,b.c,this.kc);return a};Parser.prototype.kc=function(){var a;return this.a("+")?this.Ga():(a=this.a("-"))?this.G(Parser.zc,a.c,this.Ya):this.Ga()};Parser.prototype.kd=function(a){var b=this.a(),c=b.text.split(".");a=a;for(var d, -e=0;e<c.length;e++){d=c[e];if(a)a=a[d]}if(typeof a!="function")throw"Function '"+b.text+"' at column '"+(b.index+1)+"' in '"+this.text+"' is not defined.";return a};Parser.prototype.Ga=function(){var a;if(this.a("(")){a=this.Cb();this.p(")");a=a}else if(this.a("["))a=this.Ic();else if(this.a("{"))a=this.object();else if(this.a("{:"))a=this.sb(false);else if(this.a("{("))a=this.sb(true);else{var b=this.a();(a=b.c)||this.error("not a primary expression",b)}for(;b=this.a("(","[",".");)if(b.text==="(")a= -this.jd(a);else if(b.text==="[")a=this.Md(a);else if(b.text===".")a=this.ed(a);else throw"IMPOSSIBLE";return a};Parser.prototype.sb=function(a){var b=[];if(a){if(!this.a(")")){for(b.push(this.a().text);this.a(",");)b.push(this.a().text);this.p(")")}this.p(":")}var c=this.db();this.p("}");return function(d){return function(e){var g=new Scope(d.scope.F);g.s("$",e);for(var i=0;i<b.length;i++)g.s(b[i],arguments[i]);return c({scope:g})}}};Parser.prototype.ed=function(a){var b=this.a().text;function c(d){return Scope.fa(a(d), -b)}c.za=b;return c};Parser.prototype.Md=function(a){var b=this.C();this.p("]");if(this.a("=")){var c=this.C();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}};Parser.prototype.jd=function(a){var b=[];if(this.Fa().text!=")"){do b.push(this.C());while(this.a(","))}this.p(")");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.za+"' is not a function."; -}};Parser.prototype.Ic=function(){var a=[];if(this.Fa().text!="]"){do a.push(this.C());while(this.a(","))}this.p("]");return function(b){for(var c=[],d=0;d<a.length;d++)c.push(a[d](b));return c}};Parser.prototype.object=function(){var a=[];if(this.Fa().text!="}"){do{var b=this.a().text;this.p(":");var c=this.C();a.push({ud:b,value:c})}while(this.a(","))}this.p("}");return function(d){for(var e={},g=0;g<a.length;g++){var i=a[g],l=i.value(d);e[i.ud]=l}return e}};Parser.prototype.cd=function(){for(var a= -[];this.Hb();){a.push(this.bd());this.a(";")||this.aa()}return function(b){for(var c="",d=0;d<a.length;d++)c+=a[d](b);return c}};Parser.prototype.bd=function(){var a=this.a().text,b,c;if(this.a("=")){b=a;a=this.a().text}if(this.a(":"))c=this.Ga()(null);return function(d){var e=d.scope.h("$datastore").da(a,c);d.scope.s(a,e);if(b){e=e();e.jb=b;d.scope.s(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+angular.O.quote(b)+";};"}else return""}};Parser.prototype.watch=function(){for(var a= -[];this.Hb();){a.push(this.le());this.a(";")||this.aa()}this.aa();return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.Dc(d.name,d.c)}}};Parser.prototype.le=function(){var a=this.a().text;this.p(":");var b;if(this.Fa().text=="{"){this.p("{");b=this.db();this.p("}")}else b=this.C();return function(){return{name:a,c:b}}};Scope=function(a,b){this.oc=[];this.hb={};this.name=b;a=a||{};function c(){}c.prototype=a;this.F=new c;this.F.ve=a;if(b=="ROOT")this.F.we=this.F};Scope.xa={};Scope.prototype.d= -function(){var a=this;this.fd();_.b(this.oc,function(b){a.u(b,"",{},function(){this.d(a)})})};Scope.prototype.Fc=function(a){a&&this.oc.push(a)};Scope.prototype.qd=function(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c!="."&&!Lexer.prototype.Aa(c))return false}return true};Scope.fa=function(a,b){if(!b)return a;for(var c=b.split("."),d,e=a,g=c.length,i=0;i<g;i++){d=c[i];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(_.H(a)&&d.charAt(0)=="$"){var l=angular.Y.de(e);if(d=(l=angular[l.charAt(0).toUpperCase()+l.substring(1)])?l[[d.substring(1)]]:undefined)return a=_.B(d,e,e)}}if(typeof a==="function"&&!a.qc)return bind(e,a);return a};Scope.prototype.h=function(a){return Scope.fa(this.F,a)};Scope.prototype.s=function(a,b){a=a.split(".");for(var c=this.F,d=0;a.length>1;d++){var e=a.shift(),g=c[e];if(!g){g={};c[e]=g}c=g}return c[a.shift()]=b};Scope.prototype.z=function(a,b){this.eval(a+"="+toJson(b))};Scope.prototype.eval= -function(a,b){var c=Scope.xa[a];if(!c){var d=new Parser(a);c=d.db();d.aa();Scope.xa[a]=c}b=b||{};b.scope=this;return c(b)};Scope.prototype.u=function(a,b,c,d,e){try{var g=this.eval(b,c);if(a.J){a.J=false;jQuery(a.view).gc("ng-exception").fc("ng-error")}d&&d.apply(a,[g]);return true}catch(i){console.error("Eval Widget Error:",i);b=toJson(i,true);a.J=true;jQuery(a.view).Oa("ng-exception").g("ng-error",b);e&&e.apply(a,[i,b]);return false}};Scope.prototype.je=function(a,b){var c=Scope.xa[a];if(!c){c= -(new Parser(a)).j();Scope.xa[a]=c}a={scope:this};return c(a)(a,b)};Scope.prototype.da=function(a){return(new Parser(a)).cd()({scope:this})};Scope.prototype.zd=function(a){this.F.ue.push(a)};Scope.prototype.watch=function(a){var b=this;(new Parser(a)).watch()({scope:this,Dc:function(c,d){b.Ec(c,function(e,g){try{return d({scope:b},e,g)}catch(i){alert(i)}})}})};Scope.prototype.Ec=function(a,b){var c=this.hb[a];if(!c){c={Pb:[],C:a};this.hb[a]=c}c.Pb.push(b)};Scope.prototype.fd=function(){var a=this, -b=false;jQuery.b(this.hb,function(c,d){var e=a.eval(d.C);if(e!==d.e){jQuery.b(d.Pb,function(g,i){i(e,d.e);b=true});d.e=e}});return b};Server=function(a,b){this.url=a;this.Bd=0;this.Fb=b;this.ie="_"+(""+Math.random()).substr(2)+"_";this.Xa=1800};Server.prototype.Kc=function(a){return w.wa(a)};Server.prototype.la=function(a,b,c,d){var e=this.ie+this.Bd++;nglr[e]=function(l){delete nglr[e];d(200,l)};a={Yf:b,yf:a,If:c};a=this.Kc(toJson(a));b=Math.ceil(a.length/this.Xa);c=this.url+"/$/"+e+"/"+b+"/";for(var g= -0;g<b;g++){var i=a.substr(g*this.Xa,this.Xa);this.Fb(c+(g+1)+"?h="+i,noop)}};FrameServer=y("frame");FrameServer.Be="$DATASET:";FrameServer.prototype={la:x()};VisualServer=function(a,b,c){this.Zc=a;this.update=c;this.status=b};VisualServer.prototype={la:function(a,b,c,d){var e=this;this.status.Lc(c);this.Zc.la(a,b,c,function(){e.status.ad();try{d.apply(this,arguments)}catch(g){alert(toJson(g))}e.update()})}};Users=function(a,b){this.M=a;this.Qa=b};Users.prototype={Bb:function(a){var b=this;this.M.la("GET", -"/account.json",{},function(c,d){b.Uc=d.he;a(d.he)})},Vb:function(a){var b=this;this.Qa.Vb(function(){delete b.Uc;(a||noop)()})},Ca:function(a){var b=this;this.Qa.Ca(function(){b.Bb(function(){(a||noop)()})})},Za:function(){this.Qa.Za()}};angular.j.ka=function(a,b,c){return a.match(b)?null:c||"Value does not match expected format "+b+"."};angular.j.$a=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!="undefined"&&d>c)return"Value can not be greater than "+ -c+".";return null}else return"Value is not a number."};angular.j.pf=function(a,b,c){b=angular.j.$a(a,b,c);if(b===null&&a!=Math.round(a))return"Value is not a whole number.";return b};angular.j.Vc=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)."};angular.j.Uf=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."};angular.j.$c=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."};angular.j.Jf=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."};angular.j.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."}; -angular.j.td=function(a){try{fromJson(a);return null}catch(b){return b.toString()}};WidgetFactory=function(a,b){this.Cd=0;this.Ia=a;this.T=b;this.ub=swfobject.ub;this.Nd=x()};WidgetFactory.prototype.Sc=function(a,b){var c,d=a.g("type").toLowerCase(),e=a.g("name");if(e)e=e.split(":").pop();var g="change",i=true;if(d=="button"||d=="submit"||d=="reset"||d=="image"){c=new ButtonController(a[0],e);g="click";i=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new TextController(a[0], -e);g="keyup change"}else if(d=="checkbox"){c=new CheckboxController(a[0],e);g="click"}else if(d=="radio"){c=new RadioController(a[0],e);g="click"}else if(d=="select-one")c=new SelectController(a[0],e);else if(d=="select-multiple")c=new MultiSelectController(a[0],e);else if(d=="file")c=this.Tc(a,e);else throw"Unknown type: "+d;a.data("controller",c);var l=b.h("$binder");jQuery(c.view,":input").B(g,function(){if(c.i(b)){var n=jQuery(c.view).g("ng-action")||"";b.u(c,n)&&l.d(b)}return i});return c};WidgetFactory.prototype.Tc= -function(a){var b="__uploadWidget_"+this.Cd++,c=FileController.V(b);a.Gc(c);b=this.ub({data:this.Ia+"/admin/ServerAPI.swf",width:"95",height:"20",align:"top",eg:"transparent"},{jf:"uploadWidgetId="+b,De:"always"},b);a.remove();a=new FileController(c,a[0].name,b,this.Ia+"/data/"+this.T);jQuery(b).data("controller",a);return a};FileController=function(a,b,c,d){this.view=a;this.bg=c;this.hc=b;this.Ge=d+"/_attachments";this.value=null;this.e=undefined};FileController.dispatchEvent=function(a,b,c){a=v.getElementById(a); -a=jQuery(a).data("controller");FileController.prototype["_on_"+b].apply(a,c)};FileController.V=function(a){return jQuery('<span class="ng-upload-widget"><input type="checkbox" ng-non-bindable="true"/><object id="'+a+'" /><a></a><span/></span>')};FileController.prototype.i=function(a){var b=this.view.find("input").g("checked")?this.value:null;if(this.e===b)return false;else{a.s(this.hc,b);return true}};FileController.prototype.d=function(a){if((a=a.h(this.hc))&&this.value!==a){this.value=a;this.view.find("a").g("href", -this.value.url).text(this.value.text);this.view.find("span").text(angular.filter.Pa(this.value.size))}this.view.find("input").g("checked",!!a)};NullController=y("view");NullController.prototype.i=z(true);NullController.prototype.d=x();NullController.nd=new NullController;ButtonController=y("view");ButtonController.prototype.i=z(true);ButtonController.prototype.d=x();TextController=function(a,b){this.view=a;this.exp=b;this.j=a.getAttribute("ng-validate");this.Vd=typeof a.attributes["ng-required"]!= -"undefined";this.Nb=null;this.e=undefined;this.D=a.value;a.getAttribute("ng-widget")==="datepicker"&&jQuery(a).df()};TextController.prototype.i=function(a){var b=this.view.value;if(this.e===b)return false;else{a.z(this.exp,b);this.e=b;return true}};TextController.prototype.d=function(a){var b=this.view,c=a.h(this.exp);if(typeof c==="undefined"){c=this.D;a.z(this.exp,c)}c=c?c:"";if(this.e!=c)this.e=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.Vd)d=!(c&&c.length>0);var e=d?"Required Value": -null;if(!d&&this.j&&c){e=a.je(this.j,c);d=!!e}if(this.Nb!==e){this.Nb=d;if(e!==null){b.setAttribute("ng-error",e);a.zd(this)}jQuery(b).eb("ng-validation-error",d)}};CheckboxController=function(a,b){this.view=a;this.exp=b;this.e=undefined;this.D=a.checked?a.value:""};CheckboxController.prototype.i=function(a){var b=this.view;b=b.checked?b.value:"";if(this.e===b)return false;else{a.z(this.exp,b);this.e=b;return true}};CheckboxController.prototype.d=function(a){var b=this.view,c=a.eval(this.exp);if(typeof c=== -"undefined"){c=this.D;a.z(this.exp,c)}b.checked=b.value==""+c};SelectController=function(a,b){this.view=a;this.exp=b;this.e=undefined;this.D=a.value};SelectController.prototype.i=function(a){if(this.view.selectedIndex<0)a.z(this.exp,null);else{var b=this.view.value;if(this.e===b)return false;else{a.z(this.exp,b);this.e=b;return true}}};SelectController.prototype.d=function(a){var b=this.view,c=a.h(this.exp);if(typeof c==="undefined"){c=this.D;a.z(this.exp,c)}if(c!==this.e){b.value=c?c:"";this.e=c}}; -MultiSelectController=function(a,b){this.view=a;this.exp=b;this.e=undefined;this.D=this.selected()};MultiSelectController.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};MultiSelectController.prototype.i=function(a){var b=this.selected();if(this.e===b)return false;else{a.z(this.exp,b);this.e=b;return true}};MultiSelectController.prototype.d=function(a){var b=this.view,c=a.h(this.exp);if(typeof c==="undefined"){c=this.D; -a.z(this.exp,c)}if(c!==this.e){a=b.options;for(b=0;b<a.length;b++){var d=a[b];d.selected=_.ya(c,d.value)}this.e=c}};RadioController=function(a,b){this.view=a;this.exp=b;this.e=this.Va=undefined;this.Kb=a.value;this.D=a.checked?a.value:null};RadioController.prototype.i=function(a){var b=this.view;if(this.Va)return false;else{b.checked=true;this.e=a.z(this.exp,this.Kb);return this.Va=true}};RadioController.prototype.d=function(a){var b=this.view,c=a.h(this.exp);if(this.D&&typeof c==="undefined"){c= -this.D;a.z(this.exp,c)}if(this.e!=c){this.Va=b.checked=this.Kb==""+c;this.e=c}};BindUpdater=function(a,b){this.view=a;this.exp=Binder.Ea(b);this.J=false;this.Xd={element:a}};BindUpdater.ic=function(a){var b=escapeHtml;switch(typeof a){case "string":case "boolean":case "number":return b(a);case "function":return BindUpdater.ic(a());case "object":if(isNode(a))return outerHTML(a);else if(a instanceof angular.filter.m){switch(typeof a.w){case "string":case "number":return a.w;case "function":return a.w(); -case "object":if(isNode(a.w))return outerHTML(a.w);default:break}switch(typeof a.text){case "string":case "number":return b(a.text);case "function":return b(a.text());default:break}}if(a===null)return"";return b(toJson(a,true));default:return""}};BindUpdater.prototype.i=x();BindUpdater.prototype.d=function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var g=c[e],i=Binder.ba(g);if(i){a.u(this,i,this.Xd,function(l){b.push(BindUpdater.ic(l))},function(l,n){setHtml(this.view,n)});if(this.J)return}else b.push(escapeHtml(g))}setHtml(this.view, -b.join(""))};BindAttrUpdater=function(a,b){this.view=a;this.Jc=b};BindAttrUpdater.prototype.i=x();BindAttrUpdater.prototype.d=function(a){var b=jQuery(this.view),c=this.Jc;if(this.J){this.J=false;b.gc("ng-exception").fc("ng-error")}var d=b.od("img");for(var e in c){for(var g=Binder.Ea(c[e]),i=[],l=0;l<g.length;l++){var n=Binder.ba(g[l]);if(n)try{var o=a.eval(n,{element:b[0],attrName:e});if(o&&(o.constructor!==array||o.length!==0))i.push(o)}catch(p){this.J=true;console.error("BindAttrUpdater",p);n= -toJson(p,true);i.push("["+n+"]");b.Oa("ng-exception").g("ng-error",n)}else i.push(g[l])}g=i.length?i.join(""):null;if(d&&e=="src"&&!g)g=a.h("config.server")+"/images/blank.gif";b.g(e,g)}};EvalUpdater=function(a,b){this.view=a;this.exp=b;this.J=false};EvalUpdater.prototype.i=x();EvalUpdater.prototype.d=function(a){a.u(this,this.exp)};HideUpdater=function(a,b){this.view=a;this.exp=b};HideUpdater.prototype.i=x();HideUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){var c=jQuery(this.view); -toBoolean(b)?c.Jb():c.cb()})};ShowUpdater=function(a,b){this.view=a;this.exp=b};ShowUpdater.prototype.i=x();ShowUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){var c=jQuery(this.view);toBoolean(b)?c.cb():c.Jb()})};ClassUpdater=function(a,b){this.view=a;this.exp=b};ClassUpdater.prototype.i=x();ClassUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){if(b!==null&&b!==undefined)this.view.className=b})};ClassEvenUpdater=function(a,b){this.view=a;this.exp=b};ClassEvenUpdater.prototype.i= -x();ClassEvenUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){var c=a.h("$index");jQuery(this.view).eb(b,c%2===1)})};ClassOddUpdater=function(a,b){this.view=a;this.exp=b};ClassOddUpdater.prototype.i=x();ClassOddUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){var c=a.h("$index");jQuery(this.view).eb(b,c%2===0)})};StyleUpdater=function(a,b){this.view=a;this.exp=b};StyleUpdater.prototype.i=x();StyleUpdater.prototype.d=function(a){a.u(this,this.exp,{},function(b){jQuery(this.view).g("style", -"").Sa(b)})};RepeaterUpdater=function(a,b,c,d){this.view=a;this.V=c;this.prefix=d;this.ta=[];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.Ba=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.ke=a[3]||a[1];this.vd=a[2]};RepeaterUpdater.prototype.i=x();RepeaterUpdater.prototype.d=function(a){a.u(this,this.Ba, -{},function(b){var c=this;if(!b){b=[];a.qd(this.Ba)&&a.s(this.Ba,b)}var d=b.length,e=this.ta.length,g=this.view,i=0,l=null,n=this.vd,o=this.ke,p=0;jQuery.b(b,function(r,f){if(p<e){l=c.ta[p];l.scope.s(o,f)}else{var h=new Scope(a.F,c.prefix+o+" in "+c.Ba+"["+p+"]");h.s("$index",p);n&&h.s(n,r);h.s(o,f);l={scope:h,element:c.V(h,c.prefix,p)};g.Gc(l.element);c.ta.push(l)}g=l.element;r=(new Date).getTime();l.scope.d();i+=(new Date).getTime()-r;p++});for(b=e;b>d;--b)this.ta.pop().element.removeNode();if(l&& -l.element[0].nodeName==="OPTION")if(d=jQuery(l.element[0].parentNode).data("controller")){d.e=undefined;d.d(a)}})};PopUp=y("Q");PopUp.nb="mouseleave mouseout click dblclick keypress keyup";PopUp.prototype.B=function(){this.Q.find(".ng-validation-error,.ng-exception").xd("mouseover",PopUp.Od)};PopUp.Od=function(){PopUp.ab();var a=jQuery(this);a.B(PopUp.nb,PopUp.ab);var b=a.position(),c=v.documentElement,d=(self.innerWidth||c&&c.clientWidth||v.body.clientWidth)-b.left;c=a.mf("ng-exception")?"EXCEPTION:": -"Validation error...";a=a.g("ng-error");d=d>375?"left":"right";c=jQuery("<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>");jQuery("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").Sa({left:301})}c.Sa({left:a+"px",top:b.top-3+"px"});return true};PopUp.ab=function(){jQuery("#ng-callout").Zf(PopUp.nb,PopUp.ab).remove();return true};Status=function(a){this.Sb= -a.append(Status.sc).find("#ng-loading");this.Ha=0};Status.sc='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';Status.prototype.Lc=function(){this.Ha===0&&this.Sb.cb();this.Ha++};Status.prototype.ad=function(){this.Ha--;this.Ha===0&&this.Sb.Jb("fold")}})(window,document); +function m(){return function(){}}function u(n){return function(q){this[n]=q}}function w(n){return function(){return n}} +(function(n,q){var z={z:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",$:function(a){var b="",c,d,e,f,g,h,i=0;for(a=z.Gb(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.z.charAt(f)+this.z.charAt(c)+this.z.charAt(g)+this.z.charAt(h)}return b},Gd: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.z.indexOf(a.charAt(h++)); +d=this.z.indexOf(a.charAt(h++));f=this.z.indexOf(a.charAt(h++));g=this.z.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=z.Fb(b)},Gb: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},Fb: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 q.getAttribute=="undefined")q.getAttribute=m();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};var x={},j=n.jQuery,A=j.browser.msie;if(!n.ld){angular={};n.angular=angular}if(!angular.h)angular.h={};if(!angular.filter)angular.filter={};if(!n.console)n.console={log:m(),error:m()};if(!angular.alert)angular.alert=function(){console.log(arguments);n.alert.apply(n,arguments)};var y;consoleLog=function(a,b){var c= +q.createElement("div");c.className=a;for(var d=a="",e=0;e<b.length;e++){var f=b[e];a+=d+(typeof f=="string"?f:toJson(f));d=" "}c.appendChild(q.createTextNode(a));y.appendChild(c)};isNode=function(a){return a&&a.tagName&&a.nodeName&&a.ownerDocument&&a.removeAttribute};isLeafNode=function(a){switch(a.nodeName){case "OPTION":case "PRE":case "TITLE":return true;default:return false}};noop=m();setHtml=function(a,b){if(isLeafNode(a))if(A)a.innerText=b;else a.textContent=b;else a.innerHTML=b};escapeHtml= +function(a){if(!a||!a.replace)return a;return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")};escapeAttr=function(a){if(!a||!a.replace)return a;return a.replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""")};bind=function(a,b){if(!a)throw"Missing this";if(!_.isFunction(b))throw"Missing function";return function(){return b.apply(a,arguments)}};shiftBind=function(a,b){return function(){for(var c=[this],d=0;d<arguments.length;d++)c.push(arguments[d]);return b.apply(a,c)}}; +outerHTML=function(a){var b=q.createElement("div");b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c};trim=function(a){return a.replace(/^ */,"").replace(/ *$/,"")};toBoolean=function(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a};merge=function(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=fromJson(toJson(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&merge(a[c],d)}};Loader=function(a,b,c){this.document= +j(a);this.head=j(b);this.k=c;this.location=n.location};Loader.prototype.load=function(){this.Tb();this.ab("/stylesheets/jquery-ui/smoothness/jquery-ui-1.7.1.css");this.ab("/stylesheets/css");console.log("Server: "+this.k.B);this.Sb();this.Rb();this.Ob()};Loader.prototype.Sb=function(){console.log("Loader.configureJQueryPlugins()");j.fn.scope=function(){for(var a=this;a&&a.get(0);){var b=a.data("scope");if(b)return b;a=a.parent()}return null};j.fn.controller=function(){return this.data("controller")|| +NullController.lc}};Loader.prototype.Uc=function(){return""+(new Date).getTime()};Loader.prototype.Rb=function(){var a=this.k;if(!a.I){var b=a.B.match(/https?:\/\/([\w]*)/);a.I=b?b[1]:"$MEMORY"}};Loader.prototype.Ob=function(){function a(){g.Ra(function(l){!l&&c.find("[ng-auth=eager]").length&&g.ea()})}console.log("Loader.bindHtml()");var b=new UrlWatcher(this.location),c=this.document,d=new WidgetFactory(this.k.B,this.k.I),e=new Binder(c[0],d,b,this.k);d.Gc=shiftBind(e,e.e);d=new ControlBar(c.find("body"), +this.k.B);var f=this.k.I=="$MEMORY"?new FrameServer(this.window):new Server(this.k.B,j.getScript);f=new VisualServer(f,new Status(j(c.body)),function(){e.c()});var g=new Users(f,d),h="/data/"+this.k.I,i=new DataStore(function(l,o){f.T("POST",h,l,o)},g,e.anchor);e.rb.push(function(){i.Ta()});var k=new Scope({$anchor:e.anchor,$binder:e,$config:this.k,$console:n.console,$datastore:i,$save:function(l){i.Oc(k.u,l,e.anchor)},$window:n,$uid:this.Uc,$users:g},"ROOT");c.data("scope",k);console.log("$binder.entity()"); +e.O(k);console.log("$binder.compile()");e.compile();console.log("ControlBar.bind()");d.bind();console.log("$users.fetchCurrentUser()");a();console.log("PopUp.bind()");(new PopUp(c)).bind();console.log("$binder.parseAnchor()");e.ib();console.log("$binder.executeInit()");e.fc();console.log("$binder.updateView()");e.c();b.Za=bind(e,e.Ic,b);b.Pd=function(){alert("update")};b.watch();c.find("body").show();console.log("ready()")};Loader.prototype.Tb=function(){var a=n.location.href+"#";a=a.split("#")[1]; +var b={Zb:null};a=a.split("&");for(var c=0;c<a.length;c++){var d=(a[c]+"=").split("=");b[d[0]]=d[1]}if(b.Zb=="console"){y=q.createElement("div");y.id="ng-console";q.getElementsByTagName("body")[0].appendChild(y);console.log=function(){consoleLog("ng-console-info",arguments)};console.error=function(){consoleLog("ng-console-error",arguments)}}};Loader.prototype.ab=function(a){var b=q.createElement("link");b.rel="stylesheet";b.type="text/css";a.match(/^http:/)||(a=this.k.B+a);b.href=a;this.head[0].appendChild(b)}; +UrlWatcher=function(a){this.location=a;this.delay=25;this.setTimeout=function(b,c){n.setTimeout(b,c)};this.Za=function(b){return b};this.P=a.href};UrlWatcher.prototype.watch=function(){var a=this;function b(){if(a.P!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.P.match(/#/)||(a.P+="#");a.location.href=a.P;c="_iframe_notify_"+c[1];var d=x[c];delete x[c];try{(d||noop)()}catch(e){alert(e)}}else{a.Za(a.location.href);a.P=a.location.href}}a.setTimeout(b,a.delay)}b()}; +UrlWatcher.prototype.Rc=function(a){var b=n.location.href;b.match(/#/)||(b+="#");if(b!=a)n.location.href=a;this.Hd=a};UrlWatcher.prototype.Va=function(){return n.location.href};angular.compile=function(a,b){b=b||{};(new Loader(a,j("head"),_({B:""}).extend(b))).load();var c=j(a).scope();return{updateView:function(){return c.c.apply(c,arguments)},set:function(){return c.l.apply(c,arguments)},get:function(){return c.get.apply(c,arguments)}}};angular.Global={typeOf:function(a){var b=typeof a;switch(b){case "object":if(a=== +null)return"null";if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}};angular.Collection={};angular.Object={};angular.Array={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=angular.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= +angular.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return angular.gd.find(a,function(c){return c.C==b},null)},filter:function(a,b){var c=[];c.Pb=function(k){for(var l=0;l<c.length;l++)if(!c[l](k))return false;return true};var d=Scope.Q;function e(k,l){if(l.charAt(0)==="!")return!e(k,l.substr(1));switch(typeof k){case "boolean":case "number":case "string":return(""+k).toLowerCase().indexOf(l)>-1;case "object":for(var o in k)if(o.charAt(0)!== +"$"&&e(k[o],l))return true;return false;case "array":for(o=0;o<k.length;o++)if(e(k[o],l))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={cd:b};case "object":for(var f in b)f=="$"?function(){var k=(""+b[f]).toLowerCase();k&&c.push(function(l){return e(l,k)})}():function(){var k=f,l=(""+b[f]).toLowerCase();l&&c.push(function(o){return e(d(o,k),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.Pb(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=angular.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 toBoolean(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?angular.Function.compile(f):_.identity;return d(function(i,k){return e(h(i),h(k))},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}merge(c,d);return a}};angular.String={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=angular.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}};angular.Date= +{toString:function(a){function b(c){return c<10?"0"+c:c}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())+"Z"}};angular.Function={compile:function(a){if(_.isFunction(a))return a;else if(a){var b=new Scope;return function(c){b.u=c;return b.eval(a)}}else return function(c){return c}}};(function(){function a(b,c,d){_.extend(b,c);_.each(d||[],function(e){b[e]=_[e]})}a(angular.Global,{},["extend","clone","isEqual", +"isElement","isArray","isFunction","isUndefined"]);a(angular.Collection,angular.Global,["each","map","reduce","reduceRight","detect","select","reject","all","any","include","invoke","pluck","max","min","sortBy","sortedIndex","toArray","size"]);a(angular.Array,angular.Collection,["first","last","compact","flatten","without","uniq","intersect","zip","indexOf","lastIndexOf"]);a(angular.Object,angular.Collection,["keys","values"]);a(angular.String,angular.Global);a(angular.Function,angular.Global,["bind", +"bindAll","delay","defer","wrap","compose"])})();Binder=function(a,b,c,d){this.F=a;this.ya=c;this.anchor={};this.ad=b;this.k=d||{};this.rb=[]};Binder.ga=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};Binder.kc=function(a){a=Binder.ga(a);return a.length>1||Binder.N(a[0])!==null};Binder.N=function(a){return(a=a.replace(/\n/gm, +" ").match(/^\{\{(.*)\}\}$/))?a[1]:null};Binder.prototype.Jc=function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b};Binder.prototype.ib=function(a){var b=this;a=a||this.ya.Va();var c=a.indexOf("#");if(!(c<0)){a=this.Jc(a.substring(c+1));j.each(b.anchor,function(d){delete b.anchor[d]});j.each(a,function(d,e){b.anchor[d]=e})}};Binder.prototype.Ic=function(a){console.log("URL change detected",a);this.ib(a);this.c()}; +Binder.prototype.Vc=function(){var a=this.ya.Va(),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.ya.Rc(a);return a};Binder.prototype.c=function(){(new Date).getTime();var a=j(this.F).scope();a.l("$invalidWidgets",[]);a.c();(new Date).getTime();this.Vc();_.each(this.rb,function(b){b()})};Binder.prototype.Z= +function(a){var b=j(this.F),c=b.find(a);if(b.is(a))c=c.andSelf();return c};Binder.prototype.fc=function(){this.Z("[ng-init]").each(function(){var a=j(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+toJson(c,true))}})};Binder.prototype.O=function(a){this.Z("[ng-entity]").attr("ng-watch",function(){try{var b=j(this);return a.O(b.attr("ng-entity"))+(b.attr("ng-watch")||"")}catch(c){alert(c)}})};Binder.prototype.compile=function(){var a=j(this.F), +b=this;if(this.k.nd){var c=this.Z(":submit").not("[ng-action]");c.attr("ng-action","$save()");c.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.jb(this.F)(this.F,a.scope(),"");this.Z("a[ng-action]").live("click",function(){var d=j(this);try{d.scope().eval(d.attr("ng-action"));d.removeAttr("ng-error");d.removeClass("ng-exception")}catch(e){d.addClass("ng-exception");d.attr("ng-error",toJson(e,true))}b.c();return false})};Binder.prototype.Tc=function(a, +b,c){b=b.concat();var d=b.pop(),e=Binder.ga(a.nodeValue);if(e.length>1||Binder.N(e[0])){var f=a.parentNode;if(isLeafNode(f)){f.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,b:function(l){return new BindUpdater(l,l.getAttribute("ng-bind-template"))}})}else for(var g=0;g<e.length;g++){var h=e[g],i=Binder.N(h),k;if(i){k=q.createElement("span");j(k).attr("ng-bind",i);g===0&&c.push({path:b.concat(d+g),b:Binder.prototype.hb})}else if(A&&h.charAt(0)==" "){k=q.createElement("span");k.innerHTML= +" "+h.substring(1)}else k=q.createTextNode(h);f.insertBefore(k,a)}f.removeChild(a)}};Binder.prototype.jb=function(a){var b=[];this.kb(a,[],b);return function(c,d,e){for(var f=b.length,g=0;g<f;g++){for(var h=b[g],i=c,k=h.path,l=0;l<k.length;l++)i=i.childNodes[k[l]];try{d.Jb(h.b(i,d,e))}catch(o){alert(o)}}}};Binder.prototype.kb=function(a,b,c){var d=a.nodeType;if(d==Node.TEXT_NODE)this.Tc(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?fromJson(e):{};for(var f=d.length,g=0;g<f;g++){var h=d[g],i=h.name;h=A&&i=="href"?decodeURI(a.getAttribute(i,2)):h.value;if(Binder.kc(h))e[i]=h}d=toJson(e);d.length>2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||console.log(a);var k=a.getAttribute("ng-repeat");if(k){a.removeAttribute("ng-repeat");var l=this.jb(a);d=q.createComment("ng-repeat: "+k);e=a.parentNode;e.insertBefore(d,a); +e.removeChild(a);var o=function(p,r,s){var v=j(a).clone();v.css("display","");v.attr("ng-repeat-index",""+s);v.data("scope",p);l(v[0],p,r+s+":");return v};c.push({path:b,b:function(p,r,s){return new RepeaterUpdater(j(p),k,o,s)}})}else{a.getAttribute("ng-eval")&&c.push({path:b,b:this.Ac});a.getAttribute("ng-bind")&&c.push({path:b,b:this.hb});a.getAttribute("ng-bind-attr")&&c.push({path:b,b:this.wc});a.getAttribute("ng-hide")&&c.push({path:b,b:this.Bc});a.getAttribute("ng-show")&&c.push({path:b,b:this.Cc}); +a.getAttribute("ng-class")&&c.push({path:b,b:this.xc});a.getAttribute("ng-class-odd")&&c.push({path:b,b:this.zc});a.getAttribute("ng-class-even")&&c.push({path:b,b:this.yc});a.getAttribute("ng-style")&&c.push({path:b,b:this.Dc});a.getAttribute("ng-watch")&&c.push({path:b,b:this.Ec});d=a.nodeName;if(d=="INPUT"||d=="TEXTAREA"||d=="SELECT"||d=="BUTTON"){var t=this;c.push({path:b,b:function(p,r,s){p.name=s+p.name.split(":").pop();return t.ad.Ub(j(p),r)}})}if(d=="OPTION")if(!j("<select/>").append(j(a).clone()).html().match(/<option(\s.*\s|\s)value\s*=\s*.*>.*<\/\s*option\s*>/gi))a.value= +a.text;d=a.childNodes;for(e=0;e<d.length;e++)this.kb(d[e],b.concat(e),c)}}}};Binder.prototype.Ac=function(a){return new EvalUpdater(a,a.getAttribute("ng-eval"))};Binder.prototype.hb=function(a){return new BindUpdater(a,"{{"+a.getAttribute("ng-bind")+"}}")};Binder.prototype.wc=function(a){return new BindAttrUpdater(a,fromJson(a.getAttribute("ng-bind-attr")))};Binder.prototype.Bc=function(a){return new HideUpdater(a,a.getAttribute("ng-hide"))};Binder.prototype.Cc=function(a){return new ShowUpdater(a, +a.getAttribute("ng-show"))};Binder.prototype.xc=function(a){return new ClassUpdater(a,a.getAttribute("ng-class"))};Binder.prototype.yc=function(a){return new ClassEvenUpdater(a,a.getAttribute("ng-class-even"))};Binder.prototype.zc=function(a){return new ClassOddUpdater(a,a.getAttribute("ng-class-odd"))};Binder.prototype.Dc=function(a){return new StyleUpdater(a,a.getAttribute("ng-style"))};Binder.prototype.Ec=function(a,b){b.watch(a.getAttribute("ng-watch"))};ControlBar=function(a,b){this.document= +a;this.ka=b;this.window=n;this.H=[]};ControlBar.prototype.bind=m();ControlBar.hd='<div><div class="ui-widget-overlay"></div><div id="ng-login" ng-non-bindable="true"><div class="ng-login-container"></div></div></div>';ControlBar.prototype.ea=function(a){this.H.push(a);this.H.length==1&&this.Pa("/user_session/new.mini?return_url="+encodeURIComponent(this.sb()))};ControlBar.prototype.fb=function(a){this.H.push(a);this.H.length==1&&this.Pa("/user_session/do_destroy.mini")};ControlBar.prototype.sb=function(){return this.window.location.href.split("#")[0]}; +ControlBar.prototype.Pa=function(a){var b=this,c=(new Date).getTime(),d=this.sb();d+="#$iframe_notify="+c;var e=j('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+d+'" src="'+this.ka+a+'" width="500" height="330"/></div>');this.document.append(e);e.Oa({height:363,width:500,Xd:false,tc:true,title:'Authentication: <a href="http://www.getangular.com"><tt><angular/></tt></a>'});x["_iframe_notify_"+c]=function(){e.Oa("destroy");e.remove();j.each(b.H,function(f,g){g()});b.H=[]}}; +ControlBar.Ab='<div ng-non-bindable="true" title="Permission Error:">Sorry, you do not have permission for this!</div>';ControlBar.prototype.ua=function(){if(!this.Ua){this.Ua=j(ControlBar.Ab);this.Ua.Oa({sd:true,height:70,tc:true})}};DataStore=function(a,b,c){this.post=a;this.tb=b;this.D={V:[]};this.anchor=c;this.X=[]};DataStore.prototype.Y=function(a){if(a.constructor!=Model)throw"Parameter must be an instance of Entity! "+toJson(a);var b=a.W+"/"+a.C,c=this.D[b];if(c)Model.oa(a,c);else c=this.D[b]= +a;return c};DataStore.prototype.load=function(a,b,c,d){if(b&&b!=="*"){var e=this;this.G(["GET",a.W+"/"+b],function(f){a.K(f);a.Ca();f=a.U(a);e.Y(f);(c||noop)(a)},d)}return a};DataStore.prototype.ra=function(a,b,c){var d=this,e=[],f=0;j.each(b,function(g,h){e.push(d.load(a(),h,function(){f++;if(f==b.length)(c||noop)(e)}))});return e};DataStore.prototype.bb=function(a,b,c){return this.load(a,b,c,function(d){if(d.ma==404){a.C=b;(c||noop)(a)}else throw d;})};DataStore.prototype.rc=function(a,b){var c= +this,d=[];d.Aa=function(e){return e.W==a.title};this.D.V.push(d);this.G(["GET",a.title],function(e){for(var f=0;f<e.length;f++){var g=a();g.K(e[f]);d.push(c.Y(g))}(b||noop)(d)});return d};DataStore.prototype.save=function(a,b){var c=this,d={};a.Da(d);this.G(["POST","",d],function(e){a.K(e);var f=c.Y(a);_.each(c.D.V,function(g){g.Aa(a)&&angular.Array.includeIf(g,f,true)});if(a.Ba)c.anchor[a.Ba]=a.C;b&&b(a)})};DataStore.prototype.remove=function(a,b){var c=this,d={};a.Da(d);this.G(["DELETE","",d],function(e){delete c.D[a.W+ +"/"+a.C];_.each(c.D.V,function(f){for(var g=0;g<f.length;g++)f[g].C==a.C&&f.splice(g,1)});(b||noop)(e)})};DataStore.prototype.G=function(a,b,c){a.vb=b;a.xb=c||function(d){throw d;};this.X.push(a)};DataStore.prototype.Ta=function(){function a(d,e){console.log("RESPONSE["+d+"]: ",e);if(e.ma==401)b.tb.ea(function(){b.post(c,a)});else if(e.ma)alert(toJson(e));else for(var f=0;f<e.length;f++){var g=e[f],h=c[f];if(d=g.ma)d==403?b.tb.ua():h.xb(g);else h.vb(g)}}if(this.X.length!==0){var b=this,c=this.X;this.X= +[];console.log("REQUEST:",c);this.post(c,a)}};DataStore.prototype.Oc=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.la==Model.prototype.la){d++;f.la(c)}}c()};DataStore.prototype.R=function(a,b,c,d){var e=this,f=[];f.Aa=w(false);this.D.V.push(f);this.G(["GET",a.title+"/"+b+"="+c],function(g){for(var h=0;h<g.length;h++){var i=(new a).K(g[h]);f.push(e.Y(i))}d&&d(f)});return f};DataStore.L=m();DataStore.L.all=function(){return[]};DataStore.L.R=function(){return[]}; +DataStore.L.load=function(){return{}};DataStore.L.title=undefined;DataStore.prototype.O=function(a,b){if(!a)return DataStore.L;var c=this;function d(e){return new Model(d,e)}d.title=a;d.wb=true;d.Na=this;d.$b=b||{};d.load=function(e,f){return c.load(d(),e,f)};d.ra=function(e,f){return c.ra(d,e,f)};d.bb=function(e,f){return c.bb(d(),e,f)};d.all=function(e){return c.rc(d,e)};d.R=function(e,f,g){return c.R(d,e,f,g)};d.Vd=function(e){c.G(["GET",a+"/$properties"],e)};return d};DataStore.prototype.join= +function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).td().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].fa?a[d].fa.substring(0,a[d].fa.indexOf(".")):undefined}while(d);return e.length}).value();if(_(c).select(function(d){return a[d].fa}).length!=c.length-1)throw"Exactly one entity needs to be primary."; +b.R=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.R(d.substring(d.indexOf(".")+1),e,function(i){var k=c[h++],l=a[k],o=l.fa,t={};_(i).each(function(p){var r={};f.push(r);r[g]=p;p=Scope.Q(r,o);t[p]=p});l.join.ra(_.toArray(t),function(p){var r={};_(p).each(function(s){r[s.C]=s});_(f).each(function(s){var v=Scope.Q(s,o);s[k]=r[v]})})});return f};return b};angular.filter.j= +function(a){if(a)for(var b in a)this[b]=a[b]};angular.filter.j.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}};angular.filter.currency=function(a){j(this.element).toggleClass("ng-format-negative",a<0);return"$"+angular.filter.va.apply(this,[a,2])};angular.filter.va=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};angular.filter.Xb=m();angular.filter.oc=function(a){j(this.element).addClass("ng-monospace");return toJson(a,true)};angular.filter.pb=function(a,b){a=trim(a);for(var c=a.replace(/ /g,""),d=angular.filter.pb.Bb,e=0;e<d.length;e++)for(var f=d[e],g=0;g<f.S.length;g++)if(f.S[g].test(c)){b= +f.name+": "+a;f=f.url+a;return new angular.filter.j({text:b,url:f,html:'<a href="'+escapeAttr(f)+'">'+b+"</a>",be:a})}return a?b||new angular.filter.j({text:a+" is not recognized"}):null};angular.filter.pb.Bb=[{name:"UPS",url:"http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&track.x=0&track.y=0&InquiryNumber1=",S:[/^1Z[0-9A-Z]{16}$/i]},{name:"FedEx",url:"http://www.fedex.com/Tracking?tracknumbers=",S:[/^96\d{10}?$/i,/^96\d{17}?$/i, +/^96\d{20}?$/i,/^\d{15}$/i,/^\d{12}$/i]},{name:"USPS",url:"http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=",S:[/^(91\d{20})$/i,/^(91\d{18})$/i]}];angular.filter.link=function(a,b){b=b||angular.filter.j.get(a);var c=angular.filter.j.get(a,"url")||angular.filter.j.get(a);if(c){if(angular.h.bc(c)===null)c="mailto:"+c;a='<a href="'+escapeHtml(c)+'">'+b+"</a>";return new angular.filter.j({text:b,url:c,html:a})}return a};angular.filter.Ja=function(a){if(a===null)return""; +for(var b=0;a>1E3;){a/=1024;b++}a=""+a;var c=a.indexOf(".");if(c>-1&&c+2<a.length)a=a.substring(0,c+2);return a+" "+angular.filter.Ja.Cb[b]};angular.filter.Ja.Cb=["bytes","KB","MB","GB","TB","PB"];angular.filter.image=function(a,b,c){if(a&&a.url){var d="";if(b)d=' style="max-width: '+b+"px; max-height: "+(c||b)+'px;"';return new angular.filter.j({url:a.url,text:a.url,html:'<img src="'+a.url+'"'+d+"/>"})}return null};angular.filter.Nd=function(a){return(a=angular.filter.j.get(a))?(""+a).toLowerCase(): +a};angular.filter.fe=function(a){return(a=angular.filter.j.get(a))?(""+a).toUpperCase():a};angular.filter.Md=function(a){a=angular.filter.j.get(a);if(a===""||!a)return 1;return a.split(/\n|\f/).length};angular.filter["if"]=function(a,b){return b?a:undefined};angular.filter.de=function(a,b){return b?undefined:a};angular.filter.g=function(a,b,c,d){b=b||{};var e=angular.filter.g;a={Qb:a,vd:e.La(b,"color"),Bd:e.title(b),xd:e.La(b,"label"),wd:e.values(b),yd:"bg,s,FFFFFF00"};if(_.isArray(b.bd)){a.Dd="x"; +a.Cd="0:|"+b.bd.join("|")}return angular.filter.g.$(a,c,d)};angular.filter.g.values=function(a){var b=[];_.each(a.Qc||[],function(c){var d=[];_.each(c.values||[],function(e){d.push(e)});b.push(d.join(","))});a=b.join("|");return a===""?null:"t:"+a};angular.filter.g.title=function(a){var b=[];a=a.title||[];_.each(_.isArray(a)?a:[a],function(c){b.push(encodeURIComponent(c))});return b.join("|")};angular.filter.g.La=function(a,b){var c=[],d=0;_.each(a.Qc||[],function(e){var f=[];e=e[b]||[];_.each(_.isArray(e)? +e:[e],function(g){f.push(encodeURIComponent(g));d++});c.push(f.join("|"))});return d?c.join(","):null};angular.filter.g.$=function(a,b,c){b=b||200;c=c||b;var d="http://chart.apis.google.com/chart?",e=[];a.Ad=b+"x"+c;for(var f in a){var g=a[f];g&&e.push(f+"="+g)}e.sort();d+=e.join("&");return new angular.filter.j({url:d,text:g,html:'<img width="'+b+'" height="'+c+'" src="'+d+'"/>'})};angular.filter.Wd=function(a,b,c){return angular.filter.g.$({Qb:"qr",zd:encodeURIComponent(a)},b,c)};angular.filter.ud= +{Sd:function(a,b,c){return angular.filter.g("p",a,b,c)},Td:function(a,b,c){return angular.filter.g("p3",a,b,c)},Ud:function(a,b,c){return angular.filter.g("pc",a,b,c)},pd:function(a,b,c){return angular.filter.g("bhs",a,b,c)},od:function(a,b,c){return angular.filter.g("bhg",a,b,c)},rd:function(a,b,c){return angular.filter.g("bvs",a,b,c)},qd:function(a,b,c){return angular.filter.g("bvg",a,b,c)},Ld:function(a,b,c){return angular.filter.g("lc",a,b,c)},Zd:function(a,b,c){return angular.filter.g("ls",a, +b,c)},Yd:function(a,b,c){return angular.filter.g("s",a,b,c)}};angular.filter.html=function(a){return new angular.filter.j({html:a})};array=[].constructor;toJson=function(a,b){var c=[];toJsonArray(c,a,b?"\n ":null);return c.join("")};toPrettyJson=function(a){return toJson(a,true)};fromJson=function(a){try{var b=new Parser(a,true),c=b.ia();b.M();return c()}catch(d){console.error("fromJson error: ",a,d);throw d;}};toJsonArray=function(a,b,c){var d=typeof b;if(b===null)a.push("null");else if(d!=="function")if(d=== +"boolean")a.push(""+b);else if(d==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(d==="string")return a.push(angular.String.quoteUnicode(b));else if(d==="object")if(b instanceof Array){a.push("[");var e=b.length;d=false;for(var f=0;f<e;f++){var g=b[f];d&&a.push(",");typeof g=="function"||typeof g=="undefined"?a.push("null"):toJsonArray(a,g,c);d=true}a.push("]")}else if(b instanceof Date)a.push(angular.String.quoteUnicode(angular.Date.toString(b)));else{a.push("{");c&&a.push(c);d=false;f=c? +c+" ":false;g=[];for(var h in b)h.indexOf("$$")!==0&&g.push(h);g.sort();for(h=0;h<g.length;h++){var i=g[h];try{e=b[i];if(typeof e!="function"){if(d){a.push(",");c&&a.push(c)}a.push(angular.String.quote(i));a.push(":");toJsonArray(a,e,f);d=true}}catch(k){}}a.push("}")}};Model=function(a,b){this.U=a;this.K(b||{});this.W=a.title;this.Ca()};Model.oa=function(a,b){if(!(a===b||!a||!b)){var c=function(e,f,g){return g.substring(0,2)!=="$$"&&typeof e[g]!=="function"&&typeof f[g]!=="function"};for(var d in b)c(a, +b,d)&&delete b[d];for(d in a)if(c(a,b,d))b[d]=a[d]}};Model.prototype.Ca=function(){merge(this.U.$b,this);return this};Model.prototype.la=function(a){this.U.Na.save(this,a===true?undefined:a);a===true&&this.U.Na.Ta();return this};Model.prototype.K=function(a){Model.oa(a,this);return this};Model.prototype.Da=function(a){Model.oa(this,a);return this};Lexer=function(a,b){this.text=a;this.Yb=b?20:-1;this.i=[];this.index=0};Lexer.Ea={"null":w(null),"true":w(true),"false":w(false),"+":function(a,b,c){return(b|| +0)+(c||0)},"-":function(a,b,c){return(b||0)-(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},"=":function(a,b,c){return a.scope.l(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 b&c},"|":function(a,b,c){return c(a,b)},"!":function(a,b){return!b}};Lexer.prototype.J=function(){return this.index+1<this.text.length?this.text.charAt(this.index+1):false};Lexer.prototype.parse=function(){for(var a=this.i,b=Lexer.Ea,c=true;this.index<this.text.length;){var d=this.text.charAt(this.index);if(d=='"'||d=="'"){this.Mc(d);c=true}else if(d=="("||d=="["){a.push({index:this.index,text:d});this.index++}else if(d=="{"){c=this.J();if(c==":"||c=="("){a.push({index:this.index,text:d+ +c});this.index++}else a.push({index:this.index,text:d});this.index++;c=true}else if(d==")"||d=="]"||d=="}"){a.push({index:this.index,text:d});this.index++;c=false}else if(d==":"||d=="."||d==","||d==";"){a.push({index:this.index,text:d});this.index++;c=true}else if(c&&d=="/"){this.Lc();c=false}else if(this.pa(d)){this.Kc();c=false}else if(this.ca(d)){this.lb();c=false}else if(this.nc(d))this.index++;else{c=d+this.J();var e=b[d],f=b[c];if(f){a.push({index:this.index,text:c,b:f});this.index+=2}else if(e){a.push({index:this.index, +text:d,b:e});this.index+=1}else throw"Lexer Error: Unexpected next character ["+this.text.substring(this.index)+"] in expression '"+this.text+"' at column '"+(this.index+1)+"'.";c=true}}return a};Lexer.prototype.pa=function(a){return"0"<=a&&a<="9"};Lexer.prototype.nc=function(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"};Lexer.prototype.ca=function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"};Lexer.prototype.Kc=function(){for(var a="",b=this.index;this.index<this.text.length;){var c= +this.text.charAt(this.index);if(c=="."||this.pa(c))a+=c;else break;this.index++}a=1*a;this.i.push({index:b,text:a,b:function(){return a}})};Lexer.prototype.lb=function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.ca(c)||this.pa(c))a+=c;else break;this.index++}c=Lexer.Ea[a];if(!c){c=function(d){return d.scope.get(a)};c.ba=a}this.i.push({index:b,text:a,b:c})};Lexer.zb={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'};Lexer.prototype.Mc= +function(a){var b=this.index,c=this.Yb;this.index++;for(var d="",e=false;this.index<this.text.length;){var f=this.text.charAt(this.index);if(e){if(f=="u"){f=this.text.substring(this.index+1,this.index+5);this.index+=4;d+=String.fromCharCode(parseInt(f,16))}else{e=Lexer.zb[f];d+=e?e:f}e=false}else if(f=="\\")e=true;else if(f==a){this.index++;this.i.push({index:b,text:d,b:function(){return d.length==c?angular.String.toDate(d):d}});return}else d+=f;this.index++}throw"Lexer Error: Unterminated quote ["+ +this.text.substring(b)+"] starting at column '"+(b+1)+"' in expression '"+this.text+"'.";};Lexer.prototype.Lc=function(){var a=this.index;this.index++;for(var b="",c=false;this.index<this.text.length;){var d=this.text.charAt(this.index);if(c){b+=d;c=false}else if(d==="\\"){b+=d;c=true}else if(d==="/"){this.index++;c="";if(this.ca(this.text.charAt(this.index))){this.lb();c=this.i.pop().text}var e=new RegExp(b,c);this.i.push({index:a,text:b,Id:c,b:function(){return e}});return}else b+=d;this.index++}throw"Lexer Error: Unterminated RegExp ["+ +this.text.substring(a)+"] starting at column '"+(a+1)+"' in expression '"+this.text+"'.";};Parser=function(a,b){this.text=a;this.i=(new Lexer(a,b)).parse();this.index=0};Parser.Db=w(0);Parser.prototype.error=function(a,b){throw"Token '"+b.text+"' is "+a+" at column='"+(b.index+1)+"' of expression '"+this.text+"' starting at '"+this.text.substring(b.index)+"'.";};Parser.prototype.ha=function(){if(this.i.length===0)throw"Unexpected end of expression: "+this.text;return this.i[0]};Parser.prototype.J= +function(a,b,c,d){var e=this.i;if(e.length>0){e=e[0];var f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return false};Parser.prototype.a=function(a,b,c,d){if(a=this.J(a,b,c,d)){this.i.shift();return this.Ed=a}return false};Parser.prototype.m=function(a){if(!this.a(a)){var b=this.J();throw"Expecting '"+a+"' at column '"+(b.index+1)+"' in '"+this.text+"' got '"+this.text.substring(b.index)+"'.";}};Parser.prototype.Eb=function(a,b){var c=b.apply(this);return function(d){return a(d,c(d))}}; +Parser.prototype.w=function(a,b,c){var d=c.apply(this);return function(e){return b(e,a(e),d(e))}};Parser.prototype.Wa=function(){return this.i.length>0};Parser.prototype.M=function(){if(this.i.length!==0)throw"Did not understand '"+this.text.substring(this.i[0].index)+"' while evaluating '"+this.text+"'.";};Parser.prototype.xa=function(){for(var a=[];;){this.i.length>0&&!this.J("}",")",";","]")&&a.push(this.Sa());if(!this.a(";"))return function(b){for(var c,d=0;d<a.length;d++){var e=a[d];if(e)c=e(b)}return c}}}; +Parser.prototype.Sa=function(){for(var a=this.q(),b;;)if(b=this.a("|"))a=this.w(a,b.b,this.filter);else return a};Parser.prototype.filter=function(){return this.Ga(angular.filter)};Parser.prototype.h=function(){return this.Ga(angular.validator)};Parser.prototype.Ga=function(a){for(var b=this.jc(a),c=[];;)if(this.a(":"))c.push(this.q());else{var d=function(e,f){f=[f];for(var g=0;g<c.length;g++)f.push(c[g](e));return b.apply(e,f)};return function(){return d}}};Parser.prototype.q=function(){return this.Sc()}; +Parser.prototype.Sc=function(){if(this.a("throw")){var a=this.Ia();return function(b){throw a(b);}}else return this.Ia()};Parser.prototype.Ia=function(){var a=this.eb(),b;if(b=this.a("=")){if(!a.ba)throw"Left hand side '"+this.text.substring(0,b.index)+"' of assignment '"+this.text.substring(b.index)+"' is not assignable.";return this.w(function(){return a.ba},b.b,this.eb)}else return a};Parser.prototype.eb=function(){for(var a=this.db(),b;;)if(b=this.a("||"))a=this.w(a,b.b,this.db);else return a}; +Parser.prototype.db=function(){for(var a=this.gb(),b;;)if(b=this.a("&&"))a=this.w(a,b.b,this.gb);else return a};Parser.prototype.gb=function(){var a;return(a=this.a("!"))?this.Eb(a.b,this.Qa):this.Qa()};Parser.prototype.Qa=function(){for(var a=this.mb(),b;;)if(b=this.a("==","!="))a=this.w(a,b.b,this.mb);else return a};Parser.prototype.mb=function(){for(var a=this.Ha(),b;;)if(b=this.a("<",">","<=",">="))a=this.w(a,b.b,this.Ha);else return a};Parser.prototype.Ha=function(){for(var a=this.ta(),b;b=this.a("+", +"-");)a=this.w(a,b.b,this.ta);return a};Parser.prototype.ta=function(){for(var a=this.qb(),b;b=this.a("*","/","%");)a=this.w(a,b.b,this.qb);return a};Parser.prototype.qb=function(){var a;return this.a("+")?this.ia():(a=this.a("-"))?this.w(Parser.Db,a.b,this.ta):this.ia()};Parser.prototype.jc=function(a){var b=this.a(),c=b.text.split(".");a=a;for(var d,e=0;e<c.length;e++){d=c[e];if(a)a=a[d]}if(typeof a!="function")throw"Function '"+b.text+"' at column '"+(b.index+1)+"' in '"+this.text+"' is not defined."; +return a};Parser.prototype.ia=function(){var a;if(this.a("(")){a=this.Sa();this.m(")");a=a}else if(this.a("["))a=this.Kb();else if(this.a("{"))a=this.object();else if(this.a("{:"))a=this.Ka(false);else if(this.a("{("))a=this.Ka(true);else{var b=this.a();(a=b.b)||this.error("not a primary expression",b)}for(;b=this.a("(","[",".");)if(b.text==="(")a=this.ic(a);else if(b.text==="[")a=this.Fc(a);else if(b.text===".")a=this.gc(a);else throw"IMPOSSIBLE";return a};Parser.prototype.Ka=function(a){var b=[]; +if(a){if(!this.a(")")){for(b.push(this.a().text);this.a(",");)b.push(this.a().text);this.m(")")}this.m(":")}var c=this.xa();this.m("}");return function(d){return function(e){var f=new Scope(d.scope.u);f.l("$",e);for(var g=0;g<b.length;g++)f.l(b[g],arguments[g]);return c({scope:f})}}};Parser.prototype.gc=function(a){var b=this.a().text;function c(d){return Scope.Q(a(d),b)}c.ba=b;return c};Parser.prototype.Fc=function(a){var b=this.q();this.m("]");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}};Parser.prototype.ic=function(a){var b=[];if(this.ha().text!=")"){do b.push(this.q());while(this.a(","))}this.m(")");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.ba+"' is not a function.";}};Parser.prototype.Kb=function(){var a=[];if(this.ha().text!="]"){do a.push(this.q());while(this.a(","))}this.m("]");return function(b){for(var c= +[],d=0;d<a.length;d++)c.push(a[d](b));return c}};Parser.prototype.object=function(){var a=[];if(this.ha().text!="}"){do{var b=this.a().text;this.m(":");var c=this.q();a.push({pc:b,value:c})}while(this.a(","))}this.m("}");return function(d){for(var e={},f=0;f<a.length;f++){var g=a[f],h=g.value(d);e[g.pc]=h}return e}};Parser.prototype.ec=function(){for(var a=[];this.Wa();){a.push(this.dc());this.a(";")||this.M()}return function(b){for(var c="",d=0;d<a.length;d++)c+=a[d](b);return c}};Parser.prototype.dc= +function(){var a=this.a().text,b,c;if(this.a("=")){b=a;a=this.a().text}if(this.a(":"))c=this.ia()(null);return function(d){var e=d.scope.get("$datastore").O(a,c);d.scope.l(a,e);if(b){e=e();e.Ba=b;d.scope.l(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+angular.String.quote(b)+";};"}else return""}};Parser.prototype.watch=function(){for(var a=[];this.Wa();){a.push(this.$c());this.a(";")||this.M()}this.M();return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.Hb(d.name, +d.b)}}};Parser.prototype.$c=function(){var a=this.a().text;this.m(":");var b;if(this.ha().text=="{"){this.m("{");b=this.xa();this.m("}")}else b=this.q();return function(){return{name:a,b:b}}};Scope=function(a,b){this.ub=[];this.za={};this.name=b;a=a||{};function c(){}c.prototype=a;this.u=new c;this.u.ed=a;if(b=="ROOT")this.u.fd=this.u};Scope.aa={};Scope.prototype.c=function(){var a=this;this.hc();_.each(this.ub,function(b){a.o(b,"",{},function(){this.c(a)})})};Scope.prototype.Jb=function(a){a&&this.ub.push(a)}; +Scope.prototype.mc=function(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c!="."&&!Lexer.prototype.ca(c))return false}return true};Scope.Q=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=angular.Global.typeOf(e);if(d=(h=angular[h.charAt(0).toUpperCase()+h.substring(1)])?h[[d.substring(1)]]: +undefined)return a=_.bind(d,e,e)}}if(typeof a==="function"&&!a.wb)return bind(e,a);return a};Scope.prototype.get=function(a){return Scope.Q(this.u,a)};Scope.prototype.l=function(a,b){a=a.split(".");for(var c=this.u,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};Scope.prototype.p=function(a,b){this.eval(a+"="+toJson(b))};Scope.prototype.eval=function(a,b){var c=Scope.aa[a];if(!c){var d=new Parser(a);c=d.xa();d.M();Scope.aa[a]=c}b=b||{};b.scope=this;return c(b)}; +Scope.prototype.o=function(a,b,c,d,e){try{var f=this.eval(b,c);if(a.A){a.A=false;j(a.view).removeClass("ng-exception").removeAttr("ng-error")}d&&d.apply(a,[f]);return true}catch(g){console.error("Eval Widget Error:",g);b=toJson(g,true);a.A=true;j(a.view).addClass("ng-exception").attr("ng-error",b);e&&e.apply(a,[g,b]);return false}};Scope.prototype.Yc=function(a,b){var c=Scope.aa[a];if(!c){c=(new Parser(a)).h();Scope.aa[a]=c}a={scope:this};return c(a)(a,b)};Scope.prototype.O=function(a){return(new Parser(a)).ec()({scope:this})}; +Scope.prototype.sc=function(a){this.u.dd.push(a)};Scope.prototype.watch=function(a){var b=this;(new Parser(a)).watch()({scope:this,Hb:function(c,d){b.Ib(c,function(e,f){try{return d({scope:b},e,f)}catch(g){alert(g)}})}})};Scope.prototype.Ib=function(a,b){var c=this.za[a];if(!c){c={$a:[],q:a};this.za[a]=c}c.$a.push(b)};Scope.prototype.hc=function(){var a=this,b=false;j.each(this.za,function(c,d){var e=a.eval(d.q);if(e!==d.d){j.each(d.$a,function(f,g){g(e,d.d);b=true});d.d=e}});return b};Server=function(a, +b){this.url=a;this.uc=0;this.getScript=b;this.Xc="_"+(""+Math.random()).substr(2)+"_";this.sa=1800};Server.prototype.Mb=function(a){return z.$(a)};Server.prototype.T=function(a,b,c,d){var e=this.Xc+this.uc++;x[e]=function(h){delete angular[e];d(200,h)};a={ce:b,Od:a,Qd:c};a=this.Mb(toJson(a));b=Math.ceil(a.length/this.sa);c=this.url+"/$/"+e+"/"+b+"/";for(var f=0;f<b;f++){var g=a.substr(f*this.sa,this.sa);this.getScript(c+(f+1)+"?h="+g,noop)}};FrameServer=u("frame");FrameServer.jd="$DATASET:";FrameServer.prototype= +{T:m()};VisualServer=function(a,b,c){this.ac=a;this.update=c;this.status=b};VisualServer.prototype={T:function(a,b,c,d){var e=this;this.status.Nb(c);this.ac.T(a,b,c,function(){e.status.cc();try{d.apply(this,arguments)}catch(f){alert(toJson(f))}e.update()})}};Users=function(a,b){this.B=a;this.na=b};Users.prototype={Ra:function(a){var b=this;this.B.T("GET","/account.json",{},function(c,d){b.Wb=d.Wc;a(d.Wc)})},fb:function(a){var b=this;this.na.fb(function(){delete b.Wb;(a||noop)()})},ea:function(a){var b= +this;this.na.ea(function(){b.Ra(function(){(a||noop)()})})},ua:function(){this.na.ua()}};angular.h.S=function(a,b,c){return a.match(b)?null:c||"Value does not match expected format "+b+"."};angular.h.va=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!="undefined"&&d>c)return"Value can not be greater than "+c+".";return null}else return"Value is not a number."};angular.h.Kd=function(a,b,c){b=angular.h.va(a,b,c);if(b===null&&a!= +Math.round(a))return"Value is not a whole number.";return b};angular.h.Xb=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)."};angular.h.$d=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."};angular.h.bc=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."};angular.h.Rd=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."};angular.h.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."};angular.h.oc=function(a){try{fromJson(a);return null}catch(b){return b.toString()}};WidgetFactory=function(a,b){this.vc=0;this.ka= +a;this.I=b;this.Ma=n.ae?swfobject.Ma:function(){alert("ERROR: swfobject not loaded!")};this.Gc=m()};WidgetFactory.prototype.Ub=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;if(d=="button"||d=="submit"||d=="reset"||d=="image"){c=new ButtonController(a[0],e);f="click";g=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new TextController(a[0],e);f="keyup change"}else if(d=="checkbox"){c=new CheckboxController(a[0], +e);f="click"}else if(d=="radio"){c=new RadioController(a[0],e);f="click"}else if(d=="select-one")c=new SelectController(a[0],e);else if(d=="select-multiple")c=new MultiSelectController(a[0],e);else if(d=="file")c=this.Vb(a,e);else throw"Unknown type: "+d;a.data("controller",c);var h=b.get("$binder");j(c.view,":input").bind(f,function(){if(c.e(b)){var i=j(c.view).attr("ng-action")||"";b.o(c,i)&&h.c(b)}return g});return c};WidgetFactory.prototype.Vb=function(a){var b="__uploadWidget_"+this.vc++,c=FileController.template(b); +a.after(c);b=this.Ma({data:this.ka+"/admin/ServerAPI.swf",width:"95",height:"20",align:"top",ge:"transparent"},{Jd:"uploadWidgetId="+b,kd:"always"},b);a.remove();a=new FileController(c,a[0].name,b,this.ka+"/data/"+this.I);j(b).data("controller",a);return a};FileController=function(a,b,c,d){this.view=a;this.ee=c;this.nb=b;this.md=d+"/_attachments";this.value=null;this.d=undefined};FileController.dispatchEvent=function(a,b,c){a=q.getElementById(a);a=j(a).data("controller");FileController.prototype["_on_"+ +b].apply(a,c)};FileController.template=function(a){return j('<span class="ng-upload-widget"><input type="checkbox" ng-non-bindable="true"/><object id="'+a+'" /><a></a><span/></span>')};FileController.prototype.e=function(a){var b=this.view.find("input").attr("checked")?this.value:null;if(this.d===b)return false;else{a.l(this.nb,b);return true}};FileController.prototype.c=function(a){if((a=a.get(this.nb))&&this.value!==a){this.value=a;this.view.find("a").attr("href",this.value.url).text(this.value.text); +this.view.find("span").text(angular.filter.bytes(this.value.size))}this.view.find("input").attr("checked",!!a)};NullController=u("view");NullController.prototype.e=w(true);NullController.prototype.c=m();NullController.lc=new NullController;ButtonController=u("view");ButtonController.prototype.e=w(true);ButtonController.prototype.c=m();TextController=function(a,b){this.view=a;this.exp=b;this.h=a.getAttribute("ng-validate");this.Nc=typeof a.attributes["ng-required"]!="undefined";this.Ya=null;this.d= +undefined;this.s=a.value;a.getAttribute("ng-widget")==="datepicker"&&j(a).Fd()};TextController.prototype.e=function(a){var b=this.view.value;if(this.d===b)return false;else{a.p(this.exp,b);this.d=b;return true}};TextController.prototype.c=function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.p(this.exp,c)}c=c?c:"";if(this.d!=c)this.d=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.Nc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.h&&c){e=a.Yc(this.h, +c);d=!!e}if(this.Ya!==e){this.Ya=d;if(e!==null){b.setAttribute("ng-error",e);a.sc(this)}j(b).toggleClass("ng-validation-error",d)}};CheckboxController=function(a,b){this.view=a;this.exp=b;this.d=undefined;this.s=a.checked?a.value:""};CheckboxController.prototype.e=function(a){var b=this.view;b=b.checked?b.value:"";if(this.d===b)return false;else{a.p(this.exp,b);this.d=b;return true}};CheckboxController.prototype.c=function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.s; +a.p(this.exp,c)}b.checked=b.value==""+c};SelectController=function(a,b){this.view=a;this.exp=b;this.d=undefined;this.s=a.value};SelectController.prototype.e=function(a){if(this.view.selectedIndex<0)a.p(this.exp,null);else{var b=this.view.value;if(this.d===b)return false;else{a.p(this.exp,b);this.d=b;return true}}};SelectController.prototype.c=function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.p(this.exp,c)}if(c!==this.d){b.value=c?c:"";this.d=c}};MultiSelectController= +function(a,b){this.view=a;this.exp=b;this.d=undefined;this.s=this.selected()};MultiSelectController.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};MultiSelectController.prototype.e=function(a){var b=this.selected();if(this.d===b)return false;else{a.p(this.exp,b);this.d=b;return true}};MultiSelectController.prototype.c=function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.p(this.exp,c)}if(c!== +this.d){a=b.options;for(b=0;b<a.length;b++){var d=a[b];d.selected=_.include(c,d.value)}this.d=c}};RadioController=function(a,b){this.view=a;this.exp=b;this.d=this.qa=undefined;this.Xa=a.value;this.s=a.checked?a.value:null};RadioController.prototype.e=function(a){var b=this.view;if(this.qa)return false;else{b.checked=true;this.d=a.p(this.exp,this.Xa);return this.qa=true}};RadioController.prototype.c=function(a){var b=this.view,c=a.get(this.exp);if(this.s&&typeof c==="undefined"){c=this.s;a.p(this.exp, +c)}if(this.d!=c){this.qa=b.checked=this.Xa==""+c;this.d=c}};BindUpdater=function(a,b){this.view=a;this.exp=Binder.ga(b);this.A=false;this.Pc={element:a}};BindUpdater.ob=function(a){var b=escapeHtml;switch(typeof a){case "string":case "boolean":case "number":return b(a);case "function":return BindUpdater.ob(a());case "object":if(isNode(a))return outerHTML(a);else if(a instanceof angular.filter.j){switch(typeof a.html){case "string":case "number":return a.html;case "function":return a.html();case "object":if(isNode(a.html))return outerHTML(a.html); +default:break}switch(typeof a.text){case "string":case "number":return b(a.text);case "function":return b(a.text());default:break}}if(a===null)return"";return b(toJson(a,true));default:return""}};BindUpdater.prototype.e=m();BindUpdater.prototype.c=function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var f=c[e],g=Binder.N(f);if(g){a.o(this,g,this.Pc,function(h){b.push(BindUpdater.ob(h))},function(h,i){setHtml(this.view,i)});if(this.A)return}else b.push(escapeHtml(f))}setHtml(this.view,b.join(""))}; +BindAttrUpdater=function(a,b){this.view=a;this.Lb=b};BindAttrUpdater.prototype.e=m();BindAttrUpdater.prototype.c=function(a){var b=j(this.view),c=this.Lb;if(this.A){this.A=false;b.removeClass("ng-exception").removeAttr("ng-error")}var d=b.is("img");for(var e in c){for(var f=Binder.ga(c[e]),g=[],h=0;h<f.length;h++){var i=Binder.N(f[h]);if(i)try{var k=a.eval(i,{element:b[0],attrName:e});if(k&&(k.constructor!==array||k.length!==0))g.push(k)}catch(l){this.A=true;console.error("BindAttrUpdater",l);i=toJson(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.server")+"/images/blank.gif";b.attr(e,f)}};EvalUpdater=function(a,b){this.view=a;this.exp=b;this.A=false};EvalUpdater.prototype.e=m();EvalUpdater.prototype.c=function(a){a.o(this,this.exp)};HideUpdater=function(a,b){this.view=a;this.exp=b};HideUpdater.prototype.e=m();HideUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){var c=j(this.view); +toBoolean(b)?c.hide():c.show()})};ShowUpdater=function(a,b){this.view=a;this.exp=b};ShowUpdater.prototype.e=m();ShowUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){var c=j(this.view);toBoolean(b)?c.show():c.hide()})};ClassUpdater=function(a,b){this.view=a;this.exp=b};ClassUpdater.prototype.e=m();ClassUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){if(b!==null&&b!==undefined)this.view.className=b})};ClassEvenUpdater=function(a,b){this.view=a;this.exp=b};ClassEvenUpdater.prototype.e= +m();ClassEvenUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){var c=a.get("$index");j(this.view).toggleClass(b,c%2===1)})};ClassOddUpdater=function(a,b){this.view=a;this.exp=b};ClassOddUpdater.prototype.e=m();ClassOddUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){var c=a.get("$index");j(this.view).toggleClass(b,c%2===0)})};StyleUpdater=function(a,b){this.view=a;this.exp=b};StyleUpdater.prototype.e=m();StyleUpdater.prototype.c=function(a){a.o(this,this.exp,{},function(b){j(this.view).attr("style", +"").css(b)})};RepeaterUpdater=function(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.da=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.Zc=a[3]||a[1];this.qc=a[2]};RepeaterUpdater.prototype.e=m();RepeaterUpdater.prototype.c=function(a){a.o(this, +this.da,{},function(b){var c=this;if(!b){b=[];a.mc(this.da)&&a.l(this.da,b)}var d=b.length,e=this.children.length,f=this.view,g=0,h=null,i=this.qc,k=this.Zc,l=0;j.each(b,function(t,p){if(l<e){h=c.children[l];h.scope.l(k,p)}else{var r=new Scope(a.u,c.prefix+k+" in "+c.da+"["+l+"]");r.l("$index",l);i&&r.l(i,t);r.l(k,p);h={scope:r,element:c.template(r,c.prefix,l)};f.after(h.element);c.children.push(h)}f=h.element;t=(new Date).getTime();h.scope.c();g+=(new Date).getTime()-t;l++});for(b=e;b>d;--b){var o= +this.children.pop().element[0];o.parentNode.removeChild(o)}if(h&&h.element[0].nodeName==="OPTION")if(d=j(h.element[0].parentNode).data("controller")){d.d=undefined;d.c(a)}})};PopUp=u("F");PopUp.Fa="mouseleave mouseout click dblclick keypress keyup";PopUp.prototype.bind=function(){this.F.find(".ng-validation-error,.ng-exception").live("mouseover",PopUp.Hc)};PopUp.Hc=function(){PopUp.wa();var a=j(this);a.bind(PopUp.Fa,PopUp.wa);var b=a.position(),c=q.documentElement,d=(self.innerWidth||c&&c.clientWidth|| +q.body.clientWidth)-b.left;c=a.hasClass("ng-exception")?"EXCEPTION:":"Validation error...";a=a.attr("ng-error");d=d>375?"left":"right";c=j("<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>");j("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};PopUp.wa=function(){j("#ng-callout").unbind(PopUp.Fa, +PopUp.wa).remove();return true};Status=function(a){this.cb=a.append(Status.yb).find("#ng-loading");this.ja=0};Status.yb='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';Status.prototype.Nb=function(){this.ja===0&&this.cb.show();this.ja++};Status.prototype.cc=function(){this.ja--;this.ja===0&&this.cb.hide("fold")}})(window,document); @@ -1,612 +1,3 @@ -// Underscore.js -// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the terms of the MIT license. -// Portions of Underscore are inspired by or borrowed from Prototype.js, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore/ - -(function() { - - /*------------------------- Baseline setup ---------------------------------*/ - - // Establish the root object, "window" in the browser, or "global" on the server. - var root = this; - - // Save the previous value of the "_" variable. - var previousUnderscore = root._; - - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - var wrapper = function(obj) { this._wrapped = obj; }; - - // Establish the object that gets thrown to break out of a loop iteration. - var breaker = typeof StopIteration !== 'undefined' ? StopIteration : '__break__'; - - // Create a safe reference to the Underscore object for reference below. - var _ = root._ = function(obj) { return new wrapper(obj); }; - - // Export the Underscore object for CommonJS. - if (typeof exports !== 'undefined') exports._ = _; - - // Create quick reference variables for speed access to core prototypes. - var slice = Array.prototype.slice, - unshift = Array.prototype.unshift, - toString = Object.prototype.toString, - hasOwnProperty = Object.prototype.hasOwnProperty, - propertyIsEnumerable = Object.prototype.propertyIsEnumerable; - - // Current version. - _.VERSION = '0.5.1'; - - /*------------------------ Collection Functions: ---------------------------*/ - - // The cornerstone, an each implementation. - // Handles objects implementing forEach, arrays, and raw objects. - _.each = function(obj, iterator, context) { - var index = 0; - try { - if (obj.forEach) { - obj.forEach(iterator, context); - } else if (_.isArray(obj) || _.isArguments(obj)) { - for (var i=0, l=obj.length; i<l; i++) iterator.call(context, obj[i], i, obj); - } else { - var keys = _.keys(obj), l = keys.length; - for (var i=0; i<l; i++) iterator.call(context, obj[keys[i]], keys[i], obj); - } - } catch(e) { - if (e != breaker) throw e; - } - return obj; - }; - - // Return the results of applying the iterator to each element. Use JavaScript - // 1.6's version of map, if possible. - _.map = function(obj, iterator, context) { - if (obj && _.isFunction(obj.map)) return obj.map(iterator, context); - var results = []; - _.each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; - - // Reduce builds up a single result from a list of values. Also known as - // inject, or foldl. Uses JavaScript 1.8's version of reduce, if possible. - _.reduce = function(obj, memo, iterator, context) { - if (obj && _.isFunction(obj.reduce)) return obj.reduce(_.bind(iterator, context), memo); - _.each(obj, function(value, index, list) { - memo = iterator.call(context, memo, value, index, list); - }); - return memo; - }; - - // The right-associative version of reduce, also known as foldr. Uses - // JavaScript 1.8's version of reduceRight, if available. - _.reduceRight = function(obj, memo, iterator, context) { - if (obj && _.isFunction(obj.reduceRight)) return obj.reduceRight(_.bind(iterator, context), memo); - var reversed = _.clone(_.toArray(obj)).reverse(); - _.each(reversed, function(value, index) { - memo = iterator.call(context, memo, value, index, obj); - }); - return memo; - }; - - // Return the first value which passes a truth test. - _.detect = function(obj, iterator, context) { - var result; - _.each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - _.breakLoop(); - } - }); - return result; - }; - - // Return all the elements that pass a truth test. Use JavaScript 1.6's - // filter(), if it exists. - _.select = function(obj, iterator, context) { - if (obj && _.isFunction(obj.filter)) return obj.filter(iterator, context); - var results = []; - _.each(obj, function(value, index, list) { - iterator.call(context, value, index, list) && results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - var results = []; - _.each(obj, function(value, index, list) { - !iterator.call(context, value, index, list) && results.push(value); - }); - return results; - }; - - // Determine whether all of the elements match a truth test. Delegate to - // JavaScript 1.6's every(), if it is present. - _.all = function(obj, iterator, context) { - iterator = iterator || _.identity; - if (obj && _.isFunction(obj.every)) return obj.every(iterator, context); - var result = true; - _.each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) _.breakLoop(); - }); - return result; - }; - - // Determine if at least one element in the object matches a truth test. Use - // JavaScript 1.6's some(), if it exists. - _.any = function(obj, iterator, context) { - iterator = iterator || _.identity; - if (obj && _.isFunction(obj.some)) return obj.some(iterator, context); - var result = false; - _.each(obj, function(value, index, list) { - if (result = iterator.call(context, value, index, list)) _.breakLoop(); - }); - return result; - }; - - // Determine if a given value is included in the array or object, - // based on '==='. - _.include = function(obj, target) { - if (_.isArray(obj)) return _.indexOf(obj, target) != -1; - var found = false; - _.each(obj, function(value) { - if (found = value === target) _.breakLoop(); - }); - return found; - }; - - // Invoke a method with arguments on every item in a collection. - _.invoke = function(obj, method) { - var args = _.rest(arguments, 2); - return _.map(obj, function(value) { - return (method ? value[method] : value).apply(value, args); - }); - }; - - // Convenience version of a common use case of map: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Return the maximum item or (item-based computation). - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj); - var result = {computed : -Infinity}; - _.each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj); - var result = {computed : Infinity}; - _.each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Sort the object's values by a criteria produced by an iterator. - _.sortBy = function(obj, iterator, context) { - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }), 'value'); - }; - - // Use a comparator function to figure out at what index an object should - // be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator) { - iterator = iterator || _.identity; - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >> 1; - iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; - } - return low; - }; - - // Convert anything iterable into a real, live array. - _.toArray = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - if (_.isArray(iterable)) return iterable; - if (_.isArguments(iterable)) return slice.call(iterable); - return _.map(iterable, function(val){ return val; }); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - return _.toArray(obj).length; - }; - - /*-------------------------- Array Functions: ------------------------------*/ - - // Get the first element of an array. Passing "n" will return the first N - // values in the array. Aliased as "head". The "guard" check allows it to work - // with _.map. - _.first = function(array, n, guard) { - return n && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the first entry of the array. Aliased as "tail". - // Especially useful on the arguments object. Passing an "index" will return - // the rest of the values in the array from that index onward. The "guard" - //check allows it to work with _.map. - _.rest = function(array, index, guard) { - return slice.call(array, _.isUndefined(index) || guard ? 1 : index); - }; - - // Get the last element of an array. - _.last = function(array) { - return array[array.length - 1]; - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.select(array, function(value){ return !!value; }); - }; - - // Return a completely flattened version of an array. - _.flatten = function(array) { - return _.reduce(array, [], function(memo, value) { - if (_.isArray(value)) return memo.concat(_.flatten(value)); - memo.push(value); - return memo; - }); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - var values = _.rest(arguments); - return _.select(array, function(value){ return !_.include(values, value); }); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - _.uniq = function(array, isSorted) { - return _.reduce(array, [], function(memo, el, i) { - if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo.push(el); - return memo; - }); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersect = function(array) { - var rest = _.rest(arguments); - return _.select(_.uniq(array), function(item) { - return _.all(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = _.toArray(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i=0; i<length; i++) results[i] = _.pluck(args, String(i)); - return results; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, MSIE), - // we need this function. Return the position of the first occurence of an - // item in an array, or -1 if the item is not included in the array. - _.indexOf = function(array, item) { - if (array.indexOf) return array.indexOf(item); - for (var i=0, l=array.length; i<l; i++) if (array[i] === item) return i; - return -1; - }; - - // Provide JavaScript 1.6's lastIndexOf, delegating to the native function, - // if possible. - _.lastIndexOf = function(array, item) { - if (array.lastIndexOf) return array.lastIndexOf(item); - var i = array.length; - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python range() function. See: - // http://docs.python.org/library/functions.html#range - _.range = function(start, stop, step) { - var a = _.toArray(arguments); - var solo = a.length <= 1; - var start = solo ? 0 : a[0], stop = solo ? a[0] : a[1], step = a[2] || 1; - var len = Math.ceil((stop - start) / step); - if (len <= 0) return []; - var range = new Array(len); - for (var i = start, idx = 0; true; i += step) { - if ((step > 0 ? i - stop : stop - i) >= 0) return range; - range[idx++] = i; - } - }; - - /* ----------------------- Function Functions: -----------------------------*/ - - // Create a function bound to a given object (assigning 'this', and arguments, - // optionally). Binding with arguments is also known as 'curry'. - _.bind = function(func, obj) { - var args = _.rest(arguments, 2); - return function() { - return func.apply(obj || root, args.concat(_.toArray(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = _.rest(arguments); - if (funcs.length == 0) funcs = _.functions(obj); - _.each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = _.rest(arguments, 2); - return setTimeout(function(){ return func.apply(func, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(_.rest(arguments))); - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func].concat(_.toArray(arguments)); - return wrapper.apply(wrapper, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = _.toArray(arguments); - return function() { - var args = _.toArray(arguments); - for (var i=funcs.length-1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - /* ------------------------- Object Functions: ---------------------------- */ - - // Retrieve the names of an object's properties. - _.keys = function(obj) { - if(_.isArray(obj)) return _.range(0, obj.length); - var keys = []; - for (var key in obj) if (hasOwnProperty.call(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - return _.map(obj, _.identity); - }; - - // Return a sorted list of the function names available in Underscore. - _.functions = function(obj) { - return _.select(_.keys(obj), function(key){ return _.isFunction(obj[key]); }).sort(); - }; - - // Extend a given object with all of the properties in a source object. - _.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (_.isArray(obj)) return obj.slice(0); - return _.extend({}, obj); - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - // Check object identity. - if (a === b) return true; - // Different types? - var atype = typeof(a), btype = typeof(b); - if (atype != btype) return false; - // Basic equality test (watch out for coercions). - if (a == b) return true; - // One is falsy and the other truthy. - if ((!a && b) || (a && !b)) return false; - // One of them implements an isEqual()? - if (a.isEqual) return a.isEqual(b); - // Check dates' integer values. - if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime(); - // Both are NaN? - if (_.isNaN(a) && _.isNaN(b)) return true; - // Compare regular expressions. - if (_.isRegExp(a) && _.isRegExp(b)) - return a.source === b.source && - a.global === b.global && - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - // If a is not an object by this point, we can't handle it. - if (atype !== 'object') return false; - // Check for different array lengths before comparing contents. - if (a.length && (a.length !== b.length)) return false; - // Nothing else worked, deep compare the contents. - var aKeys = _.keys(a), bKeys = _.keys(b); - // Different object sizes? - if (aKeys.length != bKeys.length) return false; - // Recursive comparison of contents. - for (var key in a) if (!_.isEqual(a[key], b[key])) return false; - return true; - }; - - // Is a given array or object empty? - _.isEmpty = function(obj) { - return _.keys(obj).length == 0; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType == 1); - }; - - // Is a given variable an arguments object? - _.isArguments = function(obj) { - return obj && _.isNumber(obj.length) && !_.isArray(obj) && !propertyIsEnumerable.call(obj, 'length'); - }; - - // Is the given value NaN -- this one is interesting. NaN != NaN, and - // isNaN(undefined) == true, so we make sure it's a number first. - _.isNaN = function(obj) { - return _.isNumber(obj) && isNaN(obj); - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return typeof obj == 'undefined'; - }; - - // Define the isArray, isDate, isFunction, isNumber, isRegExp, and isString - // functions based on their toString identifiers. - var types = ['Array', 'Date', 'Function', 'Number', 'RegExp', 'String']; - for (var i=0, l=types.length; i<l; i++) { - (function() { - var identifier = '[object ' + types[i] + ']'; - _['is' + types[i]] = function(obj) { return toString.call(obj) == identifier; }; - })(); - } - - /* -------------------------- Utility Functions: -------------------------- */ - - // Run Underscore.js in noConflict mode, returning the '_' variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Break out of the middle of an iteration. - _.breakLoop = function() { - throw breaker; - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; - }; - - // JavaScript templating a-la ERB, pilfered from John Resig's - // "Secrets of the JavaScript Ninja", page 83. - _.template = function(str, data) { - var fn = new Function('obj', - 'var p=[],print=function(){p.push.apply(p,arguments);};' + - 'with(obj){p.push(\'' + - str - .replace(/[\r\t\n]/g, " ") - .split("<%").join("\t") - .replace(/((^|%>)[^\t]*)'/g, "$1\r") - .replace(/\t=(.*?)%>/g, "',$1,'") - .split("\t").join("');") - .split("%>").join("p.push('") - .split("\r").join("\\'") - + "');}return p.join('');"); - return data ? fn(data) : fn; - }; - - /*------------------------------- Aliases ----------------------------------*/ - - _.forEach = _.each; - _.foldl = _.inject = _.reduce; - _.foldr = _.reduceRight; - _.filter = _.select; - _.every = _.all; - _.some = _.any; - _.head = _.first; - _.tail = _.rest; - _.methods = _.functions; - - /*------------------------ Setup the OOP Wrapper: --------------------------*/ - - // Helper function to continue chaining intermediate results. - var result = function(obj, chain) { - return chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.each(_.functions(_), function(name) { - var method = _[name]; - wrapper.prototype[name] = function() { - unshift.call(arguments, this._wrapped); - return result(method.apply(_, arguments), this._chain); - }; - }); - - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = Array.prototype[name]; - wrapper.prototype[name] = function() { - method.apply(this._wrapped, arguments); - return result(this._wrapped, this._chain); - }; - }); - - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = Array.prototype[name]; - wrapper.prototype[name] = function() { - return result(method.apply(this._wrapped, arguments), this._chain); - }; - }); - - // Start chaining a wrapped Underscore object. - wrapper.prototype.chain = function() { - this._chain = true; - return this; - }; - - // Extracts the result from a wrapped and chained object. - wrapper.prototype.value = function() { - return this._wrapped; - }; - -})(); (function(window, document){/** * @@ -773,19 +164,24 @@ if (typeof Node == 'undefined') { }; } -if (_.isUndefined(window.nglr)) nglr = {}; -if (_.isUndefined(window.angular)) angular = {}; -if (_.isUndefined(angular.validator)) angular.validator = {}; -if (_.isUndefined(angular.filter)) angular.filter = {}; -if (_.isUndefined(window.console)) +var callbacks = {}; +var jQuery = window['jQuery']; +var msie = jQuery['browser']['msie']; + +if (!window.angular){ angular = {}; window['angular'] = angular; } +if (!angular.validator) angular.validator = {}; +if (!angular.filter) angular.filter = {}; +if (!window.console) window.console = { log:function() {}, error:function() {} }; -if (_.isUndefined(alert)) { - alert = function(){console.log(arguments); window.alert.apply(window, arguments); }; +if (!angular.alert) { + angular.alert = function(){console.log(arguments); window.alert.apply(window, arguments); }; } +var consoleNode; + consoleLog = function(level, objs) { var log = document.createElement("div"); log.className = level; @@ -917,7 +313,6 @@ Loader.prototype.load = function() { this.loadCss('/stylesheets/jquery-ui/smoothness/jquery-ui-1.7.1.css'); this.loadCss('/stylesheets/css'); console.log("Server: " + this.config.server); - msie = jQuery.browser.msie; this.configureJQueryPlugins(); this.computeConfiguration(); this.bindHtml(); @@ -925,11 +320,7 @@ Loader.prototype.load = function() { Loader.prototype.configureJQueryPlugins = function() { console.log('Loader.configureJQueryPlugins()'); - jQuery.fn.removeNode = function() { - var node = this.get(0); - node.parentNode.removeChild(node); - }; - jQuery.fn.scope = function() { + jQuery['fn']['scope'] = function() { var element = this; while (element && element.get(0)) { var scope = element.data("scope"); @@ -939,7 +330,7 @@ Loader.prototype.configureJQueryPlugins = function() { } return null; }; - jQuery.fn.controller = function() { + jQuery['fn']['controller'] = function() { return this.data('controller') || NullController.instance; }; }; @@ -977,24 +368,19 @@ Loader.prototype.bindHtml = function() { var datastore = new DataStore(post, users, binder.anchor); binder.updateListeners.push(function(){datastore.flush();}); var scope = new Scope( { - $anchor : binder.anchor, - $binder : binder, - $config : this.config, - $console : window.console, - $datastore : datastore, - $save : function(callback) { + '$anchor' : binder.anchor, + '$binder' : binder, + '$config' : this.config, + '$console' : window.console, + '$datastore' : datastore, + '$save' : function(callback) { datastore.saveScope(scope.state, callback, binder.anchor); }, - $window : window, - $uid : this.uid, - $users : users + '$window' : window, + '$uid' : this.uid, + '$users' : users }, "ROOT"); - jQuery.each(["get", "set", "eval", "addWatchListener", "updateView"], - function(i, method){ - angular[method] = bind(scope, scope[method]); - }); - document.data('scope', scope); console.log('$binder.entity()'); binder.entity(scope); @@ -1032,7 +418,6 @@ Loader.prototype.bindHtml = function() { watcher.watch(); document.find("body").show(); console.log('ready()'); - }; Loader.prototype.visualPost = function(delegate) { @@ -1108,8 +493,8 @@ UrlWatcher.prototype.watch = function() { } self.location.href = self.expectedUrl; var id = '_iframe_notify_' + notify[1]; - var notifyFn = nglr[id]; - delete nglr[id]; + var notifyFn = callbacks[id]; + delete callbacks[id]; try { (notifyFn||noop)(); } catch (e) { @@ -1131,7 +516,7 @@ UrlWatcher.prototype.setUrl = function(url) { existingURL += '#'; if (existingURL != url) window.location.href = url; - self.existingURL = url; + this.existingURL = url; }; UrlWatcher.prototype.getUrl = function() { @@ -1147,11 +532,17 @@ angular['compile'] = function(root, config) { //todo: don't start watcher var loader = new Loader(root, jQuery("head"), _(defaults).extend(config)); loader.load(); - return jQuery(root).scope(); + var scope = jQuery(root).scope(); + //TODO: cleanup + return { + 'updateView':function(){return scope.updateView.apply(scope, arguments);}, + 'set':function(){return scope.set.apply(scope, arguments);}, + 'get':function(){return scope.get.apply(scope, arguments);} + }; }; -angular.Global = { - typeOf:function(obj){ +angular['Global'] = { + 'typeOf':function(obj){ var type = typeof obj; switch(type) { case "object": @@ -1164,10 +555,10 @@ angular.Global = { } }; -angular.Collection = {}; -angular.Object = {}; -angular.Array = { - includeIf:function(array, value, condition) { +angular['Collection'] = {}; +angular['Object'] = {}; +angular['Array'] = { + 'includeIf':function(array, value, condition) { var index = _.indexOf(array, value); if (condition) { if (index == -1) @@ -1177,8 +568,8 @@ angular.Array = { } return array; }, - sum:function(array, expression) { - var fn = angular.Function.compile(expression); + 'sum':function(array, expression) { + var fn = angular['Function']['compile'](expression); var sum = 0; for (var i = 0; i < array.length; i++) { var value = 1 * fn(array[i]); @@ -1188,15 +579,15 @@ angular.Array = { } return sum; }, - remove:function(array, value) { + 'remove':function(array, value) { var index = _.indexOf(array, value); if (index >=0) array.splice(index, 1); return value; }, - find:function(array, condition, defaultValue) { + 'find':function(array, condition, defaultValue) { if (!condition) return undefined; - var fn = angular.Function.compile(condition); + var fn = angular['Function']['compile'](condition); _.detect(array, function($){ if (fn($)){ defaultValue = $; @@ -1205,10 +596,10 @@ angular.Array = { }); return defaultValue; }, - findById:function(array, id) { + 'findById':function(array, id) { return angular.Array.find(array, function($){return $.$id == id;}, null); }, - filter:function(array, expression) { + 'filter':function(array, expression) { var predicates = []; predicates.check = function(value) { for (var j = 0; j < predicates.length; j++) { @@ -1288,16 +679,16 @@ angular.Array = { } return filtered; }, - add:function(array, value) { + 'add':function(array, value) { array.push(_.isUndefined(value)? {} : value); return array; }, - count:function(array, condition) { + 'count':function(array, condition) { if (!condition) return array.length; - var fn = angular.Function.compile(condition); + var fn = angular['Function']['compile'](condition); return _.reduce(array, 0, function(count, $){return count + (fn($)?1:0);}); }, - orderBy:function(array, expression, descend) { + 'orderBy':function(array, expression, descend) { function reverse(comp, descending) { return toBoolean(descending) ? function(a,b){return comp(b,a);} : comp; @@ -1321,7 +712,7 @@ angular.Array = { descending = $.charAt(0) == '-'; $ = $.substring(1); } - var get = $ ? angular.Function.compile($) : _.identity; + var get = $ ? angular['Function']['compile']($) : _.identity; return reverse(function(a,b){ return compare(get(a),get(b)); }, descending); @@ -1335,7 +726,7 @@ angular.Array = { }; return _.clone(array).sort(reverse(comparator, descend)); }, - orderByToggle:function(predicate, attribute) { + 'orderByToggle':function(predicate, attribute) { var STRIP = /^([+|-])?(.*)/; var ascending = false; var index = -1; @@ -1357,7 +748,7 @@ angular.Array = { predicate.unshift((ascending ? "-" : "+") + attribute); return predicate; }, - orderByDirection:function(predicate, attribute, ascend, descend) { + 'orderByDirection':function(predicate, attribute, ascend, descend) { ascend = ascend || 'ng-ascend'; descend = descend || 'ng-descend'; var att = predicate[0] || ''; @@ -1370,7 +761,7 @@ angular.Array = { } return att == attribute ? (direction ? ascend : descend) : ""; }, - merge:function(array, index, mergeValue) { + 'merge':function(array, index, mergeValue) { var value = array[index]; if (!value) { value = {}; @@ -1380,8 +771,8 @@ angular.Array = { return array; } }; -angular.String = { - quote:function(string) { +angular['String'] = { + 'quote':function(string) { return '"' + string.replace(/\\/g, '\\\\'). replace(/"/g, '\\"'). replace(/\n/g, '\\n'). @@ -1391,8 +782,8 @@ angular.String = { replace(/\v/g, '\\v') + '"'; }, - quoteUnicode:function(string) { - var str = angular.String.quote(string); + 'quoteUnicode':function(string) { + var str = angular['String']['quote'](string); var chars = []; for ( var i = 0; i < str.length; i++) { var ch = str.charCodeAt(i); @@ -1405,7 +796,7 @@ angular.String = { } return chars.join(''); }, - toDate:function(string){ + 'toDate':function(string){ var match; if (typeof string == 'string' && (match = string.match(/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/))){ @@ -1417,8 +808,8 @@ angular.String = { return string; } }; -angular.Date = { - toString:function(date){ +angular['Date'] = { + 'toString':function(date){ function pad(n) { return n < 10 ? "0" + n : n; } return (date.getUTCFullYear()) + '-' + pad(date.getUTCMonth() + 1) + '-' + @@ -1428,8 +819,8 @@ angular.Date = { pad(date.getUTCSeconds()) + 'Z'; } }; -angular.Function = { - compile:function(expression) { +angular['Function'] = { + 'compile':function(expression) { if (_.isFunction(expression)){ return expression; } else if (expression){ @@ -1451,21 +842,21 @@ angular.Function = { dst[name] = _[name]; }); }; - extend(angular.Global, {}, + extend(angular['Global'], {}, ['extend', 'clone','isEqual', 'isElement', 'isArray', 'isFunction', 'isUndefined']); - extend(angular.Collection, angular.Global, + extend(angular['Collection'], angular['Global'], ['each', 'map', 'reduce', 'reduceRight', 'detect', 'select', 'reject', 'all', 'any', 'include', 'invoke', 'pluck', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size']); - extend(angular.Array, angular.Collection, + extend(angular['Array'], angular['Collection'], ['first', 'last', 'compact', 'flatten', 'without', 'uniq', 'intersect', 'zip', 'indexOf', 'lastIndexOf']); - extend(angular.Object, angular.Collection, + extend(angular['Object'], angular['Collection'], ['keys', 'values']); - extend(angular.String, angular.Global); - extend(angular.Function, angular.Global, + extend(angular['String'], angular['Global']); + extend(angular['Function'], angular['Global'], ['bind', 'bindAll', 'delay', 'defer', 'wrap', 'compose']); })();// Copyright (C) 2009 BRAT Tech LLC Binder = function(doc, widgetFactory, urlWatcher, config) { @@ -1868,7 +1259,7 @@ ControlBar.prototype.doTemplate = function (path) { resizable: false, modal:true, title: 'Authentication: <a href="http://www.getangular.com"><tt><angular/></tt></a>' }); - nglr["_iframe_notify_" + id] = function() { + callbacks["_iframe_notify_" + id] = function() { loginView.dialog("destroy"); loginView.remove(); jQuery.each(self.callbacks, function(i, callback){ @@ -1982,7 +1373,7 @@ DataStore.prototype.save = function(document, callback) { var cachedDoc = self.cache(document); _.each(self._cache.$collections, function(collection){ if (collection.$$accept(document)) { - angular.Array.includeIf(collection, cachedDoc, true); + angular['Array']['includeIf'](collection, cachedDoc, true); } }); if (document.$$anchor) { @@ -2244,7 +1635,7 @@ angular.filter.Meta.get = function(obj, attr){ } }; -angular.filter.currency = function(amount){ +angular.filter['currency'] = function(amount){ jQuery(this.element).toggleClass('ng-format-negative', amount < 0); return '$' + angular.filter.number.apply(this, [amount, 2]); }; @@ -2550,7 +1941,7 @@ toJsonArray = function(buf, obj, pretty){ buf.push('' + obj); } } else if (type === 'string') { - return buf.push(angular.String.quoteUnicode(obj)); + return buf.push(angular['String']['quoteUnicode'](obj)); } else if (type === 'object') { if (obj instanceof Array) { buf.push("["); @@ -2568,7 +1959,7 @@ toJsonArray = function(buf, obj, pretty){ } buf.push("]"); } else if (obj instanceof Date) { - buf.push(angular.String.quoteUnicode(angular.Date.toString(obj))); + buf.push(angular['String']['quoteUnicode'](angular['Date']['toString'](obj))); } else { buf.push("{"); if (pretty) buf.push(pretty); @@ -2590,7 +1981,7 @@ toJsonArray = function(buf, obj, pretty){ buf.push(","); if (pretty) buf.push(pretty); } - buf.push(angular.String.quote(key)); + buf.push(angular['String']['quote'](key)); buf.push(":"); toJsonArray(buf, value, childPretty); comma = true; @@ -2854,7 +2245,7 @@ Lexer.prototype.readString = function(quote) { this.tokens.push({index:start, text:string, fn:function(){ return (string.length == dateParseLength) ? - angular.String.toDate(string) : string; + angular['String']['toDate'](string) : string; }}); return; } else { @@ -3015,11 +2406,11 @@ Parser.prototype.filterChain = function(){ }; Parser.prototype.filter = function(){ - return this._pipeFunction(angular.filter); + return this._pipeFunction(angular['filter']); }; Parser.prototype.validator = function(){ - return this._pipeFunction(angular.validator); + return this._pipeFunction(angular['validator']); }; Parser.prototype._pipeFunction = function(fnScope){ @@ -3366,7 +2757,7 @@ Parser.prototype.entityDecl = function () { self.scope.set(instance, document); return "$anchor." + instance + ":{" + instance + "=" + entity + ".load($anchor." + instance + ");" + - instance + ".$$anchor=" + angular.String.quote(instance) + ";" + + instance + ".$$anchor=" + angular['String']['quote'](instance) + ";" + "};"; } else { return ""; @@ -3465,7 +2856,7 @@ Scope.getter = function(instance, path) { instance = instance[key]; } if (_.isUndefined(instance) && key.charAt(0) == '$') { - var type = angular.Global.typeOf(lastInstance); + var type = angular['Global']['typeOf'](lastInstance); type = angular[type.charAt(0).toUpperCase()+type.substring(1)]; var fn = type ? type[[key.substring(1)]] : undefined; if (fn) { @@ -3622,8 +3013,8 @@ Server.prototype.base64url = function(txt) { Server.prototype.request = function(method, url, request, callback) { var requestId = this.uuid + (this.nextId++); - nglr[requestId] = function(response) { - delete nglr[requestId]; + callbacks[requestId] = function(response) { + delete angular[requestId]; callback(200, response); }; var payload = {u:url, m:method, p:request}; @@ -3798,7 +3189,13 @@ WidgetFactory = function(serverUrl, database) { this.nextUploadId = 0; this.serverUrl = serverUrl; this.database = database; - this.createSWF = swfobject.createSWF; + if (window.swfobject) { + this.createSWF = swfobject.createSWF; + } else { + this.createSWF = function(){ + alert("ERROR: swfobject not loaded!"); + }; + } this.onChangeListener = function(){}; }; @@ -3938,7 +3335,7 @@ FileController.prototype._on_uploadCompleteData = function(data) { FileController.prototype._on_select = function(name, size, type) { this.name = name; this.view.find("a").text(name).attr('href', name); - this.view.find("span").text(angular.filter.bytes(size)); + this.view.find("span").text(angular['filter']['bytes'](size)); this.upload(); }; @@ -3960,7 +3357,7 @@ FileController.prototype.updateView = function(scope) { this.view.find("a"). attr("href", this.value.url). text(this.value.text); - this.view.find("span").text(angular.filter.bytes(this.value.size)); + this.view.find("span").text(angular['filter']['bytes'](this.value.size)); } this.view.find("input").attr('checked', !!modelValue); }; @@ -4470,8 +3867,8 @@ RepeaterUpdater.prototype.updateView = function(scope) { }); // shrink children for ( var r = childrenLength; r > iteratorLength; --r) { - var unneeded = this.children.pop(); - unneeded.element.removeNode(); + var unneeded = this.children.pop().element[0]; + unneeded.parentNode.removeChild(unneeded); } // Special case for option in select if (child && child.element[0].nodeName === "OPTION") { diff --git a/example/calculator-manual_init.html b/example/calculator-manual_init.html index 175d07b9..1a6571c2 100644 --- a/example/calculator-manual_init.html +++ b/example/calculator-manual_init.html @@ -1,7 +1,8 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <script type="text/javascript" src="../angular.js#autoBind=false"></script> + <script type="text/javascript" src="../lib/jquery/jquery-1.3.2.js"></script> + <script type="text/javascript" src="../angular.js"></script> <script type="text/javascript"> $(document).ready(function(){ var scope = angular.compile(document); diff --git a/example/calculator-minified_init.html b/example/calculator-minified_init.html new file mode 100644 index 00000000..4f113f87 --- /dev/null +++ b/example/calculator-minified_init.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <script type="text/javascript" src="../lib/underscore/underscore.js"></script> + <script type="text/javascript" src="../lib/jquery/jquery-1.3.2.js"></script> + <script type="text/javascript" src="../angular-minified.js"></script> + <script type="text/javascript"> + $(document).ready(function(){ + scope = angular.compile(document); + scope.set('a', 3); + scope.updateView(); + }); + </script> + </head> + <body> + Quantity: <input type="text" name="a" value="2"> + * + Cost: <input type="text" name="b" value="3.4"> + = {{a * b | currency}} + </body> +</html> @@ -1,5 +1,5 @@ -angular.Global = { - typeOf:function(obj){ +angular['Global'] = { + 'typeOf':function(obj){ var type = typeof obj; switch(type) { case "object": @@ -12,10 +12,10 @@ angular.Global = { } }; -angular.Collection = {}; -angular.Object = {}; -angular.Array = { - includeIf:function(array, value, condition) { +angular['Collection'] = {}; +angular['Object'] = {}; +angular['Array'] = { + 'includeIf':function(array, value, condition) { var index = _.indexOf(array, value); if (condition) { if (index == -1) @@ -25,8 +25,8 @@ angular.Array = { } return array; }, - sum:function(array, expression) { - var fn = angular.Function.compile(expression); + 'sum':function(array, expression) { + var fn = angular['Function']['compile'](expression); var sum = 0; for (var i = 0; i < array.length; i++) { var value = 1 * fn(array[i]); @@ -36,15 +36,15 @@ angular.Array = { } return sum; }, - remove:function(array, value) { + 'remove':function(array, value) { var index = _.indexOf(array, value); if (index >=0) array.splice(index, 1); return value; }, - find:function(array, condition, defaultValue) { + 'find':function(array, condition, defaultValue) { if (!condition) return undefined; - var fn = angular.Function.compile(condition); + var fn = angular['Function']['compile'](condition); _.detect(array, function($){ if (fn($)){ defaultValue = $; @@ -53,10 +53,10 @@ angular.Array = { }); return defaultValue; }, - findById:function(array, id) { + 'findById':function(array, id) { return angular.Array.find(array, function($){return $.$id == id;}, null); }, - filter:function(array, expression) { + 'filter':function(array, expression) { var predicates = []; predicates.check = function(value) { for (var j = 0; j < predicates.length; j++) { @@ -136,16 +136,16 @@ angular.Array = { } return filtered; }, - add:function(array, value) { + 'add':function(array, value) { array.push(_.isUndefined(value)? {} : value); return array; }, - count:function(array, condition) { + 'count':function(array, condition) { if (!condition) return array.length; - var fn = angular.Function.compile(condition); + var fn = angular['Function']['compile'](condition); return _.reduce(array, 0, function(count, $){return count + (fn($)?1:0);}); }, - orderBy:function(array, expression, descend) { + 'orderBy':function(array, expression, descend) { function reverse(comp, descending) { return toBoolean(descending) ? function(a,b){return comp(b,a);} : comp; @@ -169,7 +169,7 @@ angular.Array = { descending = $.charAt(0) == '-'; $ = $.substring(1); } - var get = $ ? angular.Function.compile($) : _.identity; + var get = $ ? angular['Function']['compile']($) : _.identity; return reverse(function(a,b){ return compare(get(a),get(b)); }, descending); @@ -183,7 +183,7 @@ angular.Array = { }; return _.clone(array).sort(reverse(comparator, descend)); }, - orderByToggle:function(predicate, attribute) { + 'orderByToggle':function(predicate, attribute) { var STRIP = /^([+|-])?(.*)/; var ascending = false; var index = -1; @@ -205,7 +205,7 @@ angular.Array = { predicate.unshift((ascending ? "-" : "+") + attribute); return predicate; }, - orderByDirection:function(predicate, attribute, ascend, descend) { + 'orderByDirection':function(predicate, attribute, ascend, descend) { ascend = ascend || 'ng-ascend'; descend = descend || 'ng-descend'; var att = predicate[0] || ''; @@ -218,7 +218,7 @@ angular.Array = { } return att == attribute ? (direction ? ascend : descend) : ""; }, - merge:function(array, index, mergeValue) { + 'merge':function(array, index, mergeValue) { var value = array[index]; if (!value) { value = {}; @@ -228,8 +228,8 @@ angular.Array = { return array; } }; -angular.String = { - quote:function(string) { +angular['String'] = { + 'quote':function(string) { return '"' + string.replace(/\\/g, '\\\\'). replace(/"/g, '\\"'). replace(/\n/g, '\\n'). @@ -239,8 +239,8 @@ angular.String = { replace(/\v/g, '\\v') + '"'; }, - quoteUnicode:function(string) { - var str = angular.String.quote(string); + 'quoteUnicode':function(string) { + var str = angular['String']['quote'](string); var chars = []; for ( var i = 0; i < str.length; i++) { var ch = str.charCodeAt(i); @@ -253,7 +253,7 @@ angular.String = { } return chars.join(''); }, - toDate:function(string){ + 'toDate':function(string){ var match; if (typeof string == 'string' && (match = string.match(/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/))){ @@ -265,8 +265,8 @@ angular.String = { return string; } }; -angular.Date = { - toString:function(date){ +angular['Date'] = { + 'toString':function(date){ function pad(n) { return n < 10 ? "0" + n : n; } return (date.getUTCFullYear()) + '-' + pad(date.getUTCMonth() + 1) + '-' + @@ -276,8 +276,8 @@ angular.Date = { pad(date.getUTCSeconds()) + 'Z'; } }; -angular.Function = { - compile:function(expression) { +angular['Function'] = { + 'compile':function(expression) { if (_.isFunction(expression)){ return expression; } else if (expression){ @@ -299,20 +299,20 @@ angular.Function = { dst[name] = _[name]; }); }; - extend(angular.Global, {}, + extend(angular['Global'], {}, ['extend', 'clone','isEqual', 'isElement', 'isArray', 'isFunction', 'isUndefined']); - extend(angular.Collection, angular.Global, + extend(angular['Collection'], angular['Global'], ['each', 'map', 'reduce', 'reduceRight', 'detect', 'select', 'reject', 'all', 'any', 'include', 'invoke', 'pluck', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size']); - extend(angular.Array, angular.Collection, + extend(angular['Array'], angular['Collection'], ['first', 'last', 'compact', 'flatten', 'without', 'uniq', 'intersect', 'zip', 'indexOf', 'lastIndexOf']); - extend(angular.Object, angular.Collection, + extend(angular['Object'], angular['Collection'], ['keys', 'values']); - extend(angular.String, angular.Global); - extend(angular.Function, angular.Global, + extend(angular['String'], angular['Global']); + extend(angular['Function'], angular['Global'], ['bind', 'bindAll', 'delay', 'defer', 'wrap', 'compose']); })();
\ No newline at end of file diff --git a/src/DataStore.js b/src/DataStore.js index bdf882a0..6eeabb21 100644 --- a/src/DataStore.js +++ b/src/DataStore.js @@ -92,7 +92,7 @@ DataStore.prototype.save = function(document, callback) { var cachedDoc = self.cache(document); _.each(self._cache.$collections, function(collection){ if (collection.$$accept(document)) { - angular.Array.includeIf(collection, cachedDoc, true); + angular['Array']['includeIf'](collection, cachedDoc, true); } }); if (document.$$anchor) { diff --git a/src/Filters.js b/src/Filters.js index dd4217be..b3f56e75 100644 --- a/src/Filters.js +++ b/src/Filters.js @@ -22,7 +22,7 @@ angular.filter.Meta.get = function(obj, attr){ } }; -angular.filter.currency = function(amount){ +angular.filter['currency'] = function(amount){ jQuery(this.element).toggleClass('ng-format-negative', amount < 0); return '$' + angular.filter.number.apply(this, [amount, 2]); }; diff --git a/src/JSON.js b/src/JSON.js index 84c9a857..238ed489 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -38,7 +38,7 @@ toJsonArray = function(buf, obj, pretty){ buf.push('' + obj); } } else if (type === 'string') { - return buf.push(angular.String.quoteUnicode(obj)); + return buf.push(angular['String']['quoteUnicode'](obj)); } else if (type === 'object') { if (obj instanceof Array) { buf.push("["); @@ -56,7 +56,7 @@ toJsonArray = function(buf, obj, pretty){ } buf.push("]"); } else if (obj instanceof Date) { - buf.push(angular.String.quoteUnicode(angular.Date.toString(obj))); + buf.push(angular['String']['quoteUnicode'](angular['Date']['toString'](obj))); } else { buf.push("{"); if (pretty) buf.push(pretty); @@ -78,7 +78,7 @@ toJsonArray = function(buf, obj, pretty){ buf.push(","); if (pretty) buf.push(pretty); } - buf.push(angular.String.quote(key)); + buf.push(angular['String']['quote'](key)); buf.push(":"); toJsonArray(buf, value, childPretty); comma = true; diff --git a/src/Loader.js b/src/Loader.js index dfaa355a..19840567 100644 --- a/src/Loader.js +++ b/src/Loader.js @@ -23,6 +23,8 @@ if (typeof Node == 'undefined') { } var callbacks = {}; +var jQuery = window['jQuery']; +var msie = jQuery['browser']['msie']; if (!window.angular){ angular = {}; window['angular'] = angular; } if (!angular.validator) angular.validator = {}; @@ -32,8 +34,8 @@ if (!window.console) log:function() {}, error:function() {} }; -if (_.isUndefined(alert)) { - alert = function(){console.log(arguments); window.alert.apply(window, arguments); }; +if (!angular.alert) { + angular.alert = function(){console.log(arguments); window.alert.apply(window, arguments); }; } var consoleNode; @@ -169,7 +171,6 @@ Loader.prototype.load = function() { this.loadCss('/stylesheets/jquery-ui/smoothness/jquery-ui-1.7.1.css'); this.loadCss('/stylesheets/css'); console.log("Server: " + this.config.server); - msie = jQuery.browser.msie; this.configureJQueryPlugins(); this.computeConfiguration(); this.bindHtml(); @@ -177,11 +178,7 @@ Loader.prototype.load = function() { Loader.prototype.configureJQueryPlugins = function() { console.log('Loader.configureJQueryPlugins()'); - jQuery.fn.removeNode = function() { - var node = this.get(0); - node.parentNode.removeChild(node); - }; - jQuery.fn.scope = function() { + jQuery['fn']['scope'] = function() { var element = this; while (element && element.get(0)) { var scope = element.data("scope"); @@ -191,7 +188,7 @@ Loader.prototype.configureJQueryPlugins = function() { } return null; }; - jQuery.fn.controller = function() { + jQuery['fn']['controller'] = function() { return this.data('controller') || NullController.instance; }; }; @@ -229,24 +226,19 @@ Loader.prototype.bindHtml = function() { var datastore = new DataStore(post, users, binder.anchor); binder.updateListeners.push(function(){datastore.flush();}); var scope = new Scope( { - $anchor : binder.anchor, - $binder : binder, - $config : this.config, - $console : window.console, - $datastore : datastore, - $save : function(callback) { + '$anchor' : binder.anchor, + '$binder' : binder, + '$config' : this.config, + '$console' : window.console, + '$datastore' : datastore, + '$save' : function(callback) { datastore.saveScope(scope.state, callback, binder.anchor); }, - $window : window, - $uid : this.uid, - $users : users + '$window' : window, + '$uid' : this.uid, + '$users' : users }, "ROOT"); - jQuery.each(["get", "set", "eval", "addWatchListener", "updateView"], - function(i, method){ - angular[method] = bind(scope, scope[method]); - }); - document.data('scope', scope); console.log('$binder.entity()'); binder.entity(scope); @@ -284,7 +276,6 @@ Loader.prototype.bindHtml = function() { watcher.watch(); document.find("body").show(); console.log('ready()'); - }; Loader.prototype.visualPost = function(delegate) { @@ -399,6 +390,12 @@ angular['compile'] = function(root, config) { //todo: don't start watcher var loader = new Loader(root, jQuery("head"), _(defaults).extend(config)); loader.load(); - return jQuery(root).scope(); + var scope = jQuery(root).scope(); + //TODO: cleanup + return { + 'updateView':function(){return scope.updateView.apply(scope, arguments);}, + 'set':function(){return scope.set.apply(scope, arguments);}, + 'get':function(){return scope.get.apply(scope, arguments);} + }; }; diff --git a/src/Parser.js b/src/Parser.js index b23215be..cdece11e 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -185,7 +185,7 @@ Lexer.prototype.readString = function(quote) { this.tokens.push({index:start, text:string, fn:function(){ return (string.length == dateParseLength) ? - angular.String.toDate(string) : string; + angular['String']['toDate'](string) : string; }}); return; } else { @@ -346,11 +346,11 @@ Parser.prototype.filterChain = function(){ }; Parser.prototype.filter = function(){ - return this._pipeFunction(angular.filter); + return this._pipeFunction(angular['filter']); }; Parser.prototype.validator = function(){ - return this._pipeFunction(angular.validator); + return this._pipeFunction(angular['validator']); }; Parser.prototype._pipeFunction = function(fnScope){ @@ -697,7 +697,7 @@ Parser.prototype.entityDecl = function () { self.scope.set(instance, document); return "$anchor." + instance + ":{" + instance + "=" + entity + ".load($anchor." + instance + ");" + - instance + ".$$anchor=" + angular.String.quote(instance) + ";" + + instance + ".$$anchor=" + angular['String']['quote'](instance) + ";" + "};"; } else { return ""; diff --git a/src/Scope.js b/src/Scope.js index e3634cee..dff3bfbd 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -55,7 +55,7 @@ Scope.getter = function(instance, path) { instance = instance[key]; } if (_.isUndefined(instance) && key.charAt(0) == '$') { - var type = angular.Global.typeOf(lastInstance); + var type = angular['Global']['typeOf'](lastInstance); type = angular[type.charAt(0).toUpperCase()+type.substring(1)]; var fn = type ? type[[key.substring(1)]] : undefined; if (fn) { diff --git a/src/Widgets.js b/src/Widgets.js index 3a0f2845..4e4facf8 100644 --- a/src/Widgets.js +++ b/src/Widgets.js @@ -5,7 +5,13 @@ WidgetFactory = function(serverUrl, database) { this.nextUploadId = 0; this.serverUrl = serverUrl; this.database = database; - this.createSWF = swfobject.createSWF; + if (window.swfobject) { + this.createSWF = swfobject.createSWF; + } else { + this.createSWF = function(){ + alert("ERROR: swfobject not loaded!"); + }; + } this.onChangeListener = function(){}; }; @@ -145,7 +151,7 @@ FileController.prototype._on_uploadCompleteData = function(data) { FileController.prototype._on_select = function(name, size, type) { this.name = name; this.view.find("a").text(name).attr('href', name); - this.view.find("span").text(angular.filter.bytes(size)); + this.view.find("span").text(angular['filter']['bytes'](size)); this.upload(); }; @@ -167,7 +173,7 @@ FileController.prototype.updateView = function(scope) { this.view.find("a"). attr("href", this.value.url). text(this.value.text); - this.view.find("span").text(angular.filter.bytes(this.value.size)); + this.view.find("span").text(angular['filter']['bytes'](this.value.size)); } this.view.find("input").attr('checked', !!modelValue); }; @@ -677,8 +683,8 @@ RepeaterUpdater.prototype.updateView = function(scope) { }); // shrink children for ( var r = childrenLength; r > iteratorLength; --r) { - var unneeded = this.children.pop(); - unneeded.element.removeNode(); + var unneeded = this.children.pop().element[0]; + unneeded.parentNode.removeChild(unneeded); } // Special case for option in select if (child && child.element[0].nodeName === "OPTION") { diff --git a/src/test/Runner.js b/src/test/Runner.js index 5840282e..c6684951 100644 --- a/src/test/Runner.js +++ b/src/test/Runner.js @@ -110,7 +110,7 @@ test.Scenario.prototype = { }, verb:function(step){ var fn = null; - if (!step) fn = function (){ throw "Step is null!"; } + if (!step) fn = function (){ throw "Step is null!"; }; else if (step.Given) fn = angular.test.GIVEN[step.Given]; else if (step.When) fn = angular.test.WHEN[step.When]; else if (step.Then) fn = angular.test.THEN[step.Then]; diff --git a/src/test/_namespace.js b/src/test/_namespace.js index 78f430f1..e29ae72a 100644 --- a/src/test/_namespace.js +++ b/src/test/_namespace.js @@ -1,5 +1,5 @@ -if (!angular) angular = {}; -if (!angular.test) angular.test = {}; -if (!angular.test.GIVEN) angular.test.GIVEN = {}; -if (!angular.test.WHEN) angular.test.WHEN = {}; -if (!angular.test.THEN) angular.test.THEN = {}; +if (!angular) var angular = window['angular'] = {}; +if (!angular['test']) var angularTest = angular['test'] = {}; +if (!angular['test']['GIVEN']) angularTest['GIVEN'] = {}; +if (!angular['test']['WHEN']) angularTest['WHEN'] = {}; +if (!angular['test']['THEN']) angularTest['THEN'] = {}; |
