source: trunk/web/addons/job_monarch/lib/extjs/adapter/yui/ext-yui-adapter.js @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 13.0 KB
Line 
1Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isChrome=ua.indexOf("chrome")>-1,isSafari=!isChrome&&(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isIE8=!isOpera&&ua.indexOf("msie 8")>-1,isGecko=!isSafari&&!isChrome&&ua.indexOf("gecko")>-1,isGecko3=isGecko&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}if(Ext.isIE&&overrides.toString!=origclass.toString){p.toString=overrides.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isDate(ov)){var s=Ext.encode(ov).replace(/"/g,"");buf.push(k,"=",s,"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"||isNaN(v)){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isChrome:isChrome,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isIE8:isIE8,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var a=arguments;var b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(typeof a=="number"){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c){return setTimeout(d,c)}d();return 0},createSequence:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}},createInterceptor:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){b.target=this;b.method=c;if(b.apply(a||this||window,arguments)===false){return}return c.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=new String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a.toString()},format:function(b){var a=Array.prototype.slice.call(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.applyIf(Array.prototype,{indexOf:function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};if(typeof YAHOO=="undefined"){throw"Unable to load Ext, core YUI utilities (yahoo, dom, event) not found."}(function(){var f=YAHOO.util.Event;var g=YAHOO.util.Dom;var b=YAHOO.util.Connect;var h=YAHOO.util.Easing;var a=YAHOO.util.Anim;var d;Ext.lib.Dom={getViewWidth:function(i){return i?g.getDocumentWidth():g.getViewportWidth()},getViewHeight:function(i){return i?g.getDocumentHeight():g.getViewportHeight()},isAncestor:function(i,j){return g.isAncestor(i,j)},getRegion:function(i){return g.getRegion(i)},getY:function(i){return this.getXY(i)[1]},getX:function(i){return this.getXY(i)[0]},getXY:function(k){var j,o,r,s,n=(document.body||document.documentElement);k=Ext.getDom(k);if(k==n){return[0,0]}if(k.getBoundingClientRect){r=k.getBoundingClientRect();s=e(document).getScroll();return[r.left+s.left,r.top+s.top]}var t=0,q=0;j=k;var i=e(k).getStyle("position")=="absolute";while(j){t+=j.offsetLeft;q+=j.offsetTop;if(!i&&e(j).getStyle("position")=="absolute"){i=true}if(Ext.isGecko){o=e(j);var u=parseInt(o.getStyle("borderTopWidth"),10)||0;var l=parseInt(o.getStyle("borderLeftWidth"),10)||0;t+=l;q+=u;if(j!=k&&o.getStyle("overflow")!="visible"){t+=l;q+=u}}j=j.offsetParent}if(Ext.isSafari&&i){t-=n.offsetLeft;q-=n.offsetTop}if(Ext.isGecko&&!i){var m=e(n);t+=parseInt(m.getStyle("borderLeftWidth"),10)||0;q+=parseInt(m.getStyle("borderTopWidth"),10)||0}j=k.parentNode;while(j&&j!=n){if(!Ext.isOpera||(j.tagName!="TR"&&e(j).getStyle("display")!="inline")){t-=j.scrollLeft;q-=j.scrollTop}j=j.parentNode}return[t,q]},setXY:function(i,j){i=Ext.fly(i,"_setXY");i.position();var k=i.translatePoints(j);if(j[0]!==false){i.dom.style.left=k.left+"px"}if(j[1]!==false){i.dom.style.top=k.top+"px"}},setX:function(j,i){this.setXY(j,[i,false])},setY:function(i,j){this.setXY(i,[false,j])}};Ext.lib.Event={getPageX:function(i){return f.getPageX(i.browserEvent||i)},getPageY:function(i){return f.getPageY(i.browserEvent||i)},getXY:function(i){return f.getXY(i.browserEvent||i)},getTarget:function(i){return f.getTarget(i.browserEvent||i)},getRelatedTarget:function(i){return f.getRelatedTarget(i.browserEvent||i)},on:function(m,i,l,k,j){f.on(m,i,l,k,j)},un:function(k,i,j){f.removeListener(k,i,j)},purgeElement:function(i){f.purgeElement(i)},preventDefault:function(i){f.preventDefault(i.browserEvent||i)},stopPropagation:function(i){f.stopPropagation(i.browserEvent||i)},stopEvent:function(i){f.stopEvent(i.browserEvent||i)},onAvailable:function(l,k,j,i){return f.onAvailable(l,k,j,i)}};Ext.lib.Ajax={request:function(o,m,i,n,j){if(j){var k=j.headers;if(k){for(var l in k){if(k.hasOwnProperty(l)){b.initHeader(l,k[l],false)}}}if(j.xmlData){if(!k||!k["Content-Type"]){b.initHeader("Content-Type","text/xml",false)}o=(o?o:(j.method?j.method:"POST"));n=j.xmlData}else{if(j.jsonData){if(!k||!k["Content-Type"]){b.initHeader("Content-Type","application/json",false)}o=(o?o:(j.method?j.method:"POST"));n=typeof j.jsonData=="object"?Ext.encode(j.jsonData):j.jsonData}}}return b.asyncRequest(o,m,i,n)},formRequest:function(m,l,j,n,i,k){b.setForm(m,i,k);return b.asyncRequest(Ext.getDom(m).method||"POST",l,j,n)},isCallInProgress:function(i){return b.isCallInProgress(i)},abort:function(i){return b.abort(i)},serializeForm:function(i){var j=b.setForm(i.dom||i);b.resetFormState();return j}};Ext.lib.Region=YAHOO.util.Region;Ext.lib.Point=YAHOO.util.Point;Ext.lib.Anim={scroll:function(l,j,m,n,i,k){this.run(l,j,m,n,i,k,YAHOO.util.Scroll)},motion:function(l,j,m,n,i,k){this.run(l,j,m,n,i,k,YAHOO.util.Motion)},color:function(l,j,m,n,i,k){this.run(l,j,m,n,i,k,YAHOO.util.ColorAnim)},run:function(m,j,o,p,i,l,k){k=k||YAHOO.util.Anim;if(typeof p=="string"){p=YAHOO.util.Easing[p]}var n=new k(m,j,o,p);n.animateX(function(){Ext.callback(i,l)});return n}};function e(i){if(!d){d=new Ext.Element.Flyweight()}d.dom=i;return d}if(Ext.isIE){function c(){var i=Function.prototype;delete i.createSequence;delete i.defer;delete i.createDelegate;delete i.createCallback;delete i.createInterceptor;window.detachEvent("onunload",c)}window.attachEvent("onunload",c)}if(YAHOO.util.Anim){YAHOO.util.Anim.prototype.animateX=function(k,i){var j=function(){this.onComplete.unsubscribe(j);if(typeof k=="function"){k.call(i||this,this)}};this.onComplete.subscribe(j,this,true);this.animate()}}if(YAHOO.util.DragDrop&&Ext.dd.DragDrop){YAHOO.util.DragDrop.defaultPadding=Ext.dd.DragDrop.defaultPadding;YAHOO.util.DragDrop.constrainTo=Ext.dd.DragDrop.constrainTo}YAHOO.util.Dom.getXY=function(i){var j=function(k){return Ext.lib.Dom.getXY(k)};return YAHOO.util.Dom.batch(i,j,YAHOO.util.Dom,true)};if(YAHOO.util.AnimMgr){YAHOO.util.AnimMgr.fps=1000}YAHOO.util.Region.prototype.adjust=function(k,j,i,m){this.top+=k;this.left+=j;this.right+=m;this.bottom+=i;return this};YAHOO.util.Region.prototype.constrainTo=function(i){this.top=this.top.constrain(i.top,i.bottom);this.bottom=this.bottom.constrain(i.top,i.bottom);this.left=this.left.constrain(i.left,i.right);this.right=this.right.constrain(i.left,i.right);return this}})();
Note: See TracBrowser for help on using the repository browser.