var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /* * @version : 1.2.0 - Ext.NET Pro License * @author : Ext.NET, Inc. http://www.ext.net/ * @date : 2011-09-12 * @copyright : Copyright (c) 2006-2011, Ext.NET, Inc. (http://www.ext.net/). All rights reserved. * @license : See license.txt and http://www.ext.net/license/. * @website : http://www.ext.net/ */ Ext.ns("Ext.net","Ext.net.DirectMethods","Ext.ux","Ext.ux.plugins","Ext.ux.layout");Ext.net.Version="1.0.0"; Ext.net.ResourceMgr=function(){return{id:"",url:"",quickTips:true,cssClasses:{},submitDisabled:true,BLANK_IMAGE_URL:"",hasCssClass:function(id){return!!this.cssClasses[id];},registerCssClass:function(id,cssClass,registerId){if(!this.hasCssClass(id)){var ss=Ext.fly("extnet-resources"),old="";if(ss){if(Ext.isIE){old=ss.dom.styleSheet.cssText;}else{old=ss.dom.innerHTML;} ss.remove();} Ext.util.CSS.createStyleSheet(old+" "+cssClass,"extnet-resources");if(registerId!==false){this.cssClasses[id]=true;}}},toCharacterSeparatedFileName:function(name,separator){if(Ext.isEmpty(name,false)){return;} var matches=name.match(/([A-Z]+)[a-z]*|\d{1,}[a-z]{0,}/g);var temp="",i=0;for(i;i0){this.registerCssClass("",buffer.join(" "),false);}},getCmp:function(id){var d=id.split("."),o=window[d[0]];Ext.each(d.slice(1),function(v){if(!o){return null;} o=o[v];});return o?Ext.getCmp(o.id):null;},destroyCmp:function(id){var obj=Ext.getCmp(id)||window[id];if(!Ext.isObject(obj)||!obj.destroy){obj=Ext.net.ResourceMgr.getCmp(id);} if(Ext.isObject(obj)&&obj.destroy){try{obj.destroy();}catch(e){}}},init:function(config){Ext.apply(this,config||{});if(this.quickTips===true){Ext.QuickTips.init();} if((Ext.isIE6||Ext.isIE7||Ext.isAir)&&!Ext.isEmpty(this.BLANK_IMAGE_URL)){Ext.BLANK_IMAGE_URL=this.BLANK_IMAGE_URL;} this.registerPageResources();if(this.theme){Ext.getBody().addClass("x-theme-"+this.theme);} if(this.icons){this.registerIcon(this.icons,true);} if(this.ns){Ext.ns(this.ns);}},registerPageResources:function(){Ext.select("script").each(function(el){var url=el.dom.getAttribute("src");if(!Ext.isEmpty(url)&&!this.queue.contains(url)){this.queue.buffer.push({url:url,loading:false});}},this);Ext.select("link[type=text/css]").each(function(el){var url=el.dom.getAttribute("href");if(!Ext.isEmpty(url)&&!this.queue.contains(url)){this.queue.buffer.push({url:url,loading:false});}},this);},getAspForm:function(){if(this.aspForm){return Ext.get(this.aspForm);}},load:function(config,groupCallback){this.queue.clear();if(groupCallback){groupCallback={fn:groupCallback,counter:config.length||1,config:config,step:function(){this.counter--;if(this.counter===0){this.fn.apply(window,[this.config]);}}};} Ext.each(Ext.isArray(config)?config:[config],function(config){if(Ext.isString(config)){var url=config;config={url:url};if(url.substring(url.length-4)===".css"){config.mode="css";}} config.options=Ext.applyIf(config.options||{},{mode:config.mode||"js"});if(config.callback){config.loadCallback=config.callback;delete config.callback;} if(groupCallback){config.groupCallback=groupCallback;} if(!Ext.isEmpty(config.url)){this.queue.enqueue(config);}},this);this.doLoad();},doLoad:function(){var config=this.queue.peek();if(config===undefined){return;} var url=config.url,item,contains=this.queue.contains(url);if(config.force===true||contains!==true){if(contains!==true){this.queue.buffer.push({url:url,loading:true});} Ext.Ajax.request(Ext.apply({scope:this,method:"GET",callback:this.onResult,disableCaching:false},config));}else{item=this.queue.getItem(url);if(item&&item.loading){this.queue.waitingList.push(config);return;} if(config.loadCallback){config.loadCallback.apply(window,[config]);} if(config.groupCallback){config.groupCallback.step();} this.queue.dequeue(config);this.doLoad();}},onResult:function(options,success,response){if(success===true){if(options.mode==="css"){Ext.util.CSS.createStyleSheet(response.responseText);}else{var head=document.getElementsByTagName("head")[0],el=document.createElement("script");el.setAttribute("type","text/javascript");el.text=response.responseText;head.appendChild(el);} var i=0,item=this.queue.getItem(options.url);if(item!==null){item.loading=false;} if(options.loadCallback){options.loadCallback.apply(window,[options]);} if(options.groupCallback){options.groupCallback.step();} while(this.queue.waitingList.length>i){item=this.queue.waitingList[i];if(item.url===options.url){if(item.loadCallback){item.loadCallback.apply(window,[item]);} if(item.groupCallback){item.groupCallback.step();} this.queue.waitingList.remove(item);}else{i++;}}} this.queue.dequeue(options);this.doLoad();},queue:function(){return{js:[],css:[],buffer:[],waitingList:[],enqueue:function(item){this[item.options.mode].push(item);},dequeue:function(item){var mode=item.options.mode,temp=this[mode][0];this[mode]=this[mode].slice(1);return temp;},clear:function(){this.js=[];this.css=[];},contains:function(url){var i=0;url=url.replace("&","&");for(i;i0?this.css[0]:this.js[0];}};}(),setTheme:function(url,name){var html=Ext.get(document.getElementsByTagName("html")[0]);if(this.theme){html.removeClass("x-theme-"+this.theme);} if(name){this.theme=name;html.addClass("x-theme-"+this.theme);} Ext.util.CSS.swapStyleSheet("ext-theme",url);}};}(); Ext.net.StringUtils=function(){return{startsWith:function(str,value){return str.match("^"+value)!==null;},endsWith:function(str,value){return str.match(value+"$")!==null;}};}(); (function(){Ext.util.Observable.prototype.constructor=Ext.util.Observable.prototype.constructor.createInterceptor(function(){if(this.initialConfig){var id=this.initialConfig.proxyId||this.initialConfig.id;if(this.forbidIdScoping!==true&&!Ext.isEmpty(id,false)&&id.indexOf("ext-comp-")!==0){var ns=this.ns||Ext.net.ResourceMgr.ns;if(ns){(Ext.isObject(ns)?ns:Ext.ns(ns))[this.initialConfig.itemId||id]=this;}else{window[id]=this;}}}});Ext.util.Observable.prototype.constructor.prototype=Ext.util.Observable.prototype;var fns={},v,i;for(i in Ext.util.Observable){v=Ext.util.Observable[i];if(typeof v==="function"){fns[i]=v;}} Ext.util.Observable=Ext.util.Observable.prototype.constructor;Ext.applyIf(Ext.util.Observable,fns);})();Ext.util.Observable.prototype.purgeListeners=Ext.util.Observable.prototype.purgeListeners.createSequence(function(){this.cleanId();});Ext.override(Ext.util.Observable,{cleanId:function(){if(this.forbidIdScoping!==true){var ns=this.ns||Ext.net.ResourceMgr.ns,id=this.itemId||this.proxyId||this.storeId||this.id,nsObj;if(ns&&id){if(Ext.isObject(ns)&&ns[id]){try{delete ns[id];}catch(e){ns[id]=undefined;}}else if(Ext.net.ResourceMgr.getCmp(ns+"."+id)){try{delete Ext.ns(ns)[id];}catch(f){Ext.ns(ns)[id]=undefined;}}}else if(window[this.proxyId||this.storeId||this.id]){window[this.proxyId||this.storeId||this.id]=null;}}},destroy:function(){this.cleanId();},fireEvent:function(){if(!(this.isAjaxInit||false)){this.isAjaxInit=true;this.ajaxListeners={};if(this.directEvents){this.addAjaxListener(this.directEvents);}} var a=Ext.toArray(arguments),ename=a[0].toLowerCase(),me=this,ret=true,ce=me.events[ename],ace=me.ajaxListeners[ename],q,c;if(me.eventsSuspended===true){if(me.eventQueue){q=me.eventQueue;q.push(a);}}else if(Ext.isObject(ce)&&ce.bubble){if(ce.fire.apply(ce,a.slice(1))===false){return false;} if(Ext.isObject(ace)&&ace.fire.apply(ace,a.slice(1))===false){return false;} c=me.getBubbleTarget&&me.getBubbleTarget();if(c&&c.enableBubble){if(!c.events[ename]||!Ext.isObject(c.events[ename])||!c.events[ename].bubble){c.enableBubble(ename);} return c.fireEvent.apply(c,a);}}else{if(Ext.isObject(ce)||Ext.isObject(ace)){a.shift();} if(Ext.isObject(ce)){ret=ce.fire.apply(ce,a);} if(ret!==false&&Ext.isObject(ace)){ret=ace.fire.apply(ace,a);}} return ret;},addAjaxListener:function(eventName,fn,scope,o){var me=this,e,oe,filterOptRe=/^(?:scope|delay|buffer|single)$/,ce;if(Ext.isObject(eventName)){o=eventName;for(e in o){oe=o[e];if(!filterOptRe.test(e)){me.addAjaxListener(e,oe.fn||oe,oe.scope||o.scope,oe.fn?oe:o);}}}else{eventName=eventName.toLowerCase();ce=me.ajaxListeners[eventName]||true;if(Ext.isBoolean(ce)){me.ajaxListeners[eventName]=ce=new Ext.util.Event(me,eventName);} o=Ext.isObject(o)?o:{};if(Ext.isEmpty(o.delay)){o.delay=20;} ce.addListener(fn,scope,o);}}}); Ext.isEmptyObj=function(obj){if(typeof obj==="undefined"||obj===null){return true;} if(!(!Ext.isEmpty(obj)&&typeof obj==="object")){return false;} var p;for(p in obj){return false;} return true;};Ext.net.clone=function(o){if(!o||"object"!==typeof o){return o;} var c="[object Array]"===Object.prototype.toString.call(o)?[]:{},p,v;for(p in o){if(o.hasOwnProperty(p)){v=o[p];c[p]=(v&&"object"===typeof v)?Ext.net.clone(v):v;}} return c;};Ext.net.on=function(target,eventName,handler,scope,mode,cfg){var el=target;if(typeof target==="string"){el=Ext.get(target);} if(!Ext.isEmpty(el)){if(mode&&mode==="client"){el.on(eventName,handler.fn,scope,handler);}else{el.on(eventName,handler,scope,cfg);}}};Ext.net.lazyInit=function(controls){if(!Ext.isArray(controls)){return;} var cmp,i;for(i=0;i';Ext.lib.Event.onAvailable(id,function(){var DOC=document,hd=DOC.getElementsByTagName("head")[0],re=/(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,reStyle=/(?:]*)?>)((\n|\r|.)*?)(?:<\/style>)/ig,reLink=/(?:]*)?\/>)/ig,srcRe=/\ssrc=([\'\"])(.*?)\1/i,typeRe=/\stype=([\'\"])(.*?)\1/i,hrefRe=/\shref=([\'\"])(.*?)\1/i,match,attrs,hrefMatch,srcMatch,typeMatch,el,s;while((match=reLink.exec(html))){attrs=match[1];hrefMatch=attrs?attrs.match(hrefRe):false;if(hrefMatch&&hrefMatch[2]){s=DOC.createElement("link");s.href=hrefMatch[2];s.rel="stylesheet";typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2];} hd.appendChild(s);}} while((match=reStyle.exec(html))){if(match[2]&&match[2].length>0){Ext.net.ResourceMgr.registerCssClass("",match[2],false);}} while((match=re.exec(html))){attrs=match[1];srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){s=DOC.createElement("script");s.src=srcMatch[2];typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2];} hd.appendChild(s);}else if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2]);}else{window.eval.call(window,match[2]);}}} el=DOC.getElementById(id);if(el){Ext.removeNode(el);}});var createdEl=Ext.DomHelper.append(elTo,html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig,"").replace(/(?:)((\n|\r|.)*?)(?:<\/style>)/ig,"").replace(/(?:]*)?\/>)/ig,""),true);if(createdEl.id===id){createdEl=createdEl.prev();} return createdEl;};if(typeof RegExp.escape!=="function"){RegExp.escape=function(s){if("string"!==typeof s){return s;} return s.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1");};} Ext.util.Format.usMoneyTemp=Ext.util.Format.usMoney;Ext.util.Format.usMoney=function(v){return Ext.util.Format.usMoneyTemp(String(v).replace(/[^0-9.\-]/g,""));};Ext.util.Format.euroMoney=function(v){v=String(v).replace(/[^0-9.\-]/g,"");v=(Math.round((v-0)*100))/100;v=(v===Math.floor(v))?v+".00":((v*10===Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split("."),whole=ps[0],sub=ps[1]?","+ps[1]:",00",r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1"+"."+"$2");} return whole+sub+" €";}; Ext.net.Mask=function(){var instance,bmask,init=function(){bmask=Ext.getBody().createChild({cls:"x-page-mask",style:"top:0;left:0;z-index:20000;position:absolute;background-color:transparent,width:100%,height:100%,zoom:1;"}).enableDisplayMode("block").hide();Ext.EventManager.onWindowResize(function(){bmask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));});};return{show:function(cfg){this.hide();cfg=Ext.apply({msg:Ext.LoadMask.prototype.msg,msgCls:"x-mask-loading",el:Ext.getBody()},cfg||{});if(cfg.el===Ext.getBody()){if(Ext.isEmpty(bmask)){init();} bmask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true)).show();cfg.el=bmask;}else{cfg.el=Ext.net.getEl(cfg.el);} cfg.el.mask(cfg.msg,cfg.msgCls);instance=cfg.el;},hide:function(){if(instance){instance.unmask();} if(bmask){bmask.hide();} if(Ext.getBody().isMasked()===true){Ext.getBody().unmask();}}};}(); Ext.apply(Ext.form.VTypes,{daterange:function(val,field){var date=field.parseDate(val);if(date){if(field.startDateField&&(!field.dateRangeMax||(date.getTime()!==field.dateRangeMax.getTime()))){var start=Ext.getCmp(field.startDateField);if(start){start.setMaxValue(date);field.dateRangeMax=date;start.validate();}}else if(field.endDateField&&(!field.dateRangeMin||(date.getTime()!==field.dateRangeMin.getTime()))){var end=Ext.getCmp(field.endDateField);if(end){end.setMinValue(date);field.dateRangeMin=date;end.validate();}}} return true;},password:function(val,field){if(field.initialPassField){var pwd=Ext.getCmp(field.initialPassField);return pwd?(val===pwd.getValue()):false;} return true;},passwordText:"Passwords do not match",ipRegExp:/^([1-9][0-9]{0,1}|1[013-9][0-9]|12[0-689]|2[01][0-9]|22[0-3])([.]([1-9]{0,1}[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){2}[.]([1-9][0-9]{0,1}|1[0-9]{2}|2[0-4][0-9]|25[0-4])$/,ip:function(val,field){return Ext.form.VTypes.ipRegExp.test(val);},ipText:"Invalid IP Address format"}); Ext.Component.prototype.destroy=Ext.Component.prototype.destroy.createInterceptor(function(){this.destroyBin();this.cleanId();});Ext.Component.prototype.initComponent=Ext.Component.prototype.initComponent.createSequence(function(){if(!Ext.isEmpty(this.contextMenuId,false)){this.on("render",function(){this.el.on("contextmenu",function(e,t){var menu=Ext.menu.MenuMgr.get(this.contextMenuId);menu.trg=t;e.stopEvent();e.preventDefault();menu.showAt(e.getPoint());},this);},this,{single:true});} this.initFieldLabel();if(!Ext.isEmpty(this.defaultAnchor,true)){if(Ext.isEmpty(this.defaults)){this.defaults={};} Ext.apply(this.defaults,{anchor:this.defaultAnchor});} if(this.selectable===false){this.on("afterrender",function(){this.setSelectable(false);});} if(this.autoFocus){if(this.ownerCt){this.ownerCt.on("afterlayout",function(){this.focus(this.selectOnFocus||false,this.autoFocusDelay);},this);}else{this.on("afterrender",function(){this.focus(this.selectOnFocus||false,this.autoFocusDelay);});}} if(this.postback){this.on(this.postback.eventName,this.postback.fn,this,{delay:30});}});Ext.override(Ext.Component,{selectable:true,autoFocusDelay:10,destroyBin:function(){if(this.bin){Ext.destroy(this.bin);} delete this.bin;},setSelectable:function(selectable){if(selectable===false){this.setDisabled(true).el.removeClass("x-item-disabled").applyStyles("color:black;");}else if(selectable===true){this.setDisabled(false);} this.selectable=false;return this;},initFieldLabel:function(){if(this.fieldLabel){this.plugins=this.plugins||[];if(!Ext.isArray(this.plugins)){this.plugins=[this.plugins];} this.plugins.push(Ext.ux.FieldLabeler);}},addPlugins:function(plugins){if(Ext.isEmpty(this.plugins)){this.plugins=[];}else if(!Ext.isArray(this.plugins)){this.plugins=[this.plugins];} if(Ext.isArray(plugins)){var i=0;for(i;i=0){frame=true;}else if(cfg.mode){if(cfg.mode==="iframe"){frame=true;}}else if(cfg.url&&cfg.url.indexOf("://")>=0){frame=true;}else if((this.getAutoLoad().url&&this.autoLoad.url.indexOf("://")>=0)||(this.getAutoLoad().mode&&this.autoLoad.mode==="iframe")){frame=true;} return frame;},load:function(config){if(!Ext.isEmpty(config)&&!Ext.isEmptyObj(config)){if(config.passParentSize){config.params=config.params||{};config.params.width=this.body.getWidth(true);config.params.height=this.body.getHeight(true);} var al=this.getAutoLoad(),url;if(typeof config==="string"){al.url=config;}else if(typeof config==="object"){Ext.apply(al,config);} if(Ext.isEmpty(al.url)){return;} if(this.isIFrame(config)){return this.loadIFrame(al);} url=al.url;if(al.params){var params={},key;for(key in al.params){var ov=al.params[key];if(typeof ov==="function"){params[key]=ov.call(this);}else{params[key]=ov;}} params=Ext.urlEncode(params);url=url+((url.indexOf("?")>-1)?"&":"?")+params;} var um=this.body.getUpdater();loadCfg=Ext.applyIf({url:url},al);if(loadCfg.params){delete loadCfg.params;} um.update.call(um,loadCfg);} return this;},doAutoLoad:function(){},reload:function(nocache){this.getAutoLoad().nocache=nocache||this.autoLoad.nocache;this.load(this.getAutoLoad());},getAutoLoad:function(){this.autoLoad=this.autoLoad||{};return this.autoLoad;},loadContent:function(config){this.load(config);},clearContent:function(){if(this.iframe){this.iframe.un("load",this.afterLoad,this);if(Ext.isIE){this.iframe.dom.src=String.format("java{0}","script:false");} this.removeAll(true);delete this.iframe;if(this.body.isMasked()){this.body.unmask();}}else if(this.rendered){this.body.dom.innerHTML="";}},loadIFrame:function(config){var url=config.url;if(config.nocache===true){url=url+((url.indexOf("?")>-1)?"&":"?")+new Date().getTime();} if(config.params){var params={},key;for(key in config.params){var ov=config.params[key];if(typeof ov==="function"){params[key]=ov.call(this);}else{params[key]=ov;}} params=Ext.urlEncode(params);url=url+((url.indexOf("?")>-1)?"&":"?")+params;} if(Ext.isEmpty(this.iframe)){var iframeObj={tag:"iframe",id:this.id+"_IFrame",name:this.id+"_IFrame",cls:config.cls||"",src:url,frameborder:0},layout=this.getLayout();if(layout&&layout.resizeTask&&layout.resizeTask.cancel){layout.resizeTask.cancel();} if(!this.layout||this.layout.type!=="fit"){layout=new Ext.Container.LAYOUTS.fit({});this.setLayout(layout);} this.removeAll(true);var p=this,iframeCt=new Ext.Container({autoEl:iframeObj,listeners:{render:function(){p.iframe=this.el;if(config.monitorComplete){p.startIframeMonitoring();}else{this.el.on("load",p.afterLoad,p);} p.fireEvent("beforeupdate",p,{url:url,iframe:this.el});p.beforeIFrameLoad(config);}}});this.add(iframeCt);this.doLayout();}else{this.iframe.dom.src=String.format("java{0}","script:false");this.fireEvent("beforeupdate",this,{url:this.iframe.dom.src,iframe:this.iframe});this.iframe.dom.src=url;this.beforeIFrameLoad(config);} if(Ext.isIE6&&!this.destroyIframeOnUnload){this.destroyIframeOnUnload=true;if(window.addEventListener){window.addEventListener("unload",this.destroy.createDelegate(this),false);}else if(window.attachEvent){window.attachEvent("onunload",this.destroy.createDelegate(this));}} return this;},iframeCompleteCheck:function(){if(this.iframe.dom.readyState==="complete"){this.stopIframeMonitoring();this.afterLoad();}},startIframeMonitoring:function(){if(this.iframeTask){this.iframeTask.stopAll();this.iframeTask=null;} this.iframeTask=new Ext.util.TaskRunner();this.iframeTask.start({run:this.iframeCompleteCheck,interval:200,scope:this});},stopIframeMonitoring:function(){if(this.iframeTask){this.iframeTask.stopAll();this.iframeTask=null;}},beforeIFrameLoad:function(al){try{this.iframe.dom.contentWindow.parentAutoLoadControl=this;}catch(e){} if(al.showMask){this.body.mask(al.maskMsg||Ext.LoadMask.prototype.msg,al.maskCls||"x-mask-loading");} this.autoLoad=al;},afterLoad:function(){if(this.autoLoad.showMask){this.body.unmask();} try{this.iframe.dom.contentWindow.parentAutoLoadControl=this;}catch(e){} var loadCfg=this.getAutoLoad();if(loadCfg.callback){loadCfg.callback.call(loadCfg.scope||this,this,true,{iframe:this.iframe,url:this.iframe.dom.src},loadCfg);delete loadCfg.callback;} this.fireEvent("update",this,{iframe:this.iframe,url:this.iframe.dom.src});},autoLoadBeforeUpdate:function(el,url,params){this.fireEvent("beforeupdate",this,{url:url,params:params});if(this.autoLoad.showMask){this.body.mask(this.autoLoad.maskMsg||"Loading...",this.autoLoad.maskCls||"x-mask-loading");}},autoLoadUpdate:function(el,response){if(this.autoLoad.showMask){this.body.unmask();} this.fireEvent("update",this,{response:response});},autoLoadFailure:function(el,response){if(this.autoLoad.showMask){this.body.unmask();} this.fireEvent("failure",this,{response:response});},show:function(){Ext.Panel.superclass.show.call(this);if(Ext.isIE&&this.hideMode==="offsets"&&this.el){this.el.repaint();} return this;}});Ext.Panel.prototype.beforeDestroy=Ext.Panel.prototype.beforeDestroy.createInterceptor(function(){if(this.iframe){try{this.clearContent();}catch(e){}} if(this.collapsedField){this.collapsedField.destroy();}});Ext.Panel.prototype.initComponent=Ext.Panel.prototype.initComponent.createSequence(function(){this.addEvents("beforeupdate","update","failure");if(this.autoLoad){if(this.isIFrame(this.autoLoad)){this.layout="fit";} this.on("render",function(){var udr=this.getUpdater();udr.showLoadIndicator=false;udr.on("beforeupdate",this.autoLoadBeforeUpdate,this);udr.on("update",this.autoLoadUpdate,this);udr.on("failure",this.autoLoadFailure,this);},this);var loadConfig={delay:10,single:true},triggerCmp,triggerControl=this.autoLoad.triggerControl||this,triggerEvent=this.autoLoad.triggerEvent||"render";if(Ext.isFunction(triggerControl)){triggerControl=triggerControl.call(window);}else if(Ext.isString(triggerControl)){triggerCmp=Ext.getCmp(triggerControl);if(triggerCmp){triggerControl=triggerCmp;}else{triggerControl=Ext.net.getEl(triggerControl);}} loadConfig.single=!(this.autoLoad.reloadOnEvent||false);if(Ext.isEmpty(this.autoLoad.manuallyTriggered)||this.autoLoad.manuallyTriggered!==true){triggerControl.on(triggerEvent,function(){this.load(this.getAutoLoad());},this,loadConfig);}} var refreshBars=function(){var bar=this.getBottomToolbar();if(bar&&bar.el){bar.el.repaint();} bar=this.getTopToolbar();if(bar&&bar.el){bar.el.repaint();} if(this.header&&this.header.repaint){this.header.repaint();} if(this.footer&&this.footer.repaint){this.footer.repaint();}else if(this.ft){this.ft.repaint();}};if(Ext.isIE6||Ext.isIE7){this.on("show",refreshBars,this,{buffer:100});this.on("resize",refreshBars,this,{buffer:100});}});Ext.Panel.prototype.onCollapse=Ext.Panel.prototype.onCollapse.createSequence(function(doAnim,animArg){var f=this.getCollapsedField();if(!Ext.isEmpty(f)){f.dom.value="true";}});Ext.Panel.prototype.onExpand=Ext.Panel.prototype.onExpand.createSequence(function(doAnim,animArg){var f=this.getCollapsedField();if(!Ext.isEmpty(f)){f.dom.value="false";}});Ext.Panel.prototype.initComponent=Ext.Panel.prototype.initComponent.createInterceptor(function(){if(this.tbar&&(this.tbar.xtype==="paging"||this.tbar.xtype==="ux.paging")&&!Ext.isDefined(this.tbar.store)&&this.store){this.tbar.store=this.store;} if(this.bbar&&(this.bbar.xtype==="paging"||this.bbar.xtype==="ux.paging")&&!Ext.isDefined(this.bbar.store)&&this.store){this.bbar.store=this.store;}}); Ext.override(Ext.layout.FitLayout,{onLayout:function(ct,target){Ext.layout.FitLayout.superclass.onLayout.call(this,ct,target);if(!ct.collapsed){var sz;if(Ext.isIE6&&Ext.isStrict&&target.dom==(Ext.net.ResourceMgr.getAspForm()||{}).dom){sz=Ext.getBody().getViewSize();}else{sz=((Ext.isIE6&&Ext.isStrict&&target.dom==document.body)||target.dom==(Ext.net.ResourceMgr.getAspForm()||{}).dom)?target.getViewSize():target.getStyleSize();} this.setItemSize(this.activeItem||ct.items.itemAt(0),sz);}}}); Ext.layout.BorderLayout.SplitRegion.prototype.render=Ext.layout.BorderLayout.SplitRegion.prototype.render.createInterceptor(function(ct,p){var pos=this.position,dir="westeast".indexOf(pos)>-1?"Width":"Height";this.splitSettings[pos].maxProp=(Ext.isDefined(p["boxMax"+dir])?"boxMax":"max")+dir;this.splitSettings[pos].minProp=(Ext.isDefined(p["boxMin"+dir])?"boxMin":"min")+dir;});Ext.layout.BorderLayout.SplitRegion.prototype.getCollapsedEl=Ext.layout.BorderLayout.SplitRegion.prototype.getCollapsedEl.createSequence(function(){if(this.useSplitTips){this.collapsedEl.dom.title=this.collapsible?this.expandableSplitTip:this.splitTip;}});Ext.layout.BorderLayout.Region.prototype.destroy=Ext.layout.BorderLayout.Region.prototype.destroy.createInterceptor(function(){this.clearMonitor();});Ext.layout.BorderLayout.SplitRegion.override({expandableSplitTip:"Double click to show."}); Ext.layout.BoxLayout.override({getVisibleItems:function(ct){ct=ct||this.container;var t=ct.getLayoutTarget(),cti=ct.items.items,len=cti.length,i,c,items=[];for(i=0;i0){item.addClass("ux-layout-center-item");if(item.width){size.width=item.width;} item.setSize(size);}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout; Ext.net.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,extraCls:"x-column",scrollOffset:0,margin:0,split:false,fitHeight:true,background:false,isValidParent:function(c,target){return this.innerCt&&(c.getPositionEl?c.getPositionEl():c.getEl()).dom.parentNode==this.innerCt.dom;},renderAll:function(ct,target){if(this.split&&!this.splitBars){this.splitBars=[];this.margin=this.margin||5;} Ext.net.ColumnLayout.superclass.renderAll.apply(this,arguments);},getLayoutTargetSize:function(){var target=this.container.getLayoutTarget(),ret;if(target){ret=target.getViewSize();if(Ext.isIE&&Ext.isStrict&&ret.width===0){ret=target.getStyleSize();} ret.width-=(target.getPadding("lr")+this.scrollOffset);ret.height-=target.getPadding("tb");} return ret;},onLayout:function(ct,target){var cs=ct.items.items,len=cs.length,c,cel,i;if(!this.innerCt){target.addClass("x-column-layout-ct");if(this.background){target.addClass("x-column-layout-bg-ct");} this.innerCt=target.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"});} this.renderAll(ct,this.innerCt);var size=this.getLayoutTargetSize();if(size.width<1&&size.height<1){return;} var w=size.width,h=size.height;this.availableWidth=w;var pw=this.availableWidth,lastProportionedColumn;if(this.split){this.maxWidth=pw-((this.minWidth+5)*(len?(len-1):1));} if(this.fitHeight){this.innerCt.setSize(w,h);}else{this.innerCt.setWidth(w);} for(i=0;ithis.maxWidth){expansion-=(newWidth-this.maxWidth);c.setWidth(this.maxWidth);}else{c.setWidth(c.el.getWidth()-expansion);break;}} this.setMaxWidths();}},setMaxWidths:function(){var items=this.container.items.items,spare=items[items.length-1].el.dom.offsetWidth-100,i=items.length-2;for(i;i>-1;i--){var sb=this.splitBars[i],sbel=sb.el,c=items[i],cel=c.el,itemWidth=cel.dom.offsetWidth;sbel.setStyle("left",(cel.getX()-Ext.fly(cel.dom.parentNode).getX()+itemWidth)+"px");sb.maxSize=itemWidth+spare;sb.setCurrentSize(itemWidth);spare=itemWidth-100;}},onResize:function(){if(this.split){var items=this.container.items.items,tw=0,c,i;if(items[0].rendered){for(i=0;i0){this.setMaxHeights();}},onColumnResize:function(sb,newHeight){if(sb.dragSpecs.startSize){sb.topComponent.el.setStyle("height","");sb.topComponent.setHeight(newHeight);var items=this.container.items.items,expansion=newHeight-sb.dragSpecs.startSize,i=sb.index+1,len;for(i,len=items.length;expansion&&ithis.maxHeight){expansion-=(newHeight-this.maxHeight);c.setHeight(this.maxHeight);}else{c.setHeight(c.el.getHeight()-expansion);break;} delete c.rowHeight;} this.setMaxHeights();}},setMaxHeights:function(){var items=this.container.items.items,spare=items[items.length-1].el.dom.offsetHeight-100,i;for(i=items.length-2;i>-1;i--){var sb=this.splitBars[i];if(sb){var sbel=sb.el,c=items[i],cel=c.el,itemHeight=cel.dom.offsetHeight;sbel.setStyle("top",(cel.getY()-Ext.fly(cel.dom.parentNode).getY()+itemHeight)+"px");sb.maxSize=itemHeight+spare;spare=itemHeight-100;}}},onResize:function(){Ext.ux.RowLayout.superclass.onResize.apply(this,arguments);}});Ext.Container.LAYOUTS["ux.row"]=Ext.ux.RowLayout; Ext.layout.AccordionLayout.prototype.renderItem=Ext.layout.AccordionLayout.prototype.renderItem.createSequence(function(c){if(this.originalHeader){c.header.removeClass('x-accordion-hd');}}); Ext.apply(Ext.lib.Ajax,{serializeForm:function(form,parentEl){var fElements=form.elements||(document.forms[form]||Ext.getDom(form)).elements,hasSubmit=false,encoder=encodeURIComponent,element,name,data=[],type,submitDisabled=Ext.net&&Ext.net.ResourceMgr&&Ext.net.ResourceMgr.submitDisabled,i=0;hasSubmit=form.ignoreAllSubmitFields||false;for(i;i0){input=els.elements[0];}else{input=document.createElement("input");input.setAttribute("name",name);input.setAttribute("type","hidden");} input.setAttribute("value",value);pe=input.parentElement?input.parentElement:input.parentNode;if(Ext.isEmpty(pe)){form.appendChild(input);}},delayedF:function(el,remove){if(!Ext.isEmpty(el)){el.unmask();if(remove===true){el.remove();}}},showFailure:function(response,errorMsg){var bodySize=Ext.getBody().getViewSize(),width=(bodySize.width<500)?bodySize.width-50:500,height=(bodySize.height<300)?bodySize.height-50:300,win;if(Ext.isEmpty(errorMsg)){errorMsg=response.responseText;} win=new Ext.Window({modal:true,width:width,height:height,title:"Request Failure",layout:"fit",maximizable:true,listeners:{"maximize":{fn:function(el){var v=Ext.getBody().getViewSize();el.setSize(v.width,v.height);},scope:this},"resize":{fn:function(wnd){var editor=wnd.getComponent(0).getComponent("__ErrorMessageEditor");var sz=wnd.body.getViewSize();editor.setSize(sz.width,sz.height-42);}}},items:new Ext.Container({layout:"absolute",defaultType:"label",items:[{x:5,y:5,html:'
'},{x:42,y:6,html:"Status Code: "},{x:125,y:6,text:response.status},{x:42,y:25,html:"Status Text: "},{x:125,y:25,text:response.statusText},{x:0,y:42,itemId:"__ErrorMessageEditor",xtype:"htmleditor",value:errorMsg,readOnly:true,submitValue:false,enableAlignments:false,enableColors:false,enableFont:false,enableFontSize:false,enableFormat:false,enableLinks:false,enableLists:false,enableSourceEdit:false}]})});win.show();},parseResponse:function(response,options){var text=response.responseText,result={},exception=false;result.success=true;try{if(/^<\?xml/.test(text)){var xmlData=response.responseXML,root=xmlData.documentElement||xmlData,q=Ext.DomQuery;if(root&&root.nodeName==="DirectResponse"){var sv=q.selectValue("Success",root,true),pSuccess=sv!==false&&sv!=="false",pErrorMessage=q.selectValue("ErrorMessage",root,""),pScript=q.selectValue("Script",root,""),pViewState=q.selectValue("ViewState",root,""),pViewStateEncrypted=q.selectValue("ViewStateEncrypted",root,""),pEventValidation=q.selectValue("EventValidation",root,""),pServiceResponse=q.selectValue("ServiceResponse",root,""),pUserParamsResponse=q.selectValue("ExtraParamsResponse",root,""),pResult=q.selectValue("Result",root,"");if(!Ext.isEmpty(pSuccess)){Ext.apply(result,{success:pSuccess});} if(!Ext.isEmpty(pErrorMessage)){Ext.apply(result,{errorMessage:pErrorMessage});} if(!Ext.isEmpty(pScript)){Ext.apply(result,{script:pScript});} if(!Ext.isEmpty(pViewState)){Ext.apply(result,{viewState:pViewState});} if(!Ext.isEmpty(pViewStateEncrypted)){Ext.apply(result,{viewStateEncrypted:pViewStateEncrypted});} if(!Ext.isEmpty(pEventValidation)){Ext.apply(result,{eventValidation:pEventValidation});} if(!Ext.isEmpty(pServiceResponse)){Ext.apply(result,{serviceResponse:eval("("+pServiceResponse+")")});} if(!Ext.isEmpty(pUserParamsResponse)){Ext.apply(result,{extraParamsResponse:eval("("+pUserParamsResponse+")")});} if(!Ext.isEmpty(pResult)){Ext.apply(result,{result:eval("("+pResult+")")});} return{result:result,exception:false};}else{return{result:response.responseXML,exception:false};}} result=eval("("+text+")");}catch(e){result.success=false;exception=true;if(response.responseText.length===0){result.errorMessage="NORESPONSE";}else{result.errorMessage="BADRESPONSE: "+e.message;result.responseText=response.responseText;} response.statusText=result.errorMessage;} if(result&&result.d){result=result.d;if(Ext.isString(result)&&options.isDirectMethod!==true){result=Ext.decode(result);}} return{result:result,exception:exception};},cacheBusterCheck:function(o){var method=o.method||this.method||((o.params||o.xmlData||o.jsonData||o.form)?"POST":"GET"),url=o.url||this.url,form=Ext.getDom(o.form);if(form){url=url||form.action;} if(method==="POST"&&(this.disableCaching&&o.disableCaching!==false)){if(Ext.isFunction(url)){url=url.call(o.scope||"window",o);} var dcp=o.disableCachingParam||this.disableCachingParam;o.url=Ext.urlAppend(url,dcp+'='+(new Date().getTime()));}},listeners:{beforerequest:{fn:function(conn,options){var o=options||{};o.eventType=o.eventType||"event";var isInstance=(o.eventType==="public"),submitConfig={},forms,aspForm;o.extraParams=o.extraParams||{};switch(o.eventType){case"event":case"custom":case"proxy":case"postback":case"public":if(isInstance){o.action=o.name;} o.control=o.control||{};o.type=o.type||"submit";o.viewStateMode=o.viewStateMode||"default";o.action=o.action||"Click";o.headers=Ext.apply(o.headers||{},{"X-Ext.Net":"delta=true"});if(o.type==="submit"){o.form=Ext.get(o.formProxyArg);if(!Ext.isEmpty(o.form)&&!Ext.isEmpty(o.form.id)){var cmp=Ext.getCmp(o.form.id);if(!Ext.isEmpty(cmp)&&cmp.getForm&&cmp.startMonitoring){if(cmp.form&&cmp.form.el.dom.elements){o.form=cmp.form.el;}else{o.form=undefined;}}} if(Ext.isEmpty(o.form)&&!Ext.isEmpty(o.control.el)){if(Ext.isEmpty(o.control.isComposite)||o.control.isComposite===false){o.form=o.control.el.up("form");if(Ext.isEmpty(o.form)&&o.control.findParentByType){var formPanel=o.control.findParentByType("form");if(formPanel&&formPanel.renderFormElement!==false){o.form=formPanel.getForm().el;}}}else{o.form=Ext.get(o.control.elements[0]).up("form");}} if(Ext.isEmpty(o.form)&&Ext.isEmpty(o.url)&&!Ext.isEmpty(Ext.net.ResourceMgr.aspForm)){o.form=Ext.get(Ext.net.ResourceMgr.aspForm);}}else if(o.type==="load"&&Ext.isEmpty(o.method)){o.method="GET";} if(Ext.isEmpty(o.form)&&Ext.isEmpty(o.url)){if(!Ext.isEmpty(Ext.net.ResourceMgr.aspForm)){aspForm=Ext.getDom(Ext.net.ResourceMgr.aspForm);} if(aspForm){if(o.type==="submit"){o.form=aspForm;}else{o.url=aspForm.action;}}} var argument=String.format("{0}|{1}|{2}",o.proxyId||o.control.storeId||o.control.proxyId||o.control.id||"-",o.eventType,o.action);if(!Ext.isEmpty(o.form)){this.setValue(o.form.dom,"__EVENTTARGET",Ext.net.ResourceMgr.id);this.setValue(o.form.dom,"__EVENTARGUMENT",argument);Ext.getDom(o.form).ignoreAllSubmitFields=true;}else{o.url=o.url||Ext.net.ResourceMgr.url||window.location.href;Ext.apply(submitConfig,{__EVENTTARGET:Ext.net.ResourceMgr.id,__EVENTARGUMENT:argument});} if(o.viewStateMode!=="default"){Ext.apply(submitConfig,{viewStateMode:o.viewStateMode});} if(o.rethrowException){submitConfig.rethrowException=true;} if(o.before){if(o.before.call(o.control||window,o.control,o.eventType,o.action,o.extraParams,o)===false){return false;}} if(this.fireEvent("beforeajaxrequest",o.control,o.eventType,o.action,o.extraParams,o)===false){return false;} if(!Ext.isEmpty(o.extraParams)&&!Ext.isEmptyObj(o.extraParams)){Ext.apply(submitConfig,{extraParams:o.extraParams});} if(!Ext.isEmpty(o.serviceParams)){Ext.apply(submitConfig,{serviceParams:o.serviceParams});} if(!Ext.isEmpty(submitConfig)&&!Ext.isEmptyObj(submitConfig)){o.params={submitDirectEventConfig:Ext.encode({config:submitConfig})};}else{o.params={};} if(!Ext.isEmpty(o.form)){var enctype=Ext.getDom(o.form).getAttribute("enctype");if((enctype&&enctype.toLowerCase()==="multipart/form-data")||o.isUpload){Ext.apply(o.params,{"__ExtNetDirectEventMarker":"delta=true"});}} if(o.cleanRequest){o.params=Ext.apply({},o.extraParams||{});if(o.json){o.jsonData=o.params;if((o.method||this.method)!=="GET"){o.params="";}}else{var ov,key;for(key in o.params){ov=o.params[key];if(typeof ov==="object"){o.params[key]=Ext.encode(ov);}}}} if(!Ext.isEmpty(o.form)){o.form.dom.action=o.form.dom.action||o.form.action||o.url||Ext.net.ResourceMgr.url||window.location.href;} break;case"static":o.headers={"X-Ext.Net":"delta=true,staticmethod=true"};if(Ext.isEmpty(o.form)&&Ext.isEmpty(o.url)){forms=Ext.select("form").elements;o.url=(forms.length===1&&!Ext.isEmpty(forms[0].action))?forms[0].action:Ext.net.ResourceMgr.url||window.location.href;} if(o.before){if(o.before(o.control,o.eventType,o.action,o.extraParams)===false){return false;}} if(this.fireEvent("beforeajaxrequest",o.control,o.eventType,o.action,o.extraParams,o)===false){return false;} o.params=Ext.apply(o.extraParams,{"_methodName_":o.name});if(o.rethrowException){o.params._rethrowException_=true;} break;} o.scope=this;var el,em=o.eventMask||{};if((em.showMask===true)){if(!Ext.isEmpty(em.customTarget,false)&&Ext.isEmpty(em.target,false)){em.target="customtarget";} switch(em.target||"page"){case"this":if(o.control.getEl){el=o.control.getEl();}else if(o.control.dom){el=o.control;} break;case"parent":if(o.control.getEl){el=o.control.getEl().parent();}else if(o.control.parent){el=o.control.parent();} break;case"page":var theHeight="100%";if(window.innerHeight){theHeight=window.innerHeight+"px";}else if(document.documentElement&&document.documentElement.clientHeight){theHeight=document.documentElement.clientHeight+"px";}else if(document.body){theHeight=document.body.clientHeight+"px";} el=Ext.getBody().createChild({cls:"x-page-mask",style:"position:absolute;left:0;top:0;width:100%;height:"+theHeight+";z-index:20000;background-color:Transparent;"});var scroll=Ext.getBody().getScroll();el.setLeftTop(scroll.left,scroll.top);break;case"customtarget":var trg=em.customTarget||"";el=Ext.net.getEl(trg);if(Ext.isEmpty(el)){el=trg.getEl?trg.getEl():null;} break;} if(!Ext.isEmpty(el)){el.mask(em.msg||Ext.LoadMask.prototype.msg,em.msgCls||Ext.LoadMask.prototype.msgCls);o.maskEl=el;}} var removeMask=function(o){if(o.maskEl!==undefined&&o.maskEl!==null){var delay=0,em=o.eventMask||{},task;if(em&&em.minDelay){delay=em.minDelay;} var remove=(em.target||"page")==="page";task=new Ext.util.DelayedTask(function(o,remove){o.scope.delayedF(o.maskEl,remove);},o.scope,[o,remove]).delay(delay);}};var executeScript=function(o,result,response){var delay=0,em=o.eventMask||{};if(em.minDelay){delay=em.minDelay;} var task=new Ext.util.DelayedTask(function(o,result,response){if(result.script&&result.script.length>0){(function(o,result,response){eval(result.script);}).call(window,o,result,response);} this.fireEvent("ajaxrequestcomplete",response,result,o.control,o.eventType,o.action,o.extraParams,o);if(o.userSuccess){o.userSuccess.call(o.control||window,response,result,o.control,o.eventType,o.action,o.extraParams,o);} if(o.userComplete){o.userComplete.call(o.control||window,true,response,result,o.control,o.eventType,o.action,o.extraParams,o);}},o.scope,[o,result,response]).delay(delay);};o.failure=function(response,options){var o=options;removeMask(o);if(this.fireEvent("ajaxrequestexception",response,{"errorMessage":response.statusText},o.control,o.eventType,o.action,o.extraParams,o)===false){o.cancelFailureWarning=true;} if(o.userFailure){o.userFailure.call(o.control||window,response,{"errorMessage":response.responseText},o.control,o.eventType,o.action,o.extraParams,o);}else if(o.showWarningOnFailure!==false&&!o.cancelFailureWarning){o.scope.showFailure(response,"");} if(o.userComplete){o.userComplete.call(o.control||window,false,response,{"errorMessage":response.statusText},o.control,o.eventType,o.action,o.extraParams,o);}};o.success=function(response,options){var o=options;removeMask(o);var parsedResponse=o.scope.parseResponse(response,options);if(!Ext.isEmpty(parsedResponse.result.documentElement)){executeScript(o,parsedResponse.result,response);return;} var result=parsedResponse.result,exception=parsedResponse.exception;if(result.success===false){if(this.fireEvent("ajaxrequestexception",response,result,o.control,o.eventType,o.action,o.extraParams,o)===false){o.cancelFailureWarning=true;} if(o.userFailure){o.userFailure.call(o.control||window,response,result,o.control,o.eventType,o.action,o.extraParams,o);}else{if(o.showWarningOnFailure!==false&&!o.cancelFailureWarning){var errorMsg="";if(!exception&&result.errorMessage&&result.errorMessage.length>0){errorMsg=result.errorMessage;} o.scope.showFailure(response,errorMsg);}} if(o.userComplete){o.userComplete.call(o.control||window,false,response,result,o.control,o.eventType,o.action,o.extraParams,o);} return;} if(!Ext.isEmpty(result.viewState)&&o.form!==null){o.scope.setValue(o.form.dom,"__VIEWSTATE",result.viewState);delete result.viewState;if(!Ext.isEmpty(result.viewStateEncrypted)&&o.form!==null){o.scope.setValue(o.form.dom,"__VIEWSTATEENCRYPTED",result.viewStateEncrypted);delete result.viewStateEncrypted;} if(!Ext.isEmpty(result.eventValidation)&&o.form!==null){o.scope.setValue(o.form.dom,"__EVENTVALIDATION",result.eventValidation);delete result.eventValidation;}} executeScript(o,result,response);};this.cacheBusterCheck(o);}}}});Ext.net.DirectEvent.addEvents("beforeajaxrequest","ajaxrequestcomplete","ajaxrequestexception");Ext.net.DirectEvent.request=Ext.net.DirectEvent.request.createSequence(function(o){if(!Ext.isEmpty(o.form)){this.setValue(o.form.dom,"__EVENTTARGET","");this.setValue(o.form.dom,"__EVENTARGUMENT","");} if(o.after){o.after(o.control,o.extraParams);}}); Ext.net.DirectMethod={request:function(name,options){options=options||{};if(typeof options!=="object"){throw{message:"The DirectMethod options object is an invalid type: typeof "+typeof options};} var obj;if(!Ext.isEmpty(name)&&typeof name==="object"&&Ext.isEmptyObj(options)){options=name;} if(options.params&&options.json!==true){var key;for(key in options.params){obj=options.params[key];if(obj===undefined){delete options.params[key];}else if(obj&&typeof obj==="object"){options.params[key]=Ext.encode(obj);}}} obj={name:options.cleanRequest?undefined:(options.name||name),cleanRequest:options.cleanRequest,url:options.url,control:Ext.isEmpty(options.control)?null:{id:options.control},eventType:options.specifier||"public",type:options.type||"submit",method:options.method||"POST",eventMask:options.eventMask,extraParams:options.params,directMethodSuccess:options.success,directMethodFailure:options.failure,directMethodComplete:options.complete,viewStateMode:options.viewStateMode,isDirectMethod:true,userSuccess:function(response,result,control,eventType,action,extraParams,o){result=Ext.isEmpty(result.result,true)?(result.d||result):result.result;if(!Ext.isEmpty(o.directMethodSuccess)){o.directMethodSuccess(result,response,extraParams,o);} if(!Ext.isEmpty(o.directMethodComplete)){o.directMethodComplete(true,result,response,extraParams,o);}},userFailure:function(response,result,control,eventType,action,extraParams,o){if(!Ext.isEmpty(o.directMethodFailure)){o.directMethodFailure(result.errorMessage,response,extraParams,o);}else if(o.showFailureWarning!==false){Ext.net.DirectEvent.showFailure(response,result.errorMessage);} if(!Ext.isEmpty(o.directMethodComplete)){o.directMethodComplete(false,result.errorMessage,response,extraParams,o);}}};Ext.net.DirectEvent.request(Ext.apply(options,obj));}}; Ext.override(Ext.Button,{getPressedField:function(){if(!this.pressedField){this.pressedField=new Ext.form.Hidden({id:this.id+"_Pressed",name:this.id+"_Pressed"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.pressedField);} return this.pressedField;},menuArrow:true,toggleMenuArrow:function(){if(this.menuArrow===false){this.showMenuArrow();this.menuArrow=true;}else{this.hideMenuArrow();this.menuArrow=false;}},showMenuArrow:function(){var el=this.el.child("td.x-btn-mc em");if(!Ext.isEmpty(el)){el.addClass("x-btn-arrow"+(this.arrowAlign==="bottom"?"-bottom":""));}},hideMenuArrow:function(){var bottom=this.arrowAlign==="bottom"?"-bottom":"",el=this.el.child("td.x-btn-mc em.x-btn-arrow"+bottom);if(!Ext.isEmpty(el)){el.removeClass("x-btn-arrow"+bottom);}},setTarget:function(target){this.target=target;},setNavigateUrl:function(){if(this.navigateUrl){this.on("click",function(){if(this.target){window.open(this.navigateUrl,this.target);}else{window.location=this.navigateUrl;}},this);}}});Ext.Button.prototype.onRender=Ext.Button.prototype.onRender.createSequence(function(el){if(this.enableToggle||!Ext.isEmpty(this.toggleGroup)){this.getPressedField().render(this.el.parent()||this.el);this.on("toggle",function(el,pressed){el.getPressedField().setValue(pressed);},this);} if(this.el.hasClass("x-btn-over")){this.on("mouseout",function(){this.addClass("x-btn-over");},this);} if(this.flat){this.el.wrap({cls:"x-toolbar x-inline-toolbar"});} if(this.menuArrow===false){this.hideMenuArrow();} this.setNavigateUrl();}); Ext.CycleButton.prototype.setActiveItem=Ext.CycleButton.prototype.setActiveItem.createSequence(function(item,suppressEvent){if(!this.forceIcon){if(item.icon){this.setIcon(item.icon);}}});Ext.override(Ext.CycleButton,{initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler;} this.itemCount=this.menu.items.length;this.menu.cls="x-cycle-menu";var checked=0,item,i=0,len;for(i,len=this.itemCount;i(visBtn.getRegion().right-visBtn.getPadding("r"));}else{return e.getPageY()>this.btnEl.getRegion().bottom;}},showMenuArrow:function(){var el=this.el.child("em.x-btn-split"+(this.arrowAlign==="bottom"?"-bottom":""));if(!Ext.isEmpty(el)){el.removeClass("x-btn-no-arrow");}},hideMenuArrow:function(){var el=this.el.child("em.x-btn-split"+(this.arrowAlign==="bottom"?"-bottom":""));if(!Ext.isEmpty(el)){el.addClass("x-btn-no-arrow");}}}); Ext.form.Field.override({hideWithLabel:true,dataIndexAsName:true,isRemoteValidation:false,remoteValidatingMessage:"Validating...",activateRemoteValidation:function(){this.originalIsValid=this.isValid;this.originalValidate=this.validate;this.isValid=this.rv_isValid;this.validate=this.rv_validate;this.rvConfig=Ext.apply({remoteValidated:false,remoteValid:false,validationEvent:"keyup",eventOwner:"element",validationBuffer:500,showBusy:true,busyIconCls:"loading-indicator",busyTip:"Validating...",initValueValidation:"valid",responseFields:{success:"valid",message:"message",returnValue:"value"}},this.remoteValidationOptions||{});var fn=function(){this.rvTask=new Ext.util.DelayedTask(this.remoteValidate,this);(this.rvConfig.eventOwner==="element"?this.el:this).on(this.rvConfig.validationEvent,this.performRemoteValidation,this);};if(this.rendered){fn();}else{this.on("render",fn);this.on("afterrender",function(){if(this.value!==undefined){switch(this.rvConfig.initValueValidation){case"valid":this.markAsValid();break;case"invalid":break;case"validate":this.remoteValidate();break;}}});}},deactivateRemoteValidation:function(){this.isValid=this.originalIsValid;this.validate=this.originalValidate;if(this.rvTask){this.rvTask.cancel();} (this.rvConfig.eventOwner==="element"?this.el:this).un(this.rvConfig.validationEvent,this.performRemoteValidation,this);delete this.originalIsValid;delete this.originalValidate;},markAsValid:function(abortRequest){if(!this.isRemoteValidation){return;} this.rvConfig.validating=false;this.rvConfig.remoteValidated=true;this.rvConfig.remoteValid=true;if(this.validationId&&abortRequest!==false){Ext.net.DirectEvent.abort(this.validationId);}},rv_isValid:function(preventMark){if(this.disabled){return true;} if(this.rvConfig.validating){preventMark=true;} return this.originalIsValid.call(this,preventMark)&&!this.rvConfig.validating&&this.rvConfig.remoteValidated&&this.rvConfig.remoteValid;},rv_validate:function(){var clientValid=this.originalValidate.call(this),orgPrevent;if(!this.disabled&&!clientValid){return false;} if(this.rvConfig.validating){orgPrevent=this.preventMark;this.preventMark=true;this.markInvalid(this.remoteValidatingMessage);this.preventMark=orgPrevent;return false;} if(this.disabled||(clientValid&&(!this.rvConfig.remoteValidated||this.rvConfig.remoteValid))){if(this.rvConfig.lastValue===this.getValue()&&this.rvConfig.remoteValid===false){this.markInvalid(this.rv_response.message||"Invalid");} else{this.clearInvalid();} return this.rvConfig.remoteValid;} if(this.rvConfig.remoteValidated&&!this.rvConfig.remoteValid){orgPrevent=this.preventMark;this.preventMark=this.rvConfig.validating;this.markInvalid(this.rv_response.message||"Invalid");this.preventMark=orgPrevent;return false;} return false;},performRemoteValidation:function(e){if(this.rvConfig.lastValue===this.getValue()||!this.originalIsValid(true)){this.rvTask.cancel();return;} if(!e||!e.isNavKeyPress||(e&&e.isNavKeyPress&&!e.isNavKeyPress())){if(e&&e.normalizeKey){var k=e.normalizeKey(e.keyCode);if(k>=16&&k<=20){return;}} this.rvTask.delay(this.rvConfig.validationBuffer);}},remoteValidate:function(){this.rvConfig.remoteValid=false;this.rvConfig.remoteValidated=false;var dc=Ext.apply({},this.remoteValidationOptions),options={params:{}};if(this.fireEvent("beforeremotevalidation",this,options)!==false){dc.userSuccess=this.remoteValidationSuccess.createDelegate(this);dc.userFailure=this.remoteValidationFailure.createDelegate(this);dc.extraParams=Ext.apply(dc.extraParams||{},options.params);dc.control=this;dc.eventType="postback";dc.action="remotevalidation";var o={id:this.id,name:this.name,value:this.getValue()};dc.serviceParams=Ext.encode(o);if(dc.url){dc.cleanRequest=true;if(dc.json&&Ext.isEmpty(dc.method,false)){dc.method="POST";} dc.extraParams=Ext.apply(dc.extraParams,o);dc.type="load";} if(this.rvConfig.showBusy){this.setIndicatorIconCls(this.rvConfig.busyIconCls);if(this.rvConfig.busyTip){this.setIndicatorTip(this.rvConfig.busyTip);} this.alignIndicator();} this.rvConfig.remoteValidated=false;this.rvConfig.validating=true;this.rvConfig.lastValue=o.value;if(this.validationId){Ext.net.DirectEvent.abort(this.validationId);} this.validationId=Ext.net.DirectEvent.request(dc);}},remoteValidationSuccess:function(response,result,context,type,action,extraParams,o){var isException=false,responseObj;this.rvConfig.validating=false;this.validationId=null;if(this.rvConfig.showBusy){this.clearIndicator();} try{responseObj=result.serviceResponse||result.d||result;result={success:responseObj[this.rvConfig.responseFields.success],message:responseObj[this.rvConfig.responseFields.message],value:responseObj[this.rvConfig.responseFields.returnValue]};}catch(ex){result={success:false,message:ex.message};isException=true;this.rvConfig.remoteValidated=true;this.rvConfig.remoteValid=false;this.fireEvent("remotevalidationinvalid",this,response,responseObj,ex,o);if(o.cancelWarningFailure!==true&&(this.remoteValidationOptions||{}).showWarningFailure!==false&&!this.hasListener("remotevalidationinvalid")){Ext.net.DirectEvent.showFailure(response,response.responseText);} return;} if(!isException&&result.success!==true){this.fireEvent("remotevalidationinvalid",this,response,responseObj,result,o);} if(result.success===true){this.fireEvent("remotevalidationvalid",this,response,responseObj,result,o);} if(result.value!==null&&Ext.isDefined(result.value)){this.setValue(result.value);} this.rvConfig.remoteValidated=true;this.rvConfig.remoteValid=result.success;this.rv_response=result;this.validate();},remoteValidationFailure:function(response,result,context,type,action,extraParams,o){this.validationId=null;if(this.rvConfig.showBusy){this.clearIndicator();} this.fireEvent("remotevalidationfailure",this,response,{message:response.statusText},o);this.rvConfig.validating=false;this.rvConfig.remoteValidated=true;this.rvConfig.remoteValid=false;this.rv_response={success:false,message:response.responseText};if(o.cancelWarningFailure!==true&&(this.remoteValidationOptions||{}).showWarningFailure!==false&&!this.hasListener("remotevalidationfailure")){Ext.net.DirectEvent.showFailure(response,response.responseText);}},setReadOnly:function(readOnly){if(this.rendered){this.el.dom.setAttribute("readOnly",readOnly);this.el.dom.readOnly=readOnly;}else{this.readOnly=readOnly;}},getReadOnly:function(){return this.rendered?this.el.dom.readOnly:this.readOnly;},adjustWidth:function(tag,w){if(typeof w==="number"&&(Ext.isIE6||!Ext.isStrict)&&/input|textarea/i.test(tag)&&!this.inEditor){return w-3;} return w;},hideNote:function(){if(!Ext.isEmpty(this.note,false)&&this.noteEl){this.noteEl.addClass("x-hide-"+this.hideMode);} if(this.noteAlign==="top"&&this.label){this.label.removeClass("x-top-note-label");}},showNote:function(){if(!Ext.isEmpty(this.note,false)&&this.noteEl){this.noteEl.removeClass("x-hide-"+this.hideMode);} if(this.noteAlign==="top"&&this.label){this.label.addClass("x-top-note-label");}},setNote:function(t,encode){this.note=t;if(this.rendered){this.noteEl.dom.innerHTML=encode!==false?Ext.util.Format.htmlEncode(t):t;}},setNoteCls:function(cls){if(this.rendered){this.noteEl.removeClass(this.noteCls);this.noteEl.addClass(cls);} this.noteCls=cls;},clear:function(){this.setValue("");},hideFieldLabel:function(){if(this.label&&this.hideWithLabel){var parent=this.getActionEl().parent(".x-form-item");if(!Ext.isEmpty(parent)){parent.addClass("x-hide-"+this.hideMode);}}},showFieldLabel:function(){if(this.label&&this.hideWithLabel){var parent=this.getActionEl().parent(".x-form-item");if(!Ext.isEmpty(parent)){parent.removeClass("x-hide-"+this.hideMode);}}},clearIndicator:function(){this.setIndicator("");this.setIndicatorCls("");this.setIndicatorIconCls("");this.setIndicatorTip("");},setIndicator:function(t,encode){this.indicatorText=t;if(this.rendered&&this.indicatorEl){this.indicatorEl.dom.innerHTML=encode!==false?Ext.util.Format.htmlEncode(t):t;} this.initIndicator();},setIndicatorCls:function(cls){if(this.rendered&&this.indicatorEl){this.indicatorEl.removeClass(this.indicatorCls);this.indicatorEl.addClass(cls);} this.indicatorCls=cls;this.initIndicator();},setIndicatorIconCls:function(cls){if(this.rendered&&this.indicatorEl){this.indicatorEl.removeClass(this.indicatorIconCls);this.indicatorEl.addClass(cls);} this.indicatorIconCls=cls;this.initIndicator();},setIndicatorTip:function(tip){if(this.rendered&&this.indicatorEl){this.indicatorEl.dom.qtip=tip;} this.indicatorTip=tip;this.initIndicator();},showIndicator:function(){if(this.indicatorEl&&!this.indicatorElIsVisible){this.indicatorEl.removeClass("x-hide-display");this.indicatorElIsVisible=true;this.alignIndicator.defer(10,this);} if(!this.indicatorEl){this.initIndicator();}},hideIndicator:function(){if(this.indicatorEl&&this.indicatorElIsVisible){this.indicatorEl.addClass("x-hide-display");this.indicatorElIsVisible=false;}},getAlignIndicatorEl:function(){if(this.getTriggerWidth){return this.wrap;} if((!Ext.isEmpty(this.boxLabel,false)&&this.boxLabel!==" ")&&this.labelEl){return this.labelEl;} return this.getResizeEl();},getAlignIndicatorOffset:function(){var yShift=(this.noteAlign!=="top"&&this.childrenHasTopNote())?14:0,xShift=2;if(this instanceof Ext.form.Checkbox){yShift=-3;} return[xShift,yShift];},alignIndicator:function(){this.indicatorEl.alignTo(this.getAlignIndicatorEl(),"tl-tr",this.getAlignIndicatorOffset());},initIndicator:function(){if(this.indicatorEl){this.alignIndicator();return;} var f=function(){if(!Ext.isEmpty(this.indicatorText,false)||!Ext.isEmpty(this.indicatorIconCls,false)){if(!this.indicatorEl){var elp=this.getErrorCt();if(!elp){return;} this.on("hide",function(){this.hideIndicator();});this.on("invalid",function(){if(this.msgTarget==="side"&&this.errorIcon&&this.errorIcon.isVisible()){this.hideIndicator();}});this.on("show",function(){this.showIndicator();});this.on("valid",function(){if(this.msgTarget==="side"){this.showIndicator();}});this.indicatorEl=elp.createChild({cls:"x-form-indicator "+(this.indicatorCls||"")+(this.indicatorCls?" ":"")+(this.indicatorIconCls||""),html:this.indicatorText||"",style:this.indicatorIconCls?"padding-left: 18px;":""});if(this.ownerCt){this.ownerCt.on("afterlayout",this.alignIndicator,this);this.ownerCt.on("expand",this.alignIndicator,this);} this.on("resize",this.alignIndicator,this);this.on("autosize",this.alignIndicator,this);this.on("destroy",function(){Ext.destroy(this.indicatorEl);},this);} this.alignIndicator();if(this.indicatorTip){this.indicatorEl.dom.qtip=this.indicatorTip;} this.showIndicator();this.indicatorElIsVisible=true;if(this.hidden){this.hideIndicator();}}};if(this.rendered){f.call(this);}else{this.on("render",f,this);}},childrenHasTopNote:function(){if(this.items&&this.items.each){var r=false;this.items.each(function(item){if(item.noteAlign==="top"&&item.hidden!==true&&(!item.isVisible||item.isVisible())){r=true;return false;}});return r;} return false;},initNote:function(){this.on("hide",function(){if(!Ext.isEmpty(this.note,false)){this.hideNote();}});this.on("show",function(){if(!Ext.isEmpty(this.note,false)){this.showNote();}});this.on("render",function(){if(this.hidden){this.hideFieldLabel();} if(!Ext.isEmpty(this.note,false)){var noteWrap=false;if(!this.wrap){this.wrap=this.wrap||this.el.wrap();if(!this.labeler){this.positionEl=this.wrap;this.resizeEl=this.wrap;this.actionMode="wrap";noteWrap=true;}} if(this.noteAlign==="top"){this.wrap.addClass("x-top-note");} this.note=this.noteEncode?Ext.util.Format.htmlEncode(this.note):this.note;this.noteEl=this.wrap[this.noteAlign==="top"?"insertFirst":"createChild"]({cls:"x-field-note "+(this.noteCls||""),html:this.note},undefined);this.noteEl.noteWrap=noteWrap;if((this.noteAlign==="top"||this.childrenHasTopNote())&&this.label){this.label.addClass("x-top-note-label");} if(this.hidden){this.hideNote();}}else{if(this.label&&this.childrenHasTopNote()){this.label.addClass("x-top-note-label");}}});},getNoteWidthAjustment:function(){return 0;},onResize:function(w,h,rawWidth,rawHeight){Ext.form.Field.superclass.onResize.call(this,w,h,rawWidth,rawHeight);if(this.noteEl&&this.noteEl.noteWrap){if(w&&h&&w!=="auto"&&h!=="auto"){this.el.setSize(w-this.getNoteWidthAjustment(),h-this.noteEl.getHeight()-this.el.getMargins("tb"));}else{if(w&&w!=="auto"){this.el.setWidth(w-this.getNoteWidthAjustment());} if(h&&h!=="auto"){this.el.setHeight(h-this.noteEl.getHeight()-this.el.getMargins("tb"));}}}}});Ext.form.Field.prototype.initComponent=Ext.form.Field.prototype.initComponent.createSequence(function(){this.initNote();this.initIndicator();this.addEvents({"remotevalidationfailure":true,"remotevalidationinvalid":true,"remotevalidationvalid":true,"beforeremotevalidation":true});if(this.isRemoteValidation){this.activateRemoteValidation();}}); Ext.form.BasicForm.override({getValues:function(asString){var isForm=!Ext.isEmpty(this.el.dom.elements),fs=Ext.lib.Ajax.serializeForm(isForm?this.el.dom:this.el.up("form").dom,isForm?undefined:this.el);if(asString===true){return fs;} return Ext.urlDecode(fs);},getFieldValues:function(dirtyOnly,keyField){var o={},n,key,val,addField=function(f){if(dirtyOnly!==true||f.isDirty()){n=keyField?f[keyField]:f.getName();key=o[n];val=f.getValue();if(Ext.isDefined(key)){if(Ext.isArray(key)){o[n].push(val);}else{o[n]=[key,val];}}else{o[n]=val;}}};this.items.each(function(f){if(f.isComposite&&f.eachItem){f.eachItem(function(cf){addField(cf);});}else{addField(f);}});return o;},findField:function(id){var field=this.items.get(id);if(!Ext.isObject(field)){var findMatchingField=function(f){if(f.isFormField){if(f.dataIndex===id||f.id===id||f.getName()===id||f.name===id){field=f;return false;}else if((f.isComposite&&f.rendered)||(f instanceof Ext.form.CheckboxGroup&&f.items)){return f.items.each(findMatchingField);}}};this.items.each(findMatchingField);} return field||null;},updateRecord:function(record){record.beginEdit();var fs=record.fields;fs.each(function(f){var field=this.findField(f.name);if(field){var value=field.getValue();if(value&&value.getGroupValue){value=value.getGroupValue();}else if(field.eachItem){value=[];field.eachItem(function(item){value.push(item.getValue());});} record.set(f.name,value);}},this);record.endEdit();return this;}}); Ext.form.FormPanel.override({initComponent:function(){this.form=this.createForm();this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data";} if(this.renderFormElement===false){this.bodyCfg.tag="div";} Ext.FormPanel.superclass.initComponent.call(this);this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"]);},createElement:function(name,pnode){if((name==="body"||this.elements.indexOf(name)!==-1)&&this[name+"Cfg"]){if(this[name+"Cfg"].tag==="form"&&Ext.fly(pnode).up("form")){this[name+"Cfg"].tag="div";}} Ext.FormPanel.superclass.createElement.apply(this,arguments);},bindHandler:function(){var valid=true;this.form.items.each(function(f){if(f.isValid&&!f.isValid(true)){valid=false;return false;}});if(this.fbar){var fitems=this.fbar.items.items,i=0,len;for(i,len=fitems.length;i0){this.doMerge();} if(this.store.getCount()===0||this.alwaysMergeItems){this.store.on("load",this.doMerge,this,{single:!this.alwaysMergeItems});}}},doMerge:function(){var mi;for(mi=this.mergeItems.getCount()-1;mi>-1;mi--){var f=this.store.recordType.prototype.fields,dv=[],i=0;for(i;i=this.store.getCount()){return;} this.store.remove(this.store.getAt(index));},removeByValue:function(value){this.removeByField(this.valueField,value);},removeByText:function(text){this.removeByField(this.displayField,text);},getSelectionField:function(){if(!this.selectedIndexField){this.selectedIndexField=new Ext.form.Hidden({id:this.id+"_SelIndex",name:this.id+"_SelIndex"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.selectedIndexField);} return this.selectedIndexField;},getText:function(){return this.el.getValue();},getSelectedItem:function(){return{text:this.getText(),value:this.getValue()};},initSelect:false,setValueAndFireSelect:function(v){this.setValue(v);var r=this.findRecord(this.valueField,v);if(!Ext.isEmpty(r)){var index=this.store.indexOf(r);this.getSelectionField().setValue(this.getSelectedIndex());this.initSelect=true;this.fireEvent("select",this,r,index);this.initSelect=false;}},findRecordByText:function(prop,text){var record;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[prop]==text){record=r;return false;}});} return record;},origFindRecord:Ext.form.ComboBox.prototype.findRecord,findRecord:function(prop,value){if(this.store.snapshot&&this.store.snapshot.getCount()>0){var record;if(this.store.snapshot.getCount()>0){this.store.snapshot.each(function(r){if(r.data[prop]==value){record=r;return false;}});} return record;} return this.origFindRecord(prop,value);},indexOfEx:function(record){if(this.store.snapshot&&this.store.snapshot.getCount()>0){return this.store.snapshot.indexOf(record);} return this.store.data.indexOf(record);},getSelectedIndex:function(){var r=this.findRecord(this.forceSelection?this.valueField:this.displayField,this.getValue());return(!Ext.isEmpty(r))?this.indexOfEx(r):-1;},onSelect:function(record,index){if(this.fireEvent("beforeselect",this,record,index)!==false){this.setValue(record.data[this.valueField||this.displayField]);this.collapse();this.getSelectionField().setValue(this.getSelectedIndex());this.fireEvent("select",this,record,index);this.oldValue=this.getValue();var t=this.getEl().dom.value?this.getEl().dom.value.trim():"";this.oldText=(t===this.emptyText)?"":t;}},setInitValue:function(value){if(this.store.getCount()>0){this.setLoadedValue(value);}else{this.setValue(value);this.store.on("load",this.setLoadedValue.createDelegate(this,[value]),this,{single:true});}},setLoadedValue:function(value){this[this.fireSelectOnLoad?"setValueAndFireSelect":"setValue"](value);this.clearInvalid();},checkOnBlur:function(){var t=this.getEl().dom.value?this.getEl().dom.value.trim():"",v=this.getValue();if(this.oldValue!==v||(t!==this.oldText&&t!==this.emptyText)){if(!Ext.isEmpty(this.selValue)&&this.selText!==t&&this.selValue===this.getValue()){this.hiddenField.value="";} var val=this.el.dom.value,r=this.findRecordByText(this.displayField,val);if(!Ext.isEmpty(r)){this.onSelect(r,this.store.indexOf(r),false,true);}else{if(this.forceSelection){if(Ext.isEmpty(this.findRecord(this.valueField,this.oldValue))){this.clearValue();}else{this.setValue(this.oldValue);}}else{this.setValue(val);}} this.getSelectionField().setValue(this.getSelectedIndex());}},triggerBlur:function(){this.mimicing=false;Ext.getDoc().un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.el.un("keydown",this.checkTab,this);} this.checkOnBlur();Ext.form.TriggerField.superclass.onBlur.call(this);if(this.wrap){this.wrap.removeClass(this.wrapFocusClass);}},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass(this.wrapFocusClass);this.mimicing=true;Ext.getDoc().on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.el.on("keydown",this.checkTab,this);}}},selectByIndex:function(index,fireSelect){if(index>=0){this[this.fireSelect?"setValueAndFireSelect":"setValue"](this.store.getAt(index).get(this.valueField||this.displayField));}},setInitValueByIndex:function(index){if(this.store.getCount()>0){this.setLoadedIndex(index);}else{this.store.on("load",this.setLoadedIndex.createDelegate(this,[index]),this,{single:true});}},setLoadedIndex:function(index){this.selectByIndex(index,this.fireSelectOnLoad);this.clearInvalid();},onLoad:Ext.form.ComboBox.prototype.onLoad.createInterceptor(function(){if(this.mode==="single"){this.mode="local";}}),initList:Ext.form.ComboBox.prototype.initList.createSequence(function(){if(this.mode==="single"&&this.store.isLoaded){this.mode="local";}}),doForce:Ext.emptyFn}); Date.prototype.extadd=Date.prototype.add;Ext.DatePicker.prototype.initComponent=Ext.DatePicker.prototype.initComponent.createInterceptor(function(){if(!this.msadd){Date.prototype.msadd=Date.prototype.add;Date.prototype.add=function(){return this[typeof arguments[0]==="string"?"extadd":"msadd"].apply(this,arguments);};}});Ext.form.DateField.override({setDisabledDates:function(dd){this.disabledDates=dd;this.disabledDatesRE=null;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE);}},onTriggerClick:function(){if(this.disabled){return;} if(Ext.isEmpty(this.menu)){this.menu=new Ext.menu.DateMenu({hideOnClick:false,focusOnSelect:false});} this.onFocus();Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});if(this.cancelText){Ext.apply(this.menu.picker,{cancelText:this.cancelText});} if(this.dayNames){Ext.apply(this.menu.picker,{dayNames:this.dayNames});} if(this.monthNames){Ext.apply(this.menu.picker,{monthNames:this.monthNames});} if(this.monthYearText){Ext.apply(this.menu.picker,{monthYearText:this.monthYearText});} if(this.nextText){Ext.apply(this.menu.picker,{nextText:this.nextText});} if(this.okText){Ext.apply(this.menu.picker,{okText:this.okText});} if(this.prevText){Ext.apply(this.menu.picker,{prevText:this.prevText});} if(this.startDay){Ext.apply(this.menu.picker,{startDay:this.startDay});} if(this.todayText){Ext.apply(this.menu.picker,{todayText:this.todayText});} if(this.todayTip){Ext.apply(this.menu.picker,{todayTip:this.todayTip});} this.menu.on(Ext.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?");this.menuEvents("on");}}); Ext.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:"Browse...",buttonOnly:false,buttonOffset:3,readOnly:true,autoSize:Ext.emptyFn,actionMode:"wrap",initComponent:function(){Ext.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected");},isIconIgnore:function(){return true;},syncSize:function(){Ext.form.FileUploadField.superclass.syncSize.apply(this,arguments);this.fileInput.setWidth(this.button.getEl().getWidth()+(Ext.isIE?4:0));},onRender:function(ct,position){Ext.form.FileUploadField.superclass.onRender.call(this,ct,position);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap",style:"overflow:hidden;"+(Ext.isIE?"height:22px;":"")});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.createFileInput();var btnCfg=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText,disabled:this.disabled,iconCls:this.iconCls});this.button=new Ext.Button(Ext.apply(btnCfg,{renderTo:this.wrap,cls:"x-form-file-btn"+(btnCfg.iconCls?(btnCfg.text?" x-btn-text-icon":" x-btn-icon"):"")}));var fiWidth=this.button.getEl().getWidth()+(Ext.isIE?4:0);if(fiWidth>(Ext.isIE?4:0)){this.fileInput.setWidth(fiWidth);} if(this.buttonOnly){this.el.setVisibilityMode(Ext.Element.DISPLAY);this.el.hide();this.wrap.setWidth(this.button.getEl().getWidth());} this.bindListeners();this.resizeEl=this.positionEl=this.wrap;},bindListeners:function(){this.fileInput.on({scope:this,mouseenter:function(){this.button.addClass(["x-btn-over","x-btn-focus"]);},mouseleave:function(){this.button.removeClass(["x-btn-over","x-btn-focus","x-btn-click"]);},mousedown:function(){this.button.addClass("x-btn-click");},mouseup:function(){this.button.removeClass(["x-btn-over","x-btn-focus","x-btn-click"]);},change:function(){var v=this.fileInput.dom.value,fileNameRegex=/[^\\]*$/im,match=fileNameRegex.exec(v);if(match!==null){v=match[0];} this.setValue(v);this.fireEvent("fileselected",this,v);}});},createFileInput:function(){if(this.fileInput){this.fileInput.remove();} this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getFileInputId(),cls:"x-form-file",tag:"input",type:"file",size:1});if(this.buttonOnly&&this.button){var fiWidth=this.button.getEl().getWidth()+(Ext.isIE?4:0);if(fiWidth>(Ext.isIE?4:0)){this.fileInput.setWidth(fiWidth);}} if(this.disabled){this.fileInput.dom.disabled=true;}},getFileInputId:function(){return this.id+"-file";},onResize:function(w,h){Ext.form.FileUploadField.superclass.onResize.call(this,w,h);this.wrap.setWidth(w);if(!this.buttonOnly){w=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset;if(w>0){this.el.setWidth(w);}}},onDestroy:function(){Ext.form.FileUploadField.superclass.onDestroy.call(this);Ext.destroy(this.fileInput,this.button,this.wrap);},onDisable:function(){Ext.form.FileUploadField.superclass.onDisable.call(this);this.doDisable(true);},onEnable:function(){Ext.form.FileUploadField.superclass.onEnable.call(this);this.doDisable(false);},doDisable:function(disabled){this.fileInput.dom.disabled=disabled;this.button.setDisabled(disabled);},preFocus:Ext.emptyFn,alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0]);},reset:function(){this.createFileInput();this.bindListeners();Ext.form.FileUploadField.superclass.reset.call(this);}});Ext.reg("fileuploadfield",Ext.form.FileUploadField); Ext.form.Hidden.override({setValue:function(v){var temp=this.rendered?this.el.dom.value:this.value;this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?"":v);this.validate();} if(v!=temp){this.fireEvent("change");}}}); Ext.form.HtmlEditor.override({escapeValue:true,syncValue:function(){if(this.initialized){var bd=this.getEditorBody(),html=bd.innerHTML;if(Ext.isWebKit){var bs=bd.getAttribute("style"),m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){html='
'+html+"
";}} html=this.cleanHtml(html);if(this.fireEvent("beforesync",this,html)!==false){this.el.dom.value=this.escapeValue?escape(html):html;this.fireEvent("sync",this,html);}}},setValue:function(v){Ext.form.HtmlEditor.superclass.setValue.call(this,(this.escapeValue&&this.rendered)?escape(v):v);this.pushValue();return this;},getValue:function(){this[this.sourceEditMode?"pushValue":"syncValue"]();var v=Ext.form.HtmlEditor.superclass.getValue.call(this);if(!this.rendered){return v;} return this.escapeValue?unescape(v):v;},toggleSourceEdit:function(sourceEditMode){if(sourceEditMode===undefined){sourceEditMode=!this.sourceEditMode;} this.sourceEditMode=sourceEditMode===true;var btn=this.tb.items.get("sourceedit");if(btn.pressed!==this.sourceEditMode){btn.toggle(this.sourceEditMode);if(!btn.xtbHidden){return;}} if(this.sourceEditMode){this.disableItems(true);this.syncValue();if(this.escapeValue){this.el.dom.value=unescape(this.el.dom.value);} this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus();}else{if(this.initialized&&!this.readOnly){this.disableItems(false);} this.pushValue();if(this.escapeValue){this.el.dom.value=escape(this.el.dom.value);} this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus();} var lastSize=this.lastSize;if(lastSize){delete this.lastSize;this.setSize(lastSize);} this.fireEvent("editmodechange",this,this.sourceEditMode);},pushValue:function(){if(this.initialized){var v=this.escapeValue?unescape(this.el.dom.value):this.el.dom.value;if(!this.activated&&v.length<1){v=this.defaultValue;} if(this.fireEvent("beforepush",this,v)!==false){this.getEditorBody().innerHTML=v;if(Ext.isGecko){this.setDesignMode(false);} this.setDesignMode(true);this.fireEvent("push",this,v);}}},onEditorEvent:function(){if(Ext.isIE){this.currentRange=this.getDoc().selection.createRange();} this.updateToolbar();},insertAtCursor:function(text){if(!this.activated){return;} if(Ext.isIE){this.win.focus();var doc=this.getDoc(),r=this.currentRange||doc.selection.createRange();if(r){r.pasteHTML(text);this.syncValue();this.deferFocus();}}else{this.win.focus();this.execCmd("InsertHTML",text);this.deferFocus();}}}); Ext.net.HyperLink=Ext.extend(Ext.form.Label,{cls:"",url:"#",valueElement:function(){var textEl=document.createElement("a");textEl.style.verticalAlign="middle";if(!Ext.isEmpty(this.cls,false)){textEl.className=this.cls;} textEl.setAttribute("href",this.url);this.textEl=Ext.get(textEl);this.textEl.setOverflow=Ext.emptyFn;if(this.disabled){textEl.setAttribute("disabled","1");textEl.removeAttribute("href");} if(!Ext.isEmpty(this.target,false)){textEl.setAttribute("target",this.target);} if(this.imageUrl){textEl.innerHTML='';}else{textEl.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");} return textEl;},setDisabled:function(disabled){Ext.net.HyperLink.superclass.setDisabled.apply(this,arguments);if(disabled){this.textEl.dom.setAttribute("disabled","1");this.textEl.dom.removeAttribute("href");}else{this.textEl.dom.removeAttribute("disabled");this.textEl.dom.setAttribute("href",this.url);}},setImageUrl:function(imageUrl){this.imageUrl=imageUrl;this.textEl.dom.innerHTML='';},setUrl:function(url){this.url=url;this.textEl.dom.setAttribute("href",this.url);},setTarget:function(target){this.target=target;this.textEl.dom.setAttribute("target",this.target);}});Ext.reg("nethyperlink",Ext.net.HyperLink); Ext.net.Image=Ext.extend(Ext.form.Label,{cls:"",lazyLoad:false,monitorComplete:true,monitorPoll:200,allowPan:false,initComponent:function(){Ext.net.Image.superclass.initComponent.call(this);this.addEvents("resizerbeforeresize","resizerresize","pan","click","dblclick","complete","beforeload");this.imageProxy=new Image();if(this.monitorComplete){if(this.loadMask){this.loadMask=Ext.apply({msg:"Loading...",msgCls:"x-mask-loading"},this.loadMask);this.on("beforeload",function(){if(this.rendered){this.getMaskEl().mask(this.loadMask.msg,this.loadMask.msgCls);}else{this.loadMask.deferredMask=true;}});this.on("complete",function(){if(this.rendered){this.getMaskEl().unmask(this.loadMask.removeMask);}else{this.loadMask.deferredMask=false;}},this);} this.checkTask=new Ext.util.DelayedTask(function(){if(this.imageProxy.complete){this.checkTask.cancel();this.complete=true;if(this.allowPan&&this.rendered){if(this.xDelta||this.yDelta){this.wrap.dom.scrollLeft-=this.xDelta||0;this.wrap.dom.scrollTop-=this.yDelta||0;}} this.fireEvent("complete",this);}else{this.checkTask.delay(this.monitorPoll);}},this);if(!this.lazyLoad){this.imageProxy.src=this.imageUrl;this.fireEvent("beforeload",this);this.checkTask.delay(this.monitorPoll);}}},getMaskEl:function(){if(this.ownerCt){return this.ownerCt.body?this.ownerCt.body:this.ownerCt.el;} return this.wrap||this.el.parent()||Ext.getBody();},getOriginalSize:function(){return{width:this.imageProxy.width,height:this.imageProxy.height};},setSize:function(w,h){Ext.net.Image.superclass.setSize.call(this,w,h);if(this.wrap&&!this.allowPan){this.el.setSize(w,h);}},onRender:function(ct,position){if(this.lazyLoad){this.imageProxy.src=this.imageUrl;if(this.monitorComplete){this.fireEvent("beforeload",this);this.checkTask.delay(this.monitorPoll);}} if(!this.el){this.el=document.createElement("img");this.el.id=this.getId();this.el.src=this.imageUrl;this.el.style.border="none";if(this.altText){this.el.setAttribute("alt",this.altText);} if(this.align&&this.align!=="notset"){this.el.setAttribute("align",this.align);} if(!Ext.isEmpty(this.cls,false)){this.el.className=this.cls;} this.el=Ext.get(this.el);this.el.setOverflow=Ext.emptyFn;} Ext.net.Image.superclass.onRender.call(this,ct,position);this.lastSize={w:this.el.getWidth(),h:this.el.getHeight()};this.el.on("resize",function(){var w=this.el.getWidth(),h=this.el.getHeight();this.fireEvent("resize",this,w,h,this.lastSize.w,this.lastSize.h);this.lastSize={w:w,h:h};},this);var w,h;if(this.allowPan||this.resizable){this.wrap=this.el.wrap();this.positionEl=this.resizeEl=this.wrap;this.actionMode="wrap";w=this.width||this.el.getWidth();h=this.height||this.el.getHeight();this.wrap.setSize(w,h);if(!this.allowPan){this.el.setSize(w,h);}} this.el.on("click",this.onClick,this);this.el.on("dblclick",this.onDblClick,this);if(this.allowPan){this.wrap.setOverflow("hidden");this.el.on("mousedown",this.onMouseDown,this);this.el.setStyle("cursor","move");if(this.xDelta||this.yDelta){this.wrap.dom.scrollLeft-=this.xDelta||0;this.wrap.dom.scrollTop-=this.yDelta||0;}} if(this.resizable){this.resizer=new Ext.Resizable(this.wrap,Ext.applyIf(this.resizeConfig||{},{handles:"all",wrap:this.allowPan}));this.resizer.on("beforeresize",function(r,e){return this.fireEvent("resizerbeforeresize",this,e);},this);this.resizer.on("resize",function(r,width,height,e){if(!this.allowPan){this.el.setSize(width,height);} this.fireEvent("resizerresize",this,width,height,e);},this);} if(this.loadMask&&this.loadMask.deferredMask){this.getMaskEl().mask(this.loadMask.msg,this.loadMask.msgCls);}},onClick:function(e,t){this.fireEvent("click",this,e,t);},onDblClick:function(e,t){this.fireEvent("dblclick",this,e,t);},onMouseDown:function(e){e.stopEvent();this.mouseX=e.getPageX();this.mouseY=e.getPageY();Ext.getBody().on("mousemove",this.onMouseMove,this);Ext.getDoc().on("mouseup",this.onMouseUp,this);},onMouseMove:function(e){e.stopEvent();var x=e.getPageX(),y=e.getPageY();if(e.within(this.wrap)){var xDelta=x-this.mouseX;var yDelta=y-this.mouseY;this.wrap.dom.scrollLeft-=xDelta;this.wrap.dom.scrollTop-=yDelta;this.fireEvent("pan",this,this.wrap.dom.scrollLeft,this.wrap.dom.scrollTop,xDelta,yDelta);} this.mouseX=x;this.mouseY=y;},onMouseUp:function(e){Ext.getBody().un("mousemove",this.onMouseMove,this);Ext.getDoc().un("mouseup",this.onMouseUp,this);},getContentTarget:function(){return this.el;},setImageUrl:function(imageUrl){this.imageUrl=imageUrl;if(this.rendered){this.el.dom.removeAttribute("width");this.el.dom.removeAttribute("height");this.el.dom.src=this.imageUrl;if(this.monitorComplete){delete this.imageProxy;this.imageProxy=new Image();this.imageProxy.src=this.imageUrl;this.fireEvent("beforeload",this);this.checkTask.cancel();this.checkTask.delay(this.monitorPoll);}}else{if(!this.lazyLoad){delete this.imageProxy;this.imageProxy=new Image();this.imageProxy.src=this.imageUrl;if(this.monitorComplete){this.fireEvent("beforeload",this);this.checkTask.cancel();this.checkTask.delay(this.monitorPoll);}}}},setAlign:function(align){this.align=align;if(this.rendered){this.el.dom.setAttribute("align",this.align);}},setAltText:function(altText){this.altText=altText;if(this.rendered){this.el.dom.setAttribute("altText",this.altText);}},scroll:function(x,y){if(x){this.wrap.dom.scrollLeft-=x;} if(y){this.wrap.dom.scrollTop-=y;}},scrollTo:function(x,y){if(x||x===0){this.wrap.dom.scrollLeft=x;} if(y||y===0){this.wrap.dom.scrollTop=y;}},getCurrentScroll:function(){return{x:this.wrap.dom.scrollLef,y:this.wrap.dom.scrollTop};}});Ext.reg("netimage",Ext.net.Image); Ext.form.Label.override({iconAlign:"left",isFormField:true,reset:Ext.emptyFn,getName:Ext.emptyFn,validate:function(){return true;},isValid:function(){return true;},valueElement:function(){var textEl=document.createElement("span");textEl.className="x-label-value";textEl.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");this.textEl=Ext.get(textEl);this.textEl.setOverflow=Ext.emptyFn;if(this.editor){if(Ext.isEmpty(this.editor.field)){this.editor.field={xtype:"textfield"};} this.editor.target=textEl;this.editor=new Ext.Editor({},this.editor);} return textEl;},onRender:function(ct,position){if(!this.el){this.el=document.createElement(this.forId?"label":"span");this.el.className="x-label";this.el.id=this.getId();var img=document.createElement("img");img.src=Ext.BLANK_IMAGE_URL;img.className="x-label-icon "+(this.iconCls||"");if(Ext.isEmpty(this.iconCls)){img.style.display="none";} if(this.iconAlign==="left"){this.el.appendChild(img);} this.el.appendChild(this.valueElement());if(this.iconAlign==="right"){this.el.appendChild(img);} if(this.forId){this.el.setAttribute("for",this.forId);} if(ct.hasClass("x-form-element")){ct.setStyle("padding-top","3px");}} Ext.form.Label.superclass.onRender.call(this,ct,position);},getContentTarget:function(){return this.textEl;},getText:function(encode){return this.rendered?encode===true?Ext.util.Format.htmlEncode(this.textEl.dom.innerHTML):this.textEl.dom.innerHTML:this.text;},setText:function(t,encode){this.text=t;if(this.rendered){var x=encode!==false?Ext.util.Format.htmlEncode(t):t;this.textEl.dom.innerHTML=(Ext.isEmpty(t)&&!Ext.isEmpty(this.emptyText))?this.emptyText:!Ext.isEmpty(this.format)?String.format(this.format,x):x;} return this;},setIconClass:function(cls){var oldCls=this.iconCls;this.iconCls=cls;if(this.rendered){var img=this.el.child("img.x-label-icon");img.replaceClass(oldCls,this.iconCls);img.dom.style.display=(cls==="")?"none":"inline";}}}); Ext.net.MultiField=Ext.extend(Ext.form.Field,{defaultAutoCreate:{tag:"div"},initValue:Ext.emptyFn,setValue:Ext.emptyFn,getValue:Ext.emptyFn,initComponent:function(){Ext.net.MultiField.superclass.initComponent.call(this);this.on("afterrender",function(){var h=0,fh,i;if(this.fields.length>0){for(i=0;ih){h=fh;}}} if(h!==0){this.setHeight(h);}},this);},onRender:function(ct,position){Ext.net.MultiField.superclass.onRender.call(this,ct,position);if(this.ownerCt){this.ownerCt.bubble(function(c){if(c.form){this.form=c.form;return false;}},this);} this.fields=this.fields||[];if(!Ext.isArray(this.fields)){this.fields=[this.fields];} this.el.setStyle("border","none");var h=0,fh;if(this.fields.length>0){var fields=[],i;for(i=0;ih){h=fh;}} this.fields=fields;} if(h!==0){this.setHeight(h);}},onResize:function(w,h){if(!Ext.isNumber(w)||w===0){return;} if(!this.rendered){this.width=w;return;} if(this.fields&&this.fields.length>0){var i,f,pw,aw,el,percentWidth=0,sum=0,ratio;if(w<1){return;} pw=w;for(i=0;i=0;i--){Ext.destroy(this.fields[i]);}},addClass:function(cls){Ext.net.MultiField.superclass.addClass.call(this,cls);var i;for(i=0;i0){l.setAttribute("for",this.items.items[0].id);}} Ext.form.CompositeField.superclass.onRender.apply(this,arguments);},isField:function(c){return!!c.setValue&&!!c.getValue&&!!c.markInvalid&&!!c.clearInvalid;},eachItem:function(fn,scope){if(this.items&&this.items.each){var i=0,len;for(i,len=this.items.length;ithis.maxLength){this.setValue(this.getValue().substr(0,this.maxLength));}});}}}); Ext.net.TriggerField=Ext.extend(Ext.form.TriggerField,{standardTrigger:false,initTrigger:function(){var ts=this.trigger.select(".x-form-trigger",true),triggerField=this;this.wrap.setStyle("overflow","hidden");ts.each(function(t,all,index){t.hide=function(){var w=triggerField.wrap.getWidth();this.dom.style.display="none";triggerField.el.setWidth(w-triggerField.trigger.getWidth());};t.show=function(){var w=triggerField.wrap.getWidth();this.dom.style.display="";this.dom.removeAttribute("hidden");triggerField.el.setWidth(w-triggerField.trigger.getWidth());};t.on("click",this.onCustomTriggerClick,this,{index:index,t:t,tag:t.getAttributeNS("ext","tid"),preventDefault:true});t.addClassOnOver("x-form-trigger-over");t.addClassOnClick("x-form-trigger-click");},this);this.triggers=ts.elements;}});Ext.reg("nettrigger",Ext.net.TriggerField); Ext.net.MultiCombo=Ext.extend(Ext.form.ComboBox,{delimiter:",",wrapBySquareBrackets:false,valueField:"value",selectionMode:"checkbox",normalizeStringValues:function(s){if(!Ext.isEmpty(s,false)){var values=[],re=/^\[{1}|\]{1}$/g;s=s.toString().replace(re,"");Ext.each(s.split(this.delimiter),function(item){values.push(item.trim());});s=values.join(this.delimiter);} return s;},initSelection:function(selection){if(Ext.isEmpty(selection)){return;} if(!this.view){this.selectionPredefined=selection;} var getValuesFromSelection=(function(selection){var values=[];Ext.each(selection,function(item){if(!Ext.isEmpty(item.value,false)){values.push(item.value);}},this);return values.join(this.delimiter);}).createDelegate(this,undefined,true),getAllValuesFromSelection=(function(selection){var values=[];Ext.each(selection,function(item){if(!Ext.isEmpty(item.value,false)){values.push(item.value);}else if(!Ext.isEmpty(item.index)){var r=this.store.getAt(item.index);if(!Ext.isEmpty(r)){values.push(r.get(this.valueField));}}},this);return values.join(this.delimiter);}).createDelegate(this,undefined,true),setInitValues=(function(selection){var values=getAllValuesFromSelection(selection);if(!Ext.isEmpty(values,false)){this.setValue(values);} if(this.fireSelectOnLoad){this.fireEvent("select",this,this.getSelectedRecords());} this.clearInvalid();}).createDelegate(this,undefined,true);if(this.store.getCount()>0){setInitValues(selection);}else{var values=getValuesFromSelection(selection);if(!Ext.isEmpty(values,false)){this.setValue(values);} this.store.on("load",setInitValues.createDelegate(this,[selection]),this,{single:true});}},initComponent:function(){this.editable=false;if(!this.tpl){this.tpl='
'+''+'
{'+this.displayField+'}
';this.tpl=new Ext.XTemplate(this.tpl,{getItemClass:(function(){if(this.selectionMode==="selection"){return"x-mcombo-nimg-item";} return"x-mcombo-img-item";}).createDelegate(this),getImgClass:(function(values){if(this.selectionMode==="selection"){return"";} var found=false;Ext.each(this.checkedRecords,function(record){if(values[this.valueField]==record.get(this.valueField)){found=true;return false;}},this);return found?"x-grid3-check-col-on":"x-grid3-check-col";}).createDelegate(this,[],true)});} this.checkedRecords=[];Ext.net.MultiCombo.superclass.initComponent.apply(this,arguments);if(this.selectionPredefined){this.initSelection(this.selectionPredefined);} this.on("beforequery",this.onBeforeQuery);},clearValue:function(){Ext.net.MultiCombo.superclass.clearValue.call(this);this.checkedRecords=[];delete this.selectionPredefined;this.store.clearFilter();this.store.fireEvent("datachanged",this.store);this.saveSelection();},getText:function(){var s=this.getValue(this.displayField).replace(new RegExp(RegExp.escape(this.delimiter),"g"),this.delimiter+" ");if(this.wrapBySquareBrackets){s="["+s+"]";} return s;},getValue:function(field){var value=[];Ext.each(this.checkedRecords,function(record){value.push(record.get(field||this.valueField));},this);return value.join(this.delimiter);},setValue:function(v){if(v){v=this.normalizeStringValues(v);this.store.clearFilter();var values=v.split(this.delimiter),unselected=[];Ext.each(this.checkedRecords,function(r){var found=false;Ext.each(values,function(value){if(r.get(this.valueField)==value){found=true;return false;}},this);if(!found){unselected.push(r);}},this);this.checkedRecords=[];Ext.each(unselected,function(r){this.deselectRecord(r);},this);this.store.each(function(r){Ext.each(values,function(value){if(r.get(this.valueField)==value){this.checkedRecords.push(r);this.selectRecord(r);return false;}},this);},this);this.value=this.getValue();this.setRawValue(this.getText());if(this.hiddenField){this.hiddenField.value=this.value;} if(this.el){this.el.removeClass(this.emptyClass);} this.saveSelection();}else{this.clearValue();}},onBeforeQuery:function(qe){qe.query=this.normalizeStringValues(qe.query);},checkOnBlur:Ext.emptyFn,beforeBlur:Ext.emptyFn,triggerBlur:function(){this.store.clearFilter();Ext.net.MultiCombo.superclass.triggerBlur.call(this);},initList:function(){Ext.net.MultiCombo.superclass.initList.call(this);if(this.selectionPredefined){this.initSelection(this.selectionPredefined);delete this.selectionPredefined;} if(this.selectionMode!=="checkbox"){this.view.overClass="x-multi-selected";this.view.mon(this.view.getTemplateTarget(),{"mouseover":this.view.onMouseOver,"mouseout":this.view.onMouseOut,scope:this.view});}},onSelect:function(record,index){if(this.fireEvent("beforeselect",this,record,index)!==false){if(this.checkedRecords.indexOf(record)===-1){this.checkedRecords.push(record);}else{this.checkedRecords.remove(record);this.deselectRecord(record);} if(this.store.isFiltered()){this.doQuery(this.allQuery);} this.setValue(this.getValue());this.fireEvent("select",this,record,index);}},isSelected:function(record){if(Ext.isNumber(record)){record=this.store.getAt(record);} if(Ext.isString(record)){Ext.each(this.store.getRange(),function(r){if(r.get(this.valueField)==record){record=r;return false;}},this);} return this.checkedRecords.indexOf(record)!==-1;},select:function(index,scrollIntoView){if(this.selectionMode==="checkbox"){Ext.net.MultiCombo.superclass.select.call(this,index,scrollIntoView);}},deselectRecord:function(record){if(!this.view){return;} switch(this.selectionMode){case"checkbox":this.view.refreshNode(this.store.indexOf(record));break;case"selection":if(this.view.isSelected(this.store.indexOf(record))){this.view.deselect(this.store.indexOf(record));} break;case"all":if(this.view.isSelected(this.store.indexOf(record))){this.view.deselect(this.store.indexOf(record));} this.view.refreshNode(this.store.indexOf(record));break;}},selectRecord:function(record){if(!this.view){return;} switch(this.selectionMode){case"checkbox":this.view.refreshNode(this.store.indexOf(record));break;case"selection":if(!this.view.isSelected(this.store.indexOf(record))){this.view.select(this.store.indexOf(record),true);} break;case"all":if(!this.view.isSelected(this.store.indexOf(record))){this.view.select(this.store.indexOf(record),true);} this.view.refreshNode(this.store.indexOf(record));break;}},selectAll:function(){this.checkedRecords=[];this.store.each(function(record){this.checkedRecords.push(record);},this);this.doQuery(this.allQuery);this.setValue(this.getValue());},clearSelections:function(){this.clearValue();},deselectItem:function(record){if(Ext.isNumber(record)){record=this.store.getAt(record);} if(Ext.isString(record)){Ext.each(this.store.getRange(),function(r){if(r.get(this.valueField)==record){record=r;return false;}},this);} if(this.checkedRecords.indexOf(record)!==-1){this.checkedRecords.remove(record);this.deselectRecord(record);if(this.store.isFiltered()){this.doQuery(this.allQuery);} this.setValue(this.getValue());}},selectItem:function(record){if(Ext.isNumber(record)){record=this.store.getAt(record);} if(Ext.isString(record)){Ext.each(this.store.getRange(),function(r){if(r.get(this.valueField)==record){record=r;return false;}},this);} if(this.checkedRecords.indexOf(record)===-1){this.checkedRecords.push(record);this.selectRecord(record);if(this.store.isFiltered()){this.doQuery(this.allQuery);} this.setValue(this.getValue());}},getSelectedRecords:function(){return this.checkedRecords;},getSelectedIndexes:function(){var indexes=[];Ext.each(this.checkedRecords,function(record){indexes.push(this.store.indexOf(record));},this);return indexes;},getSelectedValues:function(){var values=[];Ext.each(this.checkedRecords,function(record){values.push(record.get(this.valueField));},this);return values;},getSelectedText:function(){var text=[];Ext.each(this.checkedRecords,function(record){text.push(record.get(this.displayField));},this);return text;},getSelection:function(){var selection=[];Ext.each(this.checkedRecords,function(record){selection.push({text:record.get(this.displayField),value:record.get(this.valueField),index:this.store.indexOf(record)});},this);return selection;},saveSelection:function(){this.getSelectionField().setValue(Ext.encode(this.getSelection()));},getSelectionField:function(){if(!this.selectionField){this.selectionField=new Ext.form.Hidden({id:this.id+"_Selection",name:this.id+"_Selection"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.selectionField);} return this.selectionField;}});Ext.reg("netmulticombo",Ext.net.MultiCombo); Ext.form.NumberField.prototype.setValue=Ext.form.NumberField.prototype.setValue.createSequence(function(v){if(this.trimTrailedZeros===false){var value=this.getValue(),strValue;if(!Ext.isEmpty(value,false)){strValue=value.toFixed(this.decimalPrecision).replace(".",this.decimalSeparator);this.setRawValue(strValue);}}});Ext.form.NumberField.override({negativeText:"Negative numbers are not allowed (you entered '{0}')",getErrors:function(value){var errors=Ext.form.NumberField.superclass.getErrors.apply(this,arguments);value=value||this.processValue(this.getRawValue());if(value.length<1){return errors;} value=String(value).replace(this.decimalSeparator,".");if(isNaN(value)){errors.push(String.format(this.nanText,value));} var num=this.parseValue(value);if(numthis.maxValue){errors.push(String.format(this.maxText,this.maxValue));} if(!this.allowNegative&&num<0){errors.push(String.format(this.negativeText,value));} return errors;}}); Ext.net.DropDownField=Ext.extend(Ext.net.TriggerField,{lazyInit:true,componentAlign:"tl-bl?",allowBlur:false,mode:"text",syncValue:Ext.emptyFn,initComponent:function(){Ext.net.DropDownField.superclass.initComponent.call(this);this.addEvents("expand","collapse");var cn=[],triggerCfg,isSimple;triggerCfg={tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger"};if(!Ext.isEmpty(this.triggerClass,false)){triggerCfg.cls+=" "+this.triggerClass;} if(Ext.net.StringUtils.startsWith(this.triggerClass||"","x-form-simple")){if(this.triggersConfig&&this.triggersConfig.length>0){triggerCfg.cls+=" shift-trigger";} isSimple=true;} if(this.hideTrigger){Ext.apply(triggerCfg,{style:"display:none",hidden:true});this.hideTrigger=false;} if(isSimple){this.addClass("clear-right");} if(this.triggersConfig){this.triggerConfig.cn.push(triggerCfg);}else{cn.push(triggerCfg);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:cn};}},initTrigger:function(){Ext.net.DropDownField.superclass.initTrigger.call(this);this.triggers[this.triggers.length-1].removeListener("click",this.onCustomTriggerClick,this);this.triggers[this.triggers.length-1].on("click",this.onTriggerClick,this);},initDropDownComponent:function(){if(this.component&&!this.component.render){this.component.floating=true;this.component=new Ext.ComponentMgr.create(this.component,"panel");} var renderTo=this.componentRenderTo||Ext.net.ResourceMgr.getAspForm()||document.body,zindex=parseInt(Ext.fly(renderTo).getStyle("z-index"),10);if(this.ownerCt&&!zindex){this.findParentBy(function(ct){zindex=parseInt(ct.getPositionEl().getStyle("z-index"),10);return!!zindex;});} this.component.setWidth(this.component.initialConfig.width||this.getWidth());this.component.dropDownField=this;this.component.render(renderTo);this.component.hide();this.first=true;this.component.getPositionEl().position("absolute",(zindex||12000)+5);if(this.component.initialConfig.height){this.component.setHeight(this.component.initialConfig.height);} this.syncValue(this.getValue(),this.getText());},onRender:function(ct,position){Ext.net.DropDownField.superclass.onRender.call(this,ct,position);if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off");} if(!this.lazyInit){this.initDropDownComponent();}else{this.on("focus",this.initDropDownComponent,this,{single:true});} if(this.mode!=="text"){this.getUnderlyingValueField().render(ct);}},isExpanded:function(){return this.component&&this.component.isVisible&&this.component.isVisible();},collapse:function(){if(!this.isExpanded()){return;} this.component.hide();if(this.allowBlur===false){Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);} this.fireEvent("collapse",this);},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.component.el)){this.collapse();}},expand:function(){if(this.isExpanded()||!this.hasFocus){return;} if(this.first){this.doResize(this.el.getWidth()+this.getTriggerWidth());delete this.first;}else if(this.bufferSize){this.doResize(this.bufferSize);delete this.bufferSize;} var el=this.component.getPositionEl();el.setLeft(0);el.setTop(0);if(Ext.isIE6||Ext.isIE7){this.component.show();} el.alignTo(this.wrap,this.componentAlign);if(!(Ext.isIE6||Ext.isIE7)){this.component.show();} if(this.allowBlur===false){this.mon(Ext.getDoc(),{scope:this,mousewheel:this.collapseIf,mousedown:this.collapseIf});} this.fireEvent("expand",this);},onTriggerClick:function(){if(this.readOnly||this.disabled){return;} if(this.isExpanded()){this.collapse();}else{this.onFocus({});this.expand();} this.el.focus();},validateBlur:function(){return!this.component||!this.component.isVisible();},onResize:function(w,h){Ext.net.DropDownField.superclass.onResize.apply(this,arguments);if(this.isVisible()&&this.component&&this.componentAlign.render){this.doResize(w);}else{this.bufferSize=w;}},doResize:function(w){if(!Ext.isDefined(this.component.initialConfig.width)){this.component.setWidth(w);}},checkTab:function(me,e){if(!this.isExpanded()&&e.getKey()===e.TAB){this.triggerBlur();}},onDestroy:function(){if(this.component&&this.component.rendered){this.component.destroy();} if(this.underlyingValueField&&this.underlyingValueField.rendered){this.underlyingValueField.destroy();} Ext.net.DropDownField.superclass.onDestroy.call(this);},setValue:function(value,text,collapse){if(this.mode==="text"){collapse=text;text=value;} Ext.net.DropDownField.superclass.setValue.apply(this,[text]);this.getUnderlyingValueField().setValue(value);if(!this.isExpanded()){this.syncValue(value,text);} if(collapse!==false){this.collapse();} return this;},setRawValue:function(value,text){Ext.net.DropDownField.superclass.setRawValue.call(this,value);this.getUnderlyingValueField().setValue(value);if(!this.isExpanded()){this.syncValue(value,text);} return this;},initEvents:function(){Ext.net.DropDownField.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}},"esc":function(e){this.collapse();},"tab":function(e){this.collapse();return true;},scope:this,doRelay:function(e,h,hname){if(hname==="down"||this.scope.isExpanded()){var relay=Ext.KeyNav.prototype.doRelay.apply(this,arguments);if(!Ext.isIE&&Ext.EventManager.useKeydown){this.scope.fireKey(e);} return relay;} return true;},forceKeyDown:true,defaultEventAction:"stopEvent"});},getUnderlyingValueField:function(){if(!this.underlyingValueField){this.underlyingValueField=new Ext.form.Hidden({id:this.id+"_Value",name:this.id+"_Value",value:this.underlyingValue||""});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.underlyingValueField);} return this.underlyingValueField;},getText:function(){return Ext.net.DropDownField.superclass.getValue.call(this);},getValue:function(){return this.getUnderlyingValueField().getValue();},getRawValue:function(){return this.getValue();},reset:function(){if(this.isTextMode()){this.setValue(this.originalText,false);}else{this.setValue(this.originalValue,this.originalText,false);} this.clearInvalid();this.applyEmptyText();},isTextMode:function(){return this.mode==="text";},initValue:function(){Ext.net.DropDownField.superclass.initValue.call(this);if(this.text!==undefined){if(this.isTextMode()){this.setValue(this.text,false);}else{this.setValue(this.getValue(),this.text,false);}} this.originalText=this.getText();},clearValue:function(){this.setRawValue("","");this.applyEmptyText();}});Ext.reg("netdropdown",Ext.net.DropDownField); Ext.ns("Ext.ux");Ext.ux.FieldLabeler=(function(){var getParentProperty=function(propName){var p;for(p=this.ownerCt;p;p=p.ownerCt){if(p[propName]){return p[propName];}}};return{init:function(f){f.labeler=this;f.onRender=f.onRender.createSequence(this.onRender);},onRender:function(){if(this.ownerCt){if(this.ownerCt.layout instanceof Ext.layout.FormLayout||(this.ownerCt.el&&this.ownerCt.el.hasClass("x-form-composite"))){delete this.labeler;return;}} this.onResize=this.labeler.onResize;this.onDestroy=this.onDestroy.createSequence(this.labeler.onDestroy);var isToolbar=(this.wrap||this.el).up(".x-toolbar");this.resizeEl=(this.wrap||this.el).wrap({cls:"x-form-element",style:(Ext.isIE6||Ext.isIE7)&&!isToolbar?"position:absolute;overflow:visible;left:0;":""});this.positionEl=this.itemCt=this.resizeEl.wrap({cls:"x-form-item ",style:(isToolbar?"margin-bottom:0px;":"")+(Ext.isIE&&isToolbar?"margin-top:1px;":"")});if(this.nextSibling()){this.margins=Ext.apply({top:0,right:0,bottom:this.positionEl.getMargins("b"),left:0},this.margins);} this.actionMode="itemCt";if(!Ext.isDefined(this.hideLabels)){this.hideLabels=getParentProperty.call(this,"hideLabels");} if(this.hideLabels){this.resizeEl.setStyle("padding-left","0px");return;} if(!Ext.isDefined(this.labelSeparator)){this.labelSeparator=getParentProperty.call(this,"labelSeparator");} if(!Ext.isDefined(this.labelPad)){this.labelPad=getParentProperty.call(this,"labelPad");} if(!Ext.isDefined(this.labelAlign)){this.labelAlign=getParentProperty.call(this,"labelAlign")||"left";} this.itemCt.addClass("x-form-label-"+this.labelAlign);if(this.labelAlign==="top"){if(!this.labelWidth){this.labelWidth="auto";} this.resizeEl.setStyle("padding-left","0px");}else{if(!Ext.isDefined(this.labelWidth)){this.labelWidth=getParentProperty.call(this,"labelWidth")||100;} if((Ext.isIE6||Ext.isIE7)&&isToolbar){this.resizeEl.setStyle("padding-left",(this.labelPad||5)+"px");}else{this.resizeEl.setStyle("padding-left",(this.labelWidth+(this.labelPad||5))+"px");}} this.label=this.itemCt.insertFirst({tag:"label",cls:"x-form-item-label",style:{width:this.labelWidth+"px"},html:this.fieldLabel+(this.labelSeparator||":")});},onResize:function(w,h){Ext.form.Field.prototype.onResize.apply(this,arguments);if(w){w-=this.resizeEl.getPadding("l");if(this.getTriggerWidth){this.wrap.setWidth(w);this.el.setWidth(w-this.getTriggerWidth());}else{this.el.setWidth(w);}} if(h&&(this.el.dom.tagName.toLowerCase()==="textarea"||Ext.isIE6||Ext.isIE7)){h=this.resizeEl.getHeight(true);if(!this.hideLabels&&(this.labelAlign==="top")){h-=this.label.getHeight();} if(!Ext.isIE6&&!Ext.isIE7){this.el.setHeight(h);}else{this.el.up(".x-form-item").setHeight(h);}}},onDestroy:function(){this.itemCt.remove();}};})(); Ext.override(Ext.menu.Menu,{enableScrolling:false,lastTargetIn:function(cmp){return Ext.fly(cmp.getEl?cmp.getEl():cmp).contains(this.trg);},render:function(ct,position){if(!ct&&this.floating&&this.renderToForm===true){ct=Ext.net.ResourceMgr.getAspForm()||Ext.getBody();} Ext.menu.Menu.superclass.render.call(this,ct,position);}});Ext.override(Ext.layout.MenuLayout,{doAutoSize:function(){var ct=this.container,w=ct.width;if(ct.floating){if(w){ct.setWidth(w);}else if(Ext.isIE){ct.setWidth(Ext.isStrict&&(!Ext.isIE6)?'auto':ct.minWidth);var el=ct.getEl(),t=el.dom.offsetWidth;ct.setWidth(ct.getLayoutTarget().getWidth()+el.getFrameWidth('lr'));}}}}); Ext.menu.CheckItem.prototype.onRender=Ext.menu.CheckItem.prototype.onRender.createSequence(function(el){this.getCheckedField().render(Ext.net.ResourceMgr.getAspForm()||this.el.parent()||this.el);});Ext.menu.CheckItem.override({getCheckedField:function(){if(!this.checkedField){this.checkedField=new Ext.form.Hidden({id:this.id+"_Checked",name:this.id+"_Checked"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.checkedField);} return this.checkedField;}}); Ext.override(Ext.menu.ColorMenu,{initComponent:function(){Ext.apply(this,{plain:true,showSeparator:false,items:this.palette=new Ext.ColorPalette(this.initialConfig.palette||{})});var restoreWindowProp=!Ext.isEmpty(window[this.palette.id]);this.palette.purgeListeners();if(restoreWindowProp){window[this.palette.id]=this.palette;} Ext.menu.ColorMenu.superclass.initComponent.call(this);this.relayEvents(this.palette,["select"]);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this);}}}); Ext.override(Ext.menu.DateMenu,{initComponent:function(){this.on("beforeshow",this.onBeforeShow,this);this.strict=(Ext.isIE7&&Ext.isStrict);if(this.strict){this.on("show",this.onShow,this,{single:true,delay:20});} Ext.apply(this,{plain:true,showSeparator:false,items:this.picker=new Ext.DatePicker(Ext.apply({internalRender:this.strict||!Ext.isIE,ctCls:"x-menu-date-item"},this.initialConfig.picker))});var restoreWindowProp=!Ext.isEmpty(window[this.picker.id]);this.picker.purgeListeners();if(restoreWindowProp){window[this.picker.id]=this.picker;} Ext.menu.DateMenu.superclass.initComponent.call(this);this.relayEvents(this.picker,["select"]);this.on("show",this.picker.focus,this.picker);this.on("select",this.menuHide,this);if(this.handler){this.on("select",this.handler,this.scope||this);}}}); Ext.Toolbar.HtmlElement=function(config){Ext.Toolbar.HtmlElement.superclass.constructor.call(this,config.target);};Ext.extend(Ext.Toolbar.HtmlElement,Ext.Toolbar.Item,{});Ext.reg("nettbhtml",Ext.Toolbar.HtmlElement); Ext.net.MenuPanel=function(config){Ext.net.MenuPanel.superclass.constructor.call(this,config);};Ext.extend(Ext.net.MenuPanel,Ext.Panel,{saveSelection:true,selectedIndex:-1,fitHeight:true,initComponent:function(){Ext.net.MenuPanel.superclass.initComponent.call(this);this.menu=this.menu.render?this.menu:Ext.ComponentMgr.create(this.menu,"menu");if(this.selectedIndex>-1){this.menu.items.get(this.selectedIndex).ctCls="x-menu-item-active";this.getSelIndexField().setValue(this.selectedIndex);} this.menu.on("itemclick",this.setSelection,this);this.menu.on("mouseout",this.onMenuMouseOut,this);},onMenuMouseOut:function(menu,e,t){if(!this.saveSelection){return;} var index=this.menu.items.indexOf(t),selIndex=this.getSelIndexField().getValue();if(selIndex.length>0&&index==selIndex){t.container.addClass("x-menu-item-active");}},setSelectedIndex:function(index){this.setSelection(this.menu.items.get(index));},getSelIndexField:function(){if(!this.selIndexField){this.selIndexField=new Ext.form.Hidden({id:this.id+"_SelIndex",name:this.id+"_SelIndex"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.selIndexField);} return this.selIndexField;},setSelection:function(item,e){if(this.saveSelection){this.menu.items.each(function(item){item.container.removeClass("x-menu-item-active");},this.menu);item.container.addClass("x-menu-item-active");} this.getSelIndexField().setValue(this.menu.items.indexOf(item));},clearSelection:function(){this.menu.items.each(function(item){item.container.removeClass("x-menu-item-active");},this.menu);this.getSelIndexField().setValue(null);},afterRender:function(){Ext.net.MenuPanel.superclass.afterRender.call(this);if(this.collapsed){this.on("expand",this.initMenu,this,{single:true});}else{this.initMenu();} this.getSelIndexField().render(this.el.parent()||this.el);},initMenu:function(){this.menu.render(this.body);var lay=this.menu.getEl();if(Ext.isIE){lay.shadow=false;} lay.clearPositioning("auto");if(this.fitHeight){lay.setSize("100%","100%");}else{lay.setWidth("100%");} lay.applyStyles({border:"0px"});lay.show();this.collapse(false);this.expand(false);}});Ext.reg("netmenupanel",Ext.net.MenuPanel); Ext.net.ComboMenuItem=function(config){Ext.net.ComboMenuItem.superclass.constructor.call(this,config);this.component=Ext.ComponentMgr.create(Ext.apply(config.component||config.combobox||{},{lazyInit:false}),"combo");this.component.getZIndex=function(){return 99999;};this.combo=this.component;this.addEvents("select");if(this.iconCls){this.iconCls+=" x-menu-field-icon";} this.combo.on("afterrender",function(combo){combo.getEl().swallowEvent("click");if(combo.list){combo.list.on("mousedown",function(e){Ext.lib.Event.stopPropagation(e);});}},this);};Ext.extend(Ext.net.ComboMenuItem,Ext.menu.BaseItem,{hideOnClick:false,shift:true,onSelect:function(combo,record){this.fireEvent("select",this,record);Ext.net.ComboMenuItem.superclass.handleClick.call(this);},onRender:function(container){this.component.render(container);this.el=this.component.getEl();if(Ext.isIE&&this.combo.list){this.combo.list.shadow=false;} this.el.swallowEvent(["keydown","keypress"]);Ext.each(["keydown","keypress"],function(eventName){this.el.on(eventName,function(e){if(e.isNavKeyPress()){e.stopPropagation();}},this);},this);if(this.shift){this.component.container.applyStyles({"padding-left":"24px"});}}});Ext.reg("combomenuitem",Ext.net.ComboMenuItem); Ext.net.DateFieldMenuItem=function(config){Ext.net.DateFieldMenuItem.superclass.constructor.call(this,config);this.component=Ext.ComponentMgr.create(config.component||config.dateField,"datefield");this.dateField=this.component;if(this.iconCls){this.iconCls+=" x-menu-field-icon";} this.dateField.menu=new Ext.menu.DateMenu({allowOtherMenus:true});this.dateField.on("render",function(dateField){dateField.getEl().swallowEvent("click");});};Ext.extend(Ext.net.DateFieldMenuItem,Ext.menu.BaseItem,{hideOnClick:false,canActivate:false,shift:true,onRender:function(container){this.component.render(container);this.el=this.component.getEl();this.el.swallowEvent(["keydown","keypress"]);Ext.each(["keydown","keypress"],function(eventName){this.el.on(eventName,function(e){if(e.isNavKeyPress()){e.stopPropagation();}},this);},this);if(this.shift){this.component.container.applyStyles({"padding-left":"24px"});}}});Ext.reg("datefieldmenuitem",Ext.net.DateFieldMenuItem); Ext.net.ComponentMenuItem=function(cfg){this.target=cfg.target;if(cfg.iconCls){cfg.iconCls+=" x-menu-field-icon";cfg.shift=false;} Ext.net.ComponentMenuItem.superclass.constructor.call(this,cfg);if(cfg.component){this.component=cfg.component.rendered?cfg.component:Ext.ComponentMgr.create(cfg.component,"panel");}};Ext.extend(Ext.net.ComponentMenuItem,Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-item",shift:true,componentElement:"auto",onRender:function(container){if(this.iconCls){this.iconCls+=" x-menu-field-icon";} if(this.component){this.component=this.component.rendered?this.component:Ext.ComponentMgr.create(this.component,"panel");if(!this.component.rendered){this.component.render(container);this.el=this.component.getEl();}}else{this.el=(this.target.getEl)?this.target.getEl():Ext.get(this.target);this.component=Ext.getCmp(this.el.id);} this.el.swallowEvent(["keydown","keypress"]);Ext.each(["keydown","keypress"],function(eventName){this.el.on(eventName,function(e){if(e.isNavKeyPress()){e.stopPropagation();}},this);},this);if(this.componentElement==="auto"){this.componentElement=this.component.wrap?"wrap":"element";} if(this.componentElement==="wrap"&&!Ext.isEmpty(this.component)){this.el=this.component.wrap;} if(this.shift){if(this.componentElement==="wrap"){container.applyStyles({"padding-left":"25px"});}else{this.el.applyStyles({"margin-left":"23px"});}} Ext.net.ComponentMenuItem.superclass.onRender.apply(this,arguments);if(!Ext.isEmpty(this.component)){if(this.component.doLayout){this.component.doLayout();} if(this.component.syncSize){this.component.syncSize();}} if(Ext.isIE){if(this.parentMenu){this.parentMenu.shadow=false;this.parentMenu.el.shadow=false;} if(!Ext.isEmpty(this.component)){this.component.shadow=false;this.component.el.shadow=false;}} this.component.parentMenu=this.parentMenu;},activate:function(){if(this.disabled){return false;} if(Ext.isEmpty(this.component)){return false;} this.component.focus();this.fireEvent("activate",this);return true;},deactivate:function(){this.fireEvent("deactivate",this);},disable:function(){if(Ext.isEmpty(this.component)){return;} this.component.disable();Ext.net.ComponentMenuItem.superclass.disable.call(this);},enable:function(){if(Ext.isEmpty(this.component)){return;} this.component.enable();Ext.net.ComponentMenuItem.superclass.enable.call(this);}});Ext.reg("componentmenuitem",Ext.net.ComponentMenuItem); Ext.override(Ext.menu.TextItem,{setText:function(text){if(this.rendered){this.el.dom.innerHTML=text;}else{this.text=text;}}});Ext.override(Ext.menu.Separator,{disabled:true}); Ext.ToolTip.override({initTarget:function(target){var targetEl=Ext.net.getEl(target);if(!Ext.isEmpty(targetEl)){this.initTargetEvents(targetEl);}else{var getTargetTask=new Ext.util.DelayedTask(function(task){targetEl=Ext.net.getEl(target);if(!Ext.isEmpty(targetEl)){this.initTargetEvents(targetEl);task.cancel();}else{task.delay(500,undefined,this,[task]);}},this);getTargetTask.delay(1,undefined,this,[getTargetTask]);}},initTargetEvents:function(targetEl){this.target=targetEl;var t;if((t=Ext.get(this.target))){if(this.target){this.target=Ext.get(this.target);this.target.un("mouseover",this.onTargetOver,this);this.target.un("mouseout",this.onTargetOut,this);this.target.un("mousemove",this.onMouseMove,this);} this.mon(t,{mouseover:this.onTargetOver,mouseout:this.onTargetOut,mousemove:this.onMouseMove,scope:this});this.target=t;} if(this.anchor){this.anchorTarget=this.target;}}});Ext.QuickTips.init=Ext.QuickTips.init.createSequence(function(){var fn=function(){var tip=Ext.QuickTips.getQuickTip();if(tip){tip.disabled=true;}};if(window.addEventListener){window.addEventListener("unload",fn,false);}else if(window.attachEvent){window.attachEvent("onunload",fn);}}); Ext.Toolbar.prototype.initComponent=Ext.Toolbar.prototype.initComponent.createSequence(function(){if(this.classicButtonStyle){this.setClassicButtonStyle(this.classicButtonStyle);}});Ext.override(Ext.Component,{setClassicButtonStyle:function(classic){this[classic?"addClass":"removeClass"]("x-toolbar-classic");}}); Ext.Toolbar.Item.prototype.getEl=function(){return Ext.get(this.el);}; Ext.net.ToolbarSpacer=function(config){Ext.net.ToolbarSpacer.superclass.constructor.call(this);config=config||{};this.width=config.width;this.render=function(td){Ext.net.ToolbarSpacer.superclass.render.call(this,td);if(!Ext.isEmpty(this.width)){Ext.fly(this.el).removeClass("ytb-spacer").setWidth(this.width);}};};Ext.extend(Ext.net.ToolbarSpacer,Ext.Toolbar.Spacer);Ext.reg("nettbspacer",Ext.net.ToolbarSpacer); Ext.Toolbar.TextItem.override({getText:function(){return this.rendered?this.el.dom.innerHTML:this.autoEl.html;}}); Ext.tree.TreeSorter.override({_sortFn:function(n1,n2){var desc=this.dir&&this.dir.toLowerCase()==="desc",prop=this.property||"text",sortType=this.sortType,folderSort=this.folderSort,caseSensitive=this.caseSensitive===true,leafAttr=this.leafAttr||"leaf",attr1=n1.attributes,attr2=n2.attributes;if(Ext.isString(sortType)){sortType=Ext.data.SortTypes[sortType];} if(folderSort){if(attr1[leafAttr]&&!attr2[leafAttr]){return 1;} if(!attr1[leafAttr]&&attr2[leafAttr]){return-1;}} var prop1=attr1[prop],prop2=attr2[prop],v1=sortType?sortType(prop1,n1):(caseSensitive?prop1:(prop1.toUpperCase?prop1.toUpperCase():prop1)),v2=sortType?sortType(prop2,n2):(caseSensitive?prop2:(prop2.toUpperCase?prop2.toUpperCase():prop2));if(v1v2){return desc?-1:1;} return 0;},doSort:function(node){if(this.fnDelegated!==true){this._sortFn=this._sortFn.createDelegate(this);this.fnDelegated=true;} node.sort(this._sortFn);}}); Ext.net.TreePanel=function(config){Ext.net.TreePanel.superclass.constructor.call(this,config);};Ext.extend(Ext.net.TreePanel,Ext.tree.TreePanel,{mode:"local",initNoLeafIcon:function(){if(this.noLeafIcon){var css="#"+this.id+" .x-tree-node-leaf .x-tree-node-icon{background-image: none;width:0px;}";Ext.net.ResourceMgr.registerCssClass("treepanel_css_"+this.id,css);}},initComponent:function(){Ext.net.TreePanel.superclass.initComponent.call(this);this.initEditors();this.initChildren(this.nodes);this.initNoLeafIcon();if(Ext.isEmpty(this.selectionSubmitConfig)||this.selectionSubmitConfig.disableAutomaticSubmit!==true){this.getSelectionModel().on("selectionchange",this.updateSelection,this);this.on("checkchange",this.updateCheckSelection,this,{buffer:10});this.on("append",this.updateCheckSelection,this,{buffer:10});this.on("insert",this.updateCheckSelection,this,{buffer:10});} if(!this.loader.hasListener("loadexception")){this.loader.on("loadexception",function(loader,node,response){if(Ext.net.DirectEvent.fireEvent("ajaxrequestexception",response,{"errorMessage":response.responseText},null,null,null,null,null)!==false){if((this.directEventConfig||{}).showWarningFailure!==false){Ext.net.DirectEvent.showFailure(response,response.responseText);}}},this);} this.addEvents({"submit":true,"submitexception":true,"beforeremoteaction":true,"remoteactionexception":true,"remoteactionrefusal":true,"remoteactionsuccess":true,"beforeremotemove":true,"beforeremoterename":true,"beforeremoteremove":true,"beforeremoteinsert":true,"beforeremoteappend":true});if(this.sorter&&!this.sorter.doSort){this.sorter=new Ext.tree.TreeSorter(this,this.sorter);} if(this.mode==="remote"){this.mode="local";this.setMode("remote");} this.on("nodedragover",this.onNodeDragOver,this);},setMode:function(mode){if(mode==="remote"&&this.mode==="local"){this.localActions=this.localActions||[];if(this.loader.preloadChildren){this.loader.on("load",this.onRemoteDoPreload);} if(this.editors){Ext.each(this.editors,function(editor){editor.on("complete",this.onRemoteNodeEditComplete,this);editor.on("canceledit",this.onRemoteNodeCancelEdit,this);},this);} if(this.enableDD){this.on("beforenodedrop",this.onRemoteBeforeNodeDrop,this);}}else if(mode==="local"&&this.mode==="remote"){if(this.loader.preloadChildren){this.loader.un("load",this.onRemoteDoPreload);} if(this.editors){Ext.each(this.editors,function(editor){editor.un("complete",this.onRemoteNodeEditComplete,this);editor.un("canceledit",this.onRemoteNodeCancelEdit,this);},this);} if(this.enableDD){this.un("beforenodedrop",this.onRemoteBeforeNodeDrop,this);}} this.mode=mode;},onRemoteBeforeNodeDrop:function(e){if(this.mode==="local"||this.localActions.indexOf("move")!==-1){return true;} this.moveNodeRequest(e);e.dropStatus=true;return false;},remoteOptions:function(action,node){var dc=this.directEventConfig||{},options={action:action,node:node,params:{}};if(this.fireEvent("beforeremoteaction",this,node,options,action)!==false){dc.userSuccess=this.remoteActionSuccess.createDelegate(this);dc.userFailure=this.remoteActionFailure.createDelegate(this);dc.extraParams=options.params;dc.node=node;dc.control=this;dc.eventType="postback";dc.action=action;if(!Ext.isEmpty(this[action+"Url"],false)){dc.url=this[action+"Url"];dc.cleanRequest=true;} return dc;} return false;},remoteActionSuccess:function(response,result,context,type,action,extraParams,o){if(o.node){o.node.getUI().afterLoad();} var rParams;try{rParams=result.extraParamsResponse||result.response||(result.d?result.d.response:{})||{};var responseObj=result.serviceResponse||result.d||result;result={success:responseObj.success,msg:responseObj.message};}catch(ex){this.fireEvent("remoteactionexception",this,response,ex,o);if(o.cancelWarningFailure!==true&&(this.directEventConfig||{}).showWarningFailure!==false&&!this.hasListener("remoteactionexception")){Ext.net.DirectEvent.showFailure(response,result.msg);} return;} if(result.success!==true){this.fireEvent("remoteactionrefusal",this,response,{message:result.msg},o);if(o.action==="raAppend"||o.action==="reInsert"){o.node.parentNode.removeChild(o.node);} return;} switch(o.action){case"raRename":o.node.setText(rParams.ra_newText||rParams.text||Ext.util.Format.htmlDecode(o.raConfig.newText));break;case"raRemove":o.node.parentNode.removeChild(o.node);break;case"raMove":if(o.e.point==="append"){o.e.target.expand();} if(!o.e.target.isLoaded||o.loaded){this.dropZone.completeDrop(o.e);}else{o.e.dropNode.remove();} break;case"raAppend":case"raInsert":var id=rParams.ra_id||rParams.id;if(id){o.node.setId(id);} if(rParams.ra_text||rParams.text){o.node.setText(rParams.ra_text||rParams.text);} o.node.select();break;} this.fireEvent("remoteactionsuccess",this,o.node,action,o);},remoteActionFailure:function(response,result,context,type,action,extraParams,o){if(o.node){o.node.getUI().afterLoad();} this.fireEvent("remoteactionexception",this,response,{message:response.statusText},o);if(o.cancelWarningFailure!==true&&(this.directEventConfig||{}).showWarningFailure!==false&&!this.hasListener("remoteactionexception")){Ext.net.DirectEvent.showFailure(response,response.responseText);}},onRemoteDoPreload:function(loader,node){node.cascade(function(n){loader.doPreload(n);});},onRemoteNodeEditComplete:function(editor,value,startValue){if(editor.editNode.isNew){var insert=editor.editNode.insertAction;delete editor.editNode.isNew;delete editor.editNode.insertAction;editor.editNode.setText(value);this.appendChildRequest(editor.editNode,insert);return;} this.renameNode(editor.editNode,value);return false;},onRemoteNodeCancelEdit:function(editor,value,startValue){if(editor.editNode.isNew){editor.editNode.parentNode.removeChild(editor.editNode);}},performRemoteAction:function(config){if(config.cleanRequest){if(this.remoteJson){config.json=true;config.method="POST";} config.extraParams=Ext.apply(config.extraParams,config.raConfig);config.type="load";}else{config.serviceParams=Ext.encode(config.raConfig);} config.node.getUI().beforeLoad();Ext.net.DirectEvent.request(config);},moveNodeRequest:function(e){if(this.mode==="local"||this.localActions.indexOf("move")!==-1){return;} var dc=this.remoteOptions("raMove",e.dropNode);if(dc!==false&&this.fireEvent("beforeremotemove",this,e.dropNode,e.target,e,dc.extraParams)!==false){dc.e=e;dc.loaded=e.target.loaded||e.target.loading;dc.raConfig={id:e.dropNode.id,targetId:e.target.id,point:e.point};this.performRemoteAction(dc);}},convertText:function(text){if(text===" "){return"";} return Ext.util.Format.htmlEncode(text);},renameNode:function(node,newText){if(this.mode==="local"||this.localActions.indexOf("rename")!==-1){node.setText(newText);return;} var dc=this.remoteOptions("raRename",node);if(dc!==false&&this.fireEvent("beforeremoterename",this,node,dc.extraParams)!==false){dc.raConfig={id:node.id,newText:this.convertText(newText),oldText:this.convertText(node.text)};this.performRemoteAction(dc);}},removeNode:function(node){if(node.isRoot){return;} if(this.mode==="local"||this.localActions.indexOf("remove")!==-1){node.parentNode.removeChild(node);return;} var dc=this.remoteOptions("raRemove",node);if(dc!==false&&this.fireEvent("beforeremoteremove",this,node,dc.extraParams)!==false){dc.raConfig={id:node.id};this.performRemoteAction(dc);}},appendChildRequest:function(node,insert){if(this.mode==="local"||this.localActions.indexOf(insert?"insert":"append")!==-1){return;} var dc=this.remoteOptions("ra"+(insert?"Insert":"Append"),node);if(dc!==false&&this.fireEvent("beforeremote"+(insert?"insert":"append"),this,node,dc.extraParams,insert)!==false){dc.raConfig={id:node.id,parentId:node.parentNode.id,text:this.convertText(node.text)};this.performRemoteAction(dc);}},onNodeDragOver:function(e){if(this.allowLeafDrop){e.target.leaf=false;}},appendChild:function(parentNode,defaultText,insert,index){var node=parentNode,nodeAttr={},child;node.leaf=false;node.expand(false,false);if(Ext.isString(defaultText)){nodeAttr={text:defaultText||"",loaded:true};}else{nodeAttr=Ext.applyIf(defaultText,{text:"",loaded:true});} if(insert){var beforeNode=index?node.childNodes[index]:node.firstChild;child=node.insertBefore(this.loader.createNode(nodeAttr),beforeNode);}else{child=node.appendChild(this.loader.createNode(nodeAttr));} child.isNew=true;child.insertAction=insert;this.startEdit(child);},insertBefore:function(node,defaultText){var nodeAttr={},child;if(Ext.isString(defaultText)){nodeAttr={text:defaultText||"",loaded:true};}else{nodeAttr=Ext.applyIf(defaultText,{text:"",loaded:true});} child=node.parentNode.insertBefore(this.loader.createNode(nodeAttr),node);child.isNew=true;child.insertAction=true;this.startEdit(child);},startEdit:function(node,defer){if(typeof node==="string"){node=this.getNodeById(node);} node.select();if(this.editors){Ext.each(this.editors,function(ed){ed.beforeNodeClick(node,undefined,defer);},this);}},completeEdit:function(){if(this.editors){Ext.each(this.editors,function(ed){ed.completeEdit();},this);}},cancelEdit:function(){if(this.editors){Ext.each(this.editors,function(ed){ed.cancelEdit();},this);}},onRender:function(ct,position){Ext.net.TreePanel.superclass.onRender.call(this,ct,position);if(Ext.isEmpty(this.selectionSubmitConfig)||this.selectionSubmitConfig.disableAutomaticSubmit!==true){this.getSelectionModelField().render(this.el.parent()||this.el);this.getCheckNodesField().render(this.el.parent()||this.el);}},initEditors:function(){if(this.editors){if(!Ext.isArray(this.editors)){this.editors=[this.editors];} Ext.each(this.editors,function(editor,index){editor.tree=this;this.editors[index]=new Ext.net.TreeEditor(editor);},this);}},initChildren:function(nodes){if(!Ext.isEmpty(nodes)&&nodes.length>0){var root=nodes[0],rootNode=this.createNode(root);this.setRootNode(rootNode);if(root.children){rootNode.beginUpdate();this.setChildren(root,rootNode);rootNode.endUpdate();}}},setChildren:function(parent,node){var i=0;for(i;i0){this.removeChild(this.childNodes[0]);}},clone:function(newId){var atts=this.attributes;atts.id=(newId!==false)?Ext.id():this.id;var clonedNode=new Ext.tree.TreeNode(Ext.apply({},atts)),i=0;clonedNode.text=this.text;for(i;i=0){tab=this.insert(config.index,tab);}else{tab=this.add(tab);} if(config.activate!==false){this.setActiveTab(tab);}}}); Ext.override(Ext.ColorPalette,{silentSelect:function(color){color=color.replace("#","");if(color!==this.value||this.allowReselect){var el=this.el;if(this.value){el.child("a.color-"+this.value).removeClass("x-color-palette-sel");} if(!Ext.isEmpty(color,false)){el.child("a.color-"+color).addClass("x-color-palette-sel");}else{color=null;} this.value=color;}},getColorField:function(){if(!this.colorField){this.colorField=new Ext.form.Hidden({id:this.id+"_Color",name:this.id+"_Color"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.colorField);} return this.colorField;}});Ext.ColorPalette.prototype.onRender=Ext.ColorPalette.prototype.onRender.createSequence(function(el){this.on("select",function(cp,color){this.getColorField().setValue(color);});this.getColorField().render(this.el.parent()||this.el);}); Ext.DatePicker.prototype.initComponent=Ext.DatePicker.prototype.initComponent.createSequence(function(){var fn=function(){this.getInputField().setValue(this.getValue().dateFormat("Y-m-d\\Th:i:s"));};this.on("render",fn,this);this.on("select",fn,this);});Ext.DatePicker.prototype.onRender=Ext.DatePicker.prototype.onRender.createSequence(function(el){this.getInputField().render(this.el.parent()||this.el);this.initValue();this.setReadOnly(this.readOnly);});Ext.DatePicker.override({readOnly:false,hideWithLabel:true,isFormField:true,getName:Ext.form.Field.prototype.getName,initValue:Ext.form.Field.prototype.initValue,isDirty:Ext.form.Field.prototype.isDirty,reset:Ext.form.Field.prototype.reset,isValid:Ext.form.Field.prototype.isValid,validate:Ext.form.Field.prototype.validate,processValue:Ext.form.Field.prototype.processValue,validateValue:Ext.form.Field.prototype.validateValue,getErrors:Ext.form.Field.prototype.getErrors,clearInvalid:Ext.emptyFn,markInvalid:Ext.emptyFn,getRawValue:Ext.form.Field.prototype.getValue,setRawValue:Ext.form.Field.prototype.setValue,getReadOnly:Ext.form.Field.prototype.getReadOnly,adjustWidth:Ext.form.Field.prototype.adjustWidth,hideNote:Ext.form.Field.prototype.hideNote,showNote:Ext.form.Field.prototype.showNote,hideFieldLabel:Ext.form.Field.prototype.hideFieldLabel,showFieldLabel:Ext.form.Field.prototype.showFieldLabel,initNote:Ext.form.Field.prototype.initNote,getInputField:function(){if(!this.inputField){this.inputField=new Ext.form.Hidden({id:this.id+"_Input",name:this.id+"_Input"});this.on("beforedestroy",function(){if(this.rendered){this.destroy();}},this.inputField);} return this.inputField;},setReadOnly:function(readOnly){if(this.rendered){this.el.dom.readOnly=readOnly;} this.readOnly=readOnly;this.doDisabled(readOnly);},setDisabledDates:function(dd){if(Ext.isArray(dd)){this.disabledDates=dd;this.disabledDatesRE=null;}else{this.disabledDatesRE=dd;this.disabledDates=null;} this.initDisabledDays();this.update(this.value,true);},update:function(date,forceRefresh){if(this.rendered){var vd=this.activeDate,vis=this.isVisible();this.activeDate=date;if(!forceRefresh&&vd&&this.el){var t=date.getTime();if(vd.getMonth()==date.getMonth()&&vd.getFullYear()==date.getFullYear()){this.cells.removeClass('x-date-selected');this.cells.each(function(c){if(c.dom.firstChild.dateValue==t){c.addClass('x-date-selected');if(vis&&!this.cancelFocus){Ext.fly(c.dom.firstChild).focus(50);} return false;}},this);return;}} var days=date.getDaysInMonth(),firstOfMonth=date.getFirstDateOfMonth(),startingPos=firstOfMonth.getDay()-this.startDay;if(startingPos<0){startingPos+=7;} days+=startingPos;date=date.clone();date.setHours(1);var pm=date.add('mo',-1),prevStart=pm.getDaysInMonth()-startingPos,cells=this.cells.elements,textEls=this.textNodes,d=(new Date(pm.getFullYear(),pm.getMonth(),prevStart,this.initHour)),today=new Date(),sel=date.clearTime(true).getTime(),min=this.minDate?this.minDate.clearTime(true):Number.NEGATIVE_INFINITY,max=this.maxDate?this.maxDate.clearTime(true):Number.POSITIVE_INFINITY,ddMatch=this.disabledDatesRE,ddText=this.disabledDatesText,ddays=this.disabledDays?this.disabledDays.join(''):false,ddaysText=this.disabledDaysText,format=this.format;if(this.showToday){var td=new Date().clearTime(),disable=(tdmax||(ddMatch&&format&&ddMatch.test(td.dateFormat(format)))||(ddays&&ddays.indexOf(td.getDay())!=-1));if(!this.disabled){this.todayBtn.setDisabled(disable);this.todayKeyListener[disable?'disable':'enable']();}} var setCellClass=function(cal,cell){cell.title='';var t=d.clearTime(true).getTime();cell.firstChild.dateValue=t;if(t==today){cell.className+=' x-date-today';cell.title=cal.todayText;} if(t==sel){cell.className+=' x-date-selected';if(vis){Ext.fly(cell.firstChild).focus(50);}} if(tmax){cell.className=' x-date-disabled';cell.title=cal.maxText;return;} if(ddays){if(ddays.indexOf(d.getDay())!=-1){cell.title=ddaysText;cell.className=' x-date-disabled';}} if(ddMatch&&format){var fvalue=d.dateFormat(format);if(ddMatch.test(fvalue)){cell.title=ddText.replace('%0',fvalue);cell.className=' x-date-disabled';}}};var i=0;for(;i=0?href.substr(i+1):null;if(Ext.isGecko){hash=decodeURIComponent(hash);} return hash;} var doSave=function(){hiddenField.value=currentToken;};var handleStateChange=function(token){currentToken=token;Ext.History.fireEvent("change",token);};var updateIFrame=function(token){var html=['
',Ext.util.Format.htmlEncode(token),"
"].join("");try{var doc=iframe.contentWindow.document;doc.open();doc.write(html);doc.close();return true;}catch(e){return false;}};var checkIFrame=function(){if(!iframe.contentWindow||!iframe.contentWindow.document){setTimeout(checkIFrame,10);return;} var doc=iframe.contentWindow.document;var elem=doc.getElementById("state");var token=elem?elem.innerText:null;var hash=getHash();setInterval(function(){doc=iframe.contentWindow.document;elem=doc.getElementById("state");var newtoken=elem?elem.innerText:null;var newHash=getHash();if(newtoken!==token){token=newtoken;handleStateChange(token);top.location.hash=token;hash=token;doSave();}else if(newHash!==hash){hash=newHash;updateIFrame(newHash);}},50);ready=true;Ext.History.fireEvent("ready",Ext.History);};var startUp=function(){currentToken=hiddenField.value?hiddenField.value:getHash();if(Ext.isIE6||Ext.isIE7||!Ext.isStrict&&Ext.isIE8){checkIFrame();}else{var hash=getHash();setInterval(function(){var newHash=getHash();if(newHash!==hash){hash=newHash;handleStateChange(hash);doSave();}},50);ready=true;Ext.History.fireEvent("ready",Ext.History);}};return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(onReady,scope){if(this.listeners){this.on(this.listeners);delete this.listeners;} if(ready){Ext.callback(onReady,scope,[this]);return;} if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(onReady,scope);});return;} hiddenField=Ext.getDom(Ext.History.fieldId);if(Ext.isIE6||Ext.isIE7||!Ext.isStrict&&Ext.isIE8){iframe=Ext.getDom(Ext.History.iframeId);} this.addEvents("ready","change");if(onReady){this.on("ready",onReady,scope,{single:true});} startUp();},add:function(token,preventDup){if(preventDup!==false){if(this.getToken()==token){return true;}} if(Ext.isIE6||Ext.isIE7||!Ext.isStrict&&Ext.isIE8){return updateIFrame(token);}else{top.location.hash=token;return true;}},back:function(){history.go(-1);},forward:function(){history.go(1);},getToken:function(){return ready?currentToken:getHash();}};})();Ext.apply(Ext.History,new Ext.util.Observable()); Ext.net.Notification=function(){Ext.MessageBox.notify=function(title,msg){if(Ext.isString(title)){Ext.net.Notification.show({title:title,html:msg||""});}else{Ext.net.Notification.show(title);}};var notifications=[];return{show:function(config){config=Ext.applyIf(config||{},{width:200,height:100,autoHide:true,plain:false,resizable:false,draggable:false,bodyStyle:"padding:3px;text-align:center",alignToCfg:{el:document,position:"br-br",offset:[-20,-20]},showMode:"grid",closeVisible:false,bringToFront:false,pinEvent:"none",hideDelay:2500,shadow:false,showPin:false,pinned:false,showFx:{fxName:"slideIn",args:["b",{duration:1}]},hideFx:{fxName:"ghost",args:["b",{duration:1}]},focus:Ext.emptyFn,stopHiding:function(){this.removeClass("x-notification-auto-hide");this.pinned=true;if(this.autoHide){this.hideTask.cancel();}},isStandardAlign:function(){return this.alignToCfg.el==document&&this.alignToCfg.position==="br-br";},getStatndardAlign:function(){var w=[],i=0;for(i;i=0&&!found){while(yPos>=0&&!found){var intersect=false,i=0;for(i;i0){this.showFx.args[this.showFx.args.length-1]=Ext.apply(this.showFx.args[this.showFx.args.length-1],{callback:this.afterShow,scope:this});}else{this.showFx.args=[{callback:this.afterShow,scope:this}];} this.el[this.showFx.fxName].apply(this.el,this.showFx.args);},animHide:function(){if(Ext.isArray(this.hideFx.args)&&this.hideFx.args.length>0){this.hideFx.args[this.hideFx.args.length-1]=Ext.apply(this.hideFx.args[this.hideFx.args.length-1],{callback:this.doClose,scope:this});}else{this.showFx.args=[{callback:this.doClose,scope:this}];} this.el[this.hideFx.fxName].apply(this.el,this.hideFx.args);}});config.cls=config.cls||"";config.cls+=" x-notification"+(config.autoHide?" x-notification-auto-hide":"");var w=new Ext.Window(config),mOver=function(e,t){if(!this.pinned){this.hideTask.cancel();this.delayed=true;}},mOut=function(e,t){if(!this.pinned){this.hideTask.delay(this.hideDelay);this.delayed=false;}};w.on("render",function(){if(this.autoHide){this.body.on("mouseover",mOver,this);this.body.on("mouseout",mOut,this);this.header.on("mouseover",mOver,this);this.header.on("mouseout",mOut,this);} if(this.contentEl){Ext.fly(this.contentEl).removeClass("x-hide-offsets");}},w);w.afterRender=w.afterRender.createSequence(function(){if(this.showPin){this.pin=function(e,tool){tool.hide();this.tools.pin.show();this.hideTask.cancel();this.pinned=true;};this.unpin=function(e,tool){tool.hide();this.tools.unpin.show();this.hide();this.pinned=false;};this.addTool({id:"unpin",handler:this.pin,hidden:this.pinned,scope:this});this.addTool({id:"pin",handler:this.unpin,hidden:!this.pinned,scope:this});}});w.toFront=function(e){var aw=Ext.WindowMgr.getActive();this.manager.bringToFront(this);if(!Ext.isEmpty(aw)&&aw!==this&&!this.bringToFront&&aw.manager){aw.manager.bringToFront(aw);aw.manager.bringToFront.defer(10,aw.manager,[aw]);} return this;};w.focus=Ext.emptyFn;w.afterShow=w.afterShow.createSequence(function(){if(this.pinEvent!=="none"){this.body.on(this.pinEvent,this.stopHiding,this);this.on(this.pinEvent,this.stopHiding,this);} if(this.autoHide&&!this.delayed&&!this.pinned){this.hideTask.delay(this.hideDelay);}});w.on("beforedestroy",function(){var i=0;for(i;i=0;i--){notifications[i].destroy();}} w.on("beforehide",function(){this.el.disableShadow();},w);w.show(config.alignToCfg.el||document);return w;}};}(); Ext.net.TaskResponse={stopTask:-1,stopAjax:-2};Ext.net.TaskManager=function(config){Ext.apply(this,config||{});this.initManager.defer(this.autoRunDelay||50,this);};Ext.extend(Ext.net.TaskManager,Ext.util.Observable,{tasksConfig:[],getTasks:function(){return this.tasks;},initManager:function(){this.runner=new Ext.util.TaskRunner(this.interval||10);var task,i=0;this.tasks=[];for(i;ithis.tolerance||Math.abs(s[1]-xy[1])>this.tolerance){this.triggerStart(e);}else{return;}} this.fireEvent('mousemove',this,e);this.onDrag(e);this.fireEvent('drag',this,e);}});Ext.net.DragTracker=function(config){Ext.net.DragTracker.superclass.constructor.call(this,config);};Ext.extend(Ext.net.DragTracker,Ext.dd.DragTracker,{proxyCls:"x-view-selector",onStart:function(xy){if(!this.proxy){this.proxy=this.el.createChild({cls:this.proxyCls});}else{this.proxy.setDisplayed("block");}},onDrag:function(e){var startXY=this.startXY,xy=this.getXY(),x=Math.min(startXY[0],xy[0]),y=Math.min(startXY[1],xy[1]),w=Math.abs(startXY[0]-xy[0]),h=Math.abs(startXY[1]-xy[1]);this.dragRegion.left=x;this.dragRegion.top=y;this.dragRegion.right=x+w;this.dragRegion.bottom=y+h;this.proxy.setRegion(this.dragRegion);},onEnd:function(e){if(this.proxy){this.proxy.setDisplayed(false);}}});Ext.lib.Region.prototype.isIntersect=function(region){var t=Math.max(this.top,region.top),r=Math.min(this.right,region.right),b=Math.min(this.bottom,region.bottom),l=Math.max(this.left,region.left);return b>=t&&r>=l;}; (function(){var buf=[];if(!Ext.isIE6){buf.push(".x-form-radio-group .x-panel-body,.x-form-check-group .x-panel-body{background-color:transparent;} .x-form-cb-label-nowrap{white-space:nowrap;} .x-form-cb-label-nowrap .x-form-item-label{white-space:normal;}.x-label-icon{width:16px;height:16px;margin-left:3px;margin-right:3px;vertical-align:middle;border:0px !important;}.x-label-value{vertical-align:middle;}");} if(Ext.isIE6){buf.push(".x-label-icon{width:16px;height:16px;vertical-align:middle;}");buf.push(".ext-ie6 .x-toolbar .x-tab-panel div{font-size:1px;}");buf.push(".ext-ie6 .x-grid-editor .x-form-text {top:0px !important;}");buf.push(".ext-ie6 .x-form-field-wrap.x-form-field-trigger-wrap{padding-bottom:1px;}");buf.push(".ext-ie6 .x-form-element .x-form-field-wrap.x-form-field-trigger-wrap{padding-bottom:0px;}");buf.push(".x-layout-split{background-color:transparent;} .ext-strict .ext-ie6 .x-layout-split{background-color:transparent!important;filter:none;}");buf.push(".ext-ie6 .x-form-group .x-form-group-header-text {margin-left:0px !important;left:5px;}");} if(Ext.isIE7){buf.push(".ext-ie7 .x-tree-editor .x-form-text{margin: 0px 0px !important;}");buf.push(".ext-ie7 .x-toolbar .x-tab-panel div{font-size:1px;}");buf.push(".ext-ie7 .x-grid3 .x-grid-editor .x-form-text {top:0px !important;margin-top:0px !important;}");} if(Ext.isIE){buf.push(".ext-ie .x-form-check-wrap.x-item-disabled{filter:none;}");buf.push(".ext-ie .x-item-disabled.x-box-item{filter: none;}");buf.push(".ext-ie .x-fieldset LEGEND{margin-bottom:0px;}");} buf.push(".ext-ie6 .x-form-field-trigger-wrap .x-form-text, .ext-ie7 .x-form-field-trigger-wrap .x-form-text{margin-bottom: -2px;}");buf.push(".ext-ie6 .x-form-item .x-form-field-trigger-wrap .x-form-text, .ext-ie7 .x-form-item .x-form-field-trigger-wrap .x-form-text{margin-bottom: -1px;} ");buf.push(".ext-ie8 .x-toolbar-cell .x-form-field-trigger-wrap .x-form-text{top:0px;}");buf.push(".x-textfield-icon{background-repeat:no-repeat;background-position:0 50%;width:16px;height:16px;margin-left:1px;}.x-textfield-icon-input{padding-left:20px;}.x-form-field-wrap .x-textfield-icon{top:3px;left:2px;}");buf.push("input.x-tree-node-cb{margin-left:1px;height:18px;vertical-align:bottom;}.x-tree-node .x-tree-node-inline-icon{background:transparent;height:16px !important;}.x-field-note{font-size:12px;color:gray;}.x-field-multi{float:left;padding-right:3px;position:relative;}div.x-inline-toolbar{padding:0px !important;border:0px !important;background-color:transparent !important;background-image:none !important;}");buf.push(".x-grid3 .x-row-expander-control TABLE{table-layout: auto;} .x-grid3 .x-row-expander-control TABLE.x-grid3-row-table, .x-grid3 .x-row-expander-control .x-grid3-header-offset table {table-layout:fixed;} .x-fieldset.x-form-invalid{border-color:#c30;}");buf.push(".ext-ie6 ul.x-menu-list li.x-menu-sep-li{height:5px !important;}");buf.push(".x-form-item.x-form-label-top label.x-form-item-label{width:auto;float:none;clear:none;display:inline;margin-bottom:4px;position:static;}");buf.push(".x-menu-field-icon{top:auto;margin-top:3px;margin-left:3px;}");buf.push(".x-toolbar-classic .x-btn-tl{background-position:0 0} .x-toolbar-classic .x-btn-tr{background-position:-3px 0} .x-toolbar-classic .x-btn-tc{background-position:0 -6px} .x-toolbar-classic .x-btn-ml{background-position:0 -24px} .x-toolbar-classic .x-btn-mr{background-position:-3px -24px} .x-toolbar-classic .x-btn-mc{background-position:0 -1096px} .x-toolbar-classic .x-btn-bl{background-position:0 -3px} .x-toolbar-classic .x-btn-br{background-position:-3px -3px} .x-toolbar-classic .x-btn-bc{background-position:0 -15px}");buf.push(".x-table-layout-cell{vertical-align:top;}");buf.push(".x-form-field-wrap.x-top-note .x-form-trigger{top:auto;}");buf.push(".x-btn-no-arrow{padding-right:0px !important;background:none !important;}");buf.push(".x-form-indicator{height:18px;position:absolute;left:0;top:0;display:block;background-color: transparent;background-repeat:no-repeat;background-position:0 3px;padding-top:3px;}");buf.push(".x-column-layout-ct {overflow:hidden;zoom:1;}");buf.push(".x-column-layout-bg-ct, .x-column-layout-bg-ct .x-column-inner {background-color:#f0f0f0;}");buf.push(".x-theme-blue .x-column-layout-bg-ct, .blue .x-column-layout-bg-ct .x-column-inner {background-color:#dfe8f6;}");buf.push(".x-fieldset.x-column{padding:10px;padding-top:0px;}");buf.push(".x-top-note-label{margin-top:14px;}");buf.push(".x-form-item .x-form-element .x-form-display-field{padding-top:3px;}");buf.push(".ux-layout-center-item{margin:0 auto;text-align:left;}");buf.push(".x-form-field-wrap .x-form-text.clear-right{border-right:0px !important} .x-form-field-wrap img.shift-trigger{margin-left:-1px !important}");buf.push(".x-combo-list-item{border: 1px dotted white;} .x-multi-selected{border: 1px dotted black;cursor:pointer;} .x-mcombo-nimg-item img {height:16px;width:0px;float:left;} .x-mcombo-img-item img {width:16px;height:16px;float:left;background-color: transparent; background-position: -1px -1px !important; background-repeat:no-repeat !important;}");buf.push(".ux-editable-grid{padding:0;}");buf.push(".x-notification-auto-hide .x-tool-close{display:none !important}");buf.push(".x-grid3-row-expanded .x-grid3-row-expander {background-position:-21px 2px;} .x-grid3-row-collapsed .x-grid3-row-expander {background-position:4px 2px;} .x-grid3-row-expanded .x-grid3-row-body {display:block !important;} .x-grid3-row-collapsed .x-grid3-row-body {display:none !important;}");buf.push(".x-form-invalid.x-form-composite{background-color:transparent !important;}");buf.push(".x-form-file-wrap.x-box-item{position:absolute;}");buf.push(".x-fieldset{padding-top: 0px !important;}");if(Ext.isIE9){buf.push(".ext-ie input.x-tree-node-cb, .ext-strict .ext-ie9 .ext-ie input.x-tree-node-cb, .ext-ie9 .x-form-check-wrap input {width:auto;height:auto;}");} if(Ext.isIE7&&(document.documentMode===7||document.documentMode===5)){buf.push(".ext-ie7 .x-form-text{margin-top: 0px;}");} buf.push(".ext-shim{background-color:#cccccc;}");buf.push(".x-tab-strip-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;}");Ext.net.ResourceMgr.registerCssClass("Ext.Net.CSS",buf.join(""));Ext._stringFormat=String.format;Ext.onReady(function(){String.format=Ext._stringFormat;});if(typeof Sys!=="undefined"){Sys.Application.notifyScriptLoaded();}})(); } /* playback timings (ms): captures_list: 894.083 exclusion.robots: 0.122 exclusion.robots.policy: 0.113 RedisCDXSource: 10.732 esindex: 0.009 LoadShardBlock: 861.451 (3) PetaboxLoader3.resolve: 785.438 (4) PetaboxLoader3.datanode: 758.282 (5) CDXLines.iter: 18.952 (3) load_resource: 1091.845 (2) */