aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rakefile2
-rw-r--r--angular-minified.js199
-rw-r--r--angular.js328
-rw-r--r--jsTestDriver.conf2
-rw-r--r--lib/jstestdriver/JsTestDriver.jarbin3065205 -> 3081196 bytes
-rw-r--r--src/API.js2
-rw-r--r--src/Angular.js5
-rw-r--r--src/ControlBar.js8
-rwxr-xr-xtest.sh2
-rw-r--r--test/ApiTest.js2
-rw-r--r--test/BinderTest.js2
-rw-r--r--test/testabilityPatch.js5
12 files changed, 285 insertions, 272 deletions
diff --git a/Rakefile b/Rakefile
index 56f7a9c4..8bb7e1f2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,5 +1,7 @@
include FileUtils
+task :default => [:compile, :test]
+
desc 'Generate Externs'
task :compileexterns do
out = File.new("externs.js", "w")
diff --git a/angular-minified.js b/angular-minified.js
index 64ce47d8..d3856eee 100644
--- a/angular-minified.js
+++ b/angular-minified.js
@@ -1,99 +1,102 @@
-function J(){return function(){}}function M(q){return function(){return q}}
-(function(q,y){function n(){}function N(a,b,c){var d=q.console;switch(arguments.length){case 1:d.log(a);break;case 2:d.log(a,b);break;default:d.log(a,b,c);break}}function W(a,b,c){var d=q.console;switch(arguments.length){case 1:d.error(a);break;case 2:d.error(a,b);break;default:d.error(a,b,c);break}}function da(a,b){var c=y.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:w(f));d=" "}c.appendChild(y.createTextNode(a));O.appendChild(c)}function ea(a){switch(a.nodeName){case "OPTION":case "PRE":case "TITLE":return true;
-default:return false}}function fa(a,b){if(ea(a))if(X)a.innerText=b;else a.textContent=b;else a.innerHTML=b}function C(a){if(!a||!a.replace)return a;return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ca(a){if(!a||!a.replace)return a;return a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")}function Da(a,b){if(!a)throw"Missing this";if(!_.isFunction(b))throw"Missing function";return function(){return b.apply(a,arguments)}}function ga(a){var b=y.createElement("div");
-b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c}function Y(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a}function Z(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=P(w(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&Z(a[c],d)}}function ha(a){this.location=a;this.delay=25;this.setTimeout=function(b,c){q.setTimeout(b,c)};this.Wb=function(b){return b};this.I=a.href}function Ea(){var a=k.fn;a.scope=function(){for(var b=
-this;b&&b.get(0);){var c=b.data("scope");if(c)return c;b=b.parent()}return null};a.controller=function(){return this.data("controller")||Q.Rb}}function Fa(a){if(a.hd=="console"&&!O){O=y.createElement("div");O.id="ng-console";y.getElementsByTagName("body")[0].appendChild(O);N=function(){da("ng-console-info",arguments)};console.error=function(){da("ng-console-error",arguments)}}}function ia(a,b){var c={};o(b,function(d,e){c[e]=_(d).bind(a)});return c}function Ga(a,b){var c=new ja(b.server,b.database),
-d=new x(a[0],c,b.location,b);c=new R(a.find("body"),b.oa);var e=b.fa=="$MEMORY"?new $(this.window):new ka(b.oa,k.getScript);e=new la(e,new S(k(a.body)),function(){d.d()});var f=new ma(e,c),g="/data/"+b.fa,h=new T(function(l,p){e.K("POST",g,l,p)},f,d.anchor);d.$a.push(function(){h.ga()});var i=new v({$anchor:d.anchor,$updateView:_(d.d).bind(d),$config:b,$console:q.console,$datastore:ia(h,{load:h.load,loadMany:h.ja,loadOrCreate:h.Ja,loadAll:h.Ia,save:h.save,remove:h.remove,flush:h.ga,query:h.Ua,entity:h.C,
-entities:h.entities,documentCountsByUser:h.Fb,userDocumentIdsByEntity:h.yc,join:h.join}),$save:function(l){h.sc(i.p,l,d.anchor)},$window:q,$uid:function(){return""+(new Date).getTime()},$users:f},"ROOT");a.data("scope",i);d.C(i);d.compile();c.bind();(new A(a)).bind();var j=_(ia(i,{updateView:i.d,set:i.h,get:i.get,eval:i.eval})).extend({init:function(){b.location.listen(_(d.mc).bind(d));d.Ra();d.Lb();d.d();return j},element:a[0],config:b});return j}function G(a,b,c){var d=_.last(b);o(c,function(e){d[e]=
-_[e]});m[a]=m[a]||{};o(b,function(e){U(m[a],e)})}function x(a,b,c,d){this.B=a;this.location=c;this.anchor={};this.Dc=b;this.zb=d||{};this.$a=[]}function R(a,b){this.document=a;this.aa=b;this.window=q;this.D=[]}function T(a,b,c){this.post=a;this.bb=b;this.z={M:[]};this.anchor=c;this.P=[]}function w(a,b){var c=[];aa(c,a,b?"\n ":null,_([]));return c.join("")}function P(a){try{var b=new D(a,true),c=b.Z();b.G();return c()}catch(d){W("fromJson error: ",a,d);throw d;}}function aa(a,b,c,d){if(typeof b==
-"object"){if(d.include(b)){a.push("RECURSION");return}d.push(b)}var e=typeof b;if(b===null)a.push("null");else if(e==="function")return;else if(e==="boolean")a.push(""+b);else if(e==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(e==="string")return a.push(m.String.quoteUnicode(b));else if(e==="object")if(b instanceof Array){a.push("[");var f=b.length;e=false;for(var g=0;g<f;g++){var h=b[g];e&&a.push(",");typeof h=="function"||typeof h=="undefined"?a.push("null"):aa(a,h,c,d);e=true}a.push("]")}else if(b instanceof
-Date)a.push(m.String.quoteUnicode(m.Date.toString(b)));else{a.push("{");c&&a.push(c);e=false;g=c?c+" ":false;h=[];for(var i in b)i.indexOf("$$")!==0&&h.push(i);h.sort();for(i=0;i<h.length;i++){var j=h[i];try{f=b[j];if(typeof f!="function"){if(e){a.push(",");c&&a.push(c)}a.push(m.String.quote(j));a.push(":");aa(a,f,g,d);e=true}}catch(l){}}a.push("}")}typeof b=="object"&&d.pop()}function E(a,b){this.$$entity=a;this.O(b||{});this.N=a.title;this.fb()}function F(a,b){this.text=a;this.Db=b?20:-1;this.i=
-[];this.index=0}function D(a,b){this.text=a;this.i=(new F(a,b)).parse();this.index=0}function v(a,b){this.cb=[];this.qa={};this.name=b;a=a||{};function c(){}c.prototype=a;this.p=new c;this.p.Jc=a;if(b=="ROOT")this.p.Kc=this.p}function ka(a,b){this.url=a;this.$b=0;this.getScript=b;this.zc="_"+(""+Math.random()).substr(2)+"_";this.ka=1800}function $(a){this.frame=a}function la(a,b,c){this.Eb=a;this.update=c;this.status=b}function ma(a,b){this.oa=a;this.da=b}function ja(a,b){this.ac=0;this.aa=a;this.fa=
-b;this.za=q.zd?swfobject.za:function(){alert("ERROR: swfobject not loaded!")}}function K(a,b,c,d){this.view=a;this.Cd=c;this.Xa=b;this.Pc=d+"/_attachments";this.value=null;this.c=undefined}function Q(a){this.view=a}function na(a,b){this.view=a;this.exp=b;this.L=a.getAttribute("ng-validate");this.rc=typeof a.attributes["ng-required"]!="undefined";this.Ga=null;this.c=undefined;this.o=a.value;a.getAttribute("ng-widget")==="datepicker"&&k(a).gd()}function oa(a,b){this.view=a;this.exp=b;this.c=undefined;
-this.o=a.checked?a.value:""}function pa(a,b){this.view=a;this.exp=b;this.c=undefined;this.o=a.value}function qa(a,b){this.view=a;this.exp=b;this.c=undefined;this.o=this.selected()}function ra(a,b){this.view=a;this.exp=b;this.c=this.ia=undefined;this.Fa=a.value;this.o=a.checked?a.value:null}function L(a,b){this.view=a;this.exp=x.X(b);this.u=false;this.tc={element:a}}function sa(a,b){this.view=a;this.tb=b}function ta(a,b){this.view=a;this.exp=b;this.u=false}function ua(a,b){this.view=a;this.exp=b}function va(a,
-b){this.view=a;this.exp=b}function wa(a,b){this.view=a;this.exp=b}function xa(a,b){this.view=a;this.exp=b}function ya(a,b){this.view=a;this.exp=b}function za(a,b){this.view=a;this.exp=b}function Aa(a,b,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.V=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.Bc=a[3]||a[1];this.Vb=a[2]}function A(a){this.B=a}function S(a){this.Ka=a.append(S.hb).find("#ng-loading");this.$=0}var ba={s:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",Gb:function(a){var b="",c,d,e,f,g,h,i=0;for(a=ba.ob(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.s.charAt(f)+this.s.charAt(c)+this.s.charAt(g)+this.s.charAt(h)}return b},
-jd: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.s.indexOf(a.charAt(h++));d=this.s.indexOf(a.charAt(h++));f=this.s.indexOf(a.charAt(h++));g=this.s.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=ba.nb(b)},ob: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},nb:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};if(typeof y.getAttribute==
-"undefined")y.getAttribute=J();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};q.console||(q.console={log:n,error:n});var O,o=_.each,U=_.extend,k=q.jQuery,X=k.browser.msie,m=q.angular||(q.angular={}),Ba=m.validator||(m.validator={}),r=m.filter||(m.filter={}),ca=m.callbacks||(m.callbacks=
-{});m.alert||(m.alert=function(){N(arguments);q.alert.apply(q,arguments)});ha.prototype={watch:function(){var a=this;function b(){if(a.I!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.I.match(/#/)||(a.I+="#");a.location.href=a.I;c="_iframe_notify_"+c[1];var d=ca[c];delete ca[c];try{(d||n)()}catch(e){alert(e)}}else{a.Wb(a.location.href);a.I=a.location.href}}a.setTimeout(b,a.delay)}b();return this},h:function(a){var b=this.location.href;b.match(/#/)||(b+="#");if(b!=
-a)this.location.href=a;this.md=a},get:function(){return q.location.href}};m.startUrlWatcher=function(){return(new ha(q.location)).watch()};m.compile=function(a,b){b=_({server:"",location:{get:n,set:n,listen:n}}).extend(b||{});Fa(b);Ea();return Ga(k(a),b)};var H={typeOf:function(a){if(a===null)return"null";var b=typeof a;if(b=="object"){if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}},V={},Ha={includeIf:function(a,b,c){var d=_.indexOf(a,
-b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},sum:function(a,b){b=m.Function.compile(b);for(var c=0,d=0;d<a.length;d++){var e=1*b(a[d]);isNaN(e)||(c+=e)}return c},remove:function(a,b){var c=_.indexOf(a,b);c>=0&&a.splice(c,1);return b},find:function(a,b,c){if(b){var d=m.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return m.Lc.find(a,function(c){return c.w==b},null)},filter:function(a,b){var c=[];c.wb=function(j){for(var l=0;l<c.length;l++)if(!c[l](j))return false;
-return true};var d=v.J;function e(j,l){if(l.charAt(0)==="!")return!e(j,l.substr(1));switch(typeof j){case "boolean":case "number":case "string":return(""+j).toLowerCase().indexOf(l)>-1;case "object":for(var p in j)if(p.charAt(0)!=="$"&&e(j[p],l))return true;return false;case "array":for(p=0;p<j.length;p++)if(e(j[p],l))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={Fc:b};case "object":for(var f in b)f=="$"?function(){var j=(""+b[f]).toLowerCase();
-j&&c.push(function(l){return e(l,j)})}():function(){var j=f,l=(""+b[f]).toLowerCase();l&&c.push(function(p){return e(d(p,j),l)})}();break;case "function":c.push(b);break;default:return a}for(var g=[],h=0;h<a.length;h++){var i=a[h];c.wb(i)&&g.push(i)}return g},add:function(a,b){a.push(_.isUndefined(b)?{}:b);return a},count:function(a,b){if(!b)return a.length;var c=m.Function.compile(b);return _.reduce(a,0,function(d,e){return d+(c(e)?1:0)})},orderBy:function(a,b,c){function d(f,g){return Y(g)?function(h,
-i){return f(i,h)}:f}function e(f,g){var h=typeof f,i=typeof g;if(h==i){if(h=="string")f=f.toLowerCase();if(h=="string")g=g.toLowerCase();if(f===g)return 0;return f<g?-1:1}else return h<i?-1:1}b=_.isArray(b)?b:[b];b=_.map(b,function(f){var g=false;if(typeof f=="string"&&(f.charAt(0)=="+"||f.charAt(0)=="-")){g=f.charAt(0)=="-";f=f.substring(1)}var h=f?m.Function.compile(f):_.identity;return d(function(i,j){return e(h(i),h(j))},g)});return _.clone(a).sort(d(function(f,g){for(var h=0;h<b.length;h++){var i=
-b[h](f,g);if(i!==0)return i}return 0},c))},orderByToggle:function(a,b){var c=false,d=-1;_.detect(a,function(e,f){if(e==b){c=true;d=f;return true}if((e.charAt(0)=="+"||e.charAt(0)=="-")&&e.substring(1)==b){c=e.charAt(0)=="+";d=f;return true}});d>=0&&a.splice(d,1);a.unshift((c?"-":"+")+b);return a},orderByDirection:function(a,b,c,d){c=c||"ng-ascend";d=d||"ng-descend";a=a[0]||"";var e=true;if(a.charAt(0)=="-"){a=a.substring(1);e=false}else if(a.charAt(0)=="+")a=a.substring(1);return a==b?e?c:d:""},merge:function(a,
-b,c){var d=a[b];if(!d){d={};a[b]=d}Z(c,d);return a}},Ia={quote:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(a){a=m.String.quote(a);for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b.push(a.charAt(c));else{d="000"+d.toString(16);b.push("\\u"+d.substring(d.length-4))}}return b.join("")},toDate:function(a){var b;if(typeof a=="string"&&
-(b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/))){a=new Date(0);a.setUTCFullYear(b[1],b[2]-1,b[3]);a.setUTCHours(b[4],b[5],b[6],0);return a}return a}},Ja={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"}},Ka={compile:function(a){if(_.isFunction(a))return a;else if(a){var b=new v;return function(c){b.p=c;return b.eval(a)}}else return function(c){return c}}};
-G("Global",[H],["extend","clone","isEqual","isElement","isArray","isFunction","isUndefined"]);G("Collection",[H,V],["each","map","reduce","reduceRight","detect","select","reject","all","any","include","invoke","pluck","max","min","sortBy","sortedIndex","toArray","size"]);G("Array",[H,V,Ha],["first","last","compact","flatten","without","uniq","intersect","zip","indexOf","lastIndexOf"]);G("Object",[H,V,{}],["keys","values"]);G("String",[H,Ia],[]);G("Date",[H,Ja],[]);G("Function",[H,V,Ka],["bind","bindAll",
-"delay","defer","wrap","compose"]);x.X=function(a){for(var b=[],c=0,d;(d=a.indexOf("{{",c))>-1;){c<d&&b.push(a.substr(c,d-c));c=d;d=a.indexOf("}}",d);d=d<0?a.length:d+2;b.push(a.substr(c,d-c));c=d}c!=a.length&&b.push(a.substr(c,a.length-c));return b.length===0?[a]:b};x.Qb=function(a){a=x.X(a);return a.length>1||x.H(a[0])!==null};x.H=function(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?a[1]:null};x.prototype={nc:function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,
-e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b},Ra:function(){var a=this,b=this.location.get()||"",c=b.indexOf("#");if(!(c<0)){b=this.nc(b.substring(c+1));o(a.anchor,function(d,e){delete a.anchor[e]});o(b,function(d,e){a.anchor[e]=d})}},mc:function(){this.Ra();this.d()},xc:function(){var a=this.location.get()||"",b=a.indexOf("#");if(b>-1)a=a.substring(0,b);a+="#";b="";for(var c in this.anchor){var d=this.anchor[c];if(typeof d==="undefined"||d===null)delete this.anchor[c];else{a+=
-b+encodeURIComponent(c);if(d!==true)a+="="+encodeURIComponent(d);b="&"}}this.location.h(a);return a},d:function(){(new Date).getTime();var a=k(this.B).scope();a.h("$invalidWidgets",[]);a.d();(new Date).getTime();this.xc();_.each(this.$a,function(b){b()})},R:function(a){var b=k(this.B),c=b.find(a);if(b.is(a))c=c.andSelf();return c},Lb:function(){this.R("[ng-init]").each(function(){var a=k(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+w(c,true))}})},
-C:function(a){this.R("[ng-entity]").attr("ng-watch",function(){try{var b=k(this);return a.C(b.attr("ng-entity"))+(b.attr("ng-watch")||"")}catch(c){alert(c)}})},compile:function(){var a=k(this.B);if(this.zb.Qc){var b=this.R(":submit").not("[ng-action]");b.attr("ng-action","$save()");b.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.Sa(this.B)(this.B,a.scope(),"");this.R("a[ng-action]").live("click",function(){var c=k(this),d=c.scope();try{d.eval(c.attr("ng-action"));
-c.removeAttr("ng-error");c.removeClass("ng-exception")}catch(e){c.addClass("ng-exception");c.attr("ng-error",w(e,true))}d.get("$updateView")();return false})},wc:function(a,b,c){b=b.concat();var d=b.pop(),e=x.X(a.nodeValue);if(e.length>1||x.H(e[0])){var f=a.parentNode;if(ea(f)){f.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,b:function(l){return new L(l,l.getAttribute("ng-bind-template"))}})}else for(var g=0;g<e.length;g++){var h=e[g],i=x.H(h),j;if(i){j=y.createElement("span");k(j).attr("ng-bind",
-i);g===0&&c.push({path:b.concat(d+g),b:this.Pa})}else if(X&&h.charAt(0)==" "){j=y.createElement("span");j.innerHTML="&nbsp;"+h.substring(1)}else j=y.createTextNode(h);f.insertBefore(j,a)}f.removeChild(a)}},Sa:function(a){var b=[];this.Ta(a,[],b);return function(c,d,e){for(var f=b.length,g=0;g<f;g++){for(var h=b[g],i=c,j=h.path,l=0;l<j.length;l++)i=i.childNodes[j[l]];try{d.rb(h.b(i,d,e))}catch(p){alert(p)}}}},Ta:function(a,b,c){var d=a.nodeType;if(d==Node.TEXT_NODE)this.wc(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?P(e):{};for(var f=d.length,g=0;g<f;g++){var h=d[g],i=h.name;h=X&&i=="href"?decodeURI(a.getAttribute(i,2)):h.value;if(x.Qb(h))e[i]=h}d=w(e);d.length>2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||N(a);var j=a.getAttribute("ng-repeat");if(j){a.removeAttribute("ng-repeat");var l=this.Sa(a);d=y.createComment("ng-repeat: "+
-j);e=a.parentNode;e.insertBefore(d,a);e.removeChild(a);function p(s,t,z){var I=k(a).clone();I.css("display","");I.attr("ng-repeat-index",""+z);I.data("scope",s);l(I[0],s,t+z+":");return I}c.push({path:b,b:function(s,t,z){return new Aa(k(s),j,p,z)}})}else{a.getAttribute("ng-eval")&&c.push({path:b,b:this.fc});a.getAttribute("ng-bind")&&c.push({path:b,b:this.Pa});a.getAttribute("ng-bind-attr")&&c.push({path:b,b:this.bc});a.getAttribute("ng-hide")&&c.push({path:b,b:this.gc});a.getAttribute("ng-show")&&
-c.push({path:b,b:this.hc});a.getAttribute("ng-class")&&c.push({path:b,b:this.cc});a.getAttribute("ng-class-odd")&&c.push({path:b,b:this.ec});a.getAttribute("ng-class-even")&&c.push({path:b,b:this.dc});a.getAttribute("ng-style")&&c.push({path:b,b:this.ic});a.getAttribute("ng-watch")&&c.push({path:b,b:this.jc});d=a.nodeName;if(d=="INPUT"||d=="TEXTAREA"||d=="SELECT"||d=="BUTTON"){var B=this;c.push({path:b,b:function(s,t,z){s.name=z+s.name.split(":").pop();return B.Dc.Ab(k(s),t)}})}if(d=="OPTION")if(!k("<select/>").append(k(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.Ta(d[e],b.concat(e),c)}}}},fc:function(a){return new ta(a,a.getAttribute("ng-eval"))},Pa:function(a){return new L(a,"{{"+a.getAttribute("ng-bind")+"}}")},bc:function(a){return new sa(a,P(a.getAttribute("ng-bind-attr")))},gc:function(a){return new ua(a,a.getAttribute("ng-hide"))},hc:function(a){return new va(a,a.getAttribute("ng-show"))},cc:function(a){return new wa(a,a.getAttribute("ng-class"))},dc:function(a){return new xa(a,a.getAttribute("ng-class-even"))},
-ec:function(a){return new ya(a,a.getAttribute("ng-class-odd"))},ic:function(a){return new za(a,a.getAttribute("ng-style"))},jc:function(a,b){b.watch(a.getAttribute("ng-watch"))}};R.Mc='<div><div class="ui-widget-overlay"></div><div id="ng-login" ng-non-bindable="true"><div class="ng-login-container"></div></div></div>';R.jb='<div ng-non-bindable="true" title="Permission Error:">Sorry, you do not have permission for this!</div>';R.prototype={bind:J(),Na:function(a){this.D.push(a);this.D.length==1&&
-this.Ba("/user_session/new.mini?return_url="+encodeURIComponent(this.ab()))},Xb:function(a){this.D.push(a);this.D.length==1&&this.Ba("/user_session/do_destroy.mini")},ab:function(){return this.window.location.href.split("#")[0]},Ba:function(a){var b=this,c=(new Date).getTime(),d=this.ab();d+="#$iframe_notify="+c;var e=k('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+d+'" src="'+this.aa+a+'" width="500" height="330"/></div>');this.document.append(e);e.Aa({height:363,width:500,wd:false,
-Zb:true,title:'Authentication: <a href="http://www.getangular.com"><tt>&lt;angular/&gt;</tt></a>'});callbacks["_iframe_notify_"+c]=function(){e.Aa("destroy");e.remove();o(b.D,function(f){f()});b.D=[]}},Qa:function(){if(!this.Da){this.Da=k(R.jb);this.Da.Aa({Vc:true,height:70,Zb:true})}}};T.kb=U(J(),{all:function(){return[]},query:function(){return[]},load:function(){return{}},title:undefined});T.prototype={Q:function(a){if(!a instanceof E)throw"Parameter must be an instance of Entity! "+w(a);var b=
-a.N+"/"+a.w,c=this.z[b];if(c)E.ea(a,c);else c=this.z[b]=a;return c},load:function(a,b,c,d){if(b&&b!=="*"){var e=this;this.A(["GET",a.N+"/"+b],function(f){a.O(f);a.fb();f=a.Gc(a);e.Q(f);(c||n)(a)},d)}return a},ja:function(a,b,c){var d=this,e=[],f=0;o(b,function(g){e.push(d.load(a(),g,function(){f++;if(f==b.length)(c||n)(e)}))});return e},Ja:function(a,b,c){return this.load(a,b,c,function(d){if(d.ba==404){a.w=b;(c||n)(a)}else throw d;})},Ia:function(a,b){var c=this,d=[];d.ra=function(e){return e.N==
-a.title};this.z.M.push(d);this.A(["GET",a.title],function(e){for(var f=0;f<e.length;f++){var g=a();g.O(e[f]);d.push(c.Q(g))}(b||n)(d)});return d},save:function(a,b){var c=this,d={};a.gb(d);this.A(["POST","",d],function(e){a.O(e);var f=c.Q(a);_.each(c.z.M,function(g){g.ra(a)&&m.Array.includeIf(g,f,true)});if(a.sa)c.anchor[a.sa]=a.w;b&&b(a)})},remove:function(a,b){var c=this,d={};a.gb(d);this.A(["DELETE","",d],function(e){delete c.z[a.N+"/"+a.w];_.each(c.z.M,function(f){for(var g=0;g<f.length;g++)f[g].w==
-a.w&&f.splice(g,1)});(b||n)(e)})},A:function(a,b,c){a.db=b;a.eb=c||function(d){throw d;};this.P.push(a)},ga:function(){function a(d,e){N("RESPONSE["+d+"]: ",e);if(e.ba==401)b.bb.Na(function(){b.post(c,a)});else if(e.ba)alert(w(e));else for(d=0;d<e.length;d++){var f=e[d],g=c[d],h=f.ba;if(h)h==403?b.bb.Qa():g.eb(f);else g.db(f)}}if(this.P.length!==0){var b=this,c=this.P;this.P=[];N("REQUEST:",c);this.post(c,a)}},sc: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.ta==E.prototype.ta){d++;f.ta(c)}}c()},Ua:function(a,b,c,d){var e=this,f=[];f.ra=M(false);this.z.M.push(f);this.A(["GET",a.title+"/"+b+"="+c],function(g){for(var h=0;h<g.length;h++){var i=(new a).O(g[h]);f.push(e.Q(i))}d&&d(f)});return f},entities:function(a){var b=[],c=this;this.A(["GET","$entities"],function(d){for(var e in d)b.push(c.C(e));b.sort(function(f,g){return f.title>g.title?1:-1});a&&a(b)});return b},Fb:function(){var a={};this.post([["GET","$users"]],function(b,c){o(c[0],function(d,
-e){a[e]=d})});return a},yc:function(a){var b={};this.post([["GET","$users/"+a]],function(c,d){o(d[0],function(e,f){b[f]=e})});return b},C:function(a,b){if(!a)return T.kb;var c=this,d=U(function(e){return new E(d,e)},{title:a,$$factory:true,datastore:this,defaults:b||{},load:function(e,f){return c.load(d(),e,f)},loadMany:function(e,f){return c.ja(d,e,f)},loadOrCreate:function(e,f){return c.Ja(d(),e,f)},all:function(e){return c.Ia(d,e)},query:function(e,f,g){return c.Ua(d,e,f,g)},properties:function(e){c.A(["GET",
-a+"/$properties"],e)}});return d},join:function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).Wc().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].W?a[d].W.substring(0,a[d].W.indexOf(".")):undefined}while(d);return e.length}).value();if(_(c).select(function(d){return a[d].W}).length!=
-c.length-1)throw"Exactly one entity needs to be primary.";b.query=function(d,e){var f=[],g=d?d.substring(0,d.indexOf(".")):undefined;if(g!=c[0])throw _("Named entity '<%=name%>' is not a primary entity.").template({name:g});var h=1;a[g].join.query(d.substring(d.indexOf(".")+1),e,function(i){var j=c[h++],l=a[j],p=l.W,B={};_(i).each(function(s){var t={};f.push(t);t[g]=s;s=v.J(t,p);B[s]=s});l.join.ja(_.toArray(B),function(s){var t={};_(s).each(function(z){t[z.w]=z});_(f).each(function(z){var I=v.J(z,
-p);z[j]=t[I]})})});return f};return b}};r.g=function(a){if(a)for(var b in a)this[b]=a[b]};r.g.get=function(a,b){b=b||"text";switch(typeof a){case "string":return b=="text"?a:undefined;case "object":if(a&&typeof a[b]!=="undefined")return a[b];return;default:return a}};var u;o({currency:function(a){k(this.element).toggleClass("ng-format-negative",a<0);return"$"+r.number.apply(this,[a,2])},number:function(a,b){if(isNaN(a)||!isFinite(a))return"";b=typeof b=="undefined"?2:b;var c=a<0;a=Math.abs(a);var d=
-Math.pow(10,b);a=""+Math.round(a*d);var e=a.substring(0,a.length-b);e=e||"0";d=a.substring(a.length-b);a=c?"-":"";for(c=0;c<e.length;c++){if((e.length-c)%3===0&&c!==0)a+=",";a+=e.charAt(c)}if(b>0){for(c=d.length;c<b;c++)d+="0";a+="."+d.substring(0,b)}return a},date:J(),json:function(a){k(this.element).addClass("ng-monospace");return w(a,true)},trackPackage:function(){var a=[{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=",
-na:[/^1Z[0-9A-Z]{16}$/i]},{name:"FedEx",url:"http://www.fedex.com/Tracking?tracknumbers=",na:[/^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=",na:[/^(91\d{20})$/i,/^(91\d{18})$/i]}];return function(b,c){b=b.replace(/^ */,"").replace(/ *$/,"");var d=b.replace(/ /g,""),e;o(a,function(f){o(f.na,function(g){if(g.test(d)){g=f.name+": "+b;var h=f.url+b;e=new r.g({text:g,url:h,html:'<a href="'+
-Ca(h)+'">'+g+"</a>",Ad:b});_.breakLoop()}});e&&_.breakLoop()});return e?e:b?c||new r.g({text:b+" is not recognized"}):null}}(),link:function(a,b){b=b||r.g.get(a);var c=r.g.get(a,"url")||r.g.get(a);if(c){if(m.L.ld(c)===null)c="mailto:"+c;a='<a href="'+C(c)+'">'+b+"</a>";return new r.g({text:b,url:c,html:a})}return a},bytes:function(){var a=["bytes","KB","MB","GB","TB","PB"];return function(b){if(b===null)return"";for(var c=0;b>1E3;){b/=1024;c++}b=""+b;var d=b.indexOf(".");if(d>-1&&d+2<b.length)b=b.substring(0,
+function K(){return function(){}}function P(o){return function(){return o}}
+(function(o,y){function n(){}function L(a,b,c){var d=o.console;switch(arguments.length){case 1:d.log(a);break;case 2:d.log(a,b);break;default:d.log(a,b,c);break}}function Z(a,b,c){var d=o.console;switch(arguments.length){case 1:d.error(a);break;case 2:d.error(a,b);break;default:d.error(a,b,c);break}}function ea(a,b){var c=y.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:w(f));d=" "}c.appendChild(y.createTextNode(a));Q.appendChild(c)}function fa(a){switch(a.nodeName){case "OPTION":case "PRE":case "TITLE":return true;
+default:return false}}function ga(a,b){if(fa(a))if(U)a.innerText=b;else a.textContent=b;else a.innerHTML=b}function D(a){if(!a||!a.replace)return a;return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ea(a){if(!a||!a.replace)return a;return a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")}function Fa(a,b){if(!a)throw"Missing this";if(!_.isFunction(b))throw"Missing function";return function(){return b.apply(a,arguments)}}function ha(a){var b=y.createElement("div");
+b.appendChild(a);var c=b.innerHTML;b.removeChild(a);return c}function $(a){var b=(""+a).toLowerCase();if(b=="f"||b=="0"||b=="false"||b=="no")a=false;return!!a}function V(a,b){for(var c in a){var d=b[c],e=typeof d;if(e=="undefined")b[c]=M(w(a[c]));else e=="object"&&d.constructor!=array&&c.substring(0,1)!="$"&&V(a[c],d)}}function ia(a){this.location=a;this.delay=25;this.setTimeout=function(b,c){o.setTimeout(b,c)};this.Da=function(b){return b};this.M=a.href}function Ga(){var a=k.fn;a.scope=function(){for(var b=
+this;b&&b.get(0);){var c=b.data("scope");if(c)return c;b=b.parent()}return null};a.controller=function(){return this.data("controller")||R.Ib}}function Ha(a){if(a.Fc=="console"&&!Q){Q=y.createElement("div");Q.id="ng-console";y.getElementsByTagName("body")[0].appendChild(Q);L=function(){ea("ng-console-info",arguments)};console.error=function(){ea("ng-console-error",arguments)}}}function aa(a,b){var c={};p(b,function(d,e){c[e]=_(d).bind(a)});return c}function Ia(a,b){var c=new ja(b.server,b.database),
+d=new x(a[0],c,h,b.location,b);c=new S(a.find("body"),b.server,b.database);var e=b.database=="$MEMORY"?new ba(o):new ka(b.server,k.getScript);e=new la(e,new W(k(a.body)),function(){d.d()});var f=new ma(e,c),g="/data/"+b.database,h=new X(function(l,q){e.O("POST",g,l,q)},f,d.anchor);d.k=h;d.Ua.push(function(){h.U()});var i=new v({$anchor:d.anchor,$updateView:_(d.d).bind(d),$config:b,$console:o.console,$datastore:aa(h,{load:h.load,loadMany:h.ka,loadOrCreate:h.Ga,loadAll:h.Fa,save:h.save,remove:h.remove,
+flush:h.U,query:h.Pa,entity:h.F,entities:h.entities,documentCountsByUser:h.wb,userDocumentIdsByEntity:h.rc,join:h.join}),$save:function(l){h.kc(i.w,l,d.anchor)},$window:o,$uid:function(){return""+(new Date).getTime()},$users:f},"ROOT");a.data("scope",i);d.F(i);d.compile();c.bind();(new A(a)).bind();var j=_(aa(i,{updateView:i.d,set:i.h,get:i.get,eval:i.eval})).extend({init:function(){b.location.listen(_(d.ec).bind(d));d.Ma();d.Cb();d.d();return j},element:a[0],config:b});return j}function G(a,b,c){var d=
+_.last(b);p(c,function(e){d[e]=_[e]});m[a]=m[a]||{};p(b,function(e){B(m[a],e)})}function x(a,b,c,d,e){this.D=a;this.location=d;this.k=c;this.anchor={};this.wc=b;this.qb=e||{};this.Ua=[]}function S(a,b,c){this.db=a;this.da=b;this.ia=c;this.hb=o;this.G=[]}function X(a,b,c){this.post=a;this.Wa=b;this.J=[];this.ea={$collections:this.J};this.anchor=c;this.Q=[]}function w(a,b){var c=[];ca(c,a,b?"\n ":null,_([]));return c.join("")}function M(a){try{var b=new E(a,true),c=b.ba();b.K();return c()}catch(d){Z("fromJson error: ",
+a,d);throw d;}}function ca(a,b,c,d){if(typeof b=="object"){if(d.include(b)){a.push("RECURSION");return}d.push(b)}var e=typeof b;if(b===null)a.push("null");else if(e==="function")return;else if(e==="boolean")a.push(""+b);else if(e==="number")isNaN(b)?a.push("null"):a.push(""+b);else if(e==="string")return a.push(m.String.quoteUnicode(b));else if(e==="object")if(b instanceof Array){a.push("[");var f=b.length;e=false;for(var g=0;g<f;g++){var h=b[g];e&&a.push(",");typeof h=="function"||typeof h=="undefined"?
+a.push("null"):ca(a,h,c,d);e=true}a.push("]")}else if(b instanceof Date)a.push(m.String.quoteUnicode(m.Date.toString(b)));else{a.push("{");c&&a.push(c);e=false;g=c?c+" ":false;h=[];for(var i in b)i.indexOf("$$")!==0&&h.push(i);h.sort();for(i=0;i<h.length;i++){var j=h[i];try{f=b[j];if(typeof f!="function"){if(e){a.push(",");c&&a.push(c)}a.push(m.String.quote(j));a.push(":");ca(a,f,g,d);e=true}}catch(l){}}a.push("}")}typeof b=="object"&&d.pop()}function H(a,b){this.$$entity=a;this.$loadFrom(b||{});
+this.$entity=a.title;this.$migrate()}function F(a,b){this.text=a;this.ub=b?20:-1;this.i=[];this.index=0}function E(a,b){this.text=a;this.i=(new F(a,b)).parse();this.index=0}function v(a,b){this.Xa=[];this.qa={};this.name=b;a=a||{};function c(){}c.prototype=a;this.w=new c;this.w.$parent=a;if(b=="ROOT")this.w.$root=this.w}function ka(a,b){this.url=a;this.Rb=0;this.getScript=b;this.sc="_"+(""+Math.random()).substr(2)+"_";this.la=1800}function ba(a){this.frame=a}function la(a,b,c){this.vb=a;this.update=
+c;this.status=b}function ma(a,b){this.mc=a;this.ga=b}function ja(a,b){this.Sb=0;this.da=a;this.ia=b;this.tb=o.swfobject?o.swfobject.createSWF:function(){alert("ERROR: swfobject not loaded!")}}function T(a,b,c,d){this.view=a;this.qc=c;this.I=b;this.va=d+"/_attachments";this.value=null;this.c=undefined}function R(a){this.view=a}function na(a,b){this.view=a;this.exp=b;this.P=a.getAttribute("ng-validate");this.jc=typeof a.attributes["ng-required"]!="undefined";this.Ca=null;this.c=undefined;this.s=a.value;
+a.getAttribute("ng-widget")==="datepicker"&&k(a).Ec()}function oa(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=a.checked?a.value:""}function pa(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=a.value}function qa(a,b){this.view=a;this.exp=b;this.c=undefined;this.s=this.selected()}function ra(a,b){this.view=a;this.exp=b;this.c=this.ja=undefined;this.Ba=a.value;this.s=a.checked?a.value:null}function N(a,b){this.view=a;this.exp=x.Z(b);this.B=false;this.lc={element:a}}function sa(a,b){this.view=
+a;this.mb=b}function ta(a,b){this.view=a;this.exp=b;this.B=false}function ua(a,b){this.view=a;this.exp=b}function va(a,b){this.view=a;this.exp=b}function wa(a,b){this.view=a;this.exp=b}function xa(a,b){this.view=a;this.exp=b}function ya(a,b){this.view=a;this.exp=b}function za(a,b){this.view=a;this.exp=b}function Aa(a,b,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.X=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.uc=a[3]||a[1];this.Mb=a[2]}function A(a){this.D=a}function W(a){this.Ha=a.append(W.Za).find("#ng-loading");this.ca=0}var da={A:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",xb:function(a){var b="",c,d,e,f,g,h,i=0;for(a=da.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.A.charAt(f)+this.A.charAt(c)+this.A.charAt(g)+this.A.charAt(h)}return b},Gc:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;){c=this.A.indexOf(a.charAt(h++));d=this.A.indexOf(a.charAt(h++));f=this.A.indexOf(a.charAt(h++));g=this.A.indexOf(a.charAt(h++));c=c<<2|d>>4;d=(d&15)<<4|f>>2;e=(f&3)<<6|g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+=
+String.fromCharCode(e)}return b=da.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 y.getAttribute=="undefined")y.getAttribute=K();if(typeof Node=="undefined")Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};o.console||(o.console=
+{log:n,error:n});var Q,U,k=o.jQuery||o.$,p=_.each,B=_.extend,m=o.angular||(o.angular={}),Ba=m.validator||(m.validator={}),r=m.filter||(m.filter={}),O=m.callbacks||(m.callbacks={});m.alert||(m.alert=function(){L(arguments);o.alert.apply(o,arguments)});ia.prototype={Nb:function(a){this.Da=a},watch:function(){var a=this;function b(){if(a.M!==a.location.href){var c=a.location.hash.match(/^#\$iframe_notify=(.*)$/);if(c){a.M.match(/#/)||(a.M+="#");a.location.href=a.M;c="_iframe_notify_"+c[1];var d=O[c];
+delete O[c];try{(d||n)()}catch(e){alert(e)}}else{a.Da(a.location.href);a.M=a.location.href}}a.setTimeout(b,a.delay)}b()},h:function(a){var b=this.location.href;b.match(/#/)||(b+="#");if(b!=a)this.location.href=a;this.Jc=a},get:function(){return o.location.href}};m.startUrlWatcher=function(){var a=new ia(o.location);a.watch();return aa(a,{listen:a.Nb,set:a.h,get:a.get})};m.compile=function(a,b){k=o.jQuery;U=k.browser.msie;b=_({server:"",location:{get:n,set:n,listen:n}}).extend(b||{});Ha(b);Ga();return Ia(k(a),
+b)};var I={typeOf:function(a){if(a===null)return"null";var b=typeof a;if(b=="object"){if(a instanceof Array)return"array";if(a instanceof Date)return"date";if(a.nodeType==1)return"element"}return b}},Y={},Ca={includeIf:function(a,b,c){var d=_.indexOf(a,b);if(c)d==-1&&a.push(b);else a.splice(d,1);return a},sum:function(a,b){b=m.Function.compile(b);for(var c=0,d=0;d<a.length;d++){var e=1*b(a[d]);isNaN(e)||(c+=e)}return c},remove:function(a,b){var c=_.indexOf(a,b);c>=0&&a.splice(c,1);return b},find:function(a,
+b,c){if(b){var d=m.Function.compile(b);_.detect(a,function(e){if(d(e)){c=e;return true}});return c}},findById:function(a,b){return m.yc.find(a,function(c){return c.Ya==b},null)},filter:function(a,b){var c=[];c.pb=function(j){for(var l=0;l<c.length;l++)if(!c[l](j))return false;return true};var d=v.N;function e(j,l){if(l.charAt(0)==="!")return!e(j,l.substr(1));switch(typeof j){case "boolean":case "number":case "string":return(""+j).toLowerCase().indexOf(l)>-1;case "object":for(var q in j)if(q.charAt(0)!==
+"$"&&e(j[q],l))return true;return false;case "array":for(q=0;q<j.length;q++)if(e(j[q],l))return true;return false;default:return false}}switch(typeof b){case "boolean":case "number":case "string":b={xc:b};case "object":for(var f in b)f=="$"?function(){var j=(""+b[f]).toLowerCase();j&&c.push(function(l){return e(l,j)})}():function(){var j=f,l=(""+b[f]).toLowerCase();l&&c.push(function(q){return e(d(q,j),l)})}();break;case "function":c.push(b);break;default:return a}for(var g=[],h=0;h<a.length;h++){var i=
+a[h];c.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=m.Function.compile(b);return _.reduce(a,0,function(d,e){return d+(c(e)?1:0)})},orderBy:function(a,b,c){function d(f,g){return $(g)?function(h,i){return f(i,h)}:f}function e(f,g){var h=typeof f,i=typeof g;if(h==i){if(h=="string")f=f.toLowerCase();if(h=="string")g=g.toLowerCase();if(f===g)return 0;return f<g?-1:1}else return h<i?-1:1}b=_.isArray(b)?b:[b];b=_.map(b,
+function(f){var g=false;if(typeof f=="string"&&(f.charAt(0)=="+"||f.charAt(0)=="-")){g=f.charAt(0)=="-";f=f.substring(1)}var h=f?m.Function.compile(f):_.identity;return d(function(i,j){return e(h(i),h(j))},g)});return _.clone(a).sort(d(function(f,g){for(var h=0;h<b.length;h++){var i=b[h](f,g);if(i!==0)return i}return 0},c))},orderByToggle:function(a,b){var c=false,d=-1;_.detect(a,function(e,f){if(e==b){c=true;d=f;return true}if((e.charAt(0)=="+"||e.charAt(0)=="-")&&e.substring(1)==b){c=e.charAt(0)==
+"+";d=f;return true}});d>=0&&a.splice(d,1);a.unshift((c?"-":"+")+b);return a},orderByDirection:function(a,b,c,d){c=c||"ng-ascend";d=d||"ng-descend";a=a[0]||"";var e=true;if(a.charAt(0)=="-"){a=a.substring(1);e=false}else if(a.charAt(0)=="+")a=a.substring(1);return a==b?e?c:d:""},merge:function(a,b,c){var d=a[b];if(!d){d={};a[b]=d}V(c,d);return a}},Ja={quote:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/\t/g,
+"\\t").replace(/\v/g,"\\v")+'"'},quoteUnicode:function(a){a=m.String.quote(a);for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b.push(a.charAt(c));else{d="000"+d.toString(16);b.push("\\u"+d.substring(d.length-4))}}return b.join("")},toDate:function(a){var b;if(typeof a=="string"&&(b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/))){a=new Date(0);a.setUTCFullYear(b[1],b[2]-1,b[3]);a.setUTCHours(b[4],b[5],b[6],0);return a}return a}},Da={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"}},Ka={compile:function(a){if(_.isFunction(a))return a;else if(a){var b=new v;return function(c){b.w=c;return b.eval(a)}}else return function(c){return c}}};G("Global",[I],["extend","clone","isEqual","isElement","isArray","isFunction","isUndefined"]);G("Collection",[I,Y],["each","map","reduce","reduceRight","detect","select","reject","all",
+"any","include","invoke","pluck","max","min","sortBy","sortedIndex","toArray","size"]);G("Array",[I,Y,Ca],["first","last","compact","flatten","without","uniq","intersect","zip","indexOf","lastIndexOf"]);G("Object",[I,Y,{}],["keys","values"]);G("String",[I,Ja],[]);G("Date",[I,Da],[]);m.Date.toString=Da.toString;G("Function",[I,Y,Ka],["bind","bindAll","delay","defer","wrap","compose"]);x.Z=function(a){for(var b=[],c=0,d;(d=a.indexOf("{{",c))>-1;){c<d&&b.push(a.substr(c,d-c));c=d;d=a.indexOf("}}",d);
+d=d<0?a.length:d+2;b.push(a.substr(c,d-c));c=d}c!=a.length&&b.push(a.substr(c,a.length-c));return b.length===0?[a]:b};x.Hb=function(a){a=x.Z(a);return a.length>1||x.L(a[0])!==null};x.L=function(a){return(a=a.replace(/\n/gm," ").match(/^\{\{(.*)\}\}$/))?a[1]:null};x.prototype={fc:function(a){var b={};a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,e){if(d)b[decodeURIComponent(d)]=decodeURIComponent(e)});return b},Ma:function(){var a=this,b=this.location.get()||"",c=b.indexOf("#");if(!(c<0)){b=this.fc(b.substring(c+
+1));p(a.anchor,function(d,e){delete a.anchor[e]});p(b,function(d,e){a.anchor[e]=d})}},ec:function(){this.Ma();this.d()},pc:function(){var a=this.location.get()||"",b=a.indexOf("#");if(b>-1)a=a.substring(0,b);a+="#";b="";for(var c in this.anchor){var d=this.anchor[c];if(typeof d==="undefined"||d===null)delete this.anchor[c];else{a+=b+encodeURIComponent(c);if(d!==true)a+="="+encodeURIComponent(d);b="&"}}this.location.set(a);return a},d:function(){(new Date).getTime();var a=k(this.D).scope();a.h("$invalidWidgets",
+[]);a.d();(new Date).getTime();this.pc();_.each(this.Ua,function(b){b()})},S:function(a){var b=k(this.D),c=b.find(a);if(b.is(a))c=c.andSelf();return c},Cb:function(){this.S("[ng-init]").each(function(){var a=k(this),b=a.scope();try{b.eval(a.attr("ng-init"))}catch(c){alert("EVAL ERROR:\n"+a.attr("ng-init")+"\n"+w(c,true))}})},F:function(a){var b=this;this.S("[ng-entity]").attr("ng-watch",function(){try{var c=k(this);return a.F(c.attr("ng-entity"),b.k)+(c.attr("ng-watch")||"")}catch(d){L(d);alert(d)}})},
+compile:function(){var a=k(this.D);if(this.qb.autoSubmit){var b=this.S(":submit").not("[ng-action]");b.attr("ng-action","$save()");b.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr",'{disabled:"{{$invalidWidgets}}"}')}this.Na(this.D)(this.D,a.scope(),"");this.S("a[ng-action]").live("click",function(){var c=k(this),d=c.scope();try{d.eval(c.attr("ng-action"));c.removeAttr("ng-error");c.removeClass("ng-exception")}catch(e){c.addClass("ng-exception");c.attr("ng-error",w(e,true))}d.get("$updateView")();
+return false})},oc:function(a,b,c){b=b.concat();var d=b.pop(),e=x.Z(a.nodeValue);if(e.length>1||x.L(e[0])){var f=a.parentNode;if(fa(f)){f.setAttribute("ng-bind-template",a.nodeValue);c.push({path:b,b:function(l){return new N(l,l.getAttribute("ng-bind-template"))}})}else for(var g=0;g<e.length;g++){var h=e[g],i=x.L(h),j;if(i){j=y.createElement("span");k(j).attr("ng-bind",i);g===0&&c.push({path:b.concat(d+g),b:this.La})}else if(U&&h.charAt(0)==" "){j=y.createElement("span");j.innerHTML="&nbsp;"+h.substring(1)}else j=
+y.createTextNode(h);f.insertBefore(j,a)}f.removeChild(a)}},Na:function(a){var b=[];this.Oa(a,[],b);return function(c,d,e){for(var f=b.length,g=0;g<f;g++){for(var h=b[g],i=c,j=h.path,l=0;l<j.length;l++)i=i.childNodes[j[l]];try{d.kb(h.b(i,d,e))}catch(q){alert(q)}}}},Oa:function(a,b,c){var d=a.nodeType;if(d==Node.TEXT_NODE)this.oc(a,b,c);else if(!(d!=Node.ELEMENT_NODE&&d!=Node.DOCUMENT_NODE))if(a.getAttribute){d=a.getAttribute("ng-non-bindable");if(!(d||d==="")){if(d=a.attributes){var e=a.getAttribute("ng-bind-attr");
+a.removeAttribute("ng-bind-attr");e=e?M(e):{};for(var f=d.length,g=0;g<f;g++){var h=d[g],i=h.name;h=U&&i=="href"?decodeURI(a.getAttribute(i,2)):h.value;if(x.Hb(h))e[i]=h}d=w(e);d.length>2&&a.setAttribute("ng-bind-attr",d)}a.getAttribute||L(a);var j=a.getAttribute("ng-repeat");if(j){a.removeAttribute("ng-repeat");var l=this.Na(a);d=y.createComment("ng-repeat: "+j);e=a.parentNode;e.insertBefore(d,a);e.removeChild(a);function q(s,t,z){var J=k(a).clone();J.css("display","");J.attr("ng-repeat-index",""+
+z);J.data("scope",s);l(J[0],s,t+z+":");return J}c.push({path:b,b:function(s,t,z){return new Aa(k(s),j,q,z)}})}else{a.getAttribute("ng-eval")&&c.push({path:b,b:this.Xb});a.getAttribute("ng-bind")&&c.push({path:b,b:this.La});a.getAttribute("ng-bind-attr")&&c.push({path:b,b:this.Tb});a.getAttribute("ng-hide")&&c.push({path:b,b:this.Yb});a.getAttribute("ng-show")&&c.push({path:b,b:this.Zb});a.getAttribute("ng-class")&&c.push({path:b,b:this.Ub});a.getAttribute("ng-class-odd")&&c.push({path:b,b:this.Wb});
+a.getAttribute("ng-class-even")&&c.push({path:b,b:this.Vb});a.getAttribute("ng-style")&&c.push({path:b,b:this.$b});a.getAttribute("ng-watch")&&c.push({path:b,b:this.ac});d=a.nodeName;if(d=="INPUT"||d=="TEXTAREA"||d=="SELECT"||d=="BUTTON"){var C=this;c.push({path:b,b:function(s,t,z){s.name=z+s.name.split(":").pop();return C.wc.rb(k(s),t)}})}if(d=="OPTION")if(!k("<select/>").append(k(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.Oa(d[e],b.concat(e),c)}}}},Xb:function(a){return new ta(a,a.getAttribute("ng-eval"))},La:function(a){return new N(a,"{{"+a.getAttribute("ng-bind")+"}}")},Tb:function(a){return new sa(a,M(a.getAttribute("ng-bind-attr")))},Yb:function(a){return new ua(a,a.getAttribute("ng-hide"))},Zb:function(a){return new va(a,a.getAttribute("ng-show"))},Ub:function(a){return new wa(a,a.getAttribute("ng-class"))},Vb:function(a){return new xa(a,a.getAttribute("ng-class-even"))},Wb:function(a){return new ya(a,
+a.getAttribute("ng-class-odd"))},$b:function(a){return new za(a,a.getAttribute("ng-style"))},ac:function(a,b){b.watch(a.getAttribute("ng-watch"))}};S.zc='<div><div class="ui-widget-overlay"></div><div id="ng-login" ng-non-bindable="true"><div class="ng-login-container"></div></div></div>';S.ab='<div ng-non-bindable="true" title="Permission Error:">Sorry, you do not have permission for this!</div>';S.prototype={bind:K(),Ob:function(a){this.G.push(a);this.G.length==1&&this.xa("/user_session/new.mini?database="+
+encodeURIComponent(this.ia)+"&return_url="+encodeURIComponent(this.Va()))},Pb:function(a){this.G.push(a);this.G.length==1&&this.xa("/user_session/do_destroy.mini")},Va:function(){return this.hb.location.href.split("#")[0]},xa:function(a){var b=this,c=(new Date).getTime(),d=this.Va()+"#$iframe_notify="+c,e=k('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+d+'" src="'+this.da+a+'" width="500" height="330"/></div>');this.db.append(e);e.dialog({height:363,width:500,resizable:false,modal:true,
+title:'Authentication: <a href="http://www.getangular.com"><tt>&lt;angular/&gt;</tt></a>'});O["_iframe_notify_"+c]=function(){e.dialog("destroy");e.remove();p(b.G,function(f){f()});b.G=[]}},bc:function(){if(!this.za){this.za=k(S.ab);this.za.Hc({Bc:true,height:70,Lc:true})}}};X.bb=B(K(),{all:function(){return[]},query:function(){return[]},load:function(){return{}},title:undefined});X.prototype={R:function(a){if(!a.k===this)throw"Parameter must be an instance of Entity! "+w(a);var b=a.$entity+"/"+a.$id,
+c=this.ea[b];if(c)H.ha(a,c);else c=this.ea[b]=a;return c},load:function(a,b,c,d){if(b&&b!=="*"){var e=this;this.C(["GET",a.$entity+"/"+b],function(f){a.$loadFrom(f);a.$migrate();f=a.$$entity(a);e.R(f);(c||n)(a)},d)}return a},ka:function(a,b,c){var d=this,e=[],f=0;p(b,function(g){e.push(d.load(a(),g,function(){f++;if(f==b.length)(c||n)(e)}))});return e},Ga:function(a,b,c){return this.load(a,b,c,function(d){if(d.$status_code==404){a.$id=b;(c||n)(a)}else throw d;})},Fa:function(a,b){var c=this,d=[];
+d.$$accept=function(e){return e.$entity==a.title};this.J.push(d);this.C(["GET",a.title],function(e){for(var f=0;f<e.length;f++){var g=a();g.$loadFrom(e[f]);d.push(c.R(g))}(b||n)(d)});return d},save:function(a,b){var c=this,d={};a.$saveTo(d);this.C(["POST","",d],function(e){a.$loadFrom(e);var f=c.R(a);_.each(c.J,function(g){g.$$accept(a)&&Ca.includeIf(g,f,true)});if(a.$$anchor)c.anchor[a.$$anchor]=a.$id;b&&b(a)})},remove:function(a,b){var c=this,d={};a.$saveTo(d);this.C(["DELETE","",d],function(e){delete c.ea[a.$entity+
+"/"+a.$id];_.each(c.J,function(f){for(var g=0;g<f.length;g++)f[g].$id==a.$id&&f.splice(g,1)});(b||n)(e)})},C:function(a,b,c){a.$$callback=b;a.$$failure=c||function(d){throw d;};this.Q.push(a)},U:function(){function a(d,e){L("RESPONSE["+d+"]: ",e);if(e.$status_code==401)b.Wa.login(function(){b.post(c,a)});else if(e.$status_code)alert(w(e));else for(d=0;d<e.length;d++){var f=e[d],g=c[d],h=f.$status_code;if(h)h==403?b.Wa.notAuthorized():g.$$failure(f);else g.$$callback(f)}}if(this.Q.length!==0){var b=
+this,c=this.Q;this.Q=[];L("REQUEST:",c);this.post(c,a)}},kc:function(a,b){function c(){d--;d===0&&b&&b()}var d=1;for(var e in a){var f=a[e];if(f&&f.$save==H.prototype.$save){d++;f.$save(c)}}c()},Pa:function(a,b,c,d){var e=this,f=[];f.$$accept=P(false);this.J.push(f);this.C(["GET",a.title+"/"+b+"="+c],function(g){p(g,function(h){h=a().$loadFrom(h);f.push(e.R(h))});(d||n)(f)});return f},entities:function(a){var b=[],c=this;this.C(["GET","$entities"],function(d){p(d,function(e,f){b.push(c.F(f))});b.sort(function(e,
+f){return e.title>f.title?1:-1});(a||n)(b)});return b},wb:function(){var a={};this.post([["GET","$users"]],function(b,c){B(a,c[0])});return a},rc:function(a){var b={};this.post([["GET","$users/"+a]],function(c,d){B(b,d[0])});return b},F:function(a,b){if(!a)return X.bb;var c=this,d=B(function(e){return new H(d,e)},{title:a,$$factory:true,k:this,defaults:b||{},load:function(e,f){return c.load(d(),e,f)},loadMany:function(e,f){return c.ka(d,e,f)},loadOrCreate:function(e,f){return c.Ga(d(),e,f)},all:function(e){return c.Fa(d,
+e)},query:function(e,f,g){return c.Pa(d,e,f,g)},properties:function(e){c.C(["GET",a+"/$properties"],e)}});return d},join:function(a){function b(){throw"Joined entities can not be instantiated into a document.";}var c=_(a).Cc().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].Y?a[d].Y.substring(0,a[d].Y.indexOf(".")):undefined}while(d);
+return e.length}).value();if(_(c).select(function(d){return a[d].Y}).length!=c.length-1)throw"Exactly one entity needs to be primary.";b.query=function(d,e){var f=[],g=d?d.substring(0,d.indexOf(".")):undefined;if(g!=c[0])throw _("Named entity '<%=name%>' is not a primary entity.").template({name:g});var h=1;a[g].join.query(d.substring(d.indexOf(".")+1),e,function(i){var j=c[h++],l=a[j],q=l.Y,C={};_(i).each(function(s){var t={};f.push(t);t[g]=s;s=v.N(t,q);C[s]=s});l.join.ka(_.toArray(C),function(s){var t=
+{};_(s).each(function(z){t[z.Ya]=z});_(f).each(function(z){var J=v.N(z,q);z[j]=t[J]})})});return f};return b}};r.g=function(a){if(a)for(var b in a)this[b]=a[b]};r.g.get=function(a,b){b=b||"text";switch(typeof a){case "string":return b=="text"?a:undefined;case "object":if(a&&typeof a[b]!=="undefined")return a[b];return;default:return a}};var u;p({currency:function(a){k(this.element).toggleClass("ng-format-negative",a<0);return"$"+r.number.apply(this,[a,2])},number:function(a,b){if(isNaN(a)||!isFinite(a))return"";
+b=typeof b=="undefined"?2:b;var c=a<0;a=Math.abs(a);var d=Math.pow(10,b);a=""+Math.round(a*d);var e=a.substring(0,a.length-b);e=e||"0";d=a.substring(a.length-b);a=c?"-":"";for(c=0;c<e.length;c++){if((e.length-c)%3===0&&c!==0)a+=",";a+=e.charAt(c)}if(b>0){for(c=d.length;c<b;c++)d+="0";a+="."+d.substring(0,b)}return a},date:K(),json:function(a){k(this.element).addClass("ng-monospace");return w(a,true)},trackPackage:function(){var a=[{name:"UPS",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=",
+oa:[/^1Z[0-9A-Z]{16}$/i]},{name:"FedEx",url:"http://www.fedex.com/Tracking?tracknumbers=",oa:[/^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=",oa:[/^(91\d{20})$/i,/^(91\d{18})$/i]}];return function(b,c){b=b.replace(/^ */,"").replace(/ *$/,"");var d=b.replace(/ /g,""),e;p(a,function(f){p(f.oa,function(g){if(g.test(d)){g=f.name+": "+b;var h=f.url+b;e=new r.g({text:g,url:h,html:'<a href="'+
+Ea(h)+'">'+g+"</a>",Mc:b});_.breakLoop()}});e&&_.breakLoop()});return e?e:b?c||new r.g({text:b+" is not recognized"}):null}}(),link:function(a,b){b=b||r.g.get(a);var c=r.g.get(a,"url")||r.g.get(a);if(c){if(m.P.Ic(c)===null)c="mailto:"+c;a='<a href="'+D(c)+'">'+b+"</a>";return new r.g({text:b,url:c,html:a})}return a},bytes:function(){var a=["bytes","KB","MB","GB","TB","PB"];return function(b){if(b===null)return"";for(var c=0;b>1E3;){b/=1024;c++}b=""+b;var d=b.indexOf(".");if(d>-1&&d+2<b.length)b=b.substring(0,
d+2);return b+" "+a[c]}}(),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 r.g({url:a.url,text:a.url,html:'<img src="'+a.url+'"'+d+"/>"})}return null},lowercase:function(a){return(a=r.g.get(a))?(""+a).toLowerCase():a},uppercase:function(a){return(a=r.g.get(a))?(""+a).toUpperCase():a},linecount:function(a){a=r.g.get(a);if(a===""||!a)return 1;return a.split(/\n|\f/).length},"if":function(a,b){return b?a:undefined},unless:function(a,
-b){return b?undefined:a},googleChartApi:U(function(a,b,c,d){b=b||{};a={xb:a,Xc:u.yb(b,"color"),cd:u.title(b),Zc:u.yb(b,"label"),Yc:u.values(b),$c:"bg,s,FFFFFF00"};if(_.isArray(b.Ec)){a.ed="x";a.dd="0:|"+b.Ec.join("|")}return u.encode(a,c,d)},{values:function(a){var b=[];o(a.uc||[],function(c){var d=[];o(c.values||[],function(e){d.push(e)});b.push(d.join(","))});a=b.join("|");return a===""?null:"t:"+a},title:function(a){var b=[];a=a.title||[];o(_.isArray(a)?a:[a],function(c){b.push(encodeURIComponent(c))});
-return b.join("|")},collect:function(a,b){var c=[],d=0;o(a.uc||[],function(e){var f=[];e=e[b]||[];o(_.isArray(e)?e:[e],function(g){f.push(encodeURIComponent(g));d++});c.push(f.join("|"))});return d?c.join(","):null},encode:function(a,b,c){b=b||200;c=c||b;var d="http://chart.apis.google.com/chart?",e=[];a.bd=b+"x"+c;o(a,function(f,g){f&&e.push(g+"="+f)});e.sort();d+=e.join("&");return new r.g({url:d,html:'<img width="'+b+'" height="'+c+'" src="'+d+'"/>'})}}),qrcode:function(a,b,c){return u.encode({xb:"qr",
-ad:encodeURIComponent(a)},b,c)},chart:{td:function(a,b,c){return u("p",a,b,c)},ud:function(a,b,c){return u("p3",a,b,c)},vd:function(a,b,c){return u("pc",a,b,c)},Sc:function(a,b,c){return u("bhs",a,b,c)},Rc:function(a,b,c){return u("bhg",a,b,c)},Uc:function(a,b,c){return u("bvs",a,b,c)},Tc:function(a,b,c){return u("bvg",a,b,c)},qd:function(a,b,c){return u("lc",a,b,c)},yd:function(a,b,c){return u("ls",a,b,c)},xd:function(a,b,c){return u("s",a,b,c)}},html:function(a){return new r.g({html:a})},linky:function(a){if(!a)return a;
-for(var b=/(ftp|http|https|mailto):\/\/([^\(\)|\s]+)/,c,d=a,e=[];c=d.match(b);){c=c[0].replace(/[\.\;\,\(\)\{\}\<\>]$/,"");var f=d.indexOf(c);e.push(C(d.substr(0,f)));e.push('<a href="'+c+'">');e.push(c);e.push("</a>");d=d.substring(f+c.length)}e.push(C(d));return new r.g({text:a,html:e.join("")})}},function(a,b){r[b]=a});u=r.googleChartApi;array=[].constructor;m.toJson=w;m.fromJson=P;E.ea=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]}};E.prototype={$migrate:function(){Z(this.$$entity.kd,this);return this},$save:function(a){this.$$entity.Cb.save(this,a===true?undefined:a);a===true&&this.$$entity.Cb.ga();return this},$loadFrom:function(a){E.ea(a,this);return this},$saveTo:function(a){E.ea(this,a);return this}};F.ua={"null":M(null),"true":M(true),"false":M(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.h(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}};F.ib={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'};F.prototype={F:function(){return this.index+1<this.text.length?this.text.charAt(this.index+1):false},parse:function(){for(var a=this.i,b=F.ua,c=true;this.index<this.text.length;){var d=this.text.charAt(this.index);if(d=='"'||d=="'"){this.qc(d);c=true}else if(d=="("||d=="["){a.push({index:this.index,text:d});this.index++}else if(d=="{"){c=this.F();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.pc();c=false}else if(this.ha(d)){this.oc();c=false}else if(this.U(d)){this.Va();c=false}else if(this.Tb(d))this.index++;else{c=d+this.F();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},ha:function(a){return"0"<=a&&a<="9"},Tb:function(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"},U:function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"},oc: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.i.push({index:b,text:a,b:function(){return a}})},Va:function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.U(c)||this.ha(c))a+=c;else break;this.index++}c=F.ua[a];if(!c){c=function(d){return d.scope.get(a)};c.T=a}this.i.push({index:b,text:a,b:c})},qc:function(a){var b=this.index,c=this.Db;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=F.ib[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?m.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+"'.";},pc: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.U(this.text.charAt(this.index))){this.Va();c=this.i.pop().text}var e=new RegExp(b,c);this.i.push({index:a,text:b,od: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+"'.";}};D.lb=M(0);D.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)+"'.";},Y:function(){if(this.i.length===0)throw"Unexpected end of expression: "+this.text;return this.i[0]},F: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},a:function(a,b,c,d){if(a=this.F(a,b,c,d)){this.i.shift();return this.fd=a}return false},j:function(a){if(!this.a(a)){var b=this.F();throw"Expecting '"+
-a+"' at column '"+(b.index+1)+"' in '"+this.text+"' got '"+this.text.substring(b.index)+"'.";}},mb:function(a,b){return function(c){return a(c,b(c))}},q:function(a,b,c){return function(d){return b(d,a(d),c(d))}},Ea:function(){return this.i.length>0},G:function(){if(this.i.length!==0)throw"Did not understand '"+this.text.substring(this.i[0].index)+"' while evaluating '"+this.text+"'.";},pa:function(){for(var a=[];;){this.i.length>0&&!this.F("}",")",";","]")&&a.push(this.Ca());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}}},Ca:function(){for(var a=this.m(),b;;)if(b=this.a("|"))a=this.q(a,b.b,this.filter());else return a},filter:function(){return this.wa(m.filter)},L:function(){return this.wa(m.validator)},wa:function(a){for(var b=this.Pb(a),c=[];;)if(this.a(":"))c.push(this.m());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}}},m:function(){return this.vc()},vc:function(){if(this.a("throw")){var a=
-this.ca();return function(b){throw a(b);}}else return this.ca()},ca:function(){var a=this.Ma(),b;if(b=this.a("=")){if(!a.T)throw"Left hand side '"+this.text.substring(0,b.index)+"' of assignment '"+this.text.substring(b.index)+"' is not assignable.";return this.q(function(){return a.T},b.b,this.Ma())}else return a},Ma:function(){for(var a=this.La(),b;;)if(b=this.a("||"))a=this.q(a,b.b,this.La());else return a},La:function(){for(var a=this.Oa(),b;;)if(b=this.a("&&"))a=this.q(a,b.b,this.Oa());else return a},
-Oa:function(){var a;return(a=this.a("!"))?this.mb(a.b,this.ca()):this.Kb()},Kb:function(){for(var a=this.Wa(),b;;)if(b=this.a("==","!="))a=this.q(a,b.b,this.Wa());else return a},Wa:function(){for(var a=this.xa(),b;;)if(b=this.a("<",">","<=",">="))a=this.q(a,b.b,this.xa());else return a},xa:function(){for(var a=this.la(),b;b=this.a("+","-");)a=this.q(a,b.b,this.la());return a},la:function(){for(var a=this.Za(),b;b=this.a("*","/","%");)a=this.q(a,b.b,this.Za());return a},Za:function(){var a;return this.a("+")?
-this.Z():(a=this.a("-"))?this.q(D.lb,a.b,this.la()):this.Z()},Pb: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},Z:function(){var a;if(this.a("(")){a=this.Ca();this.j(")");a=a}else if(this.a("["))a=this.sb();else if(this.a("{"))a=this.object();else if(this.a("{:"))a=this.ya(false);else if(this.a("{("))a=this.ya(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.Ob(a);else if(b.text==="[")a=this.kc(a);else if(b.text===".")a=this.Mb(a);else throw"IMPOSSIBLE";return a},ya:function(a){var b=[];if(a){if(!this.a(")")){for(b.push(this.a().text);this.a(",");)b.push(this.a().text);this.j(")")}this.j(":")}var c=this.pa();this.j("}");return function(d){return function(e){var f=new v(d.scope.p);f.h("$",e);for(var g=0;g<b.length;g++)f.h(b[g],arguments[g]);return c({scope:f})}}},
-Mb:function(a){var b=this.a().text;function c(d){return v.J(a(d),b)}c.T=b;return c},kc:function(a){var b=this.m();this.j("]");if(this.a("=")){var c=this.m();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}},Ob:function(a){var b=[];if(this.Y().text!=")"){do b.push(this.m());while(this.a(","))}this.j(")");return function(c){for(var d=[],e=0;e<b.length;e++)d.push(b[e](c));e=a(c);if(typeof e==="function")return e.apply(c,d);else throw"Expression '"+
-a.T+"' is not a function.";}},sb:function(){var a=[];if(this.Y().text!="]"){do a.push(this.m());while(this.a(","))}this.j("]");return function(b){for(var c=[],d=0;d<a.length;d++)c.push(a[d](b));return c}},object:function(){var a=[];if(this.Y().text!="}"){do{var b=this.a().text;this.j(":");var c=this.m();a.push({Ub:b,value:c})}while(this.a(","))}this.j("}");return function(d){for(var e={},f=0;f<a.length;f++){var g=a[f],h=g.value(d);e[g.Ub]=h}return e}},Jb:function(){for(var a=[];this.Ea();){a.push(this.Ib());
-this.a(";")||this.G()}return function(b){for(var c="",d=0;d<a.length;d++)c+=a[d](b);return c}},Ib:function(){var a=this.a().text,b,c;if(this.a("=")){b=a;a=this.a().text}if(this.a(":"))c=this.Z()(null);return function(d){var e=d.scope.get("$datastore").C(a,c);d.scope.h(a,e);if(b){e=e();e.sa=b;d.scope.h(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+m.String.quote(b)+";};"}else return""}},watch:function(){for(var a=[];this.Ea();){a.push(this.Cc());this.a(";")||this.G()}this.G();
-return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.pb(d.name,d.b)}}},Cc:function(){var a=this.a().text;this.j(":");var b;if(this.Y().text=="{"){this.j("{");b=this.pa();this.j("}")}else b=this.m();return function(){return{name:a,b:b}}}};v.S={};v.J=function(a,b){if(!b)return a;for(var c=b.split("."),d,e=a,f=c.length,g=0;g<f;g++){d=c[g];if(!d.match(/^[\$\w][\$\w\d]*$/))throw"Expression '"+b+"' is not a valid expression for accesing variables.";if(a){e=a;a=a[d]}if(_.isUndefined(a)&&d.charAt(0)==
-"$"){var h=m.Global.typeOf(e);if(d=(h=m[h.charAt(0).toUpperCase()+h.substring(1)])?h[[d.substring(1)]]:undefined)return a=_.bind(d,e,e)}}if(typeof a==="function"&&!a.Hc)return Da(e,a);return a};v.prototype={d:function(){var a=this;this.Nb();_.each(this.cb,function(b){a.k(b,"",{},function(){this.d(a)})})},rb:function(a){a&&this.cb.push(a)},Sb:function(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c!="."&&!F.prototype.U(c))return false}return true},get:function(a){return v.J(this.p,a)},h:function(a,
-b){a=a.split(".");for(var c=this.p,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},l:function(a,b){this.eval(a+"="+w(b))},eval:function(a,b){var c=v.S[a];if(!c){var d=new D(a);c=d.pa();d.G();v.S[a]=c}b=b||{};b.scope=this;return c(b)},k:function(a,b,c,d,e){try{var f=this.eval(b,c);if(a.u){a.u=false;k(a.view).removeClass("ng-exception").removeAttr("ng-error")}d&&d.apply(a,[f]);return true}catch(g){W("Eval Widget Error:",g);b=w(g,true);a.u=true;k(a.view).addClass("ng-exception").attr("ng-error",
-b);e&&e.apply(a,[g,b]);return false}},Ac:function(a,b){var c=v.S[a];if(!c){c=(new D(a)).L();v.S[a]=c}a={scope:this};return c(a)(a,b)},C:function(a){return(new D(a)).Jb()({scope:this})},Yb:function(a){this.p.Ic.push(a)},watch:function(a){var b=this;(new D(a)).watch()({scope:this,pb:function(c,d){b.qb(c,function(e,f){try{return d({scope:b},e,f)}catch(g){alert(g)}})}})},qb:function(a,b){var c=this.qa[a];if(!c){c={Ha:[],m:a};this.qa[a]=c}c.Ha.push(b)},Nb:function(){var a=this,b=false;o(this.qa,function(c){var d=
-a.eval(c.m);if(d!==c.c){o(c.Ha,function(e){e(d,c.c);b=true});c.c=d}});return b}};ka.prototype={ub:function(a){return ba.Gb(a)},K:function(a,b,c,d){var e=this.zc+this.$b++;ca[e]=function(h){delete m[e];d(200,h)};a={Bd:b,rd:a,sd:c};a=this.ub(w(a));b=Math.ceil(a.length/this.ka);c=this.url+"/$/"+e+"/"+b+"/";for(var f=0;f<b;f++){var g=a.substr(f*this.ka,this.ka);this.getScript(c+(f+1)+"?h="+g,n)}}};$.Nc="$DATASET:";$.prototype={K:J()};la.prototype={K:function(a,b,c,d){var e=this;this.status.vb(c);this.Eb.K(a,
-b,c,function(){e.status.Hb();try{d.apply(this,arguments)}catch(f){alert(w(f))}e.update()})}};ma.prototype={fetchCurrentUser:function(a){var b=this;this.oa.K("GET","/account.json",{},function(c,d){b.current=d.user;a(d.Dd)})},logout:function(a){var b=this;this.da.Xb(function(){delete b.current;(a||n)()})},login:function(a){var b=this;this.da.Na(function(){b.nd(function(){(a||n)()})})},notAuthorized:function(){this.da.Qa()}};o({regexp:function(a,b,c){return a.match(b)?null:c||"Value does not match expected format "+
-b+"."},number:function(a,b,c){var d=1*a;if(d==a){if(typeof b!="undefined"&&d<b)return"Value can not be less than "+b+".";if(typeof b!="undefined"&&d>c)return"Value can not be greater than "+c+".";return null}else return"Value is not a number."},integer:function(a,b,c){b=Ba.number(a,b,c);if(b===null&&a!=Math.round(a))return"Value is not a whole number.";return b},date:function(a){if(a.match(/^\d\d?\/\d\d?\/\d\d\d\d$/))return null;return"Value is not a date. (Expecting format: 12/31/2009)."},ssn:function(a){if(a.match(/^\d\d\d-\d\d-\d\d\d\d$/))return null;
-return"SSN needs to be in 999-99-9999 format."},email:function(a){if(a.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/))return null;return"Email needs to be in username@host.com format."},phone:function(a){if(a.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/))return null;if(a.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/))return null;return"Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly."},url:function(a){if(a.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/))return null;
-return"URL needs to be in http://server[:port]/path format."},json:function(a){try{P(a);return null}catch(b){return b.toString()}}},function(a,b){Ba[b]=a});ja.prototype={Ab: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 La(a[0],e);f="click";g=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new na(a[0],e);f="keyup change"}else if(d=="checkbox"){c=new oa(a[0],
-e);f="click"}else if(d=="radio"){c=new ra(a[0],e);f="click"}else if(d=="select-one")c=new pa(a[0],e);else if(d=="select-multiple")c=new qa(a[0],e);else if(d=="file")c=this.Bb(a,e);else throw"Unknown type: "+d;a.data("controller",c);var h=b.get("$updateView");k(c.view,":input").bind(f,function(){if(c.e(b)){var i=k(c.view).attr("ng-action")||"";b.k(c,i)&&h(b)}return g});return c},Bb:function(a){var b="__uploadWidget_"+this.ac++,c=K.template(b);a.after(c);b=this.za({data:this.aa+"/admin/ServerAPI.swf",
-width:"95",height:"20",align:"top",Ed:"transparent"},{pd:"uploadWidgetId="+b,Oc:"always"},b);a.remove();a=new K(c,a[0].name,b,this.aa+"/data/"+this.fa);k(b).data("controller",a);return a}};K.dispatchEvent=function(a,b,c){a=y.getElementById(a);a=k(a).data("controller");K.prototype["_on_"+b].apply(a,c)};K.template=function(a){return k('<span class="ng-upload-widget"><input type="checkbox" ng-non-bindable="true"/><object id="'+a+'" /><a></a><span/></span>')};K.prototype={e:function(a){var b=this.view.find("input").attr("checked")?
-this.value:null;if(this.c===b)return false;else{a.h(this.Xa,b);return true}},d:function(a){if((a=a.get(this.Xa))&&this.value!==a){this.value=a;this.view.find("a").attr("href",this.value.url).text(this.value.text);this.view.find("span").text(m.filter.bytes(this.value.size))}this.view.find("input").attr("checked",!!a)}};Q.prototype={e:M(true),d:n};Q.Rb=new Q;var La=Q;na.prototype={e:function(a){var b=this.view.value;if(this.c===b)return false;else{a.l(this.exp,b);this.c=b;return true}},d:function(a){var b=
-this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.o;a.l(this.exp,c)}c=c?c:"";if(this.c!=c)this.c=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.rc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.L&&c){e=a.Ac(this.L,c);d=!!e}if(this.Ga!==e){this.Ga=d;if(e!==null){b.setAttribute("ng-error",e);a.Yb(this)}k(b).toggleClass("ng-validation-error",d)}}};oa.prototype={e:function(a){var b=this.view;b=b.checked?b.value:"";if(this.c===b)return false;else{a.l(this.exp,b);
-this.c=b;return true}},d:function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.o;a.l(this.exp,c)}b.checked=b.value==""+c}};pa.prototype={e:function(a){if(this.view.selectedIndex<0)a.l(this.exp,null);else{var b=this.view.value;if(this.c===b)return false;else{a.l(this.exp,b);this.c=b;return true}}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.o;a.l(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};qa.prototype={selected:function(){for(var a=
-[],b=this.view.options,c=0;c<b.length;c++){var d=b[c];d.selected&&a.push(d.value)}return a},e:function(a){var b=this.selected();if(this.c===b)return false;else{a.l(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.o;a.l(this.exp,c)}if(c!==this.c){a=b.options;for(b=0;b<a.length;b++){var d=a[b];d.selected=_.include(c,d.value)}this.c=c}}};ra.prototype={e:function(a){var b=this.view;if(this.ia)return false;else{b.checked=true;this.c=a.l(this.exp,
-this.Fa);return this.ia=true}},d:function(a){var b=this.view,c=a.get(this.exp);if(this.o&&typeof c==="undefined"){c=this.o;a.l(this.exp,c)}if(this.c!=c){this.ia=b.checked=this.Fa==""+c;this.c=c}}};L.Ya=function(a){switch(typeof a){case "string":case "boolean":case "number":return C(a);case "function":return L.Ya(a());case "object":if(a&&a.tagName&&a.nodeName&&a.ownerDocument&&a.removeAttribute)return ga(a);else if(a instanceof m.filter.g){switch(typeof a.html){case "string":case "number":return a.html;
-case "function":return a.html();case "object":if(a.html&&a.html.tagName&&a.html.nodeName&&a.html.ownerDocument&&a.html.removeAttribute)return ga(a.html);default:break}switch(typeof a.text){case "string":case "number":return C(a.text);case "function":return C(a.text());default:break}}if(a===null)return"";return C(w(a,true));default:return""}};L.prototype={e:n,d:function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var f=c[e],g=x.H(f);if(g){a.k(this,g,this.tc,function(h){b.push(L.Ya(h))},function(h,
-i){fa(this.view,i)});if(this.u)return}else b.push(C(f))}fa(this.view,b.join(""))}};sa.prototype={e:n,d:function(a){var b=k(this.view),c=this.tb;if(this.u){this.u=false;b.removeClass("ng-exception").removeAttr("ng-error")}var d=b.is("img");for(var e in c){for(var f=x.X(c[e]),g=[],h=0;h<f.length;h++){var i=x.H(f[h]);if(i)try{var j=a.eval(i,{element:b[0],attrName:e});if(j&&(j.constructor!==array||j.length!==0))g.push(j)}catch(l){this.u=true;W("BindAttrUpdater",l);i=w(l,true);g.push("["+i+"]");b.addClass("ng-exception").attr("ng-error",
-i)}else g.push(f[h])}f=g.length?g.join(""):null;if(d&&e=="src"&&!f)f=a.get("config.server")+"/images/blank.gif";b.attr(e,f)}}};ta.prototype={e:n,d:function(a){a.k(this,this.exp)}};ua.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){var c=k(this.view);Y(b)?c.hide():c.show()})}};va.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){var c=k(this.view);Y(b)?c.show():c.hide()})}};wa.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){if(b!==null&&b!==undefined)this.view.className=
-b})}};xa.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===1)})}};ya.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===0)})}};za.prototype={e:n,d:function(a){a.k(this,this.exp,{},function(b){k(this.view).attr("style","").css(b)})}};Aa.prototype={e:n,d:function(a){a.k(this,this.V,{},function(b){var c=this;if(!b){b=[];a.Sb(this.V)&&a.h(this.V,b)}var d=b.length,e=this.children.length,
-f=this.view,g=0,h=null,i=this.Vb,j=this.Bc,l=0;o(b,function(B,s){if(l<e){h=c.children[l];h.scope.h(j,B)}else{var t=new v(a.p,c.prefix+j+" in "+c.V+"["+l+"]");t.h("$index",l);i&&t.h(i,s);t.h(j,B);h={scope:t,element:c.template(t,c.prefix,l)};f.after(h.element);c.children.push(h)}f=h.element;B=(new Date).getTime();h.scope.d();g+=(new Date).getTime()-B;l++});for(b=e;b>d;--b){var p=this.children.pop().element[0];p.parentNode.removeChild(p)}if(h&&h.element[0].nodeName==="OPTION")if(d=k(h.element[0].parentNode).data("controller")){d.c=
-undefined;d.d(a)}})}};A.va="mouseleave mouseout click dblclick keypress keyup";A.lc=function(){A.ma();var a=k(this);a.bind(A.va,A.ma);var b=a.position(),c=y.documentElement,d=(self.innerWidth||c&&c.clientWidth||y.body.clientWidth)-b.left;c=a.hasClass("ng-exception")?"EXCEPTION:":"Validation error...";a=a.attr("ng-error");d=d>375?"left":"right";c=k("<div id='ng-callout' style='width:300px'><div class='ng-arrow-"+d+"'/><div class='ng-title'>"+c+"</div><div class='ng-content'>"+a+"</div></div>");k("body").append(c);
-if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.ma=function(){k("#ng-callout").unbind(A.va,A.ma).remove();return true};A.prototype={bind:function(){this.B.find(".ng-validation-error,.ng-exception").live("mouseover",A.lc)}};S.hb='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';S.prototype={vb:function(){this.$===0&&this.Ka.show();this.$++},Hb:function(){this.$--;this.$===0&&
-this.Ka.hide("fold")}}})(window,document);
+b){return b?undefined:a},googleChartApi:B(function(a,b,c,d){b=b||{};a={cht:a,chco:u.collect(b,"color"),chtt:u.title(b),chdl:u.collect(b,"label"),chd:u.values(b),chf:"bg,s,FFFFFF00"};if(_.isArray(b.xLabels)){a.chxt="x";a.chxl="0:|"+b.Oc.join("|")}return u.encode(a,c,d)},{values:function(a){var b=[];p(a.series||[],function(c){var d=[];p(c.values||[],function(e){d.push(e)});b.push(d.join(","))});a=b.join("|");return a===""?null:"t:"+a},title:function(a){var b=[];a=a.title||[];p(_.isArray(a)?a:[a],function(c){b.push(encodeURIComponent(c))});
+return b.join("|")},collect:function(a,b){var c=[],d=0;p(a.series||[],function(e){var f=[];e=e[b]||[];p(_.isArray(e)?e:[e],function(g){f.push(encodeURIComponent(g));d++});c.push(f.join("|"))});return d?c.join(","):null},encode:function(a,b,c){b=b||200;c=c||b;var d="http://chart.apis.google.com/chart?",e=[];a.chs=b+"x"+c;p(a,function(f,g){f&&e.push(g+"="+f)});e.sort();d+=e.join("&");return new r.g({url:d,html:'<img width="'+b+'" height="'+c+'" src="'+d+'"/>'})}}),qrcode:function(a,b,c){return u.encode({cht:"qr",
+chl:encodeURIComponent(a)},b,c)},chart:{pie:function(a,b,c){return u("p",a,b,c)},pie3d:function(a,b,c){return u("p3",a,b,c)},pieConcentric:function(a,b,c){return u("pc",a,b,c)},barHorizontalStacked:function(a,b,c){return u("bhs",a,b,c)},barHorizontalGrouped:function(a,b,c){return u("bhg",a,b,c)},barVerticalStacked:function(a,b,c){return u("bvs",a,b,c)},barVerticalGrouped:function(a,b,c){return u("bvg",a,b,c)},line:function(a,b,c){return u("lc",a,b,c)},sparkline:function(a,b,c){return u("ls",a,b,c)},
+scatter:function(a,b,c){return u("s",a,b,c)}},html:function(a){return new r.g({html:a})},linky:function(a){if(!a)return a;for(var b=/(ftp|http|https|mailto):\/\/([^\(\)|\s]+)/,c,d=a,e=[];c=d.match(b);){c=c[0].replace(/[\.\;\,\(\)\{\}\<\>]$/,"");var f=d.indexOf(c);e.push(D(d.substr(0,f)));e.push('<a href="'+c+'">');e.push(c);e.push("</a>");d=d.substring(f+c.length)}e.push(D(d));return new r.g({text:a,html:e.join("")})}},function(a,b){r[b]=a});u=r.googleChartApi;array=[].constructor;m.toJson=w;m.fromJson=
+M;H.ha=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]}};B(H.prototype,{$migrate:function(){V(this.$$entity.defaults,this);return this},$merge:function(a){V(a,this);return this},$save:function(a){this.$$entity.k.save(this,a===true?undefined:a);a===true&&this.$$entity.k.U();return this},$delete:function(a){this.$$entity.k.remove(this,a===
+true?undefined:a);a===true&&this.$$entity.k.U();return this},$loadById:function(a,b){this.$$entity.k.load(this,a,b);return this},$loadFrom:function(a){H.ha(a,this);return this},$saveTo:function(a){H.ha(this,a);return this}});F.ra={"null":P(null),"true":P(true),"false":P(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.h(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}};F.$a={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'};F.prototype={H:function(){return this.index+
+1<this.text.length?this.text.charAt(this.index+1):false},parse:function(){for(var a=this.i,b=F.ra,c=true;this.index<this.text.length;){var d=this.text.charAt(this.index);if(d=='"'||d=="'"){this.ic(d);c=true}else if(d=="("||d=="["){a.push({index:this.index,text:d});this.index++}else if(d=="{"){c=this.H();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.hc();c=false}else if(this.isNumber(d)){this.gc();c=false}else if(this.W(d)){this.Qa();c=false}else if(this.Kb(d))this.index++;else{c=d+this.H();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},isNumber:function(a){return"0"<=a&&a<="9"},Kb:function(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"},W:function(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"},gc:function(){for(var a="",b=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.isNumber(c))a+=c;else break;this.index++}a=1*a;this.i.push({index:b,text:a,b:function(){return a}})},Qa:function(){for(var a="",b=this.index;this.index<
+this.text.length;){var c=this.text.charAt(this.index);if(c=="."||this.W(c)||this.isNumber(c))a+=c;else break;this.index++}c=F.ra[a];if(!c){c=function(d){return d.scope.get(a)};c.V=a}this.i.push({index:b,text:a,b:c})},ic:function(a){var b=this.index,c=this.ub;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=F.$a[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?m.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+"'.";},hc: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.W(this.text.charAt(this.index))){this.Qa();c=this.i.pop().text}var e=new RegExp(b,c);this.i.push({index:a,text:b,Kc: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+"'.";}};E.cb=P(0);E.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)+"'.";
+},aa:function(){if(this.i.length===0)throw"Unexpected end of expression: "+this.text;return this.i[0]},H: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},a:function(a,b,c,d){if(a=this.H(a,b,c,d)){this.i.shift();return this.Dc=a}return false},j:function(a){if(!this.a(a)){var b=this.H();throw"Expecting '"+a+"' at column '"+(b.index+1)+"' in '"+this.text+"' got '"+this.text.substring(b.index)+"'.";}},eb:function(a,b){return function(c){return a(c,
+b(c))}},z:function(a,b,c){return function(d){return b(d,a(d),c(d))}},Aa:function(){return this.i.length>0},K:function(){if(this.i.length!==0)throw"Did not understand '"+this.text.substring(this.i[0].index)+"' while evaluating '"+this.text+"'.";},pa:function(){for(var a=[];;){this.i.length>0&&!this.H("}",")",";","]")&&a.push(this.ya());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}}},ya:function(){for(var a=this.q(),b;;)if(b=this.a("|"))a=this.z(a,
+b.b,this.filter());else return a},filter:function(){return this.ta(m.filter)},P:function(){return this.ta(m.validator)},ta:function(a){for(var b=this.Gb(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}}},q:function(){return this.nc()},nc:function(){if(this.a("throw")){var a=this.fa();return function(b){throw a(b);}}else return this.fa()},fa:function(){var a=this.Ja(),b;if(b=this.a("=")){if(!a.V)throw"Left hand side '"+
+this.text.substring(0,b.index)+"' of assignment '"+this.text.substring(b.index)+"' is not assignable.";return this.z(function(){return a.V},b.b,this.Ja())}else return a},Ja:function(){for(var a=this.Ia(),b;;)if(b=this.a("||"))a=this.z(a,b.b,this.Ia());else return a},Ia:function(){for(var a=this.Ka(),b;;)if(b=this.a("&&"))a=this.z(a,b.b,this.Ka());else return a},Ka:function(){var a;return(a=this.a("!"))?this.eb(a.b,this.fa()):this.Bb()},Bb:function(){for(var a=this.Ra(),b;;)if(b=this.a("==","!="))a=
+this.z(a,b.b,this.Ra());else return a},Ra:function(){for(var a=this.ua(),b;;)if(b=this.a("<",">","<=",">="))a=this.z(a,b.b,this.ua());else return a},ua:function(){for(var a=this.ma(),b;b=this.a("+","-");)a=this.z(a,b.b,this.ma());return a},ma:function(){for(var a=this.Ta(),b;b=this.a("*","/","%");)a=this.z(a,b.b,this.Ta());return a},Ta:function(){var a;return this.a("+")?this.ba():(a=this.a("-"))?this.z(E.cb,a.b,this.ma()):this.ba()},Gb: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},ba:function(){var a;if(this.a("(")){a=this.ya();this.j(")");a=a}else if(this.a("["))a=this.lb();else if(this.a("{"))a=this.object();else if(this.a("{:"))a=this.wa(false);else if(this.a("{("))a=this.wa(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.Fb(a);else if(b.text===
+"[")a=this.cc(a);else if(b.text===".")a=this.Db(a);else throw"IMPOSSIBLE";return a},wa:function(a){var b=[];if(a){if(!this.a(")")){for(b.push(this.a().text);this.a(",");)b.push(this.a().text);this.j(")")}this.j(":")}var c=this.pa();this.j("}");return function(d){return function(e){var f=new v(d.scope.w);f.h("$",e);for(var g=0;g<b.length;g++)f.h(b[g],arguments[g]);return c({scope:f})}}},Db:function(a){var b=this.a().text;function c(d){return v.N(a(d),b)}c.V=b;return c},cc:function(a){var b=this.q();
+this.j("]");if(this.a("=")){var c=this.q();return function(d){return a(d)[b(d)]=c(d)}}else return function(d){var e=a(d);d=b(d);return e?e[d]:undefined}},Fb:function(a){var b=[];if(this.aa().text!=")"){do b.push(this.q());while(this.a(","))}this.j(")");return function(c){for(var d=[],e=0;e<b.length;e++)d.push(b[e](c));e=a(c);if(typeof e==="function")return e.apply(c,d);else throw"Expression '"+a.V+"' is not a function.";}},lb:function(){var a=[];if(this.aa().text!="]"){do a.push(this.q());while(this.a(","))
+}this.j("]");return function(b){for(var c=[],d=0;d<a.length;d++)c.push(a[d](b));return c}},object:function(){var a=[];if(this.aa().text!="}"){do{var b=this.a().text;this.j(":");var c=this.q();a.push({Lb:b,value:c})}while(this.a(","))}this.j("}");return function(d){for(var e={},f=0;f<a.length;f++){var g=a[f],h=g.value(d);e[g.Lb]=h}return e}},Ab:function(){for(var a=[];this.Aa();){a.push(this.zb());this.a(";")||this.K()}return function(b){for(var c="",d=0;d<a.length;d++)c+=a[d](b);return c}},zb:function(){var a=
+this.a().text,b,c;if(this.a("=")){b=a;a=this.a().text}if(this.a(":"))c=this.ba()(null);return function(d){var e=d.k.F(a,c);d.scope.h(a,e);if(b){e=e();e.$$anchor=b;d.scope.h(b,e);return"$anchor."+b+":{"+b+"="+a+".load($anchor."+b+");"+b+".$$anchor="+m.String.quote(b)+";};"}else return""}},watch:function(){for(var a=[];this.Aa();){a.push(this.vc());this.a(";")||this.K()}this.K();return function(b){for(var c=0;c<a.length;c++){var d=a[c](b);b.ib(d.name,d.b)}}},vc:function(){var a=this.a().text;this.j(":");
+var b;if(this.aa().text=="{"){this.j("{");b=this.pa();this.j("}")}else b=this.q();return function(){return{name:a,b:b}}}};v.T={};v.N=function(a,b){if(!b)return a;for(var c=b.split("."),d,e=a,f=c.length,g=0;g<f;g++){d=c[g];if(!d.match(/^[\$\w][\$\w\d]*$/))throw"Expression '"+b+"' is not a valid expression for accesing variables.";if(a){e=a;a=a[d]}if(_.isUndefined(a)&&d.charAt(0)=="$"){var h=m.Global.typeOf(e);if(d=(h=m[h.charAt(0).toUpperCase()+h.substring(1)])?h[[d.substring(1)]]:undefined)return a=
+_.bind(d,e,e)}}if(typeof a==="function"&&!a.$$factory)return Fa(e,a);return a};v.prototype={d:function(){var a=this;this.Eb();_.each(this.Xa,function(b){a.l(b,"",{},function(){this.d(a)})})},kb:function(a){a&&this.Xa.push(a)},Jb:function(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c!="."&&!F.prototype.W(c))return false}return true},get:function(a){return v.N(this.w,a)},h:function(a,b){a=a.split(".");for(var c=this.w,d=0;a.length>1;d++){var e=a.shift(),f=c[e];if(!f){f={};c[e]=f}c=f}return c[a.shift()]=
+b},o:function(a,b){this.eval(a+"="+w(b))},eval:function(a,b){var c=v.T[a];if(!c){var d=new E(a);c=d.pa();d.K();v.T[a]=c}b=b||{};b.scope=this;return c(b)},l:function(a,b,c,d,e){try{var f=this.eval(b,c);if(a.B){a.B=false;k(a.view).removeClass("ng-exception").removeAttr("ng-error")}d&&d.apply(a,[f]);return true}catch(g){Z("Eval Widget Error:",g);b=w(g,true);a.B=true;k(a.view).addClass("ng-exception").attr("ng-error",b);e&&e.apply(a,[g,b]);return false}},tc:function(a,b){var c=v.T[a];if(!c){c=(new E(a)).P();
+v.T[a]=c}a={scope:this};return c(a)(a,b)},F:function(a,b){return(new E(a)).Ab()({scope:this,k:b})},Qb:function(a){this.w.$invalidWidgets.push(a)},watch:function(a){var b=this;(new E(a)).watch()({scope:this,ib:function(c,d){b.jb(c,function(e,f){try{return d({scope:b},e,f)}catch(g){alert(g)}})}})},jb:function(a,b){var c=this.qa[a];if(!c){c={Ea:[],q:a};this.qa[a]=c}c.Ea.push(b)},Eb:function(){var a=this,b=false;p(this.qa,function(c){var d=a.eval(c.q);if(d!==c.c){p(c.Ea,function(e){e(d,c.c);b=true});
+c.c=d}});return b}};ka.prototype={nb:function(a){return da.xb(a)},O:function(a,b,c,d){var e=this.sc+this.Rb++;a=this.nb(w({u:b,m:a,p:c}));b=Math.ceil(a.length/this.la);c=this.url+"/$/"+e+"/"+b+"/";O[e]=function(h){delete O[e];d(200,h)};for(var f=0;f<b;f++){var g=a.substr(f*this.la,this.la);this.getScript(c+(f+1)+"?h="+g,n)}}};ba.Ac="$DATASET:";ba.prototype={O:K()};la.prototype={O:function(a,b,c,d){var e=this;this.status.ob(c);this.vb.O(a,b,c,function(){e.status.yb();try{d.apply(this,arguments)}catch(f){alert(w(f))}e.update()})}};
+B(ma.prototype,{fetchCurrentUser:function(a){var b=this;this.mc.O("GET","/account.json",{},function(c,d){b.current=d.user;a(d.Nc)})},logout:function(a){var b=this;this.ga.Pb(function(){delete b.current;(a||n)()})},login:function(a){var b=this;this.ga.Ob(function(){b.fetchCurrentUser(function(){(a||n)()})})},notAuthorized:function(){this.ga.bc()}});p({regexp:function(a,b,c){return a.match(b)?null:c||"Value does not match expected format "+b+"."},number:function(a,b,c){var d=1*a;if(d==a){if(typeof b!=
+"undefined"&&d<b)return"Value can not be less than "+b+".";if(typeof b!="undefined"&&d>c)return"Value can not be greater than "+c+".";return null}else return"Value is not a number."},integer:function(a,b,c){b=Ba.number(a,b,c);if(b===null&&a!=Math.round(a))return"Value is not a whole number.";return b},date:function(a){if(a.match(/^\d\d?\/\d\d?\/\d\d\d\d$/))return null;return"Value is not a date. (Expecting format: 12/31/2009)."},ssn:function(a){if(a.match(/^\d\d\d-\d\d-\d\d\d\d$/))return null;return"SSN needs to be in 999-99-9999 format."},
+email:function(a){if(a.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/))return null;return"Email needs to be in username@host.com format."},phone:function(a){if(a.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/))return null;if(a.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/))return null;return"Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly."},url:function(a){if(a.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/))return null;
+return"URL needs to be in http://server[:port]/path format."},json:function(a){try{M(a);return null}catch(b){return b.toString()}}},function(a,b){Ba[b]=a});ja.prototype={rb: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 La(a[0],e);f="click";g=false}else if(d=="text"||d=="textarea"||d=="hidden"||d=="password"){c=new na(a[0],e);f="keyup change"}else if(d=="checkbox"){c=new oa(a[0],
+e);f="click"}else if(d=="radio"){c=new ra(a[0],e);f="click"}else if(d=="select-one")c=new pa(a[0],e);else if(d=="select-multiple")c=new qa(a[0],e);else if(d=="file")c=this.sb(a,e);else throw"Unknown type: "+d;a.data("controller",c);var h=b.get("$updateView");k(c.view,":input").bind(f,function(){if(c.e(b)){var i=k(c.view).attr("ng-action")||"";b.l(c,i)&&h(b)}return g});return c},sb:function(a){var b="__uploadWidget_"+this.Sb++,c=T.template(b);a.after(c);b=this.tb({data:this.da+"/admin/ServerAPI.swf",
+width:"95",height:"20",align:"top",wmode:"transparent"},{flashvars:"uploadWidgetId="+b,allowScriptAccess:"always"},b);a.remove();a=new T(c,a[0].name,b,this.da+"/data/"+this.ia);k(b).data("controller",a);return a}};O.flashEvent=function(a,b,c){a=y.getElementById(a);a=k(a);var d=a.data("controller");T.prototype[b].apply(d,c);_.defer(a.scope().get("$updateView"))};T.template=function(a){return k('<span class="ng-upload-widget"><input type="checkbox" ng-non-bindable="true"/><object id="'+a+'" /><a></a><span/></span>')};
+B(T.prototype,{cancel:n,complete:n,httpStatus:function(a){alert("httpStatus:"+this.I+" status:"+a)},ioError:function(){alert("ioError:"+this.I)},open:function(){alert("open:"+this.I)},progress:n,securityError:function(){alert("securityError:"+this.I)},uploadCompleteData:function(a){a=M(a);a.url=this.va+"/"+a.id+"/"+a.text;this.view.find("input").attr("checked",true);var b=this.view.scope();this.value=a;this.e(b);this.value=null},select:function(a,b){this.name=a;this.view.find("a").text(a).attr("href",
+a);this.view.find("span").text(m.filter.bytes(b));this.upload()},e:function(a){var b=this.view.find("input").attr("checked")?this.value:null;if(this.c===b)return false;else{a.h(this.I,b);return true}},d:function(a){if((a=a.get(this.I))&&this.value!==a){this.value=a;this.view.find("a").attr("href",this.value.url).text(this.value.text);this.view.find("span").text(m.filter.bytes(this.value.size))}this.view.find("input").attr("checked",!!a)},upload:function(){this.name&&this.qc.uploadFile(this.va)}});
+R.prototype={e:P(true),d:n};R.Ib=new R;var La=R;na.prototype={e:function(a){var b=this.view.value;if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}c=c?c:"";if(this.c!=c)this.c=b.value=c;var d=false;b.removeAttribute("ng-error");if(this.jc)d=!(c&&c.length>0);var e=d?"Required Value":null;if(!d&&this.P&&c){e=a.tc(this.P,c);d=!!e}if(this.Ca!==e){this.Ca=d;if(e!==null){b.setAttribute("ng-error",
+e);a.Qb(this)}k(b).toggleClass("ng-validation-error",d)}}};oa.prototype={e:function(a){var b=this.view;b=b.checked?b.value:"";if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.eval(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}b.checked=b.value==""+c}};pa.prototype={e:function(a){if(this.view.selectedIndex<0)a.o(this.exp,null);else{var b=this.view.value;if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}}},d:function(a){var b=
+this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(c!==this.c){b.value=c?c:"";this.c=c}}};qa.prototype={selected:function(){for(var a=[],b=this.view.options,c=0;c<b.length;c++){var d=b[c];d.selected&&a.push(d.value)}return a},e:function(a){var b=this.selected();if(this.c===b)return false;else{a.o(this.exp,b);this.c=b;return true}},d:function(a){var b=this.view,c=a.get(this.exp);if(typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(c!==this.c){a=b.options;for(b=0;b<
+a.length;b++){var d=a[b];d.selected=_.include(c,d.value)}this.c=c}}};ra.prototype={e:function(a){var b=this.view;if(this.ja)return false;else{b.checked=true;this.c=a.o(this.exp,this.Ba);return this.ja=true}},d:function(a){var b=this.view,c=a.get(this.exp);if(this.s&&typeof c==="undefined"){c=this.s;a.o(this.exp,c)}if(this.c!=c){this.ja=b.checked=this.Ba==""+c;this.c=c}}};N.Sa=function(a){switch(typeof a){case "string":case "boolean":case "number":return D(a);case "function":return N.Sa(a());case "object":if(a&&
+a.tagName&&a.nodeName&&a.ownerDocument&&a.removeAttribute)return ha(a);else if(a instanceof m.filter.g){switch(typeof a.html){case "string":case "number":return a.html;case "function":return a.html();case "object":if(a.html&&a.html.tagName&&a.html.nodeName&&a.html.ownerDocument&&a.html.removeAttribute)return ha(a.html);default:break}switch(typeof a.text){case "string":case "number":return D(a.text);case "function":return D(a.text());default:break}}if(a===null)return"";return D(w(a,true));default:return""}};
+N.prototype={e:n,d:function(a){for(var b=[],c=this.exp,d=c.length,e=0;e<d;e++){var f=c[e],g=x.L(f);if(g){a.l(this,g,this.lc,function(h){b.push(N.Sa(h))},function(h,i){ga(this.view,i)});if(this.B)return}else b.push(D(f))}ga(this.view,b.join(""))}};sa.prototype={e:n,d:function(a){var b=k(this.view),c=this.mb;if(this.B){this.B=false;b.removeClass("ng-exception").removeAttr("ng-error")}var d=b.is("img");for(var e in c){for(var f=x.Z(c[e]),g=[],h=0;h<f.length;h++){var i=x.L(f[h]);if(i)try{var j=a.eval(i,
+{element:b[0],attrName:e});if(j&&(j.constructor!==array||j.length!==0))g.push(j)}catch(l){this.B=true;Z("BindAttrUpdater",l);i=w(l,true);g.push("["+i+"]");b.addClass("ng-exception").attr("ng-error",i)}else g.push(f[h])}f=g.length?g.join(""):null;if(d&&e=="src"&&!f)f=a.get("$config.blankImage");b.attr(e,f)}}};ta.prototype={e:n,d:function(a){a.l(this,this.exp)}};ua.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=k(this.view);$(b)?c.hide():c.show()})}};va.prototype={e:n,d:function(a){a.l(this,
+this.exp,{},function(b){var c=k(this.view);$(b)?c.show():c.hide()})}};wa.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){if(b!==null&&b!==undefined)this.view.className=b})}};xa.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===1)})}};ya.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){var c=a.get("$index");k(this.view).toggleClass(b,c%2===0)})}};za.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){k(this.view).attr("style",
+"").css(b)})}};Aa.prototype={e:n,d:function(a){a.l(this,this.X,{},function(b){var c=this;if(!b){b=[];a.Jb(this.X)&&a.h(this.X,b)}var d=b.length,e=this.children.length,f=this.view,g=0,h=null,i=this.Mb,j=this.uc,l=0;p(b,function(C,s){if(l<e){h=c.children[l];h.scope.h(j,C)}else{var t=new v(a.w,c.prefix+j+" in "+c.X+"["+l+"]");t.h("$index",l);i&&t.h(i,s);t.h(j,C);h={scope:t,element:c.template(t,c.prefix,l)};f.after(h.element);c.children.push(h)}f=h.element;C=(new Date).getTime();h.scope.d();g+=(new Date).getTime()-
+C;l++});for(b=e;b>d;--b){var q=this.children.pop().element[0];q.parentNode.removeChild(q)}if(h&&h.element[0].nodeName==="OPTION")if(d=k(h.element[0].parentNode).data("controller")){d.c=undefined;d.d(a)}})}};A.sa="mouseleave mouseout click dblclick keypress keyup";A.dc=function(){A.na();var a=k(this);a.bind(A.sa,A.na);var b=a.position(),c=y.documentElement,d=(self.innerWidth||c&&c.clientWidth||y.body.clientWidth)-b.left;c=a.hasClass("ng-exception")?"EXCEPTION:":"Validation error...";a=a.attr("ng-error");
+d=d>375?"left":"right";c=k("<div id='ng-callout' style='width:300px'><div class='ng-arrow-"+d+"'/><div class='ng-title'>"+c+"</div><div class='ng-content'>"+a+"</div></div>");k("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.na=function(){k("#ng-callout").unbind(A.sa,A.na).remove();return true};A.prototype={bind:function(){this.D.find(".ng-validation-error,.ng-exception").live("mouseover",
+A.dc)}};W.Za='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';W.prototype={ob:function(){this.ca===0&&this.Ha.show();this.ca++},yb:function(){this.ca--;this.ca===0&&this.Ha.hide("fold")}}})(window,document);
diff --git a/angular.js b/angular.js
index 2a8d6008..09b738ed 100644
--- a/angular.js
+++ b/angular.js
@@ -185,11 +185,10 @@ if (typeof Node == 'undefined') {
function noop() {}
if (!window['console']) window['console']={'log':noop, 'error':noop};
-var consoleNode,
+var consoleNode, msie,
+ jQuery = window['jQuery'] || window['$'], // weirdness to make IE happy
foreach = _.each,
extend = _.extend,
- jQuery = window['jQuery'],
- msie = jQuery['browser']['msie'],
angular = window['angular'] || (window['angular'] = {}),
angularValidator = angular['validator'] || (angular['validator'] = {}),
angularFilter = angular['filter'] || (angular['filter'] = {}),
@@ -377,7 +376,6 @@ UrlWatcher.prototype = {
self.setTimeout(pull, self.delay);
};
pull();
- return this;
},
set: function(url) {
@@ -436,19 +434,20 @@ function exposeMethods(obj, methods){
function wireAngular(element, config) {
var widgetFactory = new WidgetFactory(config['server'], config['database']);
- var binder = new Binder(element[0], widgetFactory, config['location'], config);
- var controlBar = new ControlBar(element.find('body'), config.server);
+ var binder = new Binder(element[0], widgetFactory, datastore, config['location'], config);
+ var controlBar = new ControlBar(element.find('body'), config['server'], config['database']);
var onUpdate = function(){binder.updateView();};
- var server = config.database=="$MEMORY" ?
- new FrameServer(this.window) :
- new Server(config.server, jQuery.getScript);
+ var server = config['database'] =="$MEMORY" ?
+ new FrameServer(window) :
+ new Server(config['server'], jQuery['getScript']);
server = new VisualServer(server, new Status(jQuery(element.body)), onUpdate);
var users = new Users(server, controlBar);
- var databasePath = '/data/' + config.database;
+ var databasePath = '/data/' + config['database'];
var post = function(request, callback){
server.request("POST", databasePath, request, callback);
};
var datastore = new DataStore(post, users, binder.anchor);
+ binder.datastore = datastore;
binder.updateListeners.push(function(){datastore.flush();});
var scope = new Scope({
'$anchor' : binder.anchor,
@@ -508,10 +507,14 @@ function wireAngular(element, config) {
}
angular['startUrlWatcher'] = function(){
- return new UrlWatcher(window['location']).watch();
+ var watcher = new UrlWatcher(window['location']);
+ watcher.watch();
+ return exposeMethods(watcher, {'listen':watcher.listen, 'set':watcher.set, 'get':watcher.get});
};
angular['compile'] = function(element, config) {
+ jQuery = window['jQuery'];
+ msie = jQuery['browser']['msie'];
config = _({
'server': "",
'location': {'get':noop, 'set':noop, 'listen':noop}
@@ -842,11 +845,14 @@ defineApi('Object', [angularGlobal, angularCollection, angularObject],
['keys', 'values']);
defineApi('String', [angularGlobal, angularString], []);
defineApi('Date', [angularGlobal, angularDate], []);
+//IE bug
+angular['Date']['toString'] = angularDate['toString'];
defineApi('Function', [angularGlobal, angularCollection, angularFunction],
['bind', 'bindAll', 'delay', 'defer', 'wrap', 'compose']);
-function Binder(doc, widgetFactory, location, config) {
+function Binder(doc, widgetFactory, datastore, location, config) {
this.doc = doc;
this.location = location;
+ this.datastore = datastore;
this.anchor = {};
this.widgetFactory = widgetFactory;
this.config = config || {};
@@ -895,7 +901,7 @@ Binder.prototype = {
},
parseAnchor: function() {
- var self = this, url = this.location.get() || "";
+ var self = this, url = this.location['get']() || "";
var anchorIndex = url.indexOf('#');
if (anchorIndex < 0) return;
@@ -916,7 +922,7 @@ Binder.prototype = {
},
updateAnchor: function() {
- var url = this.location.get() || "";
+ var url = this.location['get']() || "";
var anchorIndex = url.indexOf('#');
if (anchorIndex > -1)
url = url.substring(0, anchorIndex);
@@ -933,7 +939,7 @@ Binder.prototype = {
sep = '&';
}
}
- this.location.set(url);
+ this.location['set'](url);
return url;
},
@@ -969,12 +975,14 @@ Binder.prototype = {
},
entity: function (scope) {
+ var self = this;
this.docFindWithSelf("[ng-entity]").attr("ng-watch", function() {
try {
var jNode = jQuery(this);
- var decl = scope.entity(jNode.attr("ng-entity"));
+ var decl = scope.entity(jNode.attr("ng-entity"), self.datastore);
return decl + (jNode.attr('ng-watch') || "");
} catch (e) {
+ log(e);
alert(e);
}
});
@@ -982,7 +990,7 @@ Binder.prototype = {
compile: function() {
var jNode = jQuery(this.doc);
- if (this.config.autoSubmit) {
+ if (this.config['autoSubmit']) {
var submits = this.docFindWithSelf(":submit").not("[ng-action]");
submits.attr("ng-action", "$save()");
submits.not(":disabled").not("ng-bind-attr").attr("ng-bind-attr", '{disabled:"{{$invalidWidgets}}"}');
@@ -1192,10 +1200,11 @@ Binder.prototype = {
ng_watch: function(node, scope) {
scope.watch(node.getAttribute('ng-watch'));
}
-};function ControlBar(document, serverUrl) {
- this.document = document;
+};function ControlBar(document, serverUrl, database) {
+ this._document = document;
this.serverUrl = serverUrl;
- this.window = window;
+ this.database = database;
+ this._window = window;
this.callbacks = [];
};
@@ -1207,13 +1216,12 @@ ControlBar.HTML =
'</div>' +
'</div>';
+
ControlBar.FORBIDEN =
'<div ng-non-bindable="true" title="Permission Error:">' +
'Sorry, you do not have permission for this!'+
'</div>';
-
-
ControlBar.prototype = {
bind: function () {
},
@@ -1221,7 +1229,7 @@ ControlBar.prototype = {
login: function (loginSubmitFn) {
this.callbacks.push(loginSubmitFn);
if (this.callbacks.length == 1) {
- this.doTemplate("/user_session/new.mini?return_url=" + encodeURIComponent(this.urlWithoutAnchor()));
+ this.doTemplate("/user_session/new.mini?database="+encodeURIComponent(this.database)+"&return_url=" + encodeURIComponent(this.urlWithoutAnchor()));
}
},
@@ -1233,25 +1241,24 @@ ControlBar.prototype = {
},
urlWithoutAnchor: function (path) {
- return this.window.location.href.split("#")[0];
+ return this._window['location']['href'].split("#")[0];
},
doTemplate: function (path) {
var self = this;
var id = new Date().getTime();
- var url = this.urlWithoutAnchor();
- url += "#$iframe_notify=" + id;
+ var url = this.urlWithoutAnchor() + "#$iframe_notify=" + id;
var iframeHeight = 330;
var loginView = jQuery('<div style="overflow:hidden; padding:2px 0 0 0;"><iframe name="'+ url +'" src="'+this.serverUrl + path + '" width="500" height="'+ iframeHeight +'"/></div>');
- this.document.append(loginView);
- loginView.dialog({
- height:iframeHeight + 33, width:500,
- resizable: false, modal:true,
- title: 'Authentication: <a href="http://www.getangular.com"><tt>&lt;angular/&gt;</tt></a>'
+ this._document.append(loginView);
+ loginView['dialog']({
+ 'height':iframeHeight + 33, 'width':500,
+ 'resizable': false, 'modal':true,
+ 'title': 'Authentication: <a href="http://www.getangular.com"><tt>&lt;angular/&gt;</tt></a>'
});
- callbacks["_iframe_notify_" + id] = function() {
- loginView.dialog("destroy");
- loginView.remove();
+ angularCallbacks["_iframe_notify_" + id] = function() {
+ loginView['dialog']("destroy");
+ loginView['remove']();
foreach(self.callbacks, function(callback){
callback();
});
@@ -1267,7 +1274,8 @@ ControlBar.prototype = {
};function DataStore(post, users, anchor) {
this.post = post;
this.users = users;
- this._cache = {$collections:[]};
+ this._cache_collections = [];
+ this._cache = {'$collections':this._cache_collections};
this.anchor = anchor;
this.bulkRequest = [];
};
@@ -1281,10 +1289,10 @@ DataStore.NullEntity = extend(function(){}, {
DataStore.prototype = {
cache: function(document) {
- if (! document instanceof Model) {
+ if (! document.datastore === this) {
throw "Parameter must be an instance of Entity! " + toJson(document);
}
- var key = document.$entity + '/' + document.$id;
+ var key = document['$entity'] + '/' + document['$id'];
var cachedDocument = this._cache[key];
if (cachedDocument) {
Model.copyDirectFields(document, cachedDocument);
@@ -1298,10 +1306,10 @@ DataStore.prototype = {
load: function(instance, id, callback, failure) {
if (id && id !== '*') {
var self = this;
- this._jsonRequest(["GET", instance.$entity + "/" + id], function(response) {
- instance.$loadFrom(response);
- instance.$migrate();
- var clone = instance.$$entity(instance);
+ this._jsonRequest(["GET", instance['$entity'] + "/" + id], function(response) {
+ instance['$loadFrom'](response);
+ instance['$migrate']();
+ var clone = instance['$$entity'](instance);
self.cache(clone);
(callback||noop)(instance);
}, failure);
@@ -1327,8 +1335,8 @@ DataStore.prototype = {
loadOrCreate: function(instance, id, callback) {
var self=this;
return this.load(instance, id, callback, function(response){
- if (response.$status_code == 404) {
- instance.$id = id;
+ if (response['$status_code'] == 404) {
+ instance['$id'] = id;
(callback||noop)(instance);
} else {
throw response;
@@ -1339,15 +1347,15 @@ DataStore.prototype = {
loadAll: function(entity, callback) {
var self = this;
var list = [];
- list.$$accept = function(doc){
- return doc.$entity == entity.title;
+ list['$$accept'] = function(doc){
+ return doc['$entity'] == entity['title'];
};
- this._cache.$collections.push(list);
- this._jsonRequest(["GET", entity.title], function(response) {
+ this._cache_collections.push(list);
+ this._jsonRequest(["GET", entity['title']], function(response) {
var rows = response;
for ( var i = 0; i < rows.length; i++) {
var document = entity();
- document.$loadFrom(rows[i]);
+ document['$loadFrom'](rows[i]);
list.push(self.cache(document));
}
(callback||noop)(list);
@@ -1358,17 +1366,17 @@ DataStore.prototype = {
save: function(document, callback) {
var self = this;
var data = {};
- document.$saveTo(data);
+ document['$saveTo'](data);
this._jsonRequest(["POST", "", data], function(response) {
- document.$loadFrom(response);
+ document['$loadFrom'](response);
var cachedDoc = self.cache(document);
- _.each(self._cache.$collections, function(collection){
- if (collection.$$accept(document)) {
- angular['Array']['includeIf'](collection, cachedDoc, true);
+ _.each(self._cache_collections, function(collection){
+ if (collection['$$accept'](document)) {
+ angularArray['includeIf'](collection, cachedDoc, true);
}
});
- if (document.$$anchor) {
- self.anchor[document.$$anchor] = document.$id;
+ if (document['$$anchor']) {
+ self.anchor[document['$$anchor']] = document['$id'];
}
if (callback)
callback(document);
@@ -1378,13 +1386,13 @@ DataStore.prototype = {
remove: function(document, callback) {
var self = this;
var data = {};
- document.$saveTo(data);
+ document['$saveTo'](data);
this._jsonRequest(["DELETE", "", data], function(response) {
- delete self._cache[document.$entity + '/' + document.$id];
- _.each(self._cache.$collections, function(collection){
+ delete self._cache[document['$entity'] + '/' + document['$id']];
+ _.each(self._cache_collections, function(collection){
for ( var i = 0; i < collection.length; i++) {
var item = collection[i];
- if (item.$id == document.$id) {
+ if (item['$id'] == document['$id']) {
collection.splice(i, 1);
}
}
@@ -1394,8 +1402,8 @@ DataStore.prototype = {
},
_jsonRequest: function(request, callback, failure) {
- request.$$callback = callback;
- request.$$failure = failure||function(response){
+ request['$$callback'] = callback;
+ request['$$failure'] = failure||function(response){
throw response;
};
this.bulkRequest.push(request);
@@ -1409,25 +1417,25 @@ DataStore.prototype = {
log('REQUEST:', bulkRequest);
function callback(code, bulkResponse){
log('RESPONSE[' + code + ']: ', bulkResponse);
- if(bulkResponse.$status_code == 401) {
- self.users.login(function(){
+ if(bulkResponse['$status_code'] == 401) {
+ self.users['login'](function(){
self.post(bulkRequest, callback);
});
- } else if(bulkResponse.$status_code) {
+ } else if(bulkResponse['$status_code']) {
alert(toJson(bulkResponse));
} else {
for ( var i = 0; i < bulkResponse.length; i++) {
var response = bulkResponse[i];
var request = bulkRequest[i];
- var responseCode = response.$status_code;
+ var responseCode = response['$status_code'];
if(responseCode) {
if(responseCode == 403) {
- self.users.notAuthorized();
+ self.users['notAuthorized']();
} else {
- request.$$failure(response);
+ request['$$failure'](response);
}
} else {
- request.$$callback(response);
+ request['$$callback'](response);
}
}
}
@@ -1444,9 +1452,9 @@ DataStore.prototype = {
}
for(var key in scope) {
var item = scope[key];
- if (item && item.$save == Model.prototype.$save) {
+ if (item && item['$save'] == Model.prototype['$save']) {
saveCounter++;
- item.$save(onSaveDone);
+ item['$save'](onSaveDone);
}
}
onSaveDone();
@@ -1455,19 +1463,18 @@ DataStore.prototype = {
query: function(type, query, arg, callback){
var self = this;
var queryList = [];
- queryList.$$accept = function(doc){
+ queryList['$$accept'] = function(doc){
return false;
};
- this._cache.$collections.push(queryList);
- var request = type.title + '/' + query + '=' + arg;
+ this._cache_collections.push(queryList);
+ var request = type['title'] + '/' + query + '=' + arg;
this._jsonRequest(["GET", request], function(response){
var list = response;
- for(var i = 0; i < list.length; i++) {
- var document = new type().$loadFrom(list[i]);
+ foreach(list, function(item){
+ var document = type()['$loadFrom'](item);
queryList.push(self.cache(document));
- }
- if (callback)
- callback(queryList);
+ });
+ (callback||noop)(queryList);
});
return queryList;
},
@@ -1476,11 +1483,11 @@ DataStore.prototype = {
var entities = [];
var self = this;
this._jsonRequest(["GET", "$entities"], function(response) {
- for (var entityName in response) {
+ foreach(response, function(value, entityName){
entities.push(self.entity(entityName));
- }
+ });
entities.sort(function(a,b){return a.title > b.title ? 1 : -1;});
- if (callback) callback(entities);
+ (callback||noop)(entities);
});
return entities;
},
@@ -1489,9 +1496,7 @@ DataStore.prototype = {
var counts = {};
var self = this;
self.post([["GET", "$users"]], function(code, response){
- foreach(response[0], function(value, key){
- counts[key] = value;
- });
+ extend(counts, response[0]);
});
return counts;
},
@@ -1500,9 +1505,7 @@ DataStore.prototype = {
var ids = {};
var self = this;
self.post([["GET", "$users/" + user]], function(code, response){
- foreach(response[0], function(value, key){
- ids[key] = value;
- });
+ extend(ids, response[0]);
});
return ids;
},
@@ -1518,7 +1521,7 @@ DataStore.prototype = {
// entity.name does not work as name seems to be reserved for functions
'title': name,
'$$factory': true,
- 'datastore': this,
+ datastore: this, //private, obfuscate
'defaults': defaults || {},
'load': function(id, callback){
return self.load(entity(), id, callback);
@@ -1783,25 +1786,25 @@ foreach({
function(type, data, width, height) {
data = data || {};
var chart = {
- cht:type,
- chco:angularFilterGoogleChartApi.collect(data, 'color'),
- chtt:angularFilterGoogleChartApi.title(data),
- chdl:angularFilterGoogleChartApi.collect(data, 'label'),
- chd:angularFilterGoogleChartApi.values(data),
- chf:'bg,s,FFFFFF00'
+ 'cht':type,
+ 'chco':angularFilterGoogleChartApi['collect'](data, 'color'),
+ 'chtt':angularFilterGoogleChartApi['title'](data),
+ 'chdl':angularFilterGoogleChartApi['collect'](data, 'label'),
+ 'chd':angularFilterGoogleChartApi['values'](data),
+ 'chf':'bg,s,FFFFFF00'
};
- if (_.isArray(data.xLabels)) {
- chart.chxt='x';
- chart.chxl='0:|' + data.xLabels.join('|');
+ if (_.isArray(data['xLabels'])) {
+ chart['chxt']='x';
+ chart['chxl']='0:|' + data.xLabels.join('|');
}
return angularFilterGoogleChartApi['encode'](chart, width, height);
},
{
'values': function(data){
var seriesValues = [];
- foreach(data.series||[], function(serie){
+ foreach(data['series']||[], function(serie){
var values = [];
- foreach(serie.values||[], function(value){
+ foreach(serie['values']||[], function(value){
values.push(value);
});
seriesValues.push(values.join(','));
@@ -1812,7 +1815,7 @@ foreach({
'title': function(data){
var titles = [];
- var title = data.title || [];
+ var title = data['title'] || [];
foreach(_.isArray(title)?title:[title], function(text){
titles.push(encodeURIComponent(text));
});
@@ -1822,7 +1825,7 @@ foreach({
'collect': function(data, key){
var outterValues = [];
var count = 0;
- foreach(data.series||[], function(serie){
+ foreach(data['series']||[], function(serie){
var innerValues = [];
var value = serie[key] || [];
foreach(_.isArray(value)?value:[value], function(color){
@@ -1839,7 +1842,7 @@ foreach({
height = height || width;
var url = "http://chart.apis.google.com/chart?";
var urlParam = [];
- params.chs = width + "x" + height;
+ params['chs'] = width + "x" + height;
foreach(params, function(value, key){
if (value) {
urlParam.push(key + "=" + value);
@@ -1855,37 +1858,38 @@ foreach({
'qrcode': function(value, width, height) {
- return angularFilterGoogleChartApi['encode']({cht:'qr', chl:encodeURIComponent(value)}, width, height);
+ return angularFilterGoogleChartApi['encode']({
+ 'cht':'qr', 'chl':encodeURIComponent(value)}, width, height);
},
'chart': {
- pie:function(data, width, height) {
+ 'pie':function(data, width, height) {
return angularFilterGoogleChartApi('p', data, width, height);
},
- pie3d:function(data, width, height) {
+ 'pie3d':function(data, width, height) {
return angularFilterGoogleChartApi('p3', data, width, height);
},
- pieConcentric:function(data, width, height) {
+ 'pieConcentric':function(data, width, height) {
return angularFilterGoogleChartApi('pc', data, width, height);
},
- barHorizontalStacked:function(data, width, height) {
+ 'barHorizontalStacked':function(data, width, height) {
return angularFilterGoogleChartApi('bhs', data, width, height);
},
- barHorizontalGrouped:function(data, width, height) {
+ 'barHorizontalGrouped':function(data, width, height) {
return angularFilterGoogleChartApi('bhg', data, width, height);
},
- barVerticalStacked:function(data, width, height) {
+ 'barVerticalStacked':function(data, width, height) {
return angularFilterGoogleChartApi('bvs', data, width, height);
},
- barVerticalGrouped:function(data, width, height) {
+ 'barVerticalGrouped':function(data, width, height) {
return angularFilterGoogleChartApi('bvg', data, width, height);
},
- line:function(data, width, height) {
+ 'line':function(data, width, height) {
return angularFilterGoogleChartApi('lc', data, width, height);
},
- sparkline:function(data, width, height) {
+ 'sparkline':function(data, width, height) {
return angularFilterGoogleChartApi('ls', data, width, height);
},
- scatter:function(data, width, height) {
+ 'scatter':function(data, width, height) {
return angularFilterGoogleChartApi('s', data, width, height);
}
},
@@ -2027,9 +2031,9 @@ function toJsonArray(buf, obj, pretty, stack){
function Model(entity, initial) {
this['$$entity'] = entity;
- this.$loadFrom(initial||{});
- this.$entity = entity['title'];
- this.$migrate();
+ this['$loadFrom'](initial||{});
+ this['$entity'] = entity['title'];
+ this['$migrate']();
};
Model.copyDirectFields = function(src, dst) {
@@ -2049,9 +2053,9 @@ Model.copyDirectFields = function(src, dst) {
}
};
-Model.prototype = {
+extend(Model.prototype, {
'$migrate': function() {
- merge(this['$$entity'].defaults, this);
+ merge(this['$$entity']['defaults'], this);
return this;
},
@@ -2086,7 +2090,7 @@ Model.prototype = {
Model.copyDirectFields(this, other);
return this;
}
-};function Lexer(text, parsStrings){
+});function Lexer(text, parsStrings){
this.text = text;
// UTC dates have 20 characters, we send them through parser
this.dateParseLength = parsStrings ? 20 : -1;
@@ -2779,12 +2783,11 @@ Parser.prototype = {
defaults = this.primary()(null);
}
return function(self) {
- var datastore = self.scope.get('$datastore');
- var Entity = datastore.entity(entity, defaults);
+ var Entity = self.datastore.entity(entity, defaults);
self.scope.set(entity, Entity);
if (instance) {
var document = Entity();
- document.$$anchor = instance;
+ document['$$anchor'] = instance;
self.scope.set(instance, document);
return "$anchor." + instance + ":{" +
instance + "=" + entity + ".load($anchor." + instance + ");" +
@@ -2839,9 +2842,9 @@ function Scope(initialState, name) {
var State = function(){};
State.prototype = initialState;
this.state = new State();
- this.state.$parent = initialState;
+ this.state['$parent'] = initialState;
if (name == "ROOT") {
- this.state.$root = this.state;
+ this.state['$root'] = this.state;
}
};
@@ -2870,7 +2873,7 @@ Scope.getter = function(instance, path) {
}
}
}
- if (typeof instance === 'function' && !instance.$$factory) {
+ if (typeof instance === 'function' && !instance['$$factory']) {
return bind(lastInstance, instance);
}
return instance;
@@ -2902,10 +2905,12 @@ Scope.prototype = {
},
get: function(path) {
+// log('SCOPE.get', path, Scope.getter(this.state, path));
return Scope.getter(this.state, path);
},
set: function(path, value) {
+// log('SCOPE.set', path, value);
var element = path.split('.');
var instance = this.state;
for ( var i = 0; element.length > 1; i++) {
@@ -2926,6 +2931,7 @@ Scope.prototype = {
},
eval: function(expressionText, context) {
+// log('Scope.eval', expressionText);
var expression = Scope.expressionCache[expressionText];
if (!expression) {
var parser = new Parser(expressionText);
@@ -2978,13 +2984,13 @@ Scope.prototype = {
return expression(self)(self, value);
},
- entity: function(entityDeclaration) {
+ entity: function(entityDeclaration, datastore) {
var expression = new Parser(entityDeclaration).entityDeclaration();
- return expression({scope:this});
+ return expression({scope:this, datastore:datastore});
},
markInvalid: function(widget) {
- this.state.$invalidWidgets.push(widget);
+ this.state['$invalidWidgets'].push(widget);
},
watch: function(declaration) {
@@ -3042,14 +3048,13 @@ Server.prototype = {
request: function(method, url, request, callback) {
var requestId = this.uuid + (this.nextId++);
+ var payload = this.base64url(toJson({'u':url, 'm':method, 'p':request}));
+ var totalPockets = Math.ceil(payload.length / this.maxSize);
+ var baseUrl = this.url + "/$/" + requestId + "/" + totalPockets + "/";
angularCallbacks[requestId] = function(response) {
- delete angular[requestId];
+ delete angularCallbacks[requestId];
callback(200, response);
};
- var payload = {u:url, m:method, p:request};
- payload = this.base64url(toJson(payload));
- var totalPockets = Math.ceil(payload.length / this.maxSize);
- var baseUrl = this.url + "/$/" + requestId + "/" + totalPockets + "/";
for ( var pocketNo = 0; pocketNo < totalPockets; pocketNo++) {
var pocket = payload.substr(pocketNo * this.maxSize, this.maxSize);
this.getScript(baseUrl + (pocketNo+1) + "?h=" + pocket, noop);
@@ -3101,7 +3106,7 @@ function Users(server, controlBar) {
this.controlBar = controlBar;
};
-Users.prototype = {
+extend(Users.prototype, {
'fetchCurrentUser':function(callback) {
var self = this;
this.server.request("GET", "/account.json", {}, function(code, response){
@@ -3121,7 +3126,7 @@ Users.prototype = {
'login': function(callback) {
var self = this;
this.controlBar.login(function(){
- self.fetchCurrentUser(function(){
+ self['fetchCurrentUser'](function(){
(callback||noop)();
});
});
@@ -3130,7 +3135,7 @@ Users.prototype = {
'notAuthorized': function(){
this.controlBar.notAuthorized();
}
-};
+});
foreach({
'regexp': function(value, regexp, msg) {
if (!value.match(regexp)) {
@@ -3215,8 +3220,8 @@ function WidgetFactory(serverUrl, database) {
this.nextUploadId = 0;
this.serverUrl = serverUrl;
this.database = database;
- if (window.swfobject) {
- this.createSWF = swfobject.createSWF;
+ if (window['swfobject']) {
+ this.createSWF = window['swfobject']['createSWF'];
} else {
this.createSWF = function(){
alert("ERROR: swfobject not loaded!");
@@ -3275,12 +3280,12 @@ WidgetFactory.prototype = {
var view = FileController.template(uploadId);
fileInput.after(view);
var att = {
- data:this.serverUrl + "/admin/ServerAPI.swf",
- width:"95", height:"20", align:"top",
- wmode:"transparent"};
+ 'data':this.serverUrl + "/admin/ServerAPI.swf",
+ 'width':"95", 'height':"20", 'align':"top",
+ 'wmode':"transparent"};
var par = {
- flashvars:"uploadWidgetId=" + uploadId,
- allowScriptAccess:"always"};
+ 'flashvars':"uploadWidgetId=" + uploadId,
+ 'allowScriptAccess':"always"};
var swfNode = this.createSWF(att, par, uploadId);
fileInput.remove();
var cntl = new FileController(view, fileInput[0].name, swfNode, this.serverUrl + "/data/" + this.database);
@@ -3301,10 +3306,12 @@ function FileController(view, scopeName, uploader, databaseUrl) {
this.lastValue = undefined;
};
-FileController.dispatchEvent = function(id, event, args) {
+angularCallbacks['flashEvent'] = function(id, event, args) {
var object = document.getElementById(id);
- var controller = jQuery(object).data("controller");
- FileController.prototype['_on_' + event].apply(controller, args);
+ var jobject = jQuery(object);
+ var controller = jobject.data("controller");
+ FileController.prototype[event].apply(controller, args);
+ _.defer(jobject.scope().get('$updateView'));
};
FileController.template = function(id) {
@@ -3313,26 +3320,26 @@ FileController.template = function(id) {
'<object id="' + id + '" />' +
'<a></a>' +
'<span/>' +
- '</span>');
+ '</span>');
};
-FileController.prototype = {
- '_on_cancel': noop,
- '_on_complete': noop,
- '_on_httpStatus': function(status) {
+extend(FileController.prototype, {
+ 'cancel': noop,
+ 'complete': noop,
+ 'httpStatus': function(status) {
alert("httpStatus:" + this.scopeName + " status:" + status);
},
- '_on_ioError': function() {
+ 'ioError': function() {
alert("ioError:" + this.scopeName);
},
- '_on_open': function() {
+ 'open': function() {
alert("open:" + this.scopeName);
},
- '_on_progress':noop,
- '_on_securityError': function() {
+ 'progress':noop,
+ 'securityError': function() {
alert("securityError:" + this.scopeName);
},
- '_on_uploadCompleteData': function(data) {
+ 'uploadCompleteData': function(data) {
var value = fromJson(data);
value.url = this.attachmentsPath + '/' + value.id + '/' + value.text;
this.view.find("input").attr('checked', true);
@@ -3340,9 +3347,8 @@ FileController.prototype = {
this.value = value;
this.updateModel(scope);
this.value = null;
- scope.get('$binder').updateView();
},
- '_on_select': function(name, size, type) {
+ '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));
@@ -3374,10 +3380,10 @@ FileController.prototype = {
upload: function() {
if (this.name) {
- this.uploader.uploadFile(this.attachmentsPath);
+ this.uploader['uploadFile'](this.attachmentsPath);
}
}
-};
+});
///////////////////////
// NullController
@@ -3745,7 +3751,7 @@ BindAttrUpdater.prototype = {
}
var attrValue = attrValues.length ? attrValues.join('') : null;
if(isImage && attrName == 'src' && !attrValue)
- attrValue = scope.get('config.server') + '/images/blank.gif';
+ attrValue = scope.get('$config.blankImage');
jNode.attr(attrName, attrValue);
}
}
diff --git a/jsTestDriver.conf b/jsTestDriver.conf
index 6c2cf0bb..766b8c73 100644
--- a/jsTestDriver.conf
+++ b/jsTestDriver.conf
@@ -4,7 +4,7 @@ load:
- lib/jasmine/jasmine-0.10.0.js
- lib/jasmine-jstd-adapter/JasmineAdapter.js
- lib/webtoolkit/webtoolkit.base64.js
- - lib/jquery/jquery-1.4.0.js
+ - lib/jquery/jquery-1.4.js
- lib/jquery/jquery-ui-1.7.1.custom.min.js
- lib/underscore/underscore.js
- src/Angular.js
diff --git a/lib/jstestdriver/JsTestDriver.jar b/lib/jstestdriver/JsTestDriver.jar
index 256bfad9..fea70000 100644
--- a/lib/jstestdriver/JsTestDriver.jar
+++ b/lib/jstestdriver/JsTestDriver.jar
Binary files differ
diff --git a/src/API.js b/src/API.js
index d795f4c3..ce690ad1 100644
--- a/src/API.js
+++ b/src/API.js
@@ -319,5 +319,7 @@ defineApi('Object', [angularGlobal, angularCollection, angularObject],
['keys', 'values']);
defineApi('String', [angularGlobal, angularString], []);
defineApi('Date', [angularGlobal, angularDate], []);
+//IE bug
+angular['Date']['toString'] = angularDate['toString'];
defineApi('Function', [angularGlobal, angularCollection, angularFunction],
['bind', 'bindAll', 'delay', 'defer', 'wrap', 'compose']);
diff --git a/src/Angular.js b/src/Angular.js
index b208d0ec..ce25423c 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -20,7 +20,8 @@ if (typeof Node == 'undefined') {
function noop() {}
if (!window['console']) window['console']={'log':noop, 'error':noop};
-var consoleNode, jQuery, msie,
+var consoleNode, msie,
+ jQuery = window['jQuery'] || window['$'], // weirdness to make IE happy
foreach = _.each,
extend = _.extend,
angular = window['angular'] || (window['angular'] = {}),
@@ -270,7 +271,7 @@ function exposeMethods(obj, methods){
function wireAngular(element, config) {
var widgetFactory = new WidgetFactory(config['server'], config['database']);
var binder = new Binder(element[0], widgetFactory, datastore, config['location'], config);
- var controlBar = new ControlBar(element.find('body'), config['server']);
+ var controlBar = new ControlBar(element.find('body'), config['server'], config['database']);
var onUpdate = function(){binder.updateView();};
var server = config['database'] =="$MEMORY" ?
new FrameServer(window) :
diff --git a/src/ControlBar.js b/src/ControlBar.js
index 6fe5b42d..685beeb2 100644
--- a/src/ControlBar.js
+++ b/src/ControlBar.js
@@ -1,6 +1,7 @@
-function ControlBar(document, serverUrl) {
+function ControlBar(document, serverUrl, database) {
this._document = document;
this.serverUrl = serverUrl;
+ this.database = database;
this._window = window;
this.callbacks = [];
};
@@ -13,13 +14,12 @@ ControlBar.HTML =
'</div>' +
'</div>';
+
ControlBar.FORBIDEN =
'<div ng-non-bindable="true" title="Permission Error:">' +
'Sorry, you do not have permission for this!'+
'</div>';
-
-
ControlBar.prototype = {
bind: function () {
},
@@ -27,7 +27,7 @@ ControlBar.prototype = {
login: function (loginSubmitFn) {
this.callbacks.push(loginSubmitFn);
if (this.callbacks.length == 1) {
- this.doTemplate("/user_session/new.mini?return_url=" + encodeURIComponent(this.urlWithoutAnchor()));
+ this.doTemplate("/user_session/new.mini?database="+encodeURIComponent(this.database)+"&return_url=" + encodeURIComponent(this.urlWithoutAnchor()));
}
},
diff --git a/test.sh b/test.sh
index c0d1e7ac..6b1cac89 100755
--- a/test.sh
+++ b/test.sh
@@ -1,2 +1,2 @@
-java -jar lib/jstestdriver/JsTestDriver.jar --tests all | grep -v lib/jasmine
+java -jar lib/jstestdriver/JsTestDriver.jar --tests all | grep -v lib/jasmine
diff --git a/test/ApiTest.js b/test/ApiTest.js
index 35cbbd81..fc9190ed 100644
--- a/test/ApiTest.js
+++ b/test/ApiTest.js
@@ -204,7 +204,7 @@ ApiTest.prototype.testQuoteString = function(){
};
ApiTest.prototype.testQuoteStringBug = function(){
- assertEquals(angular.String.quote("7\\\"7"), '"7\\\\\\\"7"');
+ assertEquals('"7\\\\\\\"7"', angular.String.quote("7\\\"7"));
};
ApiTest.prototype.testQuoteUnicode = function(){
diff --git a/test/BinderTest.js b/test/BinderTest.js
index 6ef46fae..cf2fa31a 100644
--- a/test/BinderTest.js
+++ b/test/BinderTest.js
@@ -401,7 +401,7 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){
};
BinderTest.prototype.testRepeaterContentDoesNotBind = function(){
- var a = compile('<ul><LI ng-repeat="item in model.items"><span ng-bind="item.a"/></li></ul>');
+ var a = compile('<ul><LI ng-repeat="item in model.items"><span ng-bind="item.a"></span></li></ul>');
a.scope.set('model', {items:[{a:"A"}]});
a.binder.updateView();
assertEquals('<ul>' +
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 8fac7598..d9aed6f2 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -1,5 +1,3 @@
-TestCase = function(name) { return jstestdriver.testCaseManager.TestCase(name); };
-
HIDDEN = jQuery.browser.msie ?
'' :
jQuery.browser.safari ?
@@ -7,7 +5,7 @@ HIDDEN = jQuery.browser.msie ?
' style="display: none;"';
msie = jQuery.browser.msie;
-alert = function(msg) {jstestdriver.console.log("ALERT: " + msg);};
+//alert = function(msg) {jstestdriver.console.log("ALERT: " + msg);};
function noop(){}
@@ -35,6 +33,7 @@ function report(reportTest){
});
}
+
MockLocation = function() {
this.url = "http://server";
};