/* yahoo-dom-event.js (31,637), animation.js (13,683), connection.js (13,257), element.js (8,589), dragdrop.js (24,043), json.js (3,480), get.js (4,061), wikibits.js (3,688), menu.js (3,233), messaging.js (4,906), general.js (5,695), jquery.min.js (72,174), jquery.plugins.js (2,726), Mindtouch.util.js (4,285), comments.js (4,235), thickbox.js (12,487), jquery.autocomplete.js (20,837), jquery.editable.js (3,466), jquery.hoverIntent.min.js (2,686), pagebus.js (4,035), deki.js (4,563), quickpopup.js (791), files_table.js (7,354), image_gallery_lite.js (823), editor.js (13,149), ckeditor_basic.js (6,867), editor.js (5,451), page_tags.js (10,538), page_alerts.js (3,442), page_template_selector.js (3,152), page_content_rating.js (3,826), page_title_editor.js (6,474), tooltips.js (3,028), jquery.qtip-1.0.min.js (38,405) */ /* --------- YAHOO-DOM-EVENT.JS --------- */ /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.6.0 */ if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(R,O,S,Q,P){var M=(YAHOO.lang.isString(R))?[R]:R;for(var N=0;N-1;Q--){W=(this._removeListener(N[Q],M,V,Y)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[4];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.override){if(W.override===true){U=W.obj;}else{U=W.override;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this._removeListener(O,N.type,N.fn,N.capture);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P-1;O--){N=I[O];if(N){M._removeListener(N[M.EL],N[M.TYPE],N[M.FN],N[M.CAPTURE],O);}}N=null;}G=null;M._simpleRemove(window,"unload",M._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{}; var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.6.0",build:"1321"}); /* --------- CONNECTION.JS --------- */ /* Copyright (c) 2011, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 2.9.0 */ YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_isFormSubmit:false,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(a){this._msxml_progid.unshift(a);},setDefaultPostHeader:function(a){if(typeof a=="string"){this._default_post_header=a;this._use_default_post_header=true;}else{if(typeof a=="boolean"){this._use_default_post_header=a;}}},setDefaultXhrHeader:function(a){if(typeof a=="string"){this._default_xhr_header=a;}else{this._use_default_xhr_header=a;}},setPollingInterval:function(a){if(typeof a=="number"&&isFinite(a)){this._polling_interval=a;}},createXhrObject:function(g){var d,a,b;try{a=new XMLHttpRequest();d={conn:a,tId:g,xhr:true};}catch(c){for(b=0;b=200&&f<300)||f===1223||c){a=b.xdr?b.r:this.createResponseObject(b,h);if(j&&j.success){if(!j.scope){j.success(a);}else{j.success.apply(j.scope,[a]);}}this.successEvent.fire(a);if(b.successEvent){b.successEvent.fire(a);}}else{switch(f){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:a=this.createExceptionObject(b.tId,h,(d?d:false));if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}break;default:a=(b.xdr)?b.response:this.createResponseObject(b,h);if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}}this.failureEvent.fire(a);if(b.failureEvent){b.failureEvent.fire(a);}}this.releaseObject(b);a=null;},createResponseObject:function(a,h){var d={},k={},f,c,g,b;try{c=a.conn.getAllResponseHeaders();g=c.split("\n");for(f=0;f'+''+''+"",k=document.createElement("div");document.body.appendChild(k);k.innerHTML=j;}function b(l,i,j,n,k){h[parseInt(l.tId)]={"o":l,"c":n};if(k){n.method=i;n.data=k;}l.conn.send(j,n,l.tId);}function e(i){d(i);g._transport=document.getElementById("YUIConnectionSwf");}function c(){g.xdrReadyEvent.fire();}function a(j,i){if(j){g.startEvent.fire(j,i.argument);if(j.startEvent){j.startEvent.fire(j,i.argument);}}}function f(j){var k=h[j.tId].o,i=h[j.tId].c;if(j.statusText==="xdr:start"){a(k,i);return;}j.responseText=decodeURI(j.responseText);k.r=j;if(i.argument){k.r.argument=i.argument;}this.handleTransactionResponse(k,i,j.statusText==="xdr:abort"?true:false);delete h[j.tId];}g.xdr=b;g.swf=d;g.transport=e;g.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");g.xdrReady=c;g.handleXdrResponse=f;})();(function(){var e=YAHOO.util.Connect,g=YAHOO.util.Event,a=document.documentMode?document.documentMode:false;e._isFileUpload=false;e._formNode=null;e._sFormData=null;e._submitElementValue=null;e.uploadEvent=new YAHOO.util.CustomEvent("upload");e._hasSubmitListener=function(){if(g){g.addListener(document,"click",function(k){var j=g.getTarget(k),i=j.nodeName.toLowerCase();if((i==="input"||i==="button")&&(j.type&&j.type.toLowerCase()=="submit")){e._submitElementValue=encodeURIComponent(j.name)+"="+encodeURIComponent(j.value);}});return true;}return false;}();function h(w,r,m){var v,l,u,s,z,t=false,p=[],y=0,o,q,n,x,k;this.resetFormState();if(typeof w=="string"){v=(document.getElementById(w)||document.forms[w]);}else{if(typeof w=="object"){v=w;}else{return;}}if(r){this.createFrame(m?m:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=v;return;}for(o=0,q=v.elements.length;o-1){k=l.options[l.selectedIndex];p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}break;case"select-multiple":if(l.selectedIndex>-1){for(n=l.selectedIndex,x=l.options.length;n');if(typeof i=="boolean"){k.src="javascript:false";}}else{k=document.createElement("iframe");k.id=j;k.name=j;}k.style.position="absolute";k.style.top="-1000px";k.style.left="-1000px";document.body.appendChild(k);}function f(j){var m=[],k=j.split("&"),l,n;for(l=0;l=8)?true:false,z=this,v=(y&&y.argument)?y.argument:null,x,s,k,r,j,q;j={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",n);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",t);if(YAHOO.env.ua.ie&&!p){this._formNode.setAttribute("encoding",u);}else{this._formNode.setAttribute("enctype",u);}if(l){x=this.appendPostData(l);}this._formNode.submit();this.startEvent.fire(m,v);if(m.startEvent){m.startEvent.fire(m,v);}if(y&&y.timeout){this._timeOut[m.tId]=window.setTimeout(function(){z.abort(m,y,true);},y.timeout);}if(x&&x.length>0){for(s=0;sthis.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return ;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue; }if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id); }return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return ;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(Cthis.maxX){C=this.maxX;}}if(this.constrainY){if(Fthis.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D); }this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G0&&I-NB&&F0&&J-D=0;--i){if(pstack[i]===o){return"null";}}pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||"null";}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i=0?d:1/0;return _stringify({"":o},"",d,w,[]);}return undefined;},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z";},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d;}return str;}};})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.6.0",build:"1321"}); /* --------- GET.JS --------- */ /* Copyright (c) 2008, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.6.0 */ YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V]);}}return Z;};var I=function(T,U,W){var V=W||"utf-8";return J("link",{"id":"yui__dyn_"+(R++),"type":"text/css","charset":V,"rel":"stylesheet","href":T},U);};var P=function(T,U,W){var V=W||"utf-8";return J("script",{"id":"yui__dyn_"+(R++),"type":"text/javascript","charset":V,"src":T},U);};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId);}};};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T);}return V;};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V));}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return ;}if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T));}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.context||T;T.onTimeout.call(U,A(T));}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel();}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return ;}if(Z){U.url.shift();if(U.varName){U.varName.shift();}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName;}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.charset);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y);}else{C(V);}return ;}var T=U.url[0];if(!T){U.url.shift();return G(V);}if(U.timeout){U.timer=S.later(U.timeout,U,O,V);}if(U.type==="script"){W=P(T,c,U.charset);}else{W=I(T,c,U.charset);}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e);}}else{a.appendChild(W);}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T);}};var K=function(){if(E){return ;}E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T];}}E=false;};var D=function(a){var X=M[a];if(X){var Z=X.nodes,T=Z.length,Y=X.win.document,W=Y.getElementsByTagName("head")[0];if(X.insertBefore){var V=B(X.insertBefore,a);if(V){W=V.parentNode;}}for(var U=0;U=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;gthis.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return ;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.6.0",build:"1321"}); /* --------- WIKIBITS.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ //node is the current checkbox function select_checkboxes(node) { //select all checkboxes that is in the same form as this checkbox var boxes = Deki.$("input[@type='checkbox']", Deki.$(node).parents('form')); return node.checked ? boxes.check(): boxes.uncheck(); } // make the specified div a windowed control in IE6 // this masks an iframe (which is a windowed control) onto the div, // turning the div into a windowed control itself function makeWindowed(p_div) { var is_ie6 = document.all && (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1); if (is_ie6) { var html = ""; if (p_div) p_div.innerHTML += html; // force refresh of div var olddisplay = p_div.style.display; p_div.style.display = 'none'; p_div.style.display = olddisplay; }; } function showToc(node) { return DWMenu.Position('menuPageContent', node, -2, 0); } /*** * hooks an onclick to all links in the table of contents dropdown which closes the window */ function hookTOCLinks() { Deki.$('.pageToc ol a').click(function() { DWMenu.BodyClick(); }); }; function breadcrumbLoad(z) { document.getElementById('breadcrumb').innerHTML = z; }; function array_search(needle, haystack) { for (var i = 0; i < haystack.length; i++ ) { if (haystack[i] == needle) return i; } return false; }; // in [-]HH:MM format... // won't yet work with non-even tzs function fetchTimezone() { // FIXME: work around Safari bug var localclock = new Date(); // returns negative offset from GMT in minutes var tzRaw = localclock.getTimezoneOffset(); return formatTimezone(tzRaw); }; function formatTimezone(tzSecs) { var tzHour = Math.floor( Math.abs(tzSecs) / 60); var tzMin = Math.abs(tzSecs) % 60; return ((tzSecs >= 0) ? "-" : "") + ((tzHour < 10) ? "0" : "") + tzHour + ":" + ((tzMin < 10) ? "0" : "") + tzMin; }; function openWindow(href,menu) { window.open(href, 'popupwindow', 'width='+(winX - 100)+',height='+(winY - 100)+',scrollbars,resizable' + (menu ? ',menubar=yes' : '')); return false; }; // RecentChanges JS function toggleChangesTable(divid) { if (Deki.$('#showlink-'+divid).is(':visible')) { Deki.$('#showlink-'+divid).hide(); Deki.$('#hidelink-'+divid).show(); Deki.$('table tr.'+divid).hide(); } else { Deki.$('#showlink-'+divid).show(); Deki.$('#hidelink-'+divid).hide(); Deki.$('table tr.'+divid).show(); } return false; }; /* --------- MENU.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ function DWMenu() {}; DWMenu.Bubble = false; DWMenu.Opened = false; DWMenu.OpenedNow = false; DWMenu.Selected = false; DWMenu.LinkClick = function(divid, xoffset) { if (DWMenu.Opened && DWMenu.Opened != divid) DWMenu.Toggle(DWMenu.Opened, xoffset); DWMenu.Toggle(divid, xoffset); }; DWMenu.Toggle = function(divid, xoffset) { var node = Deki.$('#'+divid); //todo nullref var display = node.css('display'); node.toggle(); if (display == 'block') { DWMenu.Opened = false; } else { node.css('visibility', 'hidden'); //for ie6 var width = node.width(); var position = YAHOO.util.Dom.getXY(node); if (typeof(winX) != 'null') { if ((position[0] + width) > (winX - 36)) { if (typeof(offsetX) == 'undefined') offsetX = 0; node.css('left', (position[0] - width + offsetX + 5)+'px'); } } node.css('visibility', ''); DWMenu.Opened = divid; DWMenu.OpenedNow = true; } } DWMenu.Position = function (divid, elt, offsetX, offsetY) { if (!document.getElementById(divid)) return; var $elt = Deki.$(elt); var offset = $elt.offset(); offsetY = offsetY + $elt.outerHeight(); if (typeof(offsetX) == 'number') var x = offset.left + offsetX; if (typeof(offsetY) == 'number') var y = offset.top + offsetY; Deki.$("#" + divid).css("left", x+'px').css("top", y+'px'); DWMenu.LinkClick(divid, $elt.width()); return false; }; DWMenu.Off = function(divid) { var display = Deki.$('#'+divid).css('display'); if (display == 'block') { Deki.$('#'+divid).toggle(); DWMenu.Opened = false; } }; DWMenu.BodyClick = function() { if (!DWMenu.OpenedNow && !DWMenu.Bubble && DWMenu.Opened) { if (!DWMenu.Selected) { DWMenu.Toggle(DWMenu.Opened); } } if (DWMenu.Bubble) DWMenu.Bubble = false; if (DWMenu.OpenedNow) DWMenu.OpenedNow = false; }; //deprecated var menuLinkClick = function(divid, offsetX) { DWMenu.LinkClick(divid, offsetX); }; var menuToggle = function(navid, offsetX) { DWMenu.Toggle(navid, offsetX); }; var menuPosition = function (navid, elt, offsetX, offsetY) { return DWMenu.Position(navid, elt, offsetX, offsetY); }; var menuOff = function(navid) { DWMenu.Off(navid); }; var menuBodyClick = function() { DWMenu.BodyClick(); }; /* --------- MESSAGING.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ /*** * MindTouch Messaging * Outputs success/error messages that autoclose */ var MTMessage = function () {}; MTMessage.Active = false; MTMessage.DefaultTimerValue = 6; MTMessage.TimeValue = MTMessage.DefaultTimerValue; MTMessage.Timer = false; MTMessage.Show = function(headerText, bodyText, msgType, detailsArray) { if (MTMessage.Active) return; if (typeof(msgType) == 'undefined') msgType = 'ui-errormsg'; MTMessage.Active = true; MTMessage.SetHeader(headerText); MTMessage.SetBody(bodyText); if (typeof(detailsArray) == 'undefined' || detailsArray == '') { document.getElementById('MTMessageDetailsLink').style.display = 'none'; } else { MTMessage.SetDetails(detailsArray); } var node = document.getElementById('MTMessage'); document.getElementById('MTMessageStyle').className = 'ui-msg '+msgType; document.getElementById('MTMessage').style.display = 'block'; YAHOO.util.Dom.setStyle('MTMessage', 'opacity', 1); document.getElementById('MTMessageUnpaused').style.display = 'inline'; document.getElementById('MTMessagePaused').style.display = 'none'; document.getElementById('MTMessage').onmouseover = function() { if (MTMessage.Timer) MTMessage.PauseTimer(); }; MTMessage.GoTimer(); return false; }; MTMessage.Hide = function() { MTMessage.TimeValue = MTMessage.DefaultTimerValue; if (YAHOO.env.ua.ie > 0 && YAHOO.env.ua.ie < 7) { document.getElementById('MTMessage').style.display = 'none'; MTMessage.Active = false; return false; } var anim = new YAHOO.util.Anim('MTMessage', { opacity: { to: 0 } }, 1, YAHOO.util.Easing.easeOut); anim.onComplete.subscribe(function () { document.getElementById('MTMessage').style.display = 'none'; MTMessage.Active = false; }); anim.animate(); return false; }; MTMessage.PauseTimer = function() { MTMessage.Timer = false; document.getElementById('MTMessageUnpaused').style.display = 'none'; document.getElementById('MTMessagePaused').style.display = 'inline'; }; MTMessage.UnPauseTimer = function() { document.getElementById('MTMessageUnpaused').style.display = 'inline'; document.getElementById('MTMessagePaused').style.display = 'none'; MTMessage.GoTimer(); }; MTMessage.GoTimer = function() { MTMessage.Timer = true; MTMessage.TimeValue = MTMessage.DefaultTimerValue; MTMessage.TimerValue(MTMessage.TimeValue); }; MTMessage.TimerValue = function() { if (!MTMessage.Timer) return; MTMessage.TimeValue = MTMessage.TimeValue - 1; document.getElementById('MTMessageTimer').innerHTML = MTMessage.TimeValue+' '; if ((MTMessage.TimeValue) < 1) { MTMessage.Hide(); } else { setTimeout("MTMessage.TimerValue("+(MTMessage.TimeValue)+")", 1000); } }; MTMessage.SetHeader = function(val) { document.getElementById('MTMessageHeader').innerHTML = val; }; MTMessage.SetBody = function(val) { var elText = document.createTextNode(val); el = document.getElementById('MTMessageDesc'); el.innerHTML = ''; el.appendChild(elText); }; MTMessage.ShowDetails = function(anode) { document.getElementById('MTMessageDetails').style.display = 'block'; document.getElementById('MTMessageTextarea').select(); anode.parentNode.innerHTML = anode.innerHTML; //remove link return false; }; MTMessage.SetDetails = function(val) { var node, container; container = document.getElementById('MTMessageDetails'); node = document.getElementById('MTMessageTextarea'); // remove the previous message's details if ( node ) { container.removeChild(node); } node = document.createElement('textarea'); node.id = 'MTMessageTextarea'; node.className = 'ui-msgtextarea'; node.setAttribute('readonly', 'true'); node.value = eval(val); container.appendChild(node); }; /* --------- GENERAL.JS --------- */ String.prototype.utf8ToCodepoint = function() { var z = this.charCodeAt(0), length; if (z & 0x80) { length = 0; while (z & 0x80) { length++; z <<= 1; } } else length = 1; if (length != this.length) return false; if (length == 1) return z; // Mask off the length-determining bits and shift back to the original location z &= 0xff; z >>= length; // Add in the free bits from subsequent bytes for ( var i=1; i < length; i++ ) { z <<= 6; z |= this.charCodeAt(i) & 0x3f; } return z; }; String.prototype.utf8ToString = function() { var val = this.replace(/[\xc0-\xfd][\x80-\xbf]*/g, function(s) { return String.fromCharCode(s.utf8ToCodepoint()); });; return val; }; String.prototype.utf8URL = function() { var val = this.replace(/[ \?%\+&=#\.\u0080-\uFFFF]/g, function(s) { switch (s) { case ' ': return '_'; // case ' ': return '%20'; case '+': return '%2B'; default: return escape(String.charToUtf8(s.charCodeAt(0))); } }); return val; }; String.prototype.utf8 = function() { var val = this.replace(/[\u0080-\uFFFF]/g, function(s) { return String.charToUtf8(s.charCodeAt(0)); }); return val; }; String.charToUtf8 = function(codepoint) { if(codepoint < 0x80) return String.fromCharCode(codepoint); if(codepoint < 0x800) return String.fromCharCode( codepoint >> 6 & 0x3f | 0xc0, codepoint & 0x3f | 0x80); if(codepoint < 0x10000) return String.fromCharCode( codepoint >> 12 & 0x0f | 0xe0, codepoint >> 6 & 0x3f | 0x80, codepoint & 0x3f | 0x80); if(codepoint < 0x110000) return String.fromCharCode( codepoint >> 18 & 0x07 | 0xf0, codepoint >> 12 & 0x3f | 0x80, codepoint >> 6 & 0x3f | 0x80, codepoint & 0x3f | 0x80); // There should be no assigned code points outside this range, but return String.fromCharCode(codepoint); }; var winX = null; var winY = null; clientWindow = function () { if (self.innerHeight) { winX = self.innerWidth; winY = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { winX = document.documentElement.clientWidth; winY = document.documentElement.clientHeight; } else if (document.body) { winX = document.body.clientWidth; winY = document.body.clientHeight; } }; function mt_gen() { } /*** * takes a string and escapes single quotes and encodes html */ mt_gen.htmlspecialchars = function(str) { // performs HTML encoding of some given string mt_gen.htmlEncode_regEx = [ new RegExp().compile(/&/ig), new RegExp().compile(//ig), new RegExp().compile(/'/ig), new RegExp().compile(/\xA0/g), // \x22 means '"' -- we use hex reprezentation so that we don't disturb // JS compressors (well, at least mine fails.. ;) new RegExp().compile(/\x22/g), // special encode none-ASCII new RegExp().compile(/[\x80-\xFF]/g) ]; mt_gen.htmlEncode_regExR = [ "&", "<", ">", "\\'", " ", """, function(s,b){return "&#"+s.charCodeAt(0)+";";} ]; if(typeof str.replace == 'undefined') str = str.toString(); for (var i = 0; i < mt_gen.htmlEncode_regEx.length; ++i) str = str.replace(mt_gen.htmlEncode_regEx[i], mt_gen.htmlEncode_regExR[i]); return str; }; mt_gen.getUrlFromName = function(href) { href = mt_gen.extractName(href).replace(/ /g,'_'); if (href.indexOf('&') > 0 || href.indexOf('?') > 0 || href.indexOf('+') > 0 || href.indexOf('#') > 0 || href.indexOf('\\') > 0 || href.indexOf('//') > 0 || href.indexOf('%') > 0 ) href = 'index.php?title=' + encodeURIComponent(href); return '/' + href; }; mt_gen.extractName = function(href) { if (href.charAt(0) == '/') href = href.substr(1); if (href.indexOf('index.php?title=') == 0) href = href.substr('index.php?title='.length); href = href.replace(/&action=.+$/i, ''); try { href = unescape(href); } catch (e) {} return href; }; function iconify(icon_class, parentClass) { if (!parentClass) parentClass = 'icon'; var span = document.createElement('span'); span.className = parentClass; var img = document.createElement('img'); img.src = '/skins/common/icons/icon-trans.gif'; if (typeof(icon_class) != 'undefined' && icon_class != '') { img.className = icon_class; } span.appendChild(img); return span; }; //returns an XML document function encode_xml(data, outer) { var result = ''; if (typeof(data) == 'object') { for (key in data) { var value = data[key]; if (strncmp(value,'@',1) == 0) { } else { var tag = outer != null ? outer: key; if (is_numeric_array(value)) { result += encode_xml(value, key); } else if (typeof(value) == 'object') { var attrs = ''; for (attr_key in value) { var attr_value = value[attr_key]; if(strncmp(attr_key, '@', 1) == 0) { attrs += ' '+attr_key.substr(0, 1)+ '="'+mt_gen.htmlspecialchars(attr_value)+'"'; } } result += '<' + tag + attrs + '>' + encode_xml(value) + ''+"\n"; } else if (tag != '#text') { result += '<' + tag + '>' + encode_xml(value) + ''; } else { result += mt_gen.htmlspecialchars(value); } } } } else if (typeof(data) == 'string') { result = mt_gen.htmlspecialchars(data); } else { result = data; } return result; } function strncmp(str1, str2, len) { if (typeof(str1) != 'string' || typeof(str2) != 'string') { return 1; } return str1.substr(0, len) == str2 ? 0: 1; //not exactly like PHP implementation, but returns 0 if true } function is_numeric_array(data) { var construct = data.constructor; return construct == Array; } /* --------- JQUERY.MIN.JS --------- */ /*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); (function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); /* --------- JQUERY.PLUGINS.JS --------- */ jQuery.fn.extend({ check: function() { return this.each(function() { this.checked = true; }); }, uncheck: function() { return this.each(function() { this.checked = false; }); } }); jQuery.extend({ htmlEncode : function(html) { if ( !html ) return ''; html = html.replace( /&/g, '&' ); html = html.replace( //g, '>' ); return html; }, htmlDecode : function(html) { if ( !html ) return '' ; html = html.replace( />/g, '>' ); html = html.replace( /</g, '<' ); html = html.replace( /&/g, '&' ); return html; }, getScript: function(url, callback) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = url; // Handle Script loading { var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; if (callback) callback(); // Handle memory leak in IE script.onload = script.onreadystatechange = null; } }; } head.appendChild(script); // We handle everything using the script element injection return undefined; }, extendClass : function(Child, Parent) { var F = function() {}; F.prototype = Parent.prototype; Child.prototype = new F(); Child.prototype.constructor = Child; Child.superclass = Parent.prototype; if ( Parent.prototype.constructor == Object.prototype.constructor ) { Parent.prototype.constructor = Parent; } } }); (function($) { /* defaultValue plugin */ $.fn.defaultValue = function() { var elements = this; var defaultArgs = arguments; return elements.each(function(index) { var $el = $(this); var defVal = defaultArgs[index] || $el.attr('title'); var defClass = 'deki-default-value'; // make an arg? if ( ($el.val() == '') || ($el.val() == defVal) ) { // initialize only if no value $el.val(defVal).addClass(defClass); } $el.focus(function() { if ($el.hasClass(defClass)) { $el.val('').removeClass(defClass); } }) .blur(function() { if ($el.val() == '') { $el.val(defVal).addClass(defClass); } }) // make sure we don't submit the default .parents('form:first').submit(function() { if ($el.hasClass(defClass)) { $el.val(''); } }) ; // end $el }); }; /* /defaultValue plugin */ })(jQuery); /* --------- MINDTOUCH.UTIL.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ /* global Deki object */ if (typeof Deki == "undefined") { var Deki = {}; } // setup our jQuery reference Deki.$ = jQuery; Deki.url = {}; Deki.url.encode = function(plaintext) { // The Javascript escape and unescape functions do not correspond // with what browsers actually do... var SAFECHARS = "0123456789" + // Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()"; // RFC2396 Mark characters var HEX = "0123456789ABCDEF"; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "+"; // x-www-urlencoded, rather than %20 } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += "+"; } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for return encoded; } Deki.util = {}; Deki.util.Dom = {}; Deki.util.Dom.getDimensions = function(element) { var region = YAHOO.util.Dom.getRegion(element); var width = region.right - region.left; var height = region.bottom - region.top; return {"width": width, "height": height}; } Deki.util.Dom.getText = function(node) { if(typeof(node.innerText) != 'undefined') { return node.innerText; } else { return node.textContent; } } Deki.util.Dom.setInnerHTML = function (el, html) { el = YAHOO.util.Dom.get(el); if (!el || typeof html !== 'string') { return null; } // Break circular references. (function (o) { var a = o.attributes, i, l, n, c; if (a) { l = a.length; for (i = 0; i < l; i += 1) { n = a[i].name; if (typeof o[n] === 'function') { o[n] = null; } } } a = o.childNodes; if (a) { l = a.length; for (i = 0; i < l; i += 1) { c = o.childNodes[i]; // Purge child nodes. arguments.callee(c); // Removes all listeners attached to the element via YUI's addListener. YAHOO.util.Event.purgeElement(c); } } })(el); // Remove scripts from HTML string, and set innerHTML property el.innerHTML = html.replace(/]*>((.|[\r\n])*?)<\\?\/script>/ig, ""); // Return a reference to the first child return el.firstChild; }; Deki.util.Dom.setInnerText = function(el, text) { if(typeof(el.innerText) != 'undefined') el.innerText = text; else el.textContent = text; }; Deki.publish = function(c,d) { if((name != null) && (name.indexOf("*") == -1)) Deki._query_store[c] = d; window.PageBus.publish(c,d); }; Deki.subscribe = function(c,o,f,d) { window.PageBus.subscribe(c,o,f,d) }; Deki._query_store = { }; Deki.query = function(c) { return Deki._query_store[c]; }; Deki.hasValue = function(v, d) { return (v != 'undefined') && (v != null) && (v != '') ? v : ((typeof d != 'undefined') ? d : null); }; /* --------- COMMENTS.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ function MTComments() {}; MTComments.ViewingAll = false; MTComments.HookBehavior = function() { MTComments.HookSubmitOnclick(); }; //will make adding comments an inline experience MTComments.HookSubmitOnclick = function() { Deki.$('input[name=commentSubmit]').click(function() { var cn = document.getElementById('wpCommentNum'); if (cn && cn.value > 0) { return; } MTComments.PostComment(this); return false; }); }; MTComments.PostComment = function(submitButton, commentnum) { var comment = Deki.$(submitButton).parents('form').find('textarea').val(); Deki.$.post( '/deki/gui/comments.php', { 'action' : 'post', 'titleId' : Deki.PageId, 'comment' : comment, 'showAll' : MTComments.ViewingAll, 'commentNum' : commentnum ? commentnum : null }, function( data ) { MTComments.SetComment( data ); }, 'html' ); }; MTComments.ShowComment = function(commentnum) { var commentform = document.getElementById('commentTextForm'+commentnum); var commenttext = document.getElementById('commentText'+commentnum); if (!commentform || !commenttext) return false; commenttext.style.display = 'block'; commentform.style.display = 'none'; }; MTComments.EditComment = function(commentnum) { var commentform = document.getElementById('commentTextForm'+commentnum); var commenttext = document.getElementById('commentText'+commentnum); if (!commentform || !commenttext) return false; //if the comment form hasn't already been loaded if (commentform.innerHTML == '') { Deki.$.get( '/deki/gui/comments.php', { 'action' : 'edit', 'titleId' : Deki.PageId, 'commentNum' : commentnum }, function( data ) { commentform.innerHTML = data; //hook behavior to cancel link Deki.$('form#commentEditForm textarea[name=wpComment]').focus(); document.getElementById('commentCancel'+commentnum).onclick = function() { MTComments.ShowComment(commentnum); return false; }; Deki.$('form#commentEditForm input[name=commentSubmit]').click(function() { MTComments.PostComment(this, commentnum); return false; }); }, 'html' ); } commenttext.style.display = 'none'; commentform.style.display = 'block'; return false; }; MTComments.DeleteComment = function(commentnum) { if (confirm(wfMsg('comment-delete'))) { Deki.$.get( '/deki/gui/comments.php', { 'action' : 'delete', 'titleId' : Deki.PageId, 'commentNum' : commentnum }, function( data ) { Deki.$( '#comment' + commentnum ).html( data ); }, 'html' ); } return false; }; MTComments.GetComments = function(commentcount) { if (commentcount == 'all') { MTComments.ViewingAll = true; } Deki.$.get( '/deki/gui/comments.php', { 'action' : 'show', 'titleId' : Deki.PageId, 'commentCount' : commentcount }, function( data ) { MTComments.SetComment( data ); }, 'html' ); return false; }; MTComments.SetComment = function(markup) { document.getElementById('comments').innerHTML = markup; new MTComments.HookBehavior; }; //hook is in /skins/common/javascript.php /* --------- THICKBOX.JS --------- */ /* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var tb_pathToImage = "/skins/common/jquery/thickbox/loadingAnimation.gif"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init //moved to /skins/common/javascript.php //add thickbox to href & area elements that have a class of .thickbox function tb_init(domChunk){ Deki.$(domChunk).unbind('onclick'); Deki.$(domChunk).click(function(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t,a,g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link try { if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 Deki.$("body","html").css({height: "100%", width: "100%"}); Deki.$("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 Deki.$("body").append("
"); Deki.$("#TB_overlay").click(tb_remove); } }else{//all others if(document.getElementById("TB_overlay") === null){ Deki.$("body").append("
"); Deki.$("#TB_overlay").click(tb_remove); } } if(tb_detectMacXFF()){ Deki.$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash }else{ Deki.$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity } if(caption===null){caption="";} Deki.$("body").append("
");//add loader to the page Deki.$('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if(imageGroup || urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = Deki.$("a[rel='"+imageGroup+"']").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = ''+wfMsg('gallery-next')+' »'; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = '« '+wfMsg('gallery-prev')+''; } } else { TB_FoundURL = true; TB_imageCount = " Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length) + ' '; } } } if (TB_PrevHTML == '') { TB_PrevHTML = '« '+wfMsg('gallery-prev')+''; } if (TB_NextHTML == '') { TB_NextHTML = ''+wfMsg('gallery-next')+' »'; } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; // karena: IE doesn't support min-width if ( TB_WIDTH < 250 && jQuery.browser.msie && jQuery.browser.version < 7 ) { TB_WIDTH = 250; } Deki.$("#TB_window").append("
"+ '
'+TB_PrevHTML + ' ' + TB_NextHTML + '
' + TB_imageCount + "
"+caption+"" + "
"+caption+"
"); Deki.$("#TB_closeWindowButton").click(tb_remove); if (!(TB_PrevHTML === "")) { function goPrev(){ if(Deki.$(document).unbind("click",goPrev)){Deki.$(document).unbind("click",goPrev);} Deki.$("#TB_window").remove(); Deki.$("body").append("
"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } Deki.$("#TB_prev").click(goPrev); } if (!(TB_NextHTML === "")) { function goNext(){ Deki.$("#TB_window").remove(); Deki.$("body").append("
"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } Deki.$("#TB_next").click(goNext); } document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } else if(keycode == 190){ // display previous image if(!(TB_NextHTML == "")){ document.onkeydown = ""; goNext(); } } else if(keycode == 188){ // display next image if(!(TB_PrevHTML == "")){ document.onkeydown = ""; goPrev(); } } }; tb_position(); Deki.$("#TB_load").remove(); Deki.$("#TB_ImageOff").click(tb_remove); Deki.$("#TB_window").css({display:"block"}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || (typeof(winX) == 'undefined' ? 630: winX * .90); //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || (typeof(winY) == 'undefined' ? 440: winY * .90); //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window urlNoQuery = url.split('TB_'); Deki.$("#TB_iframeContent").remove(); if(params['modal'] != "true"){//iframe no modal Deki.$("#TB_window").append("
"+caption+"
"); }else{//iframe modal Deki.$("#TB_overlay").unbind(); Deki.$("#TB_window").append(""); } }else{// not an iframe, ajax if(Deki.$("#TB_window").css("display") != "block"){ if(params['modal'] != "true"){//ajax no modal Deki.$("#TB_window").append("
"); }else{//ajax modal Deki.$("#TB_overlay").unbind(); Deki.$("#TB_window").append("
"); } }else{//this means the window is already up, we are just loading new content via ajax Deki.$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; Deki.$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; Deki.$("#TB_ajaxContent")[0].scrollTop = 0; Deki.$("#TB_ajaxWindowTitle").html(caption); } } Deki.$("#TB_closeWindowButton").click(tb_remove); if(url.indexOf('TB_inline') != -1){ Deki.$("#TB_ajaxContent").append(Deki.$('#' + params['inlineId']).children()); Deki.$("#TB_window").unload(function () { Deki.$('#' + params['inlineId']).append( Deki.$("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); Deki.$("#TB_load").remove(); Deki.$("#TB_window").css({display:"block"}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); if(Deki.$.browser.safari){//safari needs help because it will not fire iframe onload Deki.$("#TB_load").remove(); Deki.$("#TB_window").css({display:"block"}); } }else{ Deki.$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); Deki.$("#TB_load").remove(); tb_init("#TB_ajaxContent a.lightbox"); Deki.$("#TB_window").css({display:"block"}); }); } } if(!params || !params['modal']){ document.onkeyup = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ Deki.$("#TB_load").remove(); Deki.$("#TB_window").css({display:"block"}); } function tb_remove() { Deki.$("#TB_imageOff").unbind("click"); Deki.$("#TB_closeWindowButton").unbind("click"); Deki.$("#TB_window").fadeOut("fast",function(){Deki.$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); Deki.$("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 Deki.$("body","html").css({height: "auto", width: "auto"}); Deki.$("html").css("overflow",""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { Deki.$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6 Deki.$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { return true; } } /* --------- JQUERY.AUTOCOMPLETE.JS --------- */ /* * Autocomplete - jQuery plugin 1.1pre * * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jšrn Zaefferer * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.autocomplete.js 5785 2008-07-12 10:37:33Z joern.zaefferer $ * */ ;(function($) { $.fn.extend({ autocomplete: function(urlOrData, options) { var isUrl = typeof urlOrData == "string"; options = $.extend({}, $.Autocompleter.defaults, { url: isUrl ? urlOrData : null, data: isUrl ? null : urlOrData, delay: isUrl ? $.Autocompleter.defaults.delay : 10, max: options && !options.scroll ? 10 : 150 }, options); // if highlight is set to false, replace it with a do-nothing function options.highlight = options.highlight || function(value) { return value; }; // if the formatMatch option is not specified, then use formatItem for backwards compatibility options.formatMatch = options.formatMatch || options.formatItem; return this.each(function() { new $.Autocompleter(this, options); }); }, result: function(handler) { return this.bind("result", handler); }, search: function(handler) { return this.trigger("search", [handler]); }, flushCache: function() { return this.trigger("flushCache"); }, setOptions: function(options){ return this.trigger("setOptions", [options]); }, unautocomplete: function() { return this.trigger("unautocomplete"); } }); $.Autocompleter = function(input, options) { var KEY = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN: 34, BACKSPACE: 8 }; // Create $ object for input element var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); var timeout; var previousValue = ""; var cache = $.Autocompleter.Cache(options); var hasFocus = 0; var lastKeyPressCode; var config = { mouseDownOnSelect: false }; var select = $.Autocompleter.Select(options, input, selectCurrent, config); var blockSubmit; // prevent form submit in opera when selecting with return key $.browser.opera && $(input.form).bind("submit.autocomplete", function() { if (blockSubmit) { blockSubmit = false; return false; } }); // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { // track last key pressed lastKeyPressCode = event.keyCode; switch(event.keyCode) { case KEY.UP: event.preventDefault(); if ( select.visible() ) { select.prev(); } else { onChange(0, true); } break; case KEY.DOWN: event.preventDefault(); if ( select.visible() ) { select.next(); } else { onChange(0, true); } break; case KEY.PAGEUP: event.preventDefault(); if ( select.visible() ) { select.pageUp(); } else { onChange(0, true); } break; case KEY.PAGEDOWN: event.preventDefault(); if ( select.visible() ) { select.pageDown(); } else { onChange(0, true); } break; // matches also semicolon case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: case KEY.TAB: case KEY.RETURN: if( selectCurrent() ) { // stop default to prevent a form submit, Opera needs special handling event.preventDefault(); blockSubmit = true; return false; } // @note kalida: Bugfix. If nothing selected and you press enter, hide the autocomplete // Otherwise, typing "te" when "test" is an autocomplete result will keep // the autocomplete window open. hideResultsNow(); // @note kalida: Bugfix. Race condition if return pressed but autocomplete ajax request // in progress (displays a/c results on complete). Disable focus, which hides results. hasFocus = 0; break; case KEY.ESC: select.hide(); break; default: // @note kalida: From above, re-establish focus on normal keypress hasFocus++; clearTimeout(timeout); timeout = setTimeout(onChange, options.delay); break; } }).focus(function(){ // track whether the field has focus, we shouldn't process any // results if the field no longer has focus hasFocus++; }).blur(function() { hasFocus = 0; if (!config.mouseDownOnSelect) { hideResults(); } }).click(function() { // show select when clicking in a focused field if ( hasFocus++ > 1 && !select.visible() ) { onChange(0, true); } }).bind("search", function() { // TODO why not just specifying both arguments? var fn = (arguments.length > 1) ? arguments[1] : null; function findValueCallback(q, data) { var result; if( data && data.length ) { for (var i=0; i < data.length; i++) { if( data[i].result.toLowerCase() == q.toLowerCase() ) { result = data[i]; break; } } } if( typeof fn == "function" ) fn(result); else $input.trigger("result", result && [result.data, result.value]); } $.each(trimWords($input.val()), function(i, value) { request(value, findValueCallback, findValueCallback); }); }).bind("flushCache", function() { cache.flush(); }).bind("setOptions", function() { $.extend(options, arguments[1]); // if we've updated the data, repopulate if ( "data" in arguments[1] ) cache.populate(); }).bind("unautocomplete", function() { select.unbind(); $input.unbind(); $(input.form).unbind(".autocomplete"); }); function selectCurrent() { var selected = select.selected(); if( !selected ) return false; var v = selected.result; previousValue = v; if ( options.multiple ) { var words = trimWords($input.val()); if ( words.length > 1 ) { v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; } v += options.multipleSeparator; } $input.val(v); hideResultsNow(); $input.trigger("result", [selected.data, selected.value]); return true; } function onChange(crap, skipPrevCheck) { if( lastKeyPressCode == KEY.DEL ) { select.hide(); return; } var currentValue = $input.val(); if ( !skipPrevCheck && currentValue == previousValue ) return; previousValue = currentValue; currentValue = lastWord(currentValue); if ( currentValue.length >= options.minChars) { $input.addClass(options.loadingClass); if (!options.matchCase) currentValue = currentValue.toLowerCase(); request(currentValue, receiveData, hideResultsNow); } else { stopLoading(); select.hide(); } }; function trimWords(value) { if ( !value ) { return [""]; } var words = value.split( options.multipleSeparator ); var result = []; $.each(words, function(i, value) { if ( $.trim(value) ) result[i] = $.trim(value); }); return result; } function lastWord(value) { if ( !options.multiple ) return value; var words = trimWords(value); return words[words.length - 1]; } // fills in the input box w/the first match (assumed to be the best match) // q: the term entered // sValue: the first matching result function autoFill(q, sValue){ // autofill in the complete box w/the first match as long as the user hasn't entered in more data // if the last user key pressed was backspace, don't autofill if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { // fill in the value (keep the case the user has typed) $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); // select the portion of the value not typed by the user (so the next character will erase) $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); } }; function hideResults() { clearTimeout(timeout); timeout = setTimeout(hideResultsNow, 200); }; function hideResultsNow() { var wasVisible = select.visible(); select.hide(); clearTimeout(timeout); stopLoading(); if (options.mustMatch) { // call search and run callback $input.search( function (result){ // if no value found, clear the input box if( !result ) { if (options.multiple) { var words = trimWords($input.val()).slice(0, -1); $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); } else $input.val( "" ); } } ); } if (wasVisible) // position cursor at end of input field $.Autocompleter.Selection(input, input.value.length, input.value.length); }; function receiveData(q, data) { if ( data && data.length && hasFocus ) { stopLoading(); select.display(data, q); autoFill(q, data[0].value); select.show(); } else { hideResultsNow(); } }; function request(term, success, failure) { if (!options.matchCase) term = term.toLowerCase(); var data = cache.load(term); // recieve the cached data if (data && data.length) { success(term, data); // if an AJAX url has been supplied, try loading the data now } else if (data && options.assumePrefixMatch) { // @note kalida: If a parent matched and didn't have data, assume // we don't have any results. It's ok to return empty. success(term, data); } else if( (typeof options.url == "string") && (options.url.length > 0) ){ var extraParams = { timestamp: +new Date() }; $.each(options.extraParams, function(key, param) { extraParams[key] = typeof param == "function" ? param() : param; }); $.ajax({ // try to leverage ajaxQueue plugin to abort previous requests mode: "abort", // limit abortion to this input port: "autocomplete" + input.name, dataType: options.dataType, url: options.url, data: $.extend({ q: lastWord(term), limit: options.max }, extraParams), success: function(data) { var parsed = options.parse && options.parse(data) || parse(data); cache.add(term, parsed); success(term, parsed); } }); } else { // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match select.emptyList(); failure(term); } }; function parse(data) { var parsed = []; var rows = data.split("\n"); for (var i=0; i < rows.length; i++) { var row = $.trim(rows[i]); if (row) { row = row.split("|"); parsed[parsed.length] = { data: row, value: row[0], result: options.formatResult && options.formatResult(row, row[0]) || row[0] }; } } return parsed; }; function stopLoading() { $input.removeClass(options.loadingClass); }; }; $.Autocompleter.defaults = { inputClass: "ac_input", resultsClass: "ac_results", loadingClass: "ac_loading", minChars: 1, delay: 400, // @note kalida: Added assumePrefixMatch option. If "t" has results, don't do more lookups for // "te", "tes" and "test". When true, behave as if "t" pulled down all prefix matches. assumePrefixMatch: false, matchCase: false, matchSubset: true, matchContains: false, cacheLength: 10, max: 100, mustMatch: false, extraParams: {}, selectFirst: true, formatItem: function(row) { return row[0]; }, formatMatch: null, autoFill: false, width: 0, multiple: false, multipleSeparator: ", ", highlight: function(value, term) { return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); }, scroll: true, scrollHeight: 180 // @note kalida: Undocumented, but you can override internal parse functions with options.parse }; $.Autocompleter.Cache = function(options) { var data = {}; var length = 0; function matchSubset(s, sub) { if (!options.matchCase) s = s.toLowerCase(); var i = s.indexOf(sub); if (options.matchContains == "word"){ i = s.toLowerCase().search("\\b" + sub.toLowerCase()); } if (i == -1) return false; return i == 0 || options.matchContains; }; function add(q, value) { if (length > options.cacheLength){ flush(); } if (!data[q]){ length++; } data[q] = value; } function populate(){ if( !options.data ) return false; // track the matches var stMatchSets = {}, nullData = 0; // no url was specified, we need to adjust the cache length to make sure it fits the local data store if( !options.url ) options.cacheLength = 1; // track all options for minChars = 0 stMatchSets[""] = []; // loop through the array and create a lookup structure for ( var i = 0, ol = options.data.length; i < ol; i++ ) { var rawValue = options.data[i]; // if rawValue is a string, make an array otherwise just reference the array rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; var value = options.formatMatch(rawValue, i+1, options.data.length); if ( value === false ) continue; var firstChar = value.charAt(0).toLowerCase(); // if no lookup array for this character exists, look it up now if( !stMatchSets[firstChar] ) stMatchSets[firstChar] = []; // if the match is a string var row = { value: value, data: rawValue, result: options.formatResult && options.formatResult(rawValue) || value }; // push the current match into the set list stMatchSets[firstChar].push(row); // keep track of minChars zero items if ( nullData++ < options.max ) { stMatchSets[""].push(row); } }; // add the data items to the cache $.each(stMatchSets, function(i, value) { // increase the cache size options.cacheLength++; // add to the cache add(i, value); }); } // populate any existing data setTimeout(populate, 25); function flush(){ data = {}; length = 0; } return { flush: flush, add: add, populate: populate, load: function(q) { if (!options.cacheLength || !length) return null; /* * if dealing w/local data and matchContains than we must make sure * to loop through all the data collections looking for matches */ if( !options.url && options.matchContains ){ // track all matches var csub = []; // loop through all the data grids for matches for( var k in data ){ // don't search through the stMatchSets[""] (minChars: 0) cache // this prevents duplicates if( k.length > 0 ){ var c = data[k]; $.each(c, function(i, x) { // if we've got a match, add it to the array if (matchSubset(x.value, q)) { csub.push(x); } }); } } return csub; } else // if the exact item exists, use it if (data[q]){ return data[q]; } else if (options.matchSubset) { for (var i = q.length - 1; i >= options.minChars; i--) { var c = data[q.substr(0, i)]; if (c) { var csub = []; $.each(c, function(i, x) { if (matchSubset(x.value, q)) { csub[csub.length] = x; } }); return csub; } } } return null; } }; }; $.Autocompleter.Select = function (options, input, select, config) { var CLASSES = { ACTIVE: "ac_over" }; var listItems, active = -1, data, term = "", needsInit = true, element, list; // Create results function init() { if (!needsInit) return; element = $("
") .hide() .addClass(options.resultsClass) .css("position", "absolute") .appendTo(document.body); list = $("
    ").appendTo(element).mouseover( function(event) { if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); $(target(event)).addClass(CLASSES.ACTIVE); } }).click(function(event) { $(target(event)).addClass(CLASSES.ACTIVE); select(); // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus input.focus(); return false; }).mousedown(function() { config.mouseDownOnSelect = true; }).mouseup(function() { config.mouseDownOnSelect = false; }); if( options.width > 0 ) element.css("width", options.width); needsInit = false; } function target(event) { var element = event.target; while(element && element.tagName != "LI") element = element.parentNode; // more fun with IE, sometimes event.target is empty, just ignore it then if(!element) return []; return element; } function moveSelect(step) { listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); movePosition(step); var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); if(options.scroll) { var offset = 0; listItems.slice(0, active).each(function() { offset += this.offsetHeight; }); if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); } else if(offset < list.scrollTop()) { list.scrollTop(offset); } } }; function movePosition(step) { active += step; if (active < 0) { active = listItems.size() - 1; } else if (active >= listItems.size()) { active = 0; } } function limitNumberOfItems(available) { return options.max && options.max < available ? options.max : available; } function fillList() { list.empty(); var max = limitNumberOfItems(data.length); for (var i=0; i < max; i++) { if (!data[i]) continue; var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); if ( formatted === false ) continue; var li = $("
  • ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; $.data(li, "ac_data", data[i]); } listItems = list.find("li"); if ( options.selectFirst ) { listItems.slice(0, 1).addClass(CLASSES.ACTIVE); active = 0; } // apply bgiframe if available if ( $.fn.bgiframe ) list.bgiframe(); } return { display: function(d, q) { init(); data = d; term = q; fillList(); }, next: function() { moveSelect(1); }, prev: function() { moveSelect(-1); }, pageUp: function() { if (active != 0 && active - 8 < 0) { moveSelect( -active ); } else { moveSelect(-8); } }, pageDown: function() { if (active != listItems.size() - 1 && active + 8 > listItems.size()) { moveSelect( listItems.size() - 1 - active ); } else { moveSelect(8); } }, hide: function() { element && element.hide(); listItems && listItems.removeClass(CLASSES.ACTIVE); active = -1; }, visible : function() { return element && element.is(":visible"); }, current: function() { return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); }, show: function() { var offset = $(input).offset(); element.css({ width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), top: offset.top + input.offsetHeight, left: offset.left }).show(); if(options.scroll) { list.scrollTop(0); list.css({ maxHeight: options.scrollHeight, overflow: 'auto' }); if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { var listHeight = 0; listItems.each(function() { listHeight += this.offsetHeight; }); var scrollbarsVisible = listHeight > options.scrollHeight; list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); if (!scrollbarsVisible) { // IE doesn't recalculate width when scrollbar disappears listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); } } } }, selected: function() { var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); return selected && selected.length && $.data(selected[0], "ac_data"); }, emptyList: function (){ list && list.empty(); }, unbind: function() { element && element.remove(); } }; }; $.Autocompleter.Selection = function(field, start, end) { if( field.createTextRange ){ var selRange = field.createTextRange(); selRange.collapse(true); selRange.moveStart("character", start); selRange.moveEnd("character", end); selRange.select(); } else if( field.setSelectionRange ){ field.setSelectionRange(start, end); } else { if( field.selectionStart ){ field.selectionStart = start; field.selectionEnd = end; } } field.focus(); }; })(jQuery); /* --------- JQUERY.EDITABLE.JS --------- */ (function($) { /* editable plugin */ $.fn.editable = function(options) { var defaults = { onDisplayValue: null, // called when clicked url: null, // ajax endpoint method: 'post', dataType: 'json', field: 'text', // name of the text post field fields: {}, // additional post fields onGenerateRequest: null, // allow field configuration onSuccess: null, // ajax handlers onError: null, editingClass: 'editing', // editing class savingClass: 'saving', // ajax save class multiLine: false, // true will change to textarea convertNewlines: false // experimental }; var options = $.extend(defaults, options); return this.each(function() { var $this = $(this); var $input = null; var value = $this.text(); $this.click(function() { // check if the input is already created if ($input) return false; $this.html(options.multiLine ? '' : ''); $input = $this.children(':first'); $this.addClass(options.editingClass); var displayValue = value; if (options.onDisplayValue) displayValue = options.onDisplayValue($this, displayValue); if (options.multiLine) { $input.text(displayValue); } else { $input.attr('value', displayValue); } $input.focus().select(); // events $input.blur(function() { saveEdit() }); $input.keydown(function(e) { // esc if (e.which === 27) cancelEdit(value); // enter/tab if (options.multiLine && e.shiftKey && (e.which == 13)) return; if (e.which === 13 || e.which === 9) { e.preventDefault(); saveEdit(); } }); // helpers function cancelEdit(setValue) { if (setValue) value = setValue; $this.text(value); if (options.convertNewlines) $this.html(nl2br($this.html())); $this.removeClass(options.editingClass); $input = null; } function saveEdit() { var request = options; request.fields = request.fields || {}; request.fields[request.field] = $input.val(); if (options.onGenerateRequest) options.onGenerateRequest($this, request); if (!request.url) throw 'jquery.editable: No ajax endpoint configured!'; $input.addClass(request.savingClass); $.ajax({ type: request.method, data: request.fields, dataType: request.dataType, url: request.url, success: function(data) { $input.removeClass(request.savingClass); if (options.onSuccess) { cancelEdit(options.onSuccess($this, value, data)); } else { cancelEdit(options.multiLine ? $input.text() : $input.val()); } }, error: function(xhr, textError) { $input.removeClass(request.savingClass); if (options.onError) { options.onError($this, value, xhr, textError); } else { $this.html(textError); } } }); } function nl2br(s) { return (s + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1
    $2'); } // halt click default return false; }); }); }; /* /editable plugin */ })(jQuery); /* --------- JQUERY.HOVERINTENT.MIN.JS --------- */ /** * hoverIntent is similar to jQuery's built-in "hover" function except that * instead of firing the onMouseOver event immediately, hoverIntent checks * to see if the user's mouse has slowed down (beneath the sensitivity * threshold) before firing the onMouseOver event. * * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ * * * hoverIntent is currently available for use in all personal or commercial * projects under both MIT and GPL licenses. This means that you can choose * the license that best suits your project, and use it accordingly. * * // basic usage (just like .hover) receives onMouseOver and onMouseOut functions * $("ul li").hoverIntent( showNav , hideNav ); * * // advanced usage receives configuration object only * $("ul li").hoverIntent({ * sensitivity: 7, // number = sensitivity threshold (must be 1 or higher) * interval: 100, // number = milliseconds of polling interval * over: showNav, // function = onMouseOver callback (required) * timeout: 0, // number = milliseconds delay before onMouseOut function call * out: hideNav // function = onMouseOut callback (required) * }); * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) 100) this._throw("StackOverflow"); try { this.P++; this._publish(this.S, path, 0, name, message); } catch(err) { this.P--; throw err; } try { this.P--; if((this.U.length > 0) && (this.P == 0)) { for(var i = 0; i < this.U.length; i++) this.unsubscribe(this.U[i]); this.U = []; } } catch(err) { // All unsubscribe exceptions should already have // been handled when unsubscribe was called in the // publish callback. This is a repeat appearance // of this exception. Discard it. } } PageBus.unsubscribe = function(sub) { this._unsubscribe(this.S, sub.p, 0, sub.i); } /* * @private @jsxobf-clobber */ PageBus._throw = function(n) { throw new Error("PageBus." + n); } /* * @private @jsxobf-clobber */ PageBus._badName = function(n) { this._throw("BadName"); } /* * @private @jsxobf-clobber */ PageBus._subscribe = function(tree, path, index, sub) { var tok = path[index]; if(tok == "") this._badName(); if(index == path.length) tree.s.push(sub); else { if(typeof tree.c == this.H) tree.c = {}; if(typeof tree.c[tok] == this.H) { try { tree.c[tok] = { c: {}, s: [] }; this._subscribe(tree.c[tok], path, index + 1, sub); } catch(err) { delete tree.c[tok]; throw err; } } else this._subscribe( tree.c[tok], path, index + 1, sub ); } } /* * @private @jsxobf-clobber */ PageBus._publish = function(tree, path, index, name, msg) { if(path[index] == "") this._badName(); if(typeof tree != this.H) { if(index < path.length) { this._publish(tree.c[path[index]], path, index + 1, name, msg); this._publish(tree.c["*"], path, index + 1, name, msg); this._call(tree.c["**"], name, msg); } else this._call(tree, name, msg); } } /* * @private @jsxobf-clobber */ PageBus._call = function(node, name, msg) { if(typeof node != this.H) { var callbacks = node.s; var max = callbacks.length; for(var i = 0; i < max; i++) if(callbacks[i].f != null) callbacks[i].f.apply(callbacks[i].w, [name, msg, callbacks[i].d]); } } /* * @jsxobf-clobber */ PageBus._unsubscribe = function(tree, path, index, sid) { if(typeof tree != this.H) { if(index < path.length) { var childNode = tree.c[path[index]]; this._unsubscribe(childNode, path, index + 1, sid); if(childNode.s.length == 0) { for(var x in childNode.c) // not empty. We're done. return; delete tree.c[path[index]]; // if we got here, c is empty } return; } else { var callbacks = tree.s; var max = callbacks.length; for(var i = 0; i < max; i++) { if(sid == callbacks[i].i) { if(this.P > 0) { if(callbacks[i].f == null) this._throw("BadParameter"); callbacks[i].f = null; this.U.push(callbacks[i]); } else callbacks.splice(i, 1); return; } } // Not found. Fall through } } this._throw("BadParameter"); } } /* --------- DEKI.JS --------- */ if (typeof Deki == 'undefined') { var Deki = {}; } var DekiWiki = Deki; // backwards compatibility // Log Deki.Log = function(m) { if (typeof console != "undefined" && console.log) { console.log(m); } }; var dl = Deki.Log; // Ui if (typeof Deki.Ui == 'undefined') { Deki.Ui = {}; } // yellowbox exceptions Deki.Ui.Message = function(title, message, details) { MTMessage.Show(title, message, 'ui-errormsg', details); }; Deki.Ui.DisabledMessage = function() { MTMessage.Show(wfMsg('error-permission-denied'), wfMsg('error-permission-details')); }; // Determine whether this element (probably a link) is disabled (directly or via parent) Deki.Ui.IsDisabled = function(el) { return $(el).hasClass('disabled') || $(el).parents('.disabled').length > 0; }; // generate a flash message Deki.Ui.Flash = function(messageHtml, type) { // find the message container var $flash = $('#sessionMsg'); var $ul = $flash.find('ul'); // clear messages $ul.empty(); // add default classes $flash.addClass('msg systemmsg'); $flash.removeClass('errormsg successmsg'); // set the message type var flashClass = 'successmsg'; switch (type) { case 'error': flashClass = 'errormsg'; break; default: } $flash.addClass(flashClass); // create the message $('
  • ').html(messageHtml).appendTo($ul); }; Deki.Ui.EmptyFlash = function() { var $flash = $('#sessionMsg'); $flash.removeAttr('class'); var $ul = $flash.find('ul'); // clear messages $ul.empty(); }; // Gui if (typeof Deki.Gui == 'undefined') { Deki.Gui = {}; } Deki.Gui.ROOT_PATH = '/deki/gui'; Deki.Gui.Status = { ERROR: 0, OK: 200, ERROR_LOGIN: 401, ERROR_COMMERCIAL: 402 }; //@param Object options - ajax options Deki.Gui.AjaxRequest = function(options) { // defaults options.type = options.type || 'get'; options.timeout = options.timeout || 10000; options.dataType = options.dataType || 'json'; var success = null; if (options.success) success = options.success; // insert success handler options.success = function(data, status, XmlHttpRequest) { if (Deki.Gui.handleResponse(data, XmlHttpRequest, options)) { if (success) success(data, status, XmlHttpRequest); } }; // insert error handler if none exists if (typeof options.error == "undefined") { options.error = function(XmlHttpRequest, status, error) { Deki.Log(XmlHttpRequest); Deki.Ui.Message(wfMsg('error'), wfMsg('internal-error')); }; } // execute the request $.ajax(options); }; /** * @param Object data - expected fields: (bool)success * @return bool */ Deki.Gui.handleResponse = function(data, XmlHttpRequest, options) { if (options.dataType == 'xml') { var $data = $(data); if ($data.find('formatter[success=1]').length) return true; Deki.Ui.Message($data.find('formatter').attr('message'), $data.find('body').val()); } else { // assume json if (data.success) return true; Deki.Ui.Message(data.message, data.body ? data.body : ''); } }; // Plugin if (typeof Deki.Plugin == 'undefined') { Deki.Plugin = {}; } Deki.Plugin.AJAX_URL = Deki.Gui.ROOT_PATH + '/plugin.php'; /** * @param string formatter - name of the plugin formatter to use * @param Object options - ajax options */ Deki.Plugin.AjaxRequest = function(formatter, options) { // defaults options.url = options.url || Deki.Plugin.AJAX_URL; // set formatter format if (options.dataType == 'xml') { options.data.format = 'xml'; } // field defaults var fields = options.data || {}; fields.formatter = formatter; if (!fields.language) fields.language = Deki.PageLanguageCode; options.data = fields; // execute the request Deki.Gui.AjaxRequest(options); }; if (typeof Deki.Plugin.Comments == 'undefined') { Deki.Plugin.Comments = {}; } /** * Update element with list of page comments * @param Object $el - jQuery element to update (optional, default #comments) */ Deki.Plugin.Comments.Update = function($el) { if (!$el) { $el = $('#comments'); } $.get('/deki/gui/comments.php', { 'action' : 'show', 'titleId' : Deki.PageId, 'commentCount' : 'all' }, function(data) { $el.html(data); }, 'html' ); }; // @param Function callback - prototype like function(event, arg1, arg2) Deki.Plugin.Subscribe = function(event, callback) { $(document).bind(event, callback); }; Deki.Plugin.Unsubscribe = function(event, callback) { $(document).unbind(event, callback); }; // @param Array args - must be an array, otherwise unexpected results Deki.Plugin.Publish = function(event, args) { $(document).trigger(event, args); }; /* --------- QUICKPOPUP.JS --------- */ var Deki = Deki || {}; Deki.QuickPopup = {}; Deki.QuickPopup.Show = function(opts) { var opts = opts || {}; var title = opts.title || ''; var width = opts.width || 400; var height = opts.height || 300; var url = opts.url || null; if (url) { var separator = url.indexOf('?') >= 0 ? '&' : '?'; var popupUrl = url + separator + 'popup=true' + '#TB_iframe&width=' + width + '&height=' + height; tb_show(title, popupUrl); } else { throw "QuickPopup: No href provided"; } }; Deki.QuickPopup.Hide = function() { if (parent) { parent.tb_remove(); } else { tb_remove(); } }; Deki.QuickPopup.Redirect = function(url) { // popups are inside iframe by default; common case is to redirect outer parent var w = parent ? parent.window : window; w.location.href = url; }; /* --------- FILES_TABLE.JS --------- */ if (typeof Deki.Plugin == 'undefined') { Deki.Plugin = {}; } if (typeof Deki.Plugin.FilesTable == 'undefined') { Deki.Plugin.FilesTable = {}; } $(function() { // general purpose onclick menu hiding $(document).click(function() { $('ul.deki-file-menu').hide(); }); Deki.Plugin.FilesTable._attachEvents(); }); Deki.Plugin.FilesTable.ID = 'pageFiles'; Deki.Plugin.FilesTable.EVENT_REFRESH_TABLE = 'FilesTable.onRefreshTable'; Deki.Plugin.FilesTable.EVENT_REFRESH_ROW = 'FilesTable.onRefreshRow'; Deki.Plugin.FilesTable.Refresh = function(pageId) { // allow custom endpoints var refreshUrl = Deki.Plugin.AJAX_URL; // load the revisions var fields = { 'formatter': 'filestable', 'page_id': pageId || Deki.PageId, 'action': 'html_refresh' }; $.ajax({ type: 'get', url: refreshUrl, dataType: 'json', data: fields, success: function(data, status) { if (!data.success) { MTMessage.Show(data.message, data.message); return; } var $container = $('#' + Deki.Plugin.FilesTable.ID); $container.html(data.body); Deki.Plugin.FilesTable._attachEvents(); // notify subscribers Deki.Plugin.Publish(Deki.Plugin.FilesTable.EVENT_REFRESH_TABLE, [$container]); } }); }; // @access private Deki.Plugin.FilesTable._attachEvents = function($context) { var $table = $context || $('#attachTable'); // hook events $table.find('a.deki-file-actions').click(clickFileActions); $table.find('a.deki-file-revisions').click(clickFileRevisions); showWebDavLinks(); // editable descriptions $table.find('.deki-editable').editable({ url: Deki.Plugin.AJAX_URL, field: 'description', multiLine: true, fields: { 'formatter': 'filestable', 'action': 'set_description', 'file_id': null }, onDisplayValue: function($el, value) { if ($el.hasClass('nodescription')) { return ''; } else { return value; } }, onGenerateRequest: function($el, options) { // @note 22 => deki-file-description-XXX var fileId = String($el.attr('id')).substr(22); options.fields.file_id = fileId; }, onSuccess: function($el, old, response) { if (Deki.Gui.handleResponse(response)) { if (response.body == '') { $el.addClass('nodescription'); return response.message; } else { $el.removeClass('nodescription'); return response.body; } } return old; } }); // helpers function clickFileRevisions(e) { var $this = $(this); // deki-file-revisions-XXX var fileId = String($this.attr('id')).substr(20); if ($this.data('loadedRevisions')) { toggleRevisions($this, fileId); return false; } // load the revisions var fields = { 'formatter': 'filestable', 'file_id': fileId, 'action': 'html_revisions' }; // allow additional fields if ($this.attr('href') != '#') { var moreFields = String($this.attr('href')).substring(1); moreFields = parseQueryString(moreFields); $.extend(fields, moreFields); } // add loading class $this.addClass('loading'); $.ajax({ type: 'get', url: Deki.Plugin.AJAX_URL, dataType: 'json', data: fields, success: function(data, status) { $this.removeClass('loading'); if (!data.success) { MTMessage.Show(data.message, data.message); return; } $this.data('loadedRevisions', true); var $tr = $this.parent().parent(); $tr.after(data.body); var $rows = $table.find('tr.group-'+fileId); // set the new classes $rows.addClass($tr.attr('class')).removeClass('groupparent'); // bind new events Deki.Plugin.FilesTable._attachEvents($rows); // notify subscribers Deki.Plugin.Publish(Deki.Plugin.FilesTable.EVENT_REFRESH_ROW, [$rows]); toggleRevisions($this, fileId); }, error: function() { $this.removeClass('loading'); } }); return false; }; function clickFileActions(e) { var $this = $(this); // deki-file-actions-XXX var fileId = String($this.attr('id')).substr(18); var $menu = $('#deki-file-menu-'+fileId); if ($menu.length < 1) { // attach to menuFiller $menu = $this.siblings('ul.deki-file-menu'); $menu.attr('id', 'deki-file-menu-'+fileId); $('#menuFiller').append($menu); $menu.hide(); } bindMenuEvents(fileId, $menu); toggleMenu($menu, $this); return false; }; function toggleRevisions($icon, fileId) { $hide = $icon.find('.hide'); $show = $icon.find('.show'); if ($hide.is(':visible')) { $table.find('.group-'+fileId).hide(); $hide.hide(); $show.show(); } else { $table.find('.group-'+fileId).show(); $hide.show(); $show.hide(); } }; function bindMenuEvents(fileId, $menu) { if (!$menu.data('fileId')) { $menu.data('fileId', fileId); if ($menu.hasClass('disabled')) { // disabled event $menu.find('li').click(function() { return false; }); return; } // general quickpopups $menu.find('.quickpopup').click(function() { if ($(this).hasClass('disabled')) return false; toggleMenu($menu); var el = $(this).find('a').get(); Deki.Plugin.FilesTable.QuickPopupFrom(el); return false; }); // specific popups $menu.find('.move').click(function() { toggleMenu($menu); doPopupMoveAttach(Deki.PageId, fileId); return false; }); $menu.find('.description').click(function() { toggleMenu($menu); $('#deki-file-description-'+fileId).click(); return false; }); $menu.find('.delete').click(function() { toggleMenu($menu); doPopupDeleteAttach(Deki.PageId, fileId); return false; }); } }; function toggleMenu($menu, $menuLink) { if ($menu.is(':visible')) { // body click to hide open menus $(document).click(); } else { $(document).click(); // align the menu to the right var linkOffset = $menuLink.offset(); $menu.css('left', (linkOffset.left + $menuLink.outerWidth()) - $menu.outerWidth()); $menu.css('top', linkOffset.top + $menuLink.outerHeight()); $menu.show(); } }; function parseQueryString(s) { var fields = {}; var keyVals = s.split(/&/); $.each(keyVals, function(i, val) { split = String(val).split(/=/); fields[split[0]] = split[1]; }); return fields; }; // office write back capabilities function showWebDavLinks() { $.each(jQuery.browser, function(browser) { if (browser == 'msie') { $table.find('a.deki-webdavdoc').css('display', 'inline'); } }); }; }; Deki.Plugin.FilesTable.QuickPopupFrom = function(el, width, height) { Deki.QuickPopup.Show({ title: $(el).attr('title') || null, 'width': width, 'height': height, url: $(el).attr('href') }); }; // todo: scope function loadOfficeDoc(url) { if (window.ActiveXObject) { var ed; try { ed = new ActiveXObject('SharePoint.OpenDocuments.1'); } catch(err) { window.alert('Unable to create an ActiveX object to open the document. This is most likely because of the security settings for your browser.'); return false; } if (ed) { ed.EditDocument(url); return false; } else { window.alert('Cannot instantiate the required ActiveX control to open the document. This is most likely because you do not have Office installed or you have an older version of Office.'); return false; } } else { window.alert('Internet Explorer is required to use this feature'); } return false; } /* --------- IMAGE_GALLERY_LITE.JS --------- */ (function($) { $(function() { Deki.Plugin.Subscribe('FilesTable.onRefreshTable', function() { Deki.Plugin.ImageGalleryLite.Refresh(); }); }); })(Deki.$); if (typeof Deki.Plugin == 'undefined') { Deki.Plugin = {}; } Deki.Plugin.ImageGalleryLite = {}; Deki.Plugin.ImageGalleryLite.ID = 'deki-image-gallery-lite'; Deki.Plugin.ImageGalleryLite.Refresh = function(pageId) { var options = { type: 'get', url: Deki.Plugin.AJAX_URL, dataType: 'json', data: { 'formatter': 'mindtouchimagegallerylite', 'page_id': pageId || Deki.PageId }, success: function(data, status) { var $container = $('#' + Deki.Plugin.ImageGalleryLite.ID); $container.html(data.body); // rehook thickbox tb_init('#'+ Deki.Plugin.ImageGalleryLite.ID +' a.lightbox'); } }; Deki.Gui.AjaxRequest(options); }; /* --------- EDITOR.JS --------- */ (function(){ Deki.Plugin = Deki.Plugin || {}; /** * @param sEditAreaId String Editor area element id * @abstract */ Deki.Plugin.Editor = function( sEditAreaId ) { this.EditArea = sEditAreaId; this.Instance = null; this.ReadOnly = false; this.$SectionToEdit = null; this.CurrentSection = null; this.OldContent = null; this.InitContent = null; this.Container = null; this.CheckDirtyFunctions = []; this.Init(); } Deki.EDITOR_STATUS_UNLOADED = 1; Deki.EDITOR_STATUS_CONTENT_LOADING = 2; Deki.EDITOR_STATUS_CONTENT_LOADED = 3; Deki.EDITOR_STATUS_LOADED = 4; Deki.EDITOR_STATUS_STARTED = 5; Deki.EditorInstance = null; Deki.Plugin.Editor._formatter = 'page_editor'; Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_UNLOADED; Deki.Plugin.Editor._preloadedContent = null; Deki.Plugin.Editor.prototype = { Init: function() { }, BeforeStart : function() { }, Start : function( editorContent, $sectionToEdit ) { this.$SectionToEdit = ( $sectionToEdit ) ? $sectionToEdit : $( "#pageText" ); // edit page if ( this.$SectionToEdit.length == 0 ) { alert( 'You did not define the ID "pageText" in your skin.' ); this.Cancel(); return; } if ( $sectionToEdit ) { this.CurrentSection = $sectionToEdit.attr( 'id' ).substr( 8 ); } this.BeforeStart(); this.OldContent = this.$SectionToEdit.html(); if ( editorContent ) { if ( this.$SectionToEdit.find( '#' + this.EditArea ).length == 0 ) { this.$SectionToEdit.html( editorContent.content ); } this.$SectionToEdit.append( editorContent.script ); $( '#wpEditTime' ).val( editorContent.edittime ); $( '#wpSection' ).val( this.CurrentSection || '' ); } var $wait = $( "#formLoading" ); $wait.show(); this.ReadOnly = Deki.EditorReadOnly || false; this.Instance = null; var saveFailed = $( '#wpArticleSaveFailed' ).val() === 'true'; this.AddCheckDirtyFunction(function() { // editor is always dirty if save was failed return saveFailed; }); var oSelf = this; // onbeforeunload sometimes fires twice in IE var onBeforeUnloadFired = false; $( window ).bind( 'beforeunload.editor', function() { var result; if ( !onBeforeUnloadFired ) { onBeforeUnloadFired = true; if ( oSelf.CheckDirty() ) { result = wfMsg('GUI.Editor.alert-changes-made-without-saving'); } } window.setTimeout(function() {onBeforeUnloadFired = false;}, 1000); return result; }); if ( this.IsSupported() && Deki.EditorWysiwyg !== false ) { this.CreateEditor( editorContent ); } else { var $textarea = $( "#" + this.EditArea ); this.AddCheckDirtyFunction(function() { return this.InitContent && this.InitContent != $textarea.val(); }); $( "#wpFormButtons input[name=doSave]" ).click(function() { var form = this.form; oSelf.CheckPermissions( function() { this.Save(); form.submit(); }, oSelf ); return false; }); $( "#wpFormButtons input[name=doCancel]" ).click(function() { if ( oSelf.ConfirmCancel() ) { oSelf.Cancel(); } }); $textarea.show(); this.InitContent = $textarea.val(); $( "#wpFormButtons" ).show(); } if (!Deki.PageNotRedirected) { $('#deki-page-title').addClass('ui-state-with-editor'); } $wait.hide(); if ( !this.CurrentSection ) { $( '.hideforedit' ).hide(); } Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_STARTED; }, IsStarted : function() { return Deki.Plugin.Editor.Status == Deki.EDITOR_STATUS_STARTED; }, /** * Creates the editor instance * @abstract */ CreateEditor : function( data ) { }, IsSupported : function() { return false; }, /** * Do an AJAX request to ensure that server is still up * and user has permissions to save the page * * @param successCallback - function to call if check is success * @param scope - the scope for successCallback * */ CheckPermissions : function( successCallback, scope ) { if ( this.ReadOnly ) { return false; } scope = scope || this; $( '#quicksavewait' ).show(); $.ajax( { url : Deki.Plugin.AJAX_URL, data : { formatter: Deki.Plugin.Editor._formatter, method : 'checkPermissions', pageId : Deki.PageId, pageTitle : Deki.PageTitle }, dataType : 'json', success : function( data, status ) { if ( status === 'success' && data.success === true ) { successCallback.call( scope ); } else { $( '#quicksavewait' ).hide(); Deki.Ui.Message( data.message, data.body ); } }, error : function() { $( '#quicksavewait' ).hide(); Deki.Ui.Message( 'We are unable to save this page', 'A server error has occurred. To avoid losing your work, copy the page contents to a new file and retry saving again.' ); } } ); return true; }, BeforeSave : function() { }, Save : function() { if ( this.ReadOnly ) { return; } this.BeforeSave(); $( window ).unbind( 'beforeunload.editor' ); $( '#quicksavewait' ).show(); Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_UNLOADED; }, BeforeCancel : function() { }, ConfirmCancel : function() { if ( !this.ReadOnly && Deki.EditorInstance && Deki.EditorInstance.CheckDirty() ) { var cancelMessage = "Are you sure you want to navigate away from the editor?\n\n" + wfMsg('GUI.Editor.alert-changes-made-without-saving') + "\n\nPress OK to continue, or Cancel to stay on the current editor."; if ( !confirm(cancelMessage) ) { return false; } } return true; }, Cancel : function() { this.BeforeCancel(); $( window ).unbind( 'beforeunload.editor' ); $( '#title' ).show(); // if we're editing an existing page $('.hideforedit').show(); if (typeof Deki.CancelUrl != 'undefined') { window.location = Deki.CancelUrl; } else if ( this.$SectionToEdit ) { if ( this.OldContent !== null ) { this.$SectionToEdit.html( this.OldContent ); } this.$SectionToEdit = null; this.Instance = null; this.CurrentSection = null; this.OldContent = null; this.InitContent = null; this.CheckDirtyFunctions = []; Deki.Plugin.Editor._preloadedContent = null; } else { window.history.back(); } Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_UNLOADED; $('#deki-page-title').removeClass('ui-state-with-editor'); }, AddCheckDirtyFunction : function( func ) { jQuery.isFunction( func ) && this.CheckDirtyFunctions.push( func ); }, CheckDirty : function() { for ( var i = 0 ; i < this.CheckDirtyFunctions.length ; i++ ) { if ( this.CheckDirtyFunctions[i].call( this ) ) { return true; } } return false; } }; Deki.Plugin.Editor.HookEditSection = function() { var href = window.location.href; if ( window.location.hash.length ) { href.substring(0, href.indexOf( '#' )); } href += ( window.location.search.length === 0 ) ? '?' : '&'; var $sections = $( 'h2.editable,h3.editable,h4.editable,h5.editable,h6.editable', $('#pageText') ); $sections.each(function() { var $this = $(this), $section = $this.parent(); var editSectionLink = href + 'action=edit§ionId=' + $section.attr( 'id' ).substr( 8 ); if ( window.location.hash.length ) { editSectionLink += window.location.hash; } var $editLink = $( document.createElement( 'a' ) ) .attr( 'href', editSectionLink ) .attr( 'title', wfMsg('wikibits-edit-section') ); var $editIcon = $( document.createElement( 'img' ) ) .attr( 'src', Deki.PathCommon + '/icons/icon-trans.gif' ) .attr( 'class', 'sectionedit' ) .attr( 'alt', wfMsg('wikibits-edit-section') ); $editLink.append( $editIcon ); $editIcon.wrap( '' ); $this.wrapInner('') .append($editLink); $editLink.wrap( '
    ' ); }) .live( 'mouseover mouseout', function( evt ) { $('div.editIcon', this).css('visibility', evt.type == 'mouseover' ? 'visible' : 'hidden'); }); $( 'div.editIcon > a', $( '#pageText' ) ).live( 'click', function() { Deki.Plugin.Publish('Editor.load', [ $(this).parent().parent().parent() ]); return false; }); } Deki.Plugin.Subscribe( 'Editor.start', function( evt, editorData, $section ) { if ( Deki.EditorInstance && Deki.Plugin.Editor.Status < Deki.EDITOR_STATUS_LOADED ) { var loadScripts = function( scripts ) { if ( jQuery.isArray( scripts ) && scripts.length > 0 ) { jQuery.getScript( scripts.shift(), function () { loadScripts( scripts ); }); } else { Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_LOADED; Deki.EditorInstance.Start( editorData, $section ); } }; loadScripts( editorData.scripts ); } return true; } ); Deki.Plugin.Subscribe( 'Editor.save', function() { if ( Deki.EditorInstance ) { return Deki.EditorInstance.Save(); } return true; }); Deki.Plugin.Subscribe( 'Editor.cancel', function() { if ( Deki.EditorInstance ) { Deki.EditorInstance.Cancel(); } return true; }); Deki.Plugin.Subscribe( 'Editor.checkPermissions', function( evt, callback, scope ) { if ( Deki.EditorInstance ) { return Deki.EditorInstance.CheckPermissions( callback, scope ); } return true; }); var contentParams, getContentParams = function( $section, action ) { if ( contentParams && contentParams.$section == $section && contentParams.action == action ) { return contentParams.params; } contentParams = {}; contentParams.$section = $section; contentParams.action = action; var sectionId = $section ? $section.attr( 'id' ).substr( 8 ) : null; var params = {}, param; if ( window.location.search.length > 0 ) { var query = window.location.search.substring(1).split('&'); for ( var i = 0 ; i < query.length ; i++ ) { param = query[i].split('='); params[param[0]] = decodeURIComponent( param[1] ) || ''; } } params.text = params.text || Deki.PageTitle; params.pageId = params.pageId || Deki.PageId; params.sectionId = params.sectionId || sectionId || ''; params.source = ( action == 'source' ); params.method = 'load'; // Article::loadContent stops to work with this params in some cases params.action && delete params.action; params.diff && delete params.diff; params.revision && delete params.revision; contentParams.params = params; return params; }; Deki.Plugin.Subscribe( 'Editor.loadContent', function( evt, $section, action ) { if ( !$section && Deki.Plugin.Editor.Status > Deki.EDITOR_STATUS_UNLOADED && Deki.Plugin.Editor.Status != Deki.EDITOR_STATUS_CONTENT_LOADED ) { return; } Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_CONTENT_LOADING; var params = getContentParams( $section, action ); if ( !$section && params.sectionId.length ) { $section = $( '#' + params.sectionId ); } Deki.Plugin.AjaxRequest( Deki.Plugin.Editor._formatter, { timeout : 3 * 60 * 1000 /* up to 3mins */, data : params, success : function( data, status ) { if ( status == 'success' && data.success === true ) { if ( !$section ) { Deki.Plugin.Editor._preloadedContent = data.body; } Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_CONTENT_LOADED; Deki.Plugin.Publish( 'Editor.contentLoaded', [ data.body, $section ] ); } else { Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_UNLOADED; Deki.Ui.Message( wfMsg('error'), data.message ); } }, error : function() { Deki.Plugin.Editor.Status = Deki.EDITOR_STATUS_UNLOADED; Deki.Ui.Message(wfMsg('error'), wfMsg('internal-error')); } } ); }); Deki.Plugin.Subscribe( 'Editor.load', function( evt, $section, action ) { if ( !Deki.PageEditable ) { return false; } if ( Deki.Plugin.Editor.Status == Deki.EDITOR_STATUS_STARTED ) { if ( Deki.EditorInstance.CurrentSection && Deki.EditorInstance.ConfirmCancel() ) { Deki.EditorInstance.Cancel(); // if we have a message, hide it $( '#sessionMsg' ).hide(); } else { return false; } } Deki.Plugin.Editor.StartLoadTime = new Date().getTime(); !$section && $( '.hideforedit' ).hide(); var startEditor = function( evt, content, $section ) { Deki.Plugin.Unsubscribe( 'Editor.contentLoaded', startEditor ); Deki.Plugin.Publish( 'Editor.start', [ content, $section ] ); }; if ( !Deki.Plugin.Editor._preloadedContent || $section ) { Deki.Plugin.Subscribe( 'Editor.contentLoaded', startEditor ); Deki.Plugin.Publish( 'Editor.loadContent', [ $section, action ] ); } else { startEditor( null, Deki.Plugin.Editor._preloadedContent ); } return false; }); /** * Support of autosave plugin * Auto start editor if draft is available */ $(function() { if ( window.localStorage && !Deki.UserIsAnonymous ) { try { if ( window.localStorage.getItem( 'cke_' + Deki.PageId ) ) { Deki.Plugin.Publish( 'Editor.load' ); } } catch (ex) {} } }); })(); /* --------- CKEDITOR_BASIC.JS --------- */ /* Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'B1GG4Z6',version:'3.5.2',revision:'6450',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b){var c=a.event.prototype;for(var d in c){if(b[d]==undefined)b[d]=c[d];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d]; return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(d&&d.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1})d=null;if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';}};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown');if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7'); if(d.quirks)d.cssClass+=' cke_browser_iequirks';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';if(d.air)d.cssClass+=' cke_browser_air';return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=1;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=1;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f 1) { str += '' + row.count + ''; } return str; }, formatMatch: function(row, i, max) { return row.title; }, formatResult: function(row) { return row.value; // replace with value ("date:2010-10-10") vs // title } }); $('#deki-page-tags-add').focus(); } }; //simple ajax wrapper: puts in defaults for tag plugin; has success and error callbacks Deki.Plugin.PageTags.AjaxRequest = function(fields, settings, callback, error) { fields = fields || {}; fields.formatter = 'pagetags'; fields.language = Deki.PageLanguageCode; settings = settings || {}; settings.type = settings.type || 'get'; settings.url = settings.url || Deki.Plugin.AJAX_URL; settings.timeout = settings.timeout || 10000; settings.data = settings.data || fields; settings.dataType = settings.dataType || 'json'; settings.error = function() { MTMessage.Show(wfMsg('error'), wfMsg('internal-error')); if (error) { error(); } }; settings.success = function(data, status) { if (!data.success) { MTMessage.Show(data.message, data.message); if (error) { error(); } return; } if (callback) { callback(data); } }; return $.ajax(settings); }; Deki.Plugin.PageTags._buttonLabel = null; Deki.Plugin.PageTags._startLoading = function() { $('#deki-page-tags-add').addClass('ac_loading'); // button [text()] or input [val()] depending on ie6 var $button = $('#deki-page-tags button.input-button'); var $input = $('#deki-page-tags input.input-button'); if (Deki.Plugin.PageTags._buttonLabel == null) { Deki.Plugin.PageTags._buttonLabel = $button.size() > 0 ? $button.text() : $input.val(); } if ($button.size() > 0 ) { $button.text(wfMsg('adding-tags')); } if ($input.size() > 0) { $input.val(wfMsg('adding-tags')); } } Deki.Plugin.PageTags._stopLoading = function() { $('#deki-page-tags-add').removeClass('ac_loading'); var $button = $('#deki-page-tags button.input-button'); var $input = $('#deki-page-tags input.input-button'); if ($button.size() > 0) { $button.text(Deki.Plugin.PageTags._buttonLabel); } if ($input.size() > 0) { $input.val(Deki.Plugin.PageTags._buttonLabel); } } Deki.Plugin.PageTags.RefreshDom = function(settings) { Deki.Plugin.PageTags._attachEvents(settings); // change link text var $link = $('#deki-page-tags-toggleview'); var clickAction = settings.view == 'view' ? 'edit' : 'view'; $link.text($link.attr(clickAction + 'text')); }; // insert page contents into container; if only updating tag list, don't rebind events Deki.Plugin.PageTags._setupPage = function(action, data, $container, isUpdate) { isUpdate = isUpdate || false; $container.html(data.body); if (action == 'view') { Deki.Plugin.PageTags._setInitialTags(); Deki.Plugin.PageTags.RefreshDom( { view: 'view' }); return; } if (action == 'edit') { if (!isUpdate) { Deki.Plugin.PageTags.RefreshDom( { view: 'edit' }); } var $input = $container.find('input[type=text]'); // complete page load; refresh event handlers, etc. if (!isUpdate) { $container.find('form').bind('submit', function(ev) { var tag = $input.val(); $input.val(''); // request in progress; add tag to queue and abort if (Deki.Plugin.PageTags._saveRequest != null) { Deki.Plugin.PageTags._saveRequest.abort(); } Deki.Plugin.PageTags._saveQueue.push(tag); Deki.Plugin.PageTags._startLoading(); Deki.Plugin.PageTags._saveRequest = Deki.Plugin.PageTags.Save(Deki.Plugin.PageTags._saveQueue, function(data) { // optimization: saves return tag list html, refresh only that portion Deki.Plugin.PageTags._setupPage('edit', data, $('#deki-page-tags-edit'), true); Deki.Plugin.PageTags._stopLoading(); Deki.Plugin.PageTags._saveRequest = null; Deki.Plugin.PageTags._saveQueue = []; }, function() { Deki.Plugin.PageTags._stopLoading(); Deki.Plugin.PageTags._saveRequest = null; Deki.Plugin.PageTags._saveQueue = []; Deki.Plugin.PageTags.Refresh('edit'); }); return false; }); } $input.focus(); // bind to tag deletes; elements that have a tagid [may be span or a] $container.find('ul.tags li :first-child[tagid]').each(function(index) { // add tagDelete button to end of wrapping li... var $parent = $(this).parent(); var $deleteIcon = $(''); $deleteIcon.addClass("tag-delete") .attr("title", wfMsg('remove-tag')) .attr("tagid", $(this).attr("tagid")) // ... with handler to remove tag & refresh view .click(function() { $deleteIcon.addClass('loading'); // request in progress; add tag to queue and abort if (Deki.Plugin.PageTags._deleteRequest != null) { Deki.Plugin.PageTags._deleteRequest.abort(); } Deki.Plugin.PageTags._deleteQueue.push($(this).attr("tagid")); Deki.Plugin.PageTags._deleteRequest = Deki.Plugin.PageTags.Delete(Deki.Plugin.PageTags._deleteQueue, function(data) { $deleteIcon.removeClass('loading'); // deletes return tag list html; refresh only that portion Deki.Plugin.PageTags._setupPage('edit', data, $('#deki-page-tags-edit'), true); Deki.Plugin.PageTags._deleteQueue = []; }, function() { // error: refresh Deki.Plugin.PageTags.Refresh('edit'); Deki.Plugin.PageTags._deleteQueue = []; } ); return false; }); $parent.prepend($deleteIcon); }); Deki.Plugin.PageTags._highlightTags(); } } Deki.Plugin.PageTags.Refresh = function(action) { Deki.Plugin.PageTags.AjaxRequest( { 'pageId': Deki.PageId, 'action': action }, {}, function(data) { Deki.Plugin.PageTags._setupPage(action, data, $('#' + Deki.Plugin.PageTags.ID), false); }); }; Deki.Plugin.PageTags.Delete = function(tagIdArray, callback, error) { return Deki.Plugin.PageTags.AjaxRequest( { 'pageId': Deki.PageId, 'action': 'delete', 'tagIds': tagIdArray.join(',') }, { type: 'POST', timeout: 10000 }, callback, error); }; //submit list of tags from input box to api Deki.Plugin.PageTags.Save = function(tagArray, callback, error) { return Deki.Plugin.PageTags.AjaxRequest( { 'pageId': Deki.PageId, 'action': 'save', 'tags': tagArray.join('\n') }, { type: 'POST', timeout: 10000 }, callback, error); }; //support old tag dialog; assume params['tags'] has newline-separated tags Deki.Plugin.PageTags.BulkSave = function(params, callback, error) { params = params || {} params['pageId'] = Deki.PageId; params['action'] = 'bulksave'; Deki.Plugin.PageTags.AjaxRequest(params, { type: 'POST', timeout: 10000 }, callback, error); }; /* --------- PAGE_ALERTS.JS --------- */ var Deki = Deki || {}; Deki.PageAlerts = {}; //Deki.PageAlerts.init $(function() { var $Alerts = Deki.$('#deki-page-alerts'); Deki.PageAlerts.$Toggle = $Alerts.find('div.toggle'); Deki.PageAlerts.$A = $Alerts.find('div.toggle a'); Deki.PageAlerts.$Form = $Alerts.find('form.options'); Deki.PageAlerts._formatter = 'pagealerts'; // only hook events if page alerts are enabled if (!$Alerts.hasClass('disabled')) { // hiding/showing the options Deki.PageAlerts.$A.click(Deki.PageAlerts.toggleOptions); // handle option selections Deki.PageAlerts.$Form.find(':radio').click(Deki.PageAlerts.changeStatus); // activate radio button when label clicked Deki.PageAlerts.$Form.find('label').click(function(){ $(this).siblings(':radio').click(); }); // grab the current selection value Deki.PageAlerts.nLastStatus = Deki.PageAlerts.$Form.find(':checked').val(); } }); // hack for IE of course // stores the last radio button value Deki.PageAlerts.nLastStatus = null; Deki.PageAlerts.toggleOptions = function(event) { var bVisible = Deki.PageAlerts.$Toggle.hasClass('with-options'); Deki.PageAlerts.setOptionsVisibility(!bVisible); if (!bVisible) { // hook the hide event, once Deki.$('body').one('click', function() { Deki.PageAlerts.setOptionsVisibility(false); }); } return false; }; Deki.PageAlerts.setOptionsVisibility = function(visible) { if (visible) { // align the form to the right var tOffset = Deki.PageAlerts.$Toggle.offset(); var tWidth = Deki.PageAlerts.$Toggle.outerWidth(); var fWidth = Deki.PageAlerts.$Form.outerWidth(); // if offset() == position(), we are relative to screen var newLeft; if (Deki.PageAlerts.$Toggle.position().left == tOffset.left) { newLeft = (tOffset.left + tWidth) - fWidth; } else { // relative to parent element var tPosition = Deki.PageAlerts.$Toggle.position(); newLeft = (tPosition.left + tWidth) - fWidth; } Deki.PageAlerts.$Form.css('left', newLeft); Deki.PageAlerts.$Toggle.addClass('with-options'); Deki.PageAlerts.$Form.show(); } else { Deki.PageAlerts.$Toggle.removeClass('with-options'); Deki.PageAlerts.$Form.hide(); // only blur when hiding the options Deki.PageAlerts.$A.blur(); } }; Deki.PageAlerts.changeStatus = function(event) { if (Deki.PageAlerts.nLastStatus != this.value) { Deki.PageAlerts.nLastStatus = this.value; // hide the menu so it seems like a "fast" operation Deki.PageAlerts.setOptionsVisibility(false); // set the status to reflect an ajax request Deki.PageAlerts.$A.addClass('loading'); // post to pagealerts ajax formatter to perform the status change Deki.Plugin.AjaxRequest(Deki.PageAlerts._formatter, { data: { pageId: Deki.PageId, status: this.value }, complete: function() { Deki.PageAlerts.$A.removeClass('loading'); }, success: function(data) { if(data.success) { Deki.PageAlerts.setStatus(data.body, data.message); } else { Deki.Ui.Message(wfMsg('error'), data.message); Deki.PageAlerts.setOptionsVisibility(true); } } } ); } }; Deki.PageAlerts.setStatus = function(bSubscribed, sStatus) { if (bSubscribed) { Deki.PageAlerts.$A.removeClass('off'); } else { Deki.PageAlerts.$A.addClass('off'); } // set the textual status if specified if (sStatus) { Deki.PageAlerts.$A.find('span.status').text(sStatus); } }; /* --------- PAGE_TEMPLATE_SELECTOR.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ var Deki = Deki || {}; if (typeof Deki.Plugin == 'undefined') { Deki.Plugin = {}; } (function($) { $(function() { Deki.Plugin.PageTemplateSelector._attachEvents(); }); })(Deki.$); Deki.Plugin.PageTemplateSelector = {}; Deki.Plugin.PageTemplateSelector.SpecialPage = 'Special:PageTemplateSelector'; Deki.Plugin.PageTemplateSelector._attachEvents = function() { // on the popup page var $popup = $('#deki-pagetemplates-embed'); if ($popup.length > 0) { $popup.removeClass('loading'); // disable links within page items $popup.find('.page-item a').click(function() { return false; }); $popup.find('li.page-item').click(function() { var $link = $(this).find('a'); // clicking previously highlighted item - templatepath has already been set if ($(this).hasClass('highlight')) { Deki.Plugin.PageTemplateSelector.DefaultAction(); return false; } // new template selection $popup.find('.page-item').removeClass('highlight'); $(this).addClass('highlight'); // set the hidden template field (link of format "#path/to/template") $('#deki-pagetemplates-templatepath').val($link.attr('href').substring(1)); }); // set default $default = $popup.find('li.page-item-default'); $default.addClass('highlight'); // Bug #8288: pressing enter should click highlighted item $(document).keypress(function(e) { if (e.keyCode == '13') { e.preventDefault(); Deki.Plugin.PageTemplateSelector.DefaultAction(); } }); } }; // Triggered for default select (i.e., submitting current form via enter) Deki.Plugin.PageTemplateSelector.DefaultAction = function() { var createPageUri = $('#deki-pagetemplates-create').attr('href') + '&template=' + $('#deki-pagetemplates-templatepath').val(); // cannot trigger native link click via javascript - manually redirect Deki.QuickPopup.Redirect(createPageUri); } Deki.Plugin.PageTemplateSelector.ShowPopup = function(title, url) { var width = 690; var height = 380; Deki.QuickPopup.Show({ 'title': title, 'url': url, width: width, height: height }); return false; }; /* --------- PAGE_CONTENT_RATING.JS --------- */ /* * MindTouch Deki - enterprise collaboration and integration platform * Copyright (C) 2006-2009 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit www.opengarden.org; * please review the licensing section. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/copyleft/gpl.html */ var Deki = Deki || {}; if (typeof Deki.Plugin == 'undefined') { Deki.Plugin = {}; } (function($) { $(function() { Deki.Plugin.PageContentRating._attachEvents(); }); })(Deki.$); Deki.Plugin.PageContentRating = {}; Deki.Plugin.PageContentRating._formatter = 'page_content_rating'; Deki.Plugin.PageContentRating._$lastClicked = null; Deki.Plugin.PageContentRating._attachEvents = function() { // if disabled, ignore existing onclick events $('.deki-page-rating-buttons.disabled a').removeAttr('onclick'); // attach to page rating events. May be called multiple times, so unbind previous handlers $('.deki-page-rating-buttons a').each(function() { // have we already attached events? if ($(this).data('pagerating.events')) return; else $(this).data('pagerating.events', true); $(this).click(function() { Deki.Plugin.PageContentRating._$lastClicked = $(this); var rating = $(this).hasClass('content-rate-up') ? 1 : 0; Deki.Plugin.PageContentRating._rate(rating); return false; }); }); $('#deki-page-rating-comment .input-button').click(function() { var comment = $('#textarea-rating').val(); parent.Deki.Plugin.PageContentRating._comment(comment); Deki.QuickPopup.Hide(); return false; }); $('#deki-page-rating-comment .secondary').click(function() { Deki.QuickPopup.Hide(); return false; }); }; Deki.Plugin.PageContentRating._updatePage = function(ratingData) { $('#deki-page-rating-score').text(ratingData.score_text); $('.deki-page-rating-buttons').replaceWith(ratingData.button_html); Deki.Plugin.PageContentRating._attachEvents(); }; Deki.Plugin.PageContentRating.ShowPopup = function(title, url) { var width = 400; var height = 190; Deki.QuickPopup.Show({ 'title': title, 'url': url, width: width, height: height }); return false; }; Deki.Plugin.PageContentRating._rate = function(rating) { Deki.Plugin.AjaxRequest(Deki.Plugin.PageContentRating._formatter, { data: { action: 'rate', pageId: Deki.PageId, rating: rating }, success: function(data) { if (data.body["popup_url"]) { Deki.Plugin.PageContentRating.ShowPopup(wfMsg('contentrating-title-popup'), data.body["popup_url"]); } Deki.Plugin.PageContentRating._updatePage(data.body); }, context: Deki.Plugin.PageContentRating._$lastClicked } ); }; Deki.Plugin.PageContentRating._comment = function(comment) { Deki.Plugin.AjaxRequest(Deki.Plugin.PageContentRating._formatter, { data: { action: 'comment', pageId: Deki.PageId, comment: comment }, success: function(data) { var $comments = $(parent.document.body).find('#comments'); parent.Deki.Plugin.Comments.Update($comments); }, context: Deki.Plugin.PageContentRating._$lastClicked } ); }; /* --------- PAGE_TITLE_EDITOR.JS --------- */ $(function() { var titleId = 'deki-page-title'; var pluginFormatter = 'page_title_editor'; var $editor = $('#' + titleId); // view var $view = $editor.find('.state-view'); var $viewTitle = $editor.find('.state-view span.title'); // hover var $hover = $editor.find('.state-hover'); var $hoverTitle = $editor.find('.state-hover span.title'); // edit var $edit = null; // mask var $mask = null; var defaults = { title: '', name: '', type: '' }; // redirected pages cannot have their titles update - this is just asking for end-user confusion if (Deki.FollowRedirects) { // hook hover events $viewTitle.hoverIntent({ sensitivity: 5, interval: 200, over: hoverOver }); $hover.hover(null, hoverOut); $editor.find('span.title').dblclick(showEditor); $editor.find('.state-hover .edit').click(showEditor); } // events function hoverOver() { if (!$hoverTitle.data('deki.positioned')) { $hoverTitle.data('deki.positioned', true); $editor.css('position', 'relative'); $hover.css({ 'visibility': 'hidden', 'display': 'block' }); // determine offset before adding class var ptOffset = $view.offset(); var ctOffset = $hoverTitle.offset(); // note: equal padding required var padding = ($hoverTitle.outerWidth() - $hoverTitle.width()) / 2; // determine shift var adjLeft = parseInt(ptOffset.left - ctOffset.left); var adjTop = parseInt(ptOffset.top - ctOffset.top); $hover.css('left', adjLeft - padding); $hover.css('top', adjTop - padding); $editor.css('position', ''); $hover.css({ 'visibility': 'visible', 'display': '' }); } $editor.addClass('ui-state-hover'); }; function hoverOut() { $editor.removeClass('ui-state-hover'); }; function buildMask() { if ($mask) { return; } var div = document.createElement('div'); $mask = $(div).html(' ').addClass('title-editor-mask'); $('body').append($mask); var zIndex = parseInt($editor.css('z-index')); zIndex = isNaN(zIndex) ? 999 : zIndex - 1; $mask.css({ 'position' : 'absolute', 'left' : 0, 'top' : 0, 'overflow' : 'hidden', 'background-color' : '#000', 'opacity' : '0.40', 'z-index' : zIndex }); var sizeMask = function() { var $doc = $(document); $mask && $mask.css({ 'width' : $doc.width(), 'height' : $doc.height() }); }; $mask.bind('show', function(){ sizeMask(); $(window).bind('resize', sizeMask); }); $mask.bind('hide', function(){ $(window).unbind('resize', sizeMask); }); } function showEditor() { if (!_loadEditor()) return; // clear the messages Deki.Ui.EmptyFlash(); // set the default title $edit.find('.edit-title').val(defaults.pageTitle); // show edit $editor.addClass('ui-state-edit'); // show mask if wysiswyg editor is opened !$mask && buildMask(); $mask.trigger('show'); $mask.show(); if (defaults.pathType == 'custom') { _unlinkTitle(); } else { if (defaults.pathType == 'fixed') { $edit.addClass('ui-state-fixed'); } _linkTitle(); } // select! $edit.find('.edit-title').focus(); $edit.find('.edit-title').select(); }; function hideEditor() { $editor.removeClass('ui-state-edit'); if ($mask) { $mask.trigger('hide'); $mask.hide(); } }; function toggleTitleLink() { if (_isLinked()) { _unlinkTitle(); } else { _linkTitle(); } }; function updateTitle() { // make the title change // disable the submit button $edit.find('.edit-update').attr("disabled","disabled"); var editor = Deki.EditorInstance && Deki.EditorInstance.IsStarted(); var fields = { pageId: Deki.PageId, action: 'update', title: $edit.find('.edit-title').val(), inlinerefresh: editor }; // user is providing a custom path name if (!_isLinked()) { fields.name = $edit.find('.edit-path').val(); } var options = { type: 'post', data: fields, success: function(data) { // update defaults defaults.pageTitle = data.body.title; defaults.pageName = data.body.name; if (editor) { Deki.Ui.Flash(data.message); // set the new display title _setTitle(defaults.pageTitle); hideEditor(); $edit.find('.edit-update').removeAttr("disabled"); } else { window.location = data.body.uri; } }, // error doesn't fall through complete: function() { $edit.find('.edit-update').removeAttr("disabled"); } }; Deki.Plugin.AjaxRequest(pluginFormatter, options); return false; }; // helpers function _isLinked() { return !$edit.hasClass('ui-state-unlinked'); }; function _setTitle(pageTitle) { $viewTitle.text(pageTitle); $hoverTitle.text(pageTitle); }; function _linkTitle() { $edit.removeClass('ui-state-unlinked'); $edit.find('.edit-title').focus(); $edit.find('.edit-title').select(); }; function _unlinkTitle() { if (defaults.pathType == 'fixed') return false; // set the defaults $edit.find('.edit-path').val(defaults.pathName); $edit.addClass('ui-state-unlinked'); $edit.find('.edit-title').focus(); $edit.find('.edit-path').select(); }; function _loadEditor() { if ($editor.data('loaded')) { return true; } // load the editing html var options = { data: { pageId: Deki.PageId, redirects: Deki.FollowRedirects }, success: function(data) { // default title defaults.pageTitle = data.body.title; // default path defaults.pathName = data.body.name; // default link state defaults.pathType = data.body.type; // add the edit html $editor.append(data.body.html); $edit = $editor.find('.state-edit'); $editor.data('loaded', true); _hookEditEvents(); showEditor(); } }; Deki.Plugin.AjaxRequest(pluginFormatter, options); return false; }; function _hookEditEvents() { var $textInputs = $edit.find('input[type=text]'); var $editPath = $edit.find('.edit-path'); var $toggleButton = $edit.find('a.toggle-link'); var $updateButton = $edit.find('.edit-update'); var $cancelButton = $edit.find('a.cancel'); // edit events $cancelButton.click(hideEditor); $toggleButton.click(toggleTitleLink); $updateButton.click(updateTitle); $textInputs.keypress(function(e) { switch (e.keyCode) { case 13: // enter updateTitle(); return false; case 27: // escape hideEditor(); return false; } }); }; }); /* --------- TOOLTIPS.JS --------- */ if (typeof Deki == 'undefined') { var Deki = {}; } if (typeof Deki.Ui == 'undefined') { Deki.Ui = {}; } if (typeof Deki.Gui == 'undefined') { Deki.Gui = {}; } (function(){ $(function() { refreshMessageTips(); }); /** * Immediately generate a tooltip message on an element * @param Object el - DOM or jQuery element * @param Object options - options object, with type one of {'login', 'commercial'} */ Deki.Ui.MessageTip = function(el, options) { options = options || {}; switch (options.type) { case 'login': addMessageTip(el, wfMsg('login-required'), 'light'); break; case 'commercial': addMessageTip(el, wfMsg('commercial-required'), 'dark'); break; } }; // tooltips override original handleResponse to display tooltips var handleResponseOriginal = Deki.Gui.handleResponse; /** * @param Object data - expected fields: context (DOM Object to receive tip) * @return bool */ Deki.Gui.handleResponse = function(data, XmlHttpRequest, options) { if (data.success) { return true; } var $el = $(options.context); switch (data.status) { // attach tooltips if possible, otherwise yellowbox case Deki.Gui.Status.ERROR_LOGIN: if ($el.length > 0) Deki.Ui.MessageTip($el, {type: 'login'}); else Deki.Ui.Message(wfMsg('login-required'), ''); return false; case Deki.Gui.Status.ERROR_COMMERCIAL: if ($el.length > 0) Deki.Ui.MessageTip($el, {type: 'commercial'}); else Deki.Ui.Message(wfMsg('commercial-required'), ''); return false; default: return handleResponseOriginal(data, XmlHttpRequest, options); } }; /** * Private methods */ var $lastMessageTip = null; function addMessageTip(el, content, styleName) { var $el = $(el); // clear last message tip, if any if ($lastMessageTip) { $lastMessageTip.qtip('destroy'); } $lastMessageTip = $el; $el.qtip({ content: content, position: { corner: { tooltip: 'topRight', target: 'bottomLeft' } }, // show tooltip immediately show: { ready: true }, // use custom hide event when body clicked (note: unfocus event not working) hide: false, api: { onRender: function() { $('body').click(function() { $el.qtip('destroy'); }); } }, style: { border: { width: 2, radius: 5 }, width: 250, padding: 5, textAlign: 'center', tip: true, name: styleName } }); }; function refreshMessageTips() { // remove existing handlers and only allow tooltip $('.disabled-login a, a.disabled-login').each(function(){ $(this).removeAttr('onclick').unbind('click') .click(function() { Deki.Ui.MessageTip($(this), {type: 'login'}); return false; }); }); $('.disabled-commercial a, a.disabled-commercial').each(function(){ $(this).removeAttr('onclick').unbind('click') .click(function() { Deki.Ui.MessageTip($(this), {type: 'commercial'}); return false; }); }); }; })(); /* --------- JQUERY.QTIP-1.0.MIN.JS --------- */ /* * jquery.qtip. The jQuery tooltip plugin * * Copyright (c) 2009 Craig Thompson * http://craigsworks.com * * Licensed under MIT * http://www.opensource.org/licenses/mit-license.php * * Launch : February 2009 * Version : 1.0.0-rc3 * Released: Tuesday 12th May, 2009 - 00:00 * Debug: jquery.qtip.debug.js */ (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;CG.dimensions.width){G.dimensions.width=J[C]}if(J[C]G.dimensions.height){G.dimensions.height=J[C]}if(J[C]0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","
    ");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","
    ");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='
    ';if(f("").get(0).getContext){u[z]+=''}else{if(f.browser.msie){G=B*2+3;u[z]+=''}}u[z]+="
    "}D=F.getDimensions().width-(Math.max(t,B)*2);y='
    ';w='
    '+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='
    '+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='
    ';if(f("").get(0).getContext){t.elements.tip+=''}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='';t.elements.tip+='';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"
    ");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('
    ').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='