123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877 |
- (function($){var Judy=function($){var self=this,_name="Judy",_nonObj=["window","document","document.documentElement","element","image","textNode","attributeNode","otherNode","event","date","regexp","jquery"],_uaIe=0,_dateFrmt,_dateTz,_nonInputFlds=["textarea","select"],_dataName,_dialEvts=["beforeClose","create","open","focus","dragStart","drag","dragStop","resizeStart","resize","resizeStop","close"],_dialOpts=["appendTo","autoOpen","buttons","closeOnEscape","closeText","dialogClass","draggable","height","hide","maxHeight","maxWidth","minHeight","minWidth","modal","position","resizable","show","title","width"],_dialMthds=["close","destroy","isOpen","moveToTop","open","option","widget"],_dialogs=[],_acInit,_acLstnrs={},_acFltrs=[{"!url":/\/inspect\/ajax/},{"!url":/\/log_filter\/ajax/}],_checklist="checkboxes",_radio="radios",_jqOvrly,_ovrlyRsz,_errorHandler=function(error,variable,options){var u=options,o={},t;
- if(typeof window.inspect==="function"&&inspect.tcepsnI){if(typeof inspect.errorHandler==="function"){if(u){if((t=typeof u)==="string"){o.message=u;
- o.wrappers=1;
- }else{if(t==="object"){o=u;
- o.wrappers=!u.wrappers?1:(u.wrappers+1);
- }}}o.category="Judy";
- inspect.errorHandler(error,variable,o);
- }else{inspect.console("Please update Inspect.");
- }}},_elm=function(list,u,cntxt,mthd,noError){var li=!list?0:undefined,t,s=u,jq,le,i,f;
- if(u){if((t=typeof u)==="object"){if(u===window||u===document||u.getAttributeNode){return !list?u:[u];
- }if(typeof u.jquery==="string"){if(u.length){if(!cntxt){return u.get(li);
- }if((jq=$(u,cntxt)).length){return jq.get(li);
- }}s=u.selector;
- }else{if(self.isArray(u)&&(le=u.length)){for(i=0;
- i<le;
- i++){if(!(u[i]===window||u[i]===document||u[i].getAttributeNode)){f=true;
- break;
- }else{if(!i&&!list){return u[0];
- }}}if(!f){return u;
- }}}}else{if(t==="string"&&(jq=$(u)).length){return jq.get(li);
- }}}if(!noError){try{throw new Error("selector["+s+"], type["+self.typeOf(u)+"], doesnt resolve to element");
- }catch(er){_errorHandler(er,null,_name+"."+mthd+"()");
- }}return undefined;
- },_fieldType=function(r,b){var t=r.tagName.toLowerCase();
- if(t==="input"){if((t=r.getAttribute("type"))){switch(t){case"button":case"submit":case"reset":return !b?"":t;
- case"radio":return _radio;
- case"checkbox":return self.ancestor(r,"div.form-checkboxes",3)?_checklist:"checkbox";
- default:return t;
- }}return"";
- }return self.arrayIndexOf(_nonInputFlds,t)>-1?t:"";
- },_disable=function(nbl,slctr,cntxt,ttl){var a=_elm(true,slctr,cntxt,!nbl?"disable":"enable"),le,i,r;
- if(a){le=a.length;
- for(i=0;
- i<le;
- i++){(r=a[i]).disabled=!nbl?"disabled":false;
- if(typeof ttl==="string"){r.setAttribute("title",ttl);
- }switch(_fieldType(r,true)){case"checkbox":$(r).unbind("click."+_name+".disabled");
- if(!nbl){$(r).bind("click."+_name+".disabled",function(){return false;
- });
- }break;
- case _checklist:$("input[type='checkbox']",r).each(function(){$(r).unbind("click."+_name+".disabled");
- if(!nbl){$(this).bind("click."+_name+".disabled",function(){return false;
- });
- }});
- break;
- case _radio:$("input[name='"+r.getAttribute("name")+"']",cntxt).each(function(){this.disabled=!nbl?"disabled":false;
- });
- break;
- case"button":case"submit":case"reset":$(r)[!nbl?"addClass":"removeClass"]("form-button-disabled");
- break;
- }}}},_valCheckbox=function(r,val){if(val===undefined){return r.checked?r.value:"";
- }r.checked=(val?"checked":false);
- return true;
- },_valRadio=function(r,context,val){var nm=r.getAttribute("name"),a,le,i,v;
- if(!nm){return _valCheckbox(r,val);
- }if(val===undefined){return(v=$("input[name='"+nm+"']:checked",context).val())!==undefined?v:"";
- }if((le=(a=$().get("input[name='"+nm+"']",context)).length)){if((v=""+val)===""){for(i=0;
- i<le;
- i++){a[i].checked=false;
- }return true;
- }for(i=0;
- i<le;
- i++){if(a[i].value===v){a[i].checked="checked";
- return true;
- }}return false;
- }return undefined;
- },_valSelect=function(r,val){var multi,ndx=-1,rOpts,nOpts,rOpt,nVals,i,vals=[],v,set=0;
- if(val===undefined&&((ndx=r.selectedIndex)===undefined||ndx<0)){return"";
- }multi=r.multiple;
- nOpts=(rOpts=$("option",r).get()).length;
- if(val===undefined){if(!multi){return(v=rOpts[ndx].value)!=="_none"?v:"";
- }for(i=0;
- i<nOpts;
- i++){if((rOpt=rOpts[i]).selected&&(v=rOpt.value)!==""&&v!=="_none"){vals.push(v);
- }}return vals.length?vals:"";
- }for(i=0;
- i<nOpts;
- i++){rOpts[i].selected=false;
- }if(val===""||val==="_none"){return true;
- }if(!self.isArray(val)){v=[""+val];
- }else{if(!(nVals=val.length)||(nVals===1&&(val[0]===""||val[0]==="_none"))){return true;
- }v=val.concat();
- for(i=0;
- i<nVals;
- i++){v[i]=""+v[i];
- }}for(i=0;
- i<nOpts;
- i++){if(((rOpt=rOpts[i]).selected=self.arrayIndexOf(v,rOpt.value)>-1?"selected":false)){++set;
- if(!multi){return 1;
- }}}return set;
- },_valChecklist=function(r,val){var par,rOpts,nOpts,rOpt,nVals,i,v=[],set=0;
- if((par=self.ancestor(r,"div.form-checkboxes",3))){nOpts=(rOpts=$("input[type='checkbox']",par).get()).length;
- if(val===undefined){for(i=0;
- i<nOpts;
- i++){if((rOpt=rOpts[i]).checked){v.push(rOpt.value);
- }}return v.length?v:"";
- }v=!self.isArray(val)?(val===""?undefined:[val]):(!(nVals=val.length)||(nVals===1&&val[0]==="")?undefined:val.concat());
- if(v===undefined){for(i=0;
- i<nOpts;
- i++){rOpts[i].checked=false;
- }return true;
- }for(i=0;
- i<nVals;
- i++){v[i]=""+v[i];
- }for(i=0;
- i<nOpts;
- i++){if(((rOpt=rOpts[i]).checked=self.arrayIndexOf(v,rOpt.value)>-1?"checked":false)){++set;
- }}return set;
- }return undefined;
- },_filter=function(o,fltr){var le=fltr.length,i,k,x,not,v;
- for(i=0;
- i<le;
- i++){for(k in fltr[i]){v=null;
- if(fltr[i].hasOwnProperty(k)){x=k;
- if((not=x.charAt(0)==="!")){x=x.substr(1);
- }if(o.hasOwnProperty(x)){if((v=fltr[i][k])&&v instanceof RegExp){if(typeof o[x]==="string"){if(v.test(o[x])){if(not){return false;
- }}else{if(!not){return false;
- }}}}else{if(o[x]===v){if(not){return false;
- }}else{if(!not){return false;
- }}}}}}}return true;
- },_acOff=function(u,s,nm,h){var le,i,rm=[],n,sbtrt;
- if(_acLstnrs[u]&&_acLstnrs.hasOwnProperty(u)){le=_acLstnrs[u].length;
- for(i=0;
- i<le;
- i++){if((_acLstnrs[u][i][0]===s||(nm&&_acLstnrs[u][i][1]===nm))&&(!h||_acLstnrs[u][i][2]===h)){rm.push(i);
- }}if((n=rm.length)){if(n===le){delete _acLstnrs[u];
- }else{sbtrt=0;
- for(i=0;
- i<n;
- i++){_acLstnrs[u].splice(rm[i]-sbtrt,1);
- ++sbtrt;
- }}}}},_keyMask=function(keystrokes){var aK=keystrokes.toUpperCase().split(/_/),nK=aK.length,k=0,ky,cK,i;
- for(i=0;
- i<nK;
- i++){switch((ky=aK[i])){case"CTR":case"CTRL":case"CMD":case"META":k+=100000;
- break;
- case"ALT":k+=10000;
- break;
- case"SHIFT":k+=1000;
- break;
- case"ENTER":case"RETURN":k+=13;
- break;
- case"ESC":case"ESCAPE":k+=27;
- break;
- case"TAB":k+=9;
- break;
- case"SPACE":k+=32;
- break;
- case"BACKSPACE":k+=8;
- break;
- case"INS":case"INSERT":k+=45;
- break;
- case"DEL":case"DELETE":k+=46;
- break;
- case"HOME":k+=36;
- break;
- case"END":k+=35;
- break;
- case"PGUP":case"PAGEUP":k+=33;
- break;
- case"PGDN":case"PAGEDOWN":k+=34;
- break;
- case"PAUSE":case"BREAK":k+=19;
- break;
- case"STAR":k+=106;
- break;
- case"-":case"MINUS":case"HYPHEN":k+=109;
- break;
- case"+":case"PLUS":k+=107;
- break;
- case"LEFT":k+=37;
- break;
- case"UP":k+=38;
- break;
- case"RIGHT":k+=39;
- break;
- case"DOWN":k+=40;
- break;
- case"F1":k+=112;
- break;
- case"F2":k+=113;
- break;
- case"F3":k+=114;
- break;
- case"F4":k+=115;
- break;
- case"F5":k+=116;
- break;
- case"F6":k+=117;
- break;
- case"F7":k+=118;
- break;
- case"F8":k+=119;
- break;
- case"F9":k+=120;
- break;
- case"F10":k+=121;
- break;
- case"F11":k+=122;
- break;
- case"F12":k+=123;
- break;
- default:cK=ky.charCodeAt(0);
- if(cK>=96&&cK<=105){k+=(cK-48);
- }else{if((cK>=65&&cK<=90)||(cK>=48&&cK<=57)){k+=cK;
- }else{throw new Error("unsupported char["+ky+"] in keystrokes["+keystrokes+"]");
- }}}}if(k&&k%1000>0){return"_"+k;
- }throw new Error("keystrokes["+keystrokes+"] "+(!k?"evaluates to nothing":"all modifiers, no plain keys"));
- },_keystrokes=function(e){var k=0,kC;
- if(e.ctrlKey||e.metaKey){k+=100000;
- }if(e.altKey){k+=10000;
- }if(e.shiftKey){k+=1000;
- }if((kC=e.keyCode)){switch(kC){case 61:k+=107;
- break;
- case 189:k+=109;
- break;
- default:if(kC>=96&&kC<=105){k+=(kC-48);
- }else{k+=kC;
- }}}return k;
- },_bindKeys=function(et,as){var jq=$(as[0]),jqMthd=typeof jq.on==="function"?"on":"bind",nAs=as.length,qualifiers="",nQs,iQ,q,nm,kms={},km,rs=jq.get(),nRs=jq.length,r,hndlr,dat,pdef=false,i,jq1,d,e,j,le,kyHndlrs,f;
- if(nAs<3){throw new Error("requires at least 3 args");
- }if(!nRs){throw new Error("No element like selector["+as[0]+"], type["+self.typeOf(as[0])+"]");
- }for(i=1;
- i<5;
- i++){switch(typeof as[i]){case"string":qualifiers=as[1];
- break;
- case"function":hndlr=as[i];
- break;
- case"object":dat=as[i];
- break;
- case"boolean":pdef=as[i];
- break;
- }}if(!hndlr){throw new Error("No handler function arg found");
- }nQs=(qualifiers=qualifiers.split(" ")).length;
- for(iQ=0;
- iQ<nQs;
- iQ++){if((q=qualifiers[iQ]).indexOf("key")===0){q=q.replace(/^key[^_]+_(.+)$/,"$1");
- }if(!q||q==="*"){jq[jqMthd].apply(jq,!dat?[et,hndlr]:[et,dat,hndlr]);
- return true;
- }nm="";
- if(q.indexOf(".")>-1){nm=q.replace(/^[^\.]+\.(.+)$/,"$1");
- q=q.replace(/^([^\.]+)\..+$/,"$1");
- }km=_keyMask(q.replace(/[_\+]\+/,"_plus").replace(/\+/g,"_"));
- if(iQ&&kms[km]&&kms.hasOwnProperty(km)){continue;
- }kms[km]={handler:hndlr,data:dat,namespace:nm,type:q,preventDefault:pdef};
- }for(i=0;
- i<nRs;
- i++){if((r=rs[i])!==document.documentElement){if(r===window){if(_uaIe){throw new Error("IE key event on window illegal, do set it on document.documentElement");
- }}else{if(!_uaIe){switch(r.tagName.toLowerCase()){case"textarea":case"input":break;
- default:if(!r.hasAttribute("tabindex")){throw new Error("non-IE key event on tag-type["+r.tagName+"] without tabindex not possible");
- }}}}}kyHndlrs=null;
- if((d=(jq1=$(r)).data("events"))&&(e=d[et])&&d.hasOwnProperty(et)){le=e.length;
- for(j=0;
- j<le;
- j++){if(e[j].namespace===_dataName){kyHndlrs=e[j].handler.judy_keyMask_handlers;
- break;
- }}}if(!kyHndlrs){f=function(evt){var o,k,a,pd,le,i,lstnr,e;
- if((a=(o=f.judy_keyMask_handlers)[k="_"+_keystrokes(evt)])&&o.hasOwnProperty(k)&&(le=a.length)){for(i=0;
- i<le;
- i++){lstnr=a[i];
- if(!pd&&lstnr.preventDefault){pd=true;
- evt.preventDefault();
- }evt.data=lstnr.data;
- evt.keystrokes=lstnr.type;
- lstnr.handler.apply(this,[evt]);
- }}};
- kyHndlrs=f.judy_keyMask_handlers={};
- jq1[jqMthd](et+"."+_dataName,f);
- }for(km in kms){if(kms.hasOwnProperty(km)){if(kyHndlrs[km]&&kyHndlrs.hasOwnProperty(km)){kyHndlrs[km].push(kms[km]);
- }else{kyHndlrs[km]=[kms[km]];
- }}}}return undefined;
- },_dateTz=function(dt,asHourStr){var z=dt.getTimezoneOffset(),zu;
- return !asHourStr?(-(z*60*1000)):(z?(((zu=z>0)?"-":"+")+((zu=((zu?z:z*-1)/60))<10?"0":"")+Math.floor(zu)):"+00");
- },_dateFrmt=function(dt,d,t,m,UTC,iso){var u,f=UTC?"getUTC":"get";
- return(d?(dt[f+"FullYear"]()+"-"+((u=dt[f+"Month"]()+1)<10?("0"+u):u)+"-"+((u=dt[f+"Date"]())<10?("0"+u):u)):"")+(d&&t?(iso?"T":" "):"")+(t?((((u=dt[f+"Hours"]())<10?("0"+u):u)+":"+((u=dt[f+"Minutes"]())<10?("0"+u):u)+":"+((u=dt[f+"Seconds"]())<10?("0"+u):u))+(m?((iso?".":" ")+((u=dt[f+"Milliseconds"]())<10?("00"+u):(u<100?("0"+u):u))):"")):"")+(!iso?"":(UTC?"Z":(_dateTz(dt,1)+":00")));
- },_dimInner=function(d,slctr,ignorePadding){var u=slctr,r,dE=document.documentElement,jq,v,p;
- if(u===window){return dE["client"+d];
- }if(u===dE||u===document.body){return dE["scroll"+d];
- }if((r=_elm(0,u,0,"inner"+d))){v=r["client"+d];
- if(!ignorePadding){if((p=(jq=$(r)).css("padding-"+(d==="Width"?"left":"top"))).indexOf("px")>-1){v-=parseFloat(p);
- }if((p=jq.css("padding-"+(d==="Width"?"right":"bottom"))).indexOf("px")>-1){v-=parseFloat(p);
- }v=Math.round(v);
- }return v;
- }return undefined;
- },_dimOuter=function(d,slctr,includeMargin,set,max){var u=slctr,r,dE=document.documentElement,jq,v;
- if(u===window){return dE["inner"+d]||dE["client"+d];
- }if(u===dE||u===document.body){return dE["scroll"+d];
- }if((r=_elm(0,u,0,"outer"+d))){v=(jq=$(r))["outer"+d](includeMargin);
- if(!set||set===v){return v;
- }v=_dimInner(d,u)+(set-v);
- if(!max||max===2){jq.css(d.toLowerCase(),v+"px");
- }if(max){jq.css("max-"+d.toLowerCase(),v+"px");
- }return set;
- }return undefined;
- },_ovrlyRsz=function(){var w=window,d=document.documentElement,dW,dD;
- _jqOvrly.css({width:((dD=self.innerWidth(d))>(dW=self.innerWidth(w))?dD:dW)+"px",height:((dD=self.innerHeight(d))>(dW=self.innerHeight(w))?dD:dW)+"px"});
- };
- this.yduj=true;
- this.yduJ=true;
- this.version=2.1;
- this.browserIE=_uaIe=(function(){var u;
- if((u=window.navigator)&&(u=u.userAgent)){if(/; MSIE \d{1,2}\.\d/.test(u)){return(u=parseFloat(u.replace(/^.+; MSIE (\d{1,2}\.\d).+/,"$1")))?u:0;
- }if(/; Trident\/\d+\.\d+;/.test(u)&&/; rv:\d+\.\d+[;\)]/.test(u)){return(u=parseFloat(u.replace(/^.+; rv:(\d+\.\d+)[;\)].+$/,"$1")))?u:0;
- }}return 0;
- }());
- this.setup=function(){self.setup=function(){};
- _dataName="judy_"+self.randName();
- };
- this.typeOf=function(u){var t=typeof u;
- if(!arguments.length){return"Judy";
- }switch(t){case"boolean":case"string":return t;
- case"number":return isFinite(u)?t:(isNaN(u)?"NaN":"infinite");
- case"object":if(u===null){return"null";
- }try{if(u.typeOf&&typeof u.typeOf==="function"){return u.typeOf();
- }else{if(typeof u.length==="number"&&!(u.propertyIsEnumerable("length"))&&typeof u.splice==="function"){return"array";
- }else{if(u===window){return"window";
- }else{if(u===document){return"document";
- }else{if(u===document.documentElement){return"document.documentElement";
- }else{if(u.getAttributeNode){return u.tagName.toLowerCase==="img"?"image":"element";
- }else{if(u.nodeType){switch(u.nodeType){case 3:return"textNode";
- case 2:return"attributeNode";
- }return"otherNode";
- }else{if(typeof u.stopPropagation==="function"||(u.cancelBubble!==undefined&&typeof u.cancelBubble!=="function"&&typeof u.boundElements==="object")){return"event";
- }else{if(typeof u.getUTCMilliseconds==="function"){return"date";
- }else{if(typeof u.exec==="function"&&typeof u.test==="function"){return"regexp";
- }else{if(u.hspace&&typeof u.hspace!=="function"){return"image";
- }else{if(u.jquery&&typeof u.jquery==="string"&&!u.hasOwnProperty("jquery")){return"jquery";
- }}}}}}}}}}}}}catch(er){}return t;
- case"function":return(u.constructor===RegExp||(typeof u.exec==="function"&&typeof u.test==="function"))?"regexp":t;
- }return t;
- };
- this.isContainer=function(u,orArray){var t;
- return u&&typeof u==="object"&&((t=self.typeOf(u))==="object"||(orArray&&t==="array")||(t!=="array"&&self.arrayIndexOf(_nonObj,t)===-1))?(!orArray||t!=="array"?"object":t):false;
- };
- this.isArray=function(u){return(u&&typeof u==="object"&&typeof u.length==="number"&&!(u.propertyIsEnumerable("length"))&&typeof u.splice==="function");
- };
- this.isNumber=function(u){return typeof u==="number"&&isFinite(u);
- };
- this.isInt=function(u,nonNegative){return typeof u==="number"&&isFinite(u)&&(u%1===0)&&(!nonNegative||u>-1);
- };
- this.containerCopy=function(oa,shallow){var t,c={},p,v;
- if(!oa||!(t=self.isContainer(oa,true))){return oa;
- }if(t==="array"){if(shallow){return oa.concat();
- }c=[];
- }for(p in oa){if(oa.hasOwnProperty(p)){c[p]=((v=oa[p])&&typeof v==="object")?(v===oa?c:(!shallow?self.containerCopy(v,false):v)):v;
- }}return c;
- };
- this.objectGet=function(o,anyNumberOfKeys){var a=arguments,le=a.length,u=o,p,i;
- try{if(!u||typeof u!=="object"){throw new Error("arg o isnt object");
- }if(le<2){throw new Error("no key arg");
- }for(i=1;
- i<le;
- i++){if(i>1&&(!u||typeof u!=="object")){return undefined;
- }if((!(p=a[i])&&p!==0)||!(p=""+p)){throw new Error("arg #"+i+"["+p+"] type["+self.typeOf(p)+"] isnt integer or non-empty string");
- }if(u.hasOwnProperty(p)){u=u[p];
- }else{return undefined;
- }}return u;
- }catch(er){_errorHandler(er,null,_name+".objectGet()");
- }return undefined;
- };
- this.objectKeys=function(o){var a,k;
- if(!o||typeof o!=="object"){return null;
- }if(typeof Object.keys==="function"){return Object.keys(o);
- }a=[];
- for(k in o){if(o.hasOwnProperty(k)){a.push(k);
- }}return a;
- };
- this.objectKeyOf=function(o,v){var k;
- if(v!==undefined&&o||typeof o==="object"){for(k in o){if(o.hasOwnProperty(k)&&o[k]===v){return k;
- }}}return undefined;
- };
- this.objectSort=function(o){var a=[],oByVal={},os={},k,v,cNum=String.fromCharCode(127),le,i=0;
- if(!o||typeof o!=="object"){return o;
- }for(k in o){if(o.hasOwnProperty(k)){++i;
- oByVal[(typeof(v=o[k])!=="number"?"":cNum)+v]=k;
- a.push(v);
- }}if(!i){return o;
- }le=i;
- a.sort();
- for(i=0;
- i<le;
- i++){os[oByVal[(typeof(v=a[i])!=="number"?"":cNum)+v]]=v;
- }return os;
- };
- this.objectKeySort=function(o){var a,os={},le,i;
- if(!(a=self.objectKeys(o))||(le=a.length)<2){return a?o:null;
- }a.sort();
- for(i=0;
- i<le;
- i++){os[a[i]]=o[a[i]];
- }return os;
- };
- this.toArray=function(o){var a,le,i;
- if(o&&typeof o==="object"){if(typeof o.hasOwnProperty==="function"){return Array.prototype.slice.call(o);
- }a=[];
- le=o.length;
- for(i=0;
- i<le;
- i++){a.push(o[i]);
- }return a;
- }return null;
- };
- this.arrayIndexOf=function(a,v){var le=a.length,i;
- for(i=0;
- i<le;
- i++){if(a[i]===v){return i;
- }}return -1;
- };
- this.merge=function(oa,oa1,isContainer,_depth){var tBoth=isContainer!==true?isContainer:0,t=tBoth||self.isContainer(oa,true),t1=tBoth||self.isContainer(oa1,true),d=_depth||0,p,le,le1,v,v1;
- try{if(d<10){if(t&&t1){if(t==="object"){if(t1==="object"){for(p in oa1){if(oa1.hasOwnProperty(p)&&(v1=oa1[p])!==undefined){if((v=oa[p])===undefined||!oa.hasOwnProperty(p)){oa[p]=v1;
- }else{if(v1!==null){if(!(t=self.isContainer(v,true))||self.isContainer(v1,true)!==t){oa[p]=v1;
- }else{self.merge(v,v1,t,d+1);
- }}}}}return true;
- }throw new TypeError("Type mismatch, first is object type["+self.typeOf(oa)+"], second is array");
- }else{if(t1==="array"){if((le1=oa1.length)){if(!(le=oa.length)){oa=oa1.concat();
- }else{for(p=0;
- p<le1;
- p++){if((v1=oa1[p])!==undefined){if(p>=le){oa.push(v1);
- }else{if((v=oa[p])===undefined){oa[p]=v1;
- }else{if(v1!==null){if(!(t=self.isContainer(v,true))||self.isContainer(v1,true)!==t){oa[p]=v1;
- }else{self.merge(v,v1,t,d+1);
- }}}}}}}}return true;
- }}throw new TypeError("Type mismatch, first is array, second is type["+self.typeOf(oa1)+"]");
- }throw new TypeError("First arg is type["+self.typeOf(oa)+"], second is type["+self.typeOf(oa1)+"]");
- }throw new Error("Cant recurse > 10, circular ref?");
- }catch(er){_errorHandler(er,null,_name+".merge()");
- }return false;
- };
- this.ancestor=function(selector,parentSelector,max){var u,r=_elm(0,selector,null,"ancestor"),tt=parentSelector,lim=max&&max>0?(max+1):101,id,aCls,tn,cls,le,i;
- if(!r||r===window||r===document.documentElement){return undefined;
- }if(!tt||!(tt=$.trim(""+tt))){return r.parentNode;
- }if(tt.indexOf("#")>-1){u=tt.replace(/^([^\#]+)?\#([^\.]+)(\..+)?$/,"$2,$1$3").split(",");
- id=u[0];
- tt=u[1]||"";
- }if(tt.indexOf(".")>-1){aCls=tt.split(".");
- tt=aCls[0];
- aCls.splice(0,1);
- le=aCls.length;
- }tt=tt.toLowerCase();
- while((--lim)&&(r=r.parentNode)){if(r.nodeType!==1||tn==="body"){return undefined;
- }tn=r.tagName.toLowerCase();
- if((tt&&tn!==tt)||(id&&r.id!==id)){continue;
- }if(le){if(!(cls=r.className).length){continue;
- }cls=" "+cls+" ";
- u=0;
- for(i=0;
- i<le;
- i++){if(cls.indexOf(aCls[i])===-1){continue;
- }++u;
- }if(u<le){continue;
- }}return r;
- }return undefined;
- };
- this.selector=function(selector,findName){var s=selector,f=findName,t=typeof s,x,v,tg;
- try{if(!s){throw new Error("Falsy selector, type["+t+"]");
- }if(t==="string"){return !f?s:(s.indexOf("[name=")===-1?[s]:[s,s.replace(/^.*\[name=['\"]([^'\"]+)['\"]\].*$/,"$1")]);
- }else{if(t==="object"){if($.isWindow(s)){x="_win_";
- }else{if(s===document){x="_doc_";
- }else{if(s===document.documentElement){x="_docElm_";
- }}}if(x){return !f?x:[x];
- }if(typeof s.getAttributeNode!=="function"||typeof s.getAttribute!=="function"){throw new Error("Selector, type["+t+"], isnt non-empty string|element");
- }tg=s.tagName.toLowerCase();
- if((v=s.getAttribute("name"))){x=tg+'[name="'+v+'"]';
- return !f?x:[x,v];
- }if((v=s.id)){x="#"+v;
- }else{if((v=s.className)){x=tg+"."+v.replace(/ +/g,".");
- }else{if((v=s.getAttribute("type"))){x=tg+'[type="'+v+'"]';
- }else{x=tg;
- }}}return !f?x:[x];
- }else{throw new Error("Selector, type["+t+"], isnt non-empty string|element");
- }}}catch(er){_errorHandler(er,null,_name+".selector()");
- }return null;
- };
- this.ajaxcomplete=function(selector,url,data,handler,filter){var s=selector,t=typeof s,nm,u=url,d=data,h=handler,f=filter,a,le,i,v;
- try{if(!s){throw new Error("Falsy selector, type["+t+"]");
- }if(t==="object"){if(s instanceof $){s=s.selector||s.get();
- }if($.isArray(s)){if(!(le=s.length)){throw new Error("Empty selector, type array or jquery");
- }for(i=0;
- i<le;
- i++){self.ajaxcomplete(s[i],u,d,h,f);
- return;
- }}}if(!(a=self.selector(s,true))){throw new Error("Bad selector, see previous error");
- }nm=a[1];
- s=a[0];
- if(!u||typeof u!=="string"){throw new Error("Url type["+self.typeOf(v)+"] isnt non-empty string");
- }if(u!=="*"){if(u.indexOf("http")===0){u=u.replace(/^https?:\/\/[^\/]+(\/.+)$/,"$1");
- }else{if(u.charAt(0)!=="/"){u="/"+u;
- }}}if(h){if(typeof h==="object"){f=h;
- h=null;
- }}if(d&&typeof d==="function"){h=d;
- d=null;
- }if(!h){throw new Error("Cant resolve a handler");
- }if(!_acInit){$(document).ajaxComplete(function(event,xhr,settings){var url=self.objectGet(settings,"url"),all=[],nm,val,le,i,n,j,k,$jq,nElms,fElms,elms,elm,lstnr,h,d,evt;
- if(url){if(url.indexOf("http")===0){url=url.replace(/^https?:\/\/[^\/]+(\/.+)$/,"$1");
- }for(k in _acLstnrs){if(_acLstnrs.hasOwnProperty(k)&&url.indexOf(k)===0){all.push(_acLstnrs[k]);
- }}if(_acLstnrs["*"]&&_acLstnrs.hasOwnProperty("*")){all.push(_acLstnrs["*"]);
- }if((le=all.length)){if((nm=self.objectGet(settings,"extraData","_triggering_element_name"))){if(!($jq=$('[name="'+nm+'"]')).length){return;
- }if((val=self.objectGet(settings,"extraData","_triggering_element_value"))!==undefined){if(!($jq=$jq.filter('[value="'+val+'"]')).length){return;
- }}nElms=(fElms=$jq.get()).length;
- }for(i=0;
- i<le;
- i++){n=all[i].length;
- for(j=0;
- j<n;
- j++){lstnr=$jq=elms=h=d=evt=null;
- lstnr=all[i][j];
- if(nm){if(lstnr[1]!==nm||(lstnr[4]&&!_filter(settings,lstnr[4]))){continue;
- }elms=fElms;
- }else{nElms=1;
- switch(lstnr[0]){case"_win_":elms=[window];
- break;
- case"_doc_":elms=[document];
- break;
- case"_docElm_":elms=[document.documentElement];
- break;
- default:nElms=(elms=$(lstnr[0]).get()).length;
- }if(!nElms||(lstnr[4]&&!_filter(settings,lstnr[4]))){continue;
- }}h=lstnr[2];
- d=lstnr[3];
- evt=!d?{type:"ajaxcomplete"}:{type:"ajaxcomplete",data:d};
- evt.ajax=settings;
- for(k=0;
- k<nElms;
- k++){elm=null;
- elm=elms[k];
- h.apply(elm,[evt]);
- }}}}}});
- _acInit=true;
- }if(f){if(!$.isArray(f)){f=[f];
- }if(u==="*"){f=f.concat(_acFltrs);
- }}else{if(u==="*"){f=_acFltrs;
- }}if(!_acLstnrs[u]){_acLstnrs[u]=[[s,nm,h,d,f]];
- }else{_acLstnrs[u].push([s,nm,h,d,f]);
- }}catch(er){_errorHandler(er,null,_name+".ajaxcomplete()");
- }};
- this.ajaxcomplete.off=function(selector,url,handler){var s=selector,t=typeof s,u=url,h=handler,nm,lstnrs,a,le,i,rm=[],sbtrt;
- try{if(!_acInit){return;
- }if(!s){throw new Error("Falsy selector, type["+t+"]");
- }if(t==="object"){if(s instanceof $){s=s.selector||s.get();
- }if($.isArray(s)){if(!(le=s.length)){throw new Error("Empty selector, type array or jquery");
- }for(i=0;
- i<le;
- i++){self.ajaxcomplete.off(s[i],u,h);
- return;
- }}}if(!(a=self.selector(s,true))){throw new Error("Bad selector, see previous error");
- }nm=a[1];
- s=a[0];
- if(u){if((t=typeof u)==="function"){h=u;
- u=null;
- }else{if(t!=="string"){throw new Error("Url type["+self.typeOf(v)+"] isnt non-empty string");
- }if(u.indexOf("http")===0){u=u.replace(/^https?:\/\/[^\/]+(\/.+)$/,"$1");
- }else{if(u.charAt(0)!=="/"){u="/"+u;
- }}}}if(u){_acOff(u,s,nm,h);
- }else{for(u in _acLstnrs){_acOff(u,s,nm,h);
- }}}catch(er){_errorHandler(er,null,_name+".ajaxcomplete.off()");
- }};
- this.keydown=function(){try{_bindKeys("keydown",arguments);
- return true;
- }catch(er){_errorHandler(er,null,_name+".keydown()");
- }return false;
- };
- this.keyup=function(){try{_bindKeys("keyup",arguments);
- return true;
- }catch(er){_errorHandler(er,null,_name+".keyup()");
- }return false;
- };
- this.eventList=function(selector,type){var r=_elm(0,selector,null,"eventList"),jq,o,k;
- if(!r){return undefined;
- }jq=$(r);
- if((o=jq.data())){if(!o.hasOwnProperty("events")){for(k in o){if(k.length>7&&o.hasOwnProperty(k)&&k.indexOf("jQuery")===0){if(!(o=o[k])||!o.events||!o.hasOwnProperty("events")){return null;
- }}}}}if(!o){return null;
- }if(!type){return o.events;
- }o=o.events;
- for(k in o){if(k===type&&o.hasOwnProperty(k)){return o[k];
- }}return null;
- };
- this.isField=function(elm,button){return typeof elm==="object"&&elm.tagName?(_fieldType(elm,button)?true:false):undefined;
- };
- this.fieldType=function(selector,context,button){var r=_elm(0,selector,context,"fieldType");
- return r?_fieldType(r,button):undefined;
- };
- this.fieldValue=function(selector,context,val,type){var r=_elm(0,selector,context,"fieldValue"),t;
- if(r&&(t=type||_fieldType(r,true))){switch(t){case"select":return _valSelect(r,val);
- case"checkbox":return _valCheckbox(r,val);
- case"checkboxes":case"checklist":return _valChecklist(r,val);
- case"radio":case"radios":return _valRadio(r,context,val);
- case"image":t="src";
- default:t="";
- }if(val===undefined){return !t?r.value:r.getAttribute(t);
- }if(!t){r.value=""+val;
- }else{r.setAttribute(t,""+val);
- }return true;
- }return undefined;
- };
- this.disable=function(selector,context,hoverTitle){_disable(0,selector,context,hoverTitle);
- };
- this.enable=function(selector,context,hoverTitle){_disable(1,selector,context,hoverTitle);
- };
- this.scrollTrap=function(selector,context,eventName){var a=_elm(true,selector,context,"scrollTrap"),nm=eventName||(_name+".scrollTrap");
- if(a){$(a).each(function(){var preventZone=100,halfZone,s=this.scrollTop,$self=$(this),$chlds,le,$chld,h;
- if(!$self.hasClass("scroll-trapped")){if((le=($chlds=$self.children()).get().length)===1){$chld=$($chlds.get(0));
- }else{if(le){$chld=$chlds.wrapAll("<div />").parent();
- }else{return;
- }}$self.addClass("scroll-trapped");
- if((h=this.clientHeight)<1.5*preventZone){preventZone=Math.floor(h/1.5);
- }halfZone=Math.floor(preventZone/2);
- $chld.css({"margin-top":preventZone+"px","margin-bottom":preventZone+"px"});
- this.scrollTop=s+preventZone;
- $self.bind("scroll."+nm,function(){var that=this,s=that.scrollTop,h;
- if(s<halfZone){that.scrollTop=halfZone;
- setTimeout(function(){that.scrollTop=preventZone;
- },100);
- }else{if(s>(h=that.scrollHeight-that.clientHeight)-halfZone){that.scrollTop=h-halfZone;
- setTimeout(function(){that.scrollTop=h-preventZone;
- },100);
- }}});
- }});
- }};
- this.scrollTo=function(selector,context,offset,pad){var u,par,r,to=offset,p=pad||0,num,$par,chld,prvntZn=0,max=-1;
- if((par=_elm(0,selector,context,"scrollTo"))){if(!to||typeof to==="number"||!(r=_elm(0,to,par,"",true))){num=true;
- to=!to||!isFinite(to)||to<0?0:to;
- }if(($par=$(par)).hasClass("scroll-trapped")&&(chld=$par.children().get(0))){prvntZn=parseInt($(chld).css("margin-top").replace(/px/,""),10);
- max=par.scrollHeight-par.clientHeight-Math.floor(prvntZn*0.75);
- }if(num){to+=prvntZn;
- }else{par.scrollTop=prvntZn;
- to=(r.offsetTop-par.offsetTop);
- }if(p&&prvntZn&&p<0&&(p*-1)>(u=Math.floor(prvntZn/4))){p=-u;
- }to+=p;
- if(max>0&&to>max){to=max;
- }par.scrollTop=to;
- }};
- this.focus=function(selector,context,delay){var d=delay||0,to;
- if(selector){to=setTimeout(function(){var r;
- if((r=_elm(0,selector,context,"",true))){try{r.focus();
- }catch(er){}}},d>=0?d:20);
- }};
- this.innerWidth=function(selector,ignorePadding){return _dimInner("Width",selector,ignorePadding);
- };
- this.innerHeight=function(selector,ignorePadding){return _dimInner("Height",selector,ignorePadding);
- };
- this.outerWidth=function(selector,includeMargin,set,max){return _dimOuter("Width",selector,includeMargin,set,max);
- };
- this.outerHeight=function(selector,includeMargin,set,max){return _dimOuter("Height",selector,includeMargin,set,max);
- };
- this.stripTags=function(u){return $.trim((""+u).replace(/<[^<>]+>/g," ").replace(/[ ]+/g," "));
- };
- this.toLeading=function(u,length){var le=length||1;
- return(new Array(le).join("0")+u).substr(-le,le);
- };
- this.toUpperCaseFirst=function(u){var s=""+u,le=s.length;
- return !le?"":(s.charAt(0).toUpperCase()+(le<2?"":s.substr(1)));
- };
- this.isLeapYear=function(u){var y;
- switch(self.typeOf(u)){case"date":y=u.getFullYear();
- break;
- case"number":y=u;
- break;
- case"string":y=parseInt(u,10);
- break;
- default:return null;
- }if(isFinite(y)&&u>-1&&u%1===0){return(!(y%4)&&(y%100))||!(y%400);
- }return null;
- };
- this.dateISO=function(date,UTC){var d=date||new Date();
- return UTC&&Date.prototype.toISOString?d.toISOString():_dateFrmt(d,1,1,1,UTC,1);
- };
- this.dateTime=function(date,UTC){var d=date||new Date();
- return UTC&&Date.prototype.toISOString?d.toISOString().replace(/T/," ").replace(/\.\d{3}Z$/,""):_dateFrmt(d,1,1,0,UTC);
- };
- this.dateToFormat=function(date,sFormat){var u=date,fmt=sFormat||"YYYY-MM-DD",le,y,m,d,s,a,b;
- if(u&&typeof u==="object"&&u.getFullYear){y=u.getFullYear();
- m=self.toLeading(u.getMonth()+1,2);
- d=self.toLeading(u.getDate(),2);
- if((a=(s=fmt.substr(0,10)).replace(/[MDY]/g,"")).length<2){return"";
- }b=a.charAt(1);
- a=a.charAt(0);
- switch(s.replace(/[^MDY]/g,"")){case"YYYYMMDD":s=y+a+m+b+d;
- break;
- case"MMDDYYYY":s=m+a+d+b+y;
- break;
- case"DDMMYYYY":s=d+a+m+b+y;
- break;
- default:return"";
- }if((le=fmt.length)>11){s+=" "+self.toLeading(u.getHours(),2);
- if(le>14){s+=":"+self.toLeading(u.getMinutes(),2);
- if(le>17){s+=":"+self.toLeading(u.getSeconds(),2);
- if(le>20){s+=" "+self.toLeading(u.getMilliseconds(),3);
- }}}}return s;
- }else{try{throw new Error("date["+u+"] type["+self.typeOf(u)+"] is not a non-empty Date");
- }catch(er){_errorHandler(er,null,_name+".dateToFormat()");
- }return"";
- }};
- this.dateFromFormat=function(sDate,sFormat){var s=sDate,dt=new Date(),fmt=sFormat||"YYYY-MM-DD",y,m,d;
- if(s&&typeof s==="string"){if(/^YYYY.MM.DD$/.test(fmt)){y=s.substr(0,4);
- m=s.substr(5,2);
- d=s.substr(8,2);
- }else{if(/^MM.DD.YYYY$/.test(fmt)){y=s.substr(6,4);
- m=s.substr(0,2);
- d=s.substr(3,2);
- }else{if(/^DD.MM.YYYY$/.test(fmt)){y=s.substr(6,4);
- m=s.substr(3,2);
- d=s.substr(0,2);
- }else{return null;
- }}}y=parseInt(y,10);
- d=parseInt(d,10);
- switch((m=parseInt(m,10))){case 1:case 3:case 5:case 7:case 8:case 10:case 12:if(d>31){return null;
- }break;
- case 4:case 6:case 9:case 11:if(d>30){return null;
- }break;
- case 2:if(d>29||(d===29&&!self.isLeapYear(y))){return null;
- }break;
- default:return null;
- }dt.setFullYear(y,m-1,d);
- dt.setHours(0,0,0);
- dt.setMilliseconds(0);
- return dt;
- }else{try{throw new Error("date["+s+"] type["+self.typeOf(s)+"] is not non-empty string");
- }catch(er){_errorHandler(er,null,_name+".dateFromFormat()");
- }return null;
- }};
- this.timeFormat=function(date,sTime){var d=date,t=sTime?$.trim(sTime):0,h=0,i=0,s=0,le,v;
- if(d&&typeof d==="object"&&d.getFullYear){if(t){if(/^\d+$/.test(t)){h=t.substr(0,2);
- if((le=t.length)>3){i=t.substr(2,2);
- if(le>5){s=t.substr(4,2);
- }}}else{if((le=(t=t.split(/[^\d]/)).length)){h=t[0];
- if(le>1){i=t[1];
- if(le>2){s=t[2];
- }}}}if(h){h=isFinite(v=parseInt(h,10))&&v<25?v:0;
- if(i){i=isFinite(v=parseInt(i,10))&&v<60?v:0;
- }if(s){s=isFinite(v=parseInt(s,10))&&v<60?v:0;
- }if(h===24){if(!i&&!s){h=23;
- i=s=59;
- }else{h=0;
- }}}d.setHours(h,i,s);
- }else{h=d.getHours();
- i=d.getMinutes();
- s=d.getSeconds();
- }return""+(h<10?"0":"")+h+":"+(i<10?"0":"")+i+":"+(s<10?"0":"")+s;
- }else{try{throw new Error("date["+d+"] type["+self.typeOf(d)+"] is not a non-empty Date");
- }catch(er){_errorHandler(er,null,_name+".timeFormat()");
- }return"00:00:00";
- }};
- this.numberToFormat=function(num,oFormat){var n=num||0,s,sgn="",o,isInt,kSep,scale,u,le,d,i;
- if(!n){return"0";
- }if(n<0){n*=-1;
- sgn="-";
- }isInt=!(u=(o=oFormat||{}).type)||u==="integer";
- kSep=(u=o.thousand_separator)||u===""?u:" ";
- if((d=n%1)){n=Math.round(n);
- }s=""+n;
- if(kSep&&(le=s.length)>3){n=s;
- s=n.substr(0,i=le%3);
- while(i<le){s+=(i?kSep:"")+n.substr(i,3);
- i+=3;
- }}scale=o.scale||2;
- return sgn+s+(isInt?"":(((u=o.decimal_separator)||u===""?u:".")+((d?(""+Math.round(d*Math.pow(10,scale))):"")+new Array(scale+1).join("0")).substr(0,scale)));
- };
- this.numberFromFormat=function(str,oFormat){var s=$.trim(str),sgn=1,o,isInt,dSep,u,p,d,n;
- if(!s||s==="0"||s==="-0"){return 0;
- }if(s.charAt(0)==="-"){sgn=-1;
- s=s.substr(1);
- }if((s=s.replace(/^(.*\d)\D+$/,"$1").replace(/^[^1-9]+([1-9].*)$/,"$1"))){isInt=!(u=(o=oFormat||{}).type)||u==="integer";
- dSep=o.decimal_separator||".";
- if(new RegExp("\\"+dSep+"\\d*\\D").test(s)){return false;
- }if((p=s.indexOf(dSep))>-1){d=s.substr(p).replace(/\D/g,"");
- s=s.substr(0,p);
- }n=parseInt(s.replace(/\D/g,""),10);
- if(d){n+=parseInt(d,10)/Math.pow(10,d.length);
- }return sgn*(!isInt?n:Math.round(n));
- }return 0;
- };
- this.rand=function(min,max){var m=min||0;
- return m+Math.floor((Math.random()*(((max||9000000000000000)-m)+1))+1)-1;
- };
- this.randName=function(length){var al=length||20,l,s=String.fromCharCode(Math.floor(Math.random()*26)+97);
- while((l=s.length)<al){s+=Math.floor(Math.random()*9000000000000000).toString(36);
- }return l>al?s.substr(0,al):s;
- };
- this.overlay=function(show,opaque,hoverTitle){var hide=!show||typeof show==="object",ttl=hoverTitle||"",clsO="module-judy-overlay-opaque",clsT="module-judy-overlay-hovertitled";
- if(!_jqOvrly){if(hide){return;
- }$(document.body).append('<div id="module_judy_overlay" class="'+(opaque?clsO:"")+(opaque&&ttl?" ":"")+(ttl?clsT:"")+'"></div>');
- _jqOvrly=$("div#module_judy_overlay");
- _ovrlyRsz();
- $(window).resize(function(){_ovrlyRsz();
- });
- }else{if(hide){_jqOvrly.hide();
- return;
- }else{_jqOvrly[opaque?"addClass":"removeClass"](clsO)[ttl?"addClass":"removeClass"](clsT).get(0).setAttribute("title",ttl);
- }}_jqOvrly.show();
- };
- this.dialog=function(selector,option,value){var sl=selector,u=option,t,s,o,v=value,keys,a,tg="",id="",cls="module-judy-dialog",cls1="",elm,jq,dialExists,fxd,title,doOpen,autoOpenLater,to;
- if($.ui&&typeof $.ui.dialog==="function"){if(u){if((t=typeof u)==="string"){if(u!=="option"){s=u;
- }else{if(v&&typeof v==="object"){o=self.containerCopy(v);
- }}}else{if(t==="object"){o=self.containerCopy(u);
- }}}if(sl){if(typeof sl==="string"){if(sl.indexOf("#")===-1&&sl.indexOf(".")===-1){if((elm=document.getElementById(id=sl))&&self.arrayIndexOf(_dialogs,id)>-1){dialExists=true;
- }}else{if((elm=$(sl).get(0))){if((id=elm.id)){if(self.arrayIndexOf(_dialogs,id)>-1){dialExists=true;
- }}else{id=elm.id=self.randName();
- }}else{a=sl.replace(/^([a-z\d_\-]+)?(\#[a-z\d_\-]+)?(\.[a-z\d_\-]+)?$/,"$1,$2,$3").split(",");
- tg=a[0];
- id=a[1]?a[1].substr(1):self.randName();
- if(a[2]){cls1=" "+a[2].split(/\./).join(" ");
- }}}}else{if(typeof sl==="object"&&sl.getAttributeNode){if((id=elm.id)){if(self.arrayIndexOf(_dialogs,id)>-1){dialExists=true;
- }}else{id=elm.id=self.randName();
- }}}}else{id=self.randName();
- }if(dialExists){doOpen=false;
- jq=$(elm);
- if(o){delete o.fixed;
- if((keys=self.objectKeys(o)).length===1){v=o[s=keys[0]];
- }}if(s){if(s==="content"){if(jq.dialog("isOpen")){doOpen=true;
- }jq.html(v);
- if(doOpen){if(doOpen){to=setTimeout(function(){jq.dialog("open");
- },100);
- }}return id;
- }if(s==="getContent"){return jq.html();
- }if(s==="title"){$(".ui-dialog-title",$(elm.parentNode)).html(v);
- return id;
- }else{if(self.arrayIndexOf(_dialOpts,s)>-1||self.arrayIndexOf(_dialEvts,s)>-1){jq.dialog("option",s,v);
- }}if(self.arrayIndexOf(_dialMthds,s)>-1){return jq.dialog(s);
- }jq.dialog(s,v);
- return id;
- }else{if(o){if(jq.dialog("isOpen")){doOpen=true;
- jq.dialog("close");
- }if(o.close&&o.hasOwnProperty("close")&&typeof o.close!=="function"){doOpen=false;
- delete o.close;
- }if(o.content!==undefined&&o.hasOwnProperty("content")){jq.html(v);
- delete o.content;
- }if(o.open&&o.hasOwnProperty("open")){doOpen=true;
- delete o.open;
- }jq.dialog(o);
- if(doOpen){to=setTimeout(function(){jq.dialog("open");
- },100);
- }}}return id;
- }doOpen=true;
- if(!o){o={};
- if(s){o[s]=v;
- }}if(!elm){$(document.body).append("<"+(tg||"div")+' id="'+id+'" class="'+cls+cls1+(!o.contentClass?"":(" "+o.contentClass))+'"></'+(tg||"div")+">");
- elm=document.getElementById(id);
- }jq=$(elm);
- if(o.open&&o.hasOwnProperty("open")){delete o.open;
- }if(!o.autoOpen&&o.hasOwnProperty("autoOpen")){doOpen=false;
- }else{autoOpenLater=true;
- o.autoOpen=false;
- }if((u=self.objectGet(o,"content"))){jq.html(u);
- delete o.content;
- }if(o.fixed&&o.hasOwnProperty("fixed")){fxd=true;
- delete o.fixed;
- }if(o.title&&o.hasOwnProperty("title")){title=o.title;
- delete o.title;
- }jq.dialog(o);
- u=$(elm.parentNode);
- if(fxd){u.css("position","fixed");
- }if(title!==undefined){$(".ui-dialog-title",u).html(title);
- }u.addClass(cls+"-container");
- _dialogs.push(id);
- if(doOpen){to=setTimeout(function(){jq.dialog("open");
- if(autoOpenLater){jq.dialog("autoOpen",true);
- }},100);
- }return id;
- }try{throw new Error("jQuery UI Dialog not included");
- }catch(er){_errorHandler(er,null,_name+".dialog()");
- }return false;
- };
- this.timer=function(o,func,args,delay){return new self.Timer(o,func,args,delay);
- };
- this.Timer=function(o,func,args,delay){var a=args||[],fired=false,f=o?function(){fired=true;
- try{func.apply(o,a);
- }catch(er){}}:function(){fired=true;
- try{func();
- }catch(er){}},t=window.setTimeout(f,delay||0);
- this.fired=function(){return fired;
- };
- this.cancel=function(){window.clearTimeout(t);
- };
- };
- };
- (Drupal.Judy=window.Judy=window.judy=new Judy($)).setup();
- })(jQuery);
|