From a3073c44e2d0e8ef70528e21d223fd364831a1af Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 25 Aug 2015 16:18:02 +0100 Subject: [PATCH] Update minify script to use closure --- deluge/ui/web/js/extjs/ext-extensions.js | 84 +++++++++++++++++++++++- minify_web_js.py | 18 +++-- 2 files changed, 96 insertions(+), 6 deletions(-) diff --git a/deluge/ui/web/js/extjs/ext-extensions.js b/deluge/ui/web/js/extjs/ext-extensions.js index 6e2e7cab1..412d4c633 100644 --- a/deluge/ui/web/js/extjs/ext-extensions.js +++ b/deluge/ui/web/js/extjs/ext-extensions.js @@ -1 +1,83 @@ -Ext.ns('Ext.ux.form');Ext.ux.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:'Browse...',buttonOnly:false,buttonOffset:3,readOnly:true,autoSize:Ext.emptyFn,initComponent:function(){Ext.ux.form.FileUploadField.superclass.initComponent.call(this);this.addEvents('fileselected');},onRender:function(ct,position){Ext.ux.form.FileUploadField.superclass.onRender.call(this,ct,position);this.wrap=this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});this.el.addClass('x-form-file-text');this.el.dom.removeAttribute('name');this.createFileInput();var btnCfg=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(btnCfg,{renderTo:this.wrap,cls:'x-form-file-btn'+(btnCfg.iconCls?' x-btn-icon':'')}));if(this.buttonOnly){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;this.setValue(v);this.fireEvent('fileselected',this,v);}});},createFileInput:function(){this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:'x-form-file',tag:'input',type:'file',size:1});},reset:function(){if(this.rendered){this.fileInput.remove();this.createFileInput();this.bindListeners();}Ext.ux.form.FileUploadField.superclass.reset.call(this);},getFileInputId:function(){return this.id+'-file';},onResize:function(w,h){Ext.ux.form.FileUploadField.superclass.onResize.call(this,w,h);this.wrap.setWidth(w);if(!this.buttonOnly){var w=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset;this.el.setWidth(w);}},onDestroy:function(){Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);Ext.destroy(this.fileInput,this.button,this.wrap);},onDisable:function(){Ext.ux.form.FileUploadField.superclass.onDisable.call(this);this.doDisable(true);},onEnable:function(){Ext.ux.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]);}});Ext.reg('fileuploadfield',Ext.ux.form.FileUploadField);Ext.form.FileUploadField=Ext.ux.form.FileUploadField;Ext.override(Ext.form.RadioGroup,{afterRender:function(){this.items.each(function(i){this.relayEvents(i,['check']);},this);if(this.lazyValue){this.setValue(this.value);delete this.value;delete this.lazyValue;}Ext.form.RadioGroup.superclass.afterRender.call(this);},getName:function(){return this.items.first().getName();},getValue:function(){return this.items.first().getGroupValue();},setValue:function(v){if(!this.items.each){this.value=v;this.lazyValue=true;return;}this.items.each(function(item){if(item.rendered){var checked=(item.el.getValue()==String(v));item.el.dom.checked=checked;item.el.dom.defaultChecked=checked;item.wrap[checked?'addClass':'removeClass'](item.checkedCls);}});}});Ext.ns('Ext.ux.form');Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:'wrap',deferHeight:true,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(config){var spinnerConfig=Ext.copyTo({},config,'incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass');var spl=this.spinner=new Ext.ux.Spinner(spinnerConfig);var plugins=config.plugins?(Ext.isArray(config.plugins)?config.plugins.push(spl):[config.plugins,spl]):spl;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(config,{plugins:plugins}));},getResizeEl:function(){return this.wrap;},getPositionEl:function(){return this.wrap;},alignErrorIcon:function(){if(this.wrap)this.errorIcon.alignTo(this.wrap,'tl-tr',[2,0]);},validateBlur:function(){return true;}});Ext.reg('spinnerfield',Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.override(Ext.ux.form.SpinnerField,{onBlur:Ext.form.Field.prototype.onBlur});Ext.ns('Ext.ux.form');Ext.ux.form.SpinnerGroup=Ext.extend(Ext.form.CheckboxGroup,{defaultType:'spinnerfield',anchor:'98%',groupCls:'x-form-spinner-group',colCfg:{},onRender:function(ct,position){if(!this.el){var panelCfg={cls:this.groupCls,layout:'column',border:false,renderTo:ct};var colCfg=Ext.apply({defaultType:this.defaultType,layout:'form',border:false,labelWidth:60,defaults:{hideLabel:true,anchor:'60%'}},this.colCfg);if(this.items[0].items){Ext.apply(panelCfg,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var i=0,len=this.items.length;i0&&i%rows==0)ri++;if(this.items[i].fieldLabel)this.items[i].hideLabel=false;cols[ri].items.push(this.items[i]);};}else{for(var i=0,len=this.items.length;i');ts.rowHolder.disableFormats=true;ts.rowHolder.compile();ts.rowBody=new Ext.Template('','{cells}',(this.enableRowBody?'':''),'
{body}
');ts.rowBody.disableFormats=true;ts.rowBody.compile();},getStyleRowHeight:function(){return Ext.isBorderBox?(this.rowHeight+this.borderHeight):this.rowHeight;},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight;},getVisibleRowCount:function(){var rh=this.getCalculatedRowHeight(),visibleHeight=this.scroller.dom.clientHeight;return(visibleHeight<1)?0:Math.ceil(visibleHeight/rh);},getVisibleRows:function(){var count=this.getVisibleRowCount(),sc=this.scroller.dom.scrollTop,start=(sc===0?0:Math.floor(sc/this.getCalculatedRowHeight())-1);return{first:Math.max(start,0),last:Math.min(start+count+2,this.ds.getCount()-1)};},doRender:function(cs,rs,ds,startRow,colCount,stripe,onlyBody){var ts=this.templates,ct=ts.cell,rt=ts.row,rb=ts.rowBody,last=colCount-1,rh=this.getStyleRowHeight(),vr=this.getVisibleRows(),tstyle='width:'+this.getTotalWidth()+';height:'+rh+'px;',buf=[],cb,c,p={},rp={tstyle:tstyle},r;for(var j=0,len=rs.length;j=vr.first&&rowIndex<=vr.last;if(visible)for(var i=0;i0;},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update();},update:function(){if(this.scrollDelay){if(!this.renderTask)this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this);this.renderTask.delay(this.scrollDelay);}else this.doUpdate();},onRemove:function(ds,record,index,isUpdate){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);if(isUpdate!==true)this.update();},doUpdate:function(){if(this.getVisibleRowCount()>0){var g=this.grid,cm=g.colModel,ds=g.store,cs=this.getColumnData(),vr=this.getVisibleRows(),row;for(var i=vr.first;i<=vr.last;i++)if(!this.isRowRendered(i)&&(row=this.getRow(i))){var html=this.doRender(cs,[ds.getAt(i)],ds,i,cm.getColumnCount(),g.stripeRows,true);row.innerHTML=html;}this.clean();}},clean:function(){if(!this.cleanTask)this.cleanTask=new Ext.util.DelayedTask(this.doClean,this);this.cleanTask.delay(this.cleanDelay);},doClean:function(){if(this.getVisibleRowCount()>0){var vr=this.getVisibleRows();vr.first-=this.cacheSize;vr.last+=this.cacheSize;var i=0,rows=this.getRows();if(vr.first<=0)i=vr.last+1;for(var len=this.ds.getCount();ivr.last)&&rows[i].innerHTML)rows[i].innerHTML='';}},removeTask:function(name){var task=this[name];if(task&&task.cancel){task.cancel();this[name]=null;}},destroy:function(){this.removeTask('cleanTask');this.removeTask('renderTask');Ext.ux.grid.BufferView.superclass.destroy.call(this);},layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update();}});Ext.override(Ext.layout.FormLayout,{renderItem:function(c,position,target){if(c&&!c.rendered&&(c.isFormField||c.fieldLabel)&&c.inputType!='hidden'){var args=this.getTemplateArgs(c);if(typeof position=='number')position=target.dom.childNodes[position]||null;if(position)c.formItem=this.fieldTpl.insertBefore(position,args,true);else c.formItem=this.fieldTpl.append(target,args,true);c.actionMode='formItem';c.render('x-form-el-'+c.id);c.container=c.formItem;c.actionMode='container';}else Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments);}});Ext.override(Ext.tree.MultiSelectionModel,{onNodeClick:function(node,e){if(e.ctrlKey&&this.isSelected(node))this.unselect(node);else if(e.shiftKey&&!this.isSelected(node)){var parentNode=node.parentNode;if(this.lastSelNode.parentNode.id!=parentNode.id)return;var fi=parentNode.indexOf(node),li=parentNode.indexOf(this.lastSelNode);this.select(this.lastSelNode,e,false,true);if(fi>li)fi=fi+li,li=fi-li,fi=fi-li;parentNode.eachChild(function(n){var i=parentNode.indexOf(n);if(fi','
','
','','','','','','
','
',this.enableHdMenu?'':'','{header}','
','
','
','','
','
','
');if(!this.colgroupTpl)this.colgroupTpl=new Ext.XTemplate('');},initColumns:function(){var cs=this.columns,len=cs.length,columns=[],i,c;for(i=0;i10))this.setScrollOffset(sw);else{var me=this;setTimeout(function(){me.setScrollOffset(bd.offsetWidth-bd.clientWidth>10?sw:0);},10);}}},updateColumnWidths:function(){var cols=this.columns,colCount=cols.length,groups=this.outerCt.query('colgroup'),groupCount=groups.length,c,g,i,j;for(i=0;i0&&this.columns[index])this.setColumnVisible(index,!item.checked);}return true;},setColumnVisible:function(index,visible){this.columns[index].hidden=!visible;this.updateColumnWidths();},scrollToTop:function(){this.innerBody.dom.scrollTop=0;this.innerBody.dom.scrollLeft=0;},syncScroll:function(){this.syncHeaderScroll();var mb=this.innerBody.dom;this.fireEvent('bodyscroll',mb.scrollLeft,mb.scrollTop);},syncHeaderScroll:function(){var mb=this.innerBody.dom;this.innerHd.dom.scrollLeft=mb.scrollLeft;this.innerHd.dom.scrollLeft=mb.scrollLeft;},registerNode:function(n){Ext.ux.tree.TreeGrid.superclass.registerNode.call(this,n);if(!n.uiProvider&&!n.isRoot&&!n.ui.isTreeGridNodeUI)n.ui=new Ext.ux.tree.TreeGridNodeUI(n);}});Ext.reg('treegrid',Ext.ux.tree.TreeGrid);Ext.tree.ColumnResizer=Ext.extend(Ext.util.Observable,{minWidth:14,constructor:function(config){Ext.apply(this,config);Ext.tree.ColumnResizer.superclass.constructor.call(this);},init:function(tree){this.tree=tree;tree.on('render',this.initEvents,this);},initEvents:function(tree){tree.mon(tree.innerHd,'mousemove',this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(tree.innerHd);tree.on('beforedestroy',this.tracker.destroy,this.tracker);},handleHdMove:function(e,t){var hw=5,x=e.getPageX(),hd=e.getTarget('.x-treegrid-hd',3,true);if(hd){var r=hd.getRegion(),ss=hd.dom.style,pn=hd.dom.parentNode;if(x-r.left<=hw&&hd.dom!==pn.firstChild){var ps=hd.dom.previousSibling;while(ps&&Ext.fly(ps).hasClass('x-treegrid-hd-hidden'))ps=ps.previousSibling;if(ps){this.activeHd=Ext.get(ps);ss.cursor=Ext.isWebKit?'e-resize':'col-resize';}}else if(r.right-x<=hw){var ns=hd.dom;while(ns&&Ext.fly(ns).hasClass('x-treegrid-hd-hidden'))ns=ns.previousSibling;if(ns){this.activeHd=Ext.get(ns);ss.cursor=Ext.isWebKit?'w-resize':'col-resize';}}else{delete this.activeHd;ss.cursor='';}}},onBeforeStart:function(e){this.dragHd=this.activeHd;return !!this.dragHd;},onStart:function(e){this.dragHeadersDisabled=this.tree.headersDisabled;this.tree.headersDisabled=true;this.proxy=this.tree.body.createChild({cls:'x-treegrid-resizer'});this.proxy.setHeight(this.tree.body.getHeight());var x=this.tracker.getXY()[0];this.hdX=this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(x-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left;},onDrag:function(e){var cursorX=this.tracker.getXY()[0];this.proxy.setWidth((cursorX-this.hdX).constrain(this.minWidth,this.maxWidth));},onEnd:function(e){var nw=this.proxy.getWidth(),tree=this.tree,disabled=this.dragHeadersDisabled;this.proxy.remove();delete this.dragHd;tree.columns[this.hdIndex].width=nw;tree.updateColumnWidths();setTimeout(function(){tree.headersDisabled=disabled;},100);}});(function(){Ext.override(Ext.list.Column,{init:function(){var types=Ext.data.Types,st=this.sortType;if(this.type){if(Ext.isString(this.type))this.type=Ext.data.Types[this.type.toUpperCase()]||types.AUTO;}else this.type=types.AUTO;if(Ext.isString(st))this.sortType=Ext.data.SortTypes[st];else if(Ext.isEmpty(st))this.sortType=this.type.sortType;}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=Ext.extend(Ext.list.BooleanColumn,{});Ext.reg('tgcolumn',Ext.tree.Column);Ext.reg('tgnumbercolumn',Ext.tree.NumberColumn);Ext.reg('tgdatecolumn',Ext.tree.DateColumn);Ext.reg('tgbooleancolumn',Ext.tree.BooleanColumn);})();Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(attr){if(!attr.uiProvider)attr.uiProvider=Ext.ux.tree.TreeGridNodeUI;return Ext.tree.TreeLoader.prototype.createNode.call(this,attr);}});Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,renderElements:function(n,a,targetNode,bulkRender){var t=n.getOwnerTree(),cols=t.columns,c=cols[0],i,buf,len;this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';buf=['','','','',this.indentMarkup,"",'','','','',(c.tpl?c.tpl.apply(a):a[c.dataIndex]||c.text),'',''];for(i=1,len=cols.length;i','
',(c.tpl?c.tpl.apply(a):a[c.dataIndex]),'
','');}buf.push('','');for(i=0,len=cols.length;i');buf.push('');if(bulkRender!==true&&n.nextSibling&&n.nextSibling.ui.getEl())this.wrap=Ext.DomHelper.insertHtml("beforeBegin",n.nextSibling.ui.getEl(),buf.join(''));else this.wrap=Ext.DomHelper.insertHtml("beforeEnd",targetNode,buf.join(''));this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;var cs=this.elNode.firstChild.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];this.anchor=cs[3];this.textNode=cs[3].firstChild;},animExpand:function(cb){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this,cb);}});Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,render:function(){if(!this.rendered){this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom;this.node.expanded=true;}if(Ext.isWebKit){var ct=this.ctNode;ct.style.tableLayout=null;(function(){ct.style.tableLayout='fixed';}).defer(1);}},destroy:function(){if(this.elNode)Ext.dd.Registry.unregister(this.elNode.id);delete this.node;},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.override(Ext.ux.tree.TreeGridNodeUI,{updateColumns:function(){if(!this.rendered)return;var a=this.node.attributes,t=this.node.getOwnerTree(),cols=t.columns,c=cols[0];this.anchor.firstChild.innerHTML=(c.tpl?c.tpl.apply(a):a[c.dataIndex]||c.text);for(i=1,len=cols.length;iv2)return desc?-1:+1;else return 0;};tree.on('afterrender',this.onAfterTreeRender,this,{single:true});tree.on('headermenuclick',this.onHeaderMenuClick,this);},onAfterTreeRender:function(){if(this.tree.hmenu)this.tree.hmenu.insert(0,{itemId:'asc',text:this.sortAscText,cls:'xg-hmenu-sort-asc'},{itemId:'desc',text:this.sortDescText,cls:'xg-hmenu-sort-desc'});this.updateSortIcon(0,'asc');},onHeaderMenuClick:function(c,id,index){if(id==='asc'||id==='desc'){this.onHeaderClick(c,null,index);return false;}},onHeaderClick:function(c,el,i){if(c&&!this.tree.headersDisabled){var me=this;me.property=c.dataIndex;me.dir=c.dir=(c.dir==='desc'?'asc':'desc');me.sortType=c.sortType;me.caseSensitive===Ext.isBoolean(c.caseSensitive)?c.caseSensitive:this.caseSensitive;me.sortFn=c.sortFn||this.defaultSortFn;this.tree.root.cascade(function(n){if(!n.isLeaf())me.updateSort(me.tree,n);});this.updateSortIcon(i,c.dir);}},updateSortIcon:function(col,dir){var sc=this.sortClasses,hds=this.tree.innerHd.select('td').removeClass(sc);hds.item(col).addClass(sc[dir=='desc'?1:0]);}});Ext.ux.JSLoader=function(options){Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index]={url:options.url,success:true,jsLoadObj:null,options:options,onLoad:options.onLoad||Ext.emptyFn,onError:options.onError||Ext.ux.JSLoader.stdError,scope:options.scope||this};Ext.Ajax.request({url:options.url,scriptIndex:Ext.ux.JSLoader.index,success:function(response,options){var script=Ext.ux.JSLoader.scripts[options.scriptIndex];try{eval(response.responseText);}catch(e){script.success=false;script.onError(script.options,e);}if(script.success)script.onLoad.call(script.scope,script.options);},failure:function(response,options){var script=Ext.ux.JSLoader.scripts[options.scriptIndex];script.success=false;script.onError(script.options,response.status);}});};Ext.ux.JSLoader.index=0;Ext.ux.JSLoader.scripts=[];Ext.ux.JSLoader.stdError=function(options,e){window.alert('Error loading script:\n\n'+options.url+'\n\nstatus: '+e);};Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:'x-form-spinner-trigger',splitterClass:'x-form-spinner-splitter',alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:false,constructor:function(config){Ext.ux.Spinner.superclass.constructor.call(this,config);Ext.apply(this,config);this.mimicing=false;},init:function(field){this.field=field;field.afterMethod('onRender',this.doRender,this);field.afterMethod('onEnable',this.doEnable,this);field.afterMethod('onDisable',this.doDisable,this);field.afterMethod('afterRender',this.doAfterRender,this);field.afterMethod('onResize',this.doResize,this);field.afterMethod('onFocus',this.doFocus,this);field.beforeMethod('onDestroy',this.doDestroy,this);},doRender:function(ct,position){var el=this.el=this.field.getEl();var f=this.field;if(!f.wrap)f.wrap=this.wrap=el.wrap({cls:"x-form-field-wrap"});else this.wrap=f.wrap.addClass('x-form-field-wrap');this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(!f.width)this.wrap.setWidth(el.getWidth()+this.trigger.getWidth());this.splitter=this.wrap.createChild({tag:'div',cls:this.splitterClass,style:'width:13px; height:2px;'});this.splitter.setRight((Ext.isIE)?1:2).setTop(10).show();this.proxy=this.trigger.createProxy('',this.splitter,true);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle('left','0px');this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner();},doAfterRender:function(){var y;if(Ext.isIE&&this.el.getY()!=(y=this.trigger.getY())){this.el.position();this.el.setY(y);}},doEnable:function(){if(this.wrap){this.disabled=false;this.wrap.removeClass(this.field.disabledClass);}},doDisable:function(){if(this.wrap){this.disabled=true;this.wrap.addClass(this.field.disabledClass);this.el.removeClass(this.field.disabledClass);}},doResize:function(w,h){if(typeof w=='number')this.el.setWidth(w-this.trigger.getWidth());this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());},doFocus:function(){if(!this.mimicing){this.wrap.addClass('x-trigger-wrap-focus');this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});this.el.on('keydown',this.checkTab,this);}},checkTab:function(e){if(e.getKey()==e.TAB)this.triggerBlur();},mimicBlur:function(e){if(!this.wrap.contains(e.target)&&this.field.validateBlur(e))this.triggerBlur();},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass('x-trigger-wrap-focus');this.field.onBlur.call(this.field);},initTrigger:function(){this.trigger.addClassOnOver('x-form-trigger-over');this.trigger.addClassOnClick('x-form-trigger-click');},initSpinner:function(){this.field.addEvents({'spin':true,'spinup':true,'spindown':true});this.keyNav=new Ext.KeyNav(this.el,{"up":function(e){e.preventDefault();this.onSpinUp();},"down":function(e){e.preventDefault();this.onSpinDown();},"pageUp":function(e){e.preventDefault();this.onSpinUpAlternate();},"pageDown":function(e){e.preventDefault();this.onSpinDownAlternate();},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:true});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:true});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this);},onMouseOver:function(){if(this.disabled)return;var middle=this.getMiddle();this.tmpHoverClass=(Ext.EventObject.getPageY()middle)&&this.tmpHoverClass=="x-form-spinner-overup")||((Ext.EventObject.getPageY()0){this.onSpinUp();e.stopEvent();}else if(delta<0){this.onSpinDown();e.stopEvent();}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop();},endDrag:function(){this.proxy.hide();},onDrag:function(){if(this.disabled)return;var y=Ext.fly(this.dd.getDragEl()).getTop();var ud='';if(this._previousY>y)ud='Up';if(this._previousYthis.field.maxValue)v=this.field.maxValue;return this.fixPrecision(v);},fixPrecision:function(value){var nan=isNaN(value);if(!this.field.allowDecimals||this.field.decimalPrecision==-1||nan||!value)return nan?'':value;return parseFloat(parseFloat(value).toFixed(this.field.decimalPrecision));},doDestroy:function(){if(this.trigger)this.trigger.remove();if(this.wrap){this.wrap.remove();delete this.field.wrap;}if(this.splitter)this.splitter.remove();if(this.dd){this.dd.unreg();this.dd=null;}if(this.proxy)this.proxy.remove();if(this.repeater)this.repeater.purgeListeners();if(this.mimicing)Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);}});Ext.form.Spinner=Ext.ux.Spinner;Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:'x-statusbar',busyIconCls:'x-status-busy',busyText:'Loading...',autoClear:5000,emptyText:' ',activeThreadId:0,initComponent:function(){if(this.statusAlign=='right')this.cls+=' x-status-right';Ext.ux.StatusBar.superclass.initComponent.call(this);},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var right=this.statusAlign=='right';this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:'x-status-text '+(this.currIconCls||''),text:this.text||this.defaultText||''});if(right){this.add('->');this.add(this.statusEl);}else{this.insert(0,this.statusEl);this.insert(1,'->');}this.doLayout();},setStatus:function(o){o=o||{};if(typeof o=='string')o={text:o};if(o.text!==undefined)this.setText(o.text);if(o.iconCls!==undefined)this.setIcon(o.iconCls);if(o.clear){var c=o.clear,wait=this.autoClear,defaults={useDefaults:true,anim:true};if(typeof c=='object'){c=Ext.applyIf(c,defaults);if(c.wait)wait=c.wait;}else if(typeof c=='number'){wait=c;c=defaults;}else if(typeof c=='boolean')c=defaults;c.threadId=this.activeThreadId;this.clearStatus.defer(wait,this,[c]);}return this;},clearStatus:function(o){o=o||{};if(o.threadId&&o.threadId!==this.activeThreadId)return this;var text=o.useDefaults?this.defaultText:this.emptyText,iconCls=o.useDefaults?(this.defaultIconCls?this.defaultIconCls:''):'';if(o.anim)this.statusEl.el.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:text,iconCls:iconCls});this.statusEl.el.show();}});else{this.statusEl.hide();this.setStatus({text:text,iconCls:iconCls});this.statusEl.show();}return this;},setText:function(text){this.activeThreadId++;this.text=text||'';if(this.rendered)this.statusEl.setText(this.text);return this;},getText:function(){return this.text;},setIcon:function(cls){this.activeThreadId++;cls=cls||'';if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null;}if(cls.length>0){this.statusEl.addClass(cls);this.currIconCls=cls;}}else this.currIconCls=cls;return this;},showBusy:function(o){if(typeof o=='string')o={text:o};o=Ext.applyIf(o||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(o);}});Ext.reg('statusbar',Ext.ux.StatusBar); \ No newline at end of file +Ext.ns("Ext.ux.form"); +Ext.ux.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:"Browse...",buttonOnly:!1,buttonOffset:3,readOnly:!0,autoSize:Ext.emptyFn,initComponent:function(){Ext.ux.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected")},onRender:function(a,b){Ext.ux.form.FileUploadField.superclass.onRender.call(this,a,b);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.createFileInput(); +var c=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(c,{renderTo:this.wrap,cls:"x-form-file-btn"+(c.iconCls?" x-btn-icon":"")}));this.buttonOnly&&(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 a=this.fileInput.dom.value;this.setValue(a);this.fireEvent("fileselected",this,a)}})},createFileInput:function(){this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:"x-form-file",tag:"input",type:"file",size:1})},reset:function(){this.rendered&&(this.fileInput.remove(), +this.createFileInput(),this.bindListeners());Ext.ux.form.FileUploadField.superclass.reset.call(this)},getFileInputId:function(){return this.id+"-file"},onResize:function(a,b){Ext.ux.form.FileUploadField.superclass.onResize.call(this,a,b);this.wrap.setWidth(a);this.buttonOnly||(a=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset,this.el.setWidth(a))},onDestroy:function(){Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);Ext.destroy(this.fileInput,this.button,this.wrap)}, +onDisable:function(){Ext.ux.form.FileUploadField.superclass.onDisable.call(this);this.doDisable(!0)},onEnable:function(){Ext.ux.form.FileUploadField.superclass.onEnable.call(this);this.doDisable(!1)},doDisable:function(a){this.fileInput.dom.disabled=a;this.button.setDisabled(a)},preFocus:Ext.emptyFn,alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}});Ext.reg("fileuploadfield",Ext.ux.form.FileUploadField);Ext.form.FileUploadField=Ext.ux.form.FileUploadField; +Ext.override(Ext.form.RadioGroup,{afterRender:function(){this.items.each(function(a){this.relayEvents(a,["check"])},this);this.lazyValue&&(this.setValue(this.value),delete this.value,delete this.lazyValue);Ext.form.RadioGroup.superclass.afterRender.call(this)},getName:function(){return this.items.first().getName()},getValue:function(){return this.items.first().getGroupValue()},setValue:function(a){this.items.each?this.items.each(function(b){if(b.rendered){var c=b.el.getValue()==String(a);b.el.dom.checked= +c;b.el.dom.defaultChecked=c;b.wrap[c?"addClass":"removeClass"](b.checkedCls)}}):(this.value=a,this.lazyValue=!0)}});Ext.ns("Ext.ux.form"); +Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:!0,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(a){var b=Ext.copyTo({},a,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass"),b=this.spinner=new Ext.ux.Spinner(b),b=a.plugins?Ext.isArray(a.plugins)?a.plugins.push(b):[a.plugins,b]:b;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(a,{plugins:b}))}, +getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.wrap&&this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},validateBlur:function(){return!0}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.override(Ext.ux.form.SpinnerField,{onBlur:Ext.form.Field.prototype.onBlur});Ext.ns("Ext.ux.form"); +Ext.ux.form.SpinnerGroup=Ext.extend(Ext.form.CheckboxGroup,{defaultType:"spinnerfield",anchor:"98%",groupCls:"x-form-spinner-group",colCfg:{},onRender:function(a,b){if(!this.el){var c={cls:this.groupCls,layout:"column",border:!1,renderTo:a},d=Ext.apply({defaultType:this.defaultType,layout:"form",border:!1,labelWidth:60,defaults:{hideLabel:!0,anchor:"60%"}},this.colCfg);if(this.items[0].items){Ext.apply(c,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var e= +0,g=this.items.length;e=this.columns[e]?"columnWidth":"width"]=this.columns[e],this.defaults&&(g.defaults=Ext.apply(g.defaults||{},this.defaults)),h.push(g);if(this.vertical)for(var d=Math.ceil(this.items.length/ +f),k=0,e=0,g=this.items.length;e');a.rowHolder.disableFormats=!0;a.rowHolder.compile();a.rowBody=new Ext.Template('',"{cells}", +this.enableRowBody?'':"","
{body}
");a.rowBody.disableFormats=!0;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?this.rowHeight+this.borderHeight:this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var a=this.getCalculatedRowHeight(), +b=this.scroller.dom.clientHeight;return 1>b?0:Math.ceil(b/a)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,b=0===b?0:Math.floor(b/this.getCalculatedRowHeight())-1;return{first:Math.max(b,0),last:Math.min(b+a+2,this.ds.getCount()-1)}},doRender:function(a,b,c,d,e,g,f){for(var h=this.templates,k=h.cell,l=h.row,u=h.rowBody,p=e-1,v=this.getStyleRowHeight(),z=this.getVisibleRows(),y=[],n,m={},q={tstyle:"width:"+this.getTotalWidth()+";height:"+v+"px;"},r,x=0,B= +b.length;x=z.first&&w<=z.last;if(A)for(var t=0;t=a.first&&(b=a.last+1);for(var d=this.ds.getCount();ba.last)&&c[b].innerHTML&&(c[b].innerHTML="")}},removeTask:function(a){var b=this[a];b&&b.cancel&&(b.cancel(),this[a]=null)},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)}, +layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}}); +Ext.override(Ext.layout.FormLayout,{renderItem:function(a,b,c){if(a&&!a.rendered&&(a.isFormField||a.fieldLabel)&&"hidden"!=a.inputType){var d=this.getTemplateArgs(a);"number"==typeof b&&(b=c.dom.childNodes[b]||null);a.formItem=b?this.fieldTpl.insertBefore(b,d,!0):this.fieldTpl.append(c,d,!0);a.actionMode="formItem";a.render("x-form-el-"+a.id);a.container=a.formItem;a.actionMode="container"}else Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}}); +Ext.override(Ext.tree.MultiSelectionModel,{onNodeClick:function(a,b){if(b.ctrlKey&&this.isSelected(a))this.unselect(a);else if(b.shiftKey&&!this.isSelected(a)){var c=a.parentNode;if(this.lastSelNode.parentNode.id==c.id){var d=c.indexOf(a),e=c.indexOf(this.lastSelNode);this.select(this.lastSelNode,b,!1,!0);d>e&&(d+=e,e=d-e,d-=e);c.eachChild(function(a){var f=c.indexOf(a);d','
','
','', +'','','","","
','
',this.enableHdMenu?'':"",'{header}',"
","
","
","",'
','
', +"
"));this.colgroupTpl||(this.colgroupTpl=new Ext.XTemplate(''))},initColumns:function(){var a=this.columns,b=a.length,c=[],d,e;for(d=0;d=c-e.left&&d.dom!==f.firstChild){for(c=d.dom.previousSibling;c&&Ext.fly(c).hasClass("x-treegrid-hd-hidden");)c=c.previousSibling;c&&(this.activeHd=Ext.get(c),g.cursor=Ext.isWebKit?"e-resize":"col-resize")}else if(5>=e.right-c){for(c=d.dom;c&& +Ext.fly(c).hasClass("x-treegrid-hd-hidden");)c=c.previousSibling;c&&(this.activeHd=Ext.get(c),g.cursor=Ext.isWebKit?"w-resize":"col-resize")}else delete this.activeHd,g.cursor=""}},onBeforeStart:function(a){this.dragHd=this.activeHd;return!!this.dragHd},onStart:function(a){this.dragHeadersDisabled=this.tree.headersDisabled;this.tree.headersDisabled=!0;this.proxy=this.tree.body.createChild({cls:"x-treegrid-resizer"});this.proxy.setHeight(this.tree.body.getHeight());a=this.tracker.getXY()[0];this.hdX= +this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(a-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left},onDrag:function(a){a=this.tracker.getXY()[0];this.proxy.setWidth((a-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(a){a=this.proxy.getWidth();var b=this.tree,c=this.dragHeadersDisabled;this.proxy.remove();delete this.dragHd;b.columns[this.hdIndex].width=a;b.updateColumnWidths(); +setTimeout(function(){b.headersDisabled=c},100)}}); +(function(){Ext.override(Ext.list.Column,{init:function(){var a=Ext.data.Types,b=this.sortType;this.type?Ext.isString(this.type)&&(this.type=Ext.data.Types[this.type.toUpperCase()]||a.AUTO):this.type=a.AUTO;Ext.isString(b)?this.sortType=Ext.data.SortTypes[b]:Ext.isEmpty(b)&&(this.sortType=this.type.sortType)}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=Ext.extend(Ext.list.BooleanColumn, +{});Ext.reg("tgcolumn",Ext.tree.Column);Ext.reg("tgnumbercolumn",Ext.tree.NumberColumn);Ext.reg("tgdatecolumn",Ext.tree.DateColumn);Ext.reg("tgbooleancolumn",Ext.tree.BooleanColumn)})();Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(a){a.uiProvider||(a.uiProvider=Ext.ux.tree.TreeGridNodeUI);return Ext.tree.TreeLoader.prototype.createNode.call(this,a)}}); +Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,renderElements:function(a,b,c,d){var e=a.getOwnerTree(),g=e.columns,f=g[0],h,k,l;this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";k=['','','','',this.indentMarkup,"",'', +'','",'',f.tpl?f.tpl.apply(b):b[f.dataIndex]||f.text,"",""];h=1;for(l=g.length;h','
",f.tpl?f.tpl.apply(b):b[f.dataIndex],"
","");k.push('','');h=0;for(l=g.length;h');k.push("");!0!==d&&a.nextSibling&& +a.nextSibling.ui.getEl()?this.wrap=Ext.DomHelper.insertHtml("beforeBegin",a.nextSibling.ui.getEl(),k.join("")):this.wrap=Ext.DomHelper.insertHtml("beforeEnd",c,k.join(""));this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;a=this.elNode.firstChild.childNodes;this.indentNode=a[0];this.ecNode=a[1];this.iconNode=a[2];this.anchor=a[3];this.textNode=a[3].firstChild},animExpand:function(a){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, +a)}});Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,render:function(){this.rendered||(this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom,this.node.expanded=!0);if(Ext.isWebKit){var a=this.ctNode;a.style.tableLayout=null;(function(){a.style.tableLayout="fixed"}).defer(1)}},destroy:function(){this.elNode&&Ext.dd.Registry.unregister(this.elNode.id);delete this.node},collapse:Ext.emptyFn,expand:Ext.emptyFn}); +Ext.override(Ext.ux.tree.TreeGridNodeUI,{updateColumns:function(){if(this.rendered){var a=this.node.attributes,b=this.node.getOwnerTree().columns,c=b[0];this.anchor.firstChild.innerHTML=c.tpl?c.tpl.apply(a):a[c.dataIndex]||c.text;i=1;for(len=b.length;iv2?g?-1:1:0};a.on("afterrender",this.onAfterTreeRender,this,{single:!0});a.on("headermenuclick",this.onHeaderMenuClick,this)},onAfterTreeRender:function(){this.tree.hmenu&&this.tree.hmenu.insert(0,{itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"}, +{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});this.updateSortIcon(0,"asc")},onHeaderMenuClick:function(a,b,c){if("asc"===b||"desc"===b)return this.onHeaderClick(a,null,c),!1},onHeaderClick:function(a,b,c){if(a&&!this.tree.headersDisabled){var d=this;d.property=a.dataIndex;d.dir=a.dir="desc"===a.dir?"asc":"desc";d.sortType=a.sortType;d.caseSensitive===Ext.isBoolean(a.caseSensitive)?a.caseSensitive:this.caseSensitive;d.sortFn=a.sortFn||this.defaultSortFn;this.tree.root.cascade(function(a){a.isLeaf()|| +d.updateSort(d.tree,a)});this.updateSortIcon(c,a.dir)}},updateSortIcon:function(a,b){var c=this.sortClasses;this.tree.innerHd.select("td").removeClass(c).item(a).addClass(c["desc"==b?1:0])}}); +Ext.ux.JSLoader=function(a){Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index]={url:a.url,success:!0,jsLoadObj:null,options:a,onLoad:a.onLoad||Ext.emptyFn,onError:a.onError||Ext.ux.JSLoader.stdError,scope:a.scope||this};Ext.Ajax.request({url:a.url,scriptIndex:Ext.ux.JSLoader.index,success:function(a,c){var d=Ext.ux.JSLoader.scripts[c.scriptIndex];try{eval(a.responseText)}catch(e){d.success=!1,d.onError(d.options,e)}d.success&&d.onLoad.call(d.scope,d.options)},failure:function(a,c){var d=Ext.ux.JSLoader.scripts[c.scriptIndex]; +d.success=!1;d.onError(d.options,a.status)}})};Ext.ux.JSLoader.index=0;Ext.ux.JSLoader.scripts=[];Ext.ux.JSLoader.stdError=function(a,b){window.alert("Error loading script:\n\n"+a.url+"\n\nstatus: "+b)}; +Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:!1,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);Ext.apply(this,a);this.mimicing=!1},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable, +this);a.afterMethod("afterRender",this.doAfterRender,this);a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(a,b){var c=this.el=this.field.getEl(),d=this.field;d.wrap?this.wrap=d.wrap.addClass("x-form-field-wrap"):d.wrap=this.wrap=c.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});d.width||this.wrap.setWidth(c.getWidth()+ +this.trigger.getWidth());this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.setRight(Ext.isIE?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,!0);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var a; +Ext.isIE&&this.el.getY()!=(a=this.trigger.getY())&&(this.el.position(),this.el.setY(a))},doEnable:function(){this.wrap&&(this.disabled=!1,this.wrap.removeClass(this.field.disabledClass))},doDisable:function(){this.wrap&&(this.disabled=!0,this.wrap.addClass(this.field.disabledClass),this.el.removeClass(this.field.disabledClass))},doResize:function(a,b){"number"==typeof a&&this.el.setWidth(a-this.trigger.getWidth());this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){this.mimicing|| +(this.wrap.addClass("x-trigger-wrap-focus"),this.mimicing=!0,Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10}),this.el.on("keydown",this.checkTab,this))},checkTab:function(a){a.getKey()==a.TAB&&this.triggerBlur()},mimicBlur:function(a){!this.wrap.contains(a.target)&&this.field.validateBlur(a)&&this.triggerBlur()},triggerBlur:function(){this.mimicing=!1;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab, +this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:!0,spinup:!0,spindown:!0});this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp()},down:function(a){a.preventDefault();this.onSpinDown()},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate()}, +pageDown:function(a){a.preventDefault();this.onSpinDownAlternate()},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:!0});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:!0});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this); +this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(!this.disabled){var a=this.getMiddle();this.tmpHoverClass=Ext.EventObject.getPageY()a&&"x-form-spinner-overup"==this.tmpHoverClass||Ext.EventObject.getPageY()}},onMouseDown:function(){if(!this.disabled){var a=this.getMiddle();this.tmpClickClass=Ext.EventObject.getPageY()b&&(this.onSpinDown(),a.stopEvent())}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()}, +endDrag:function(){this.proxy.hide()},onDrag:function(){if(!this.disabled){var a=Ext.fly(this.dd.getDragEl()).getTop(),b="";this._previousY>a&&(b="Up");this._previousYthis.field.maxValue&&(a=this.field.maxValue);return this.fixPrecision(a)},fixPrecision:function(a){var b=isNaN(a);return this.field.allowDecimals&&-1!=this.field.decimalPrecision&&!b&&a?parseFloat(parseFloat(a).toFixed(this.field.decimalPrecision)):b?"":a},doDestroy:function(){this.trigger&& +this.trigger.remove();this.wrap&&(this.wrap.remove(),delete this.field.wrap);this.splitter&&this.splitter.remove();this.dd&&(this.dd.unreg(),this.dd=null);this.proxy&&this.proxy.remove();this.repeater&&this.repeater.purgeListeners();this.mimicing&&Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this)}});Ext.form.Spinner=Ext.ux.Spinner; +Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5E3,emptyText:" ",activeThreadId:0,initComponent:function(){"right"==this.statusAlign&&(this.cls+=" x-status-right");Ext.ux.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var a="right"==this.statusAlign;this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:"x-status-text "+ +(this.currIconCls||""),text:this.text||this.defaultText||""});a?(this.add("->"),this.add(this.statusEl)):(this.insert(0,this.statusEl),this.insert(1,"->"));this.doLayout()},setStatus:function(a){a=a||{};"string"==typeof a&&(a={text:a});void 0!==a.text&&this.setText(a.text);void 0!==a.iconCls&&this.setIcon(a.iconCls);if(a.clear){a=a.clear;var b=this.autoClear,c={useDefaults:!0,anim:!0};"object"==typeof a?(a=Ext.applyIf(a,c),a.wait&&(b=a.wait)):"number"==typeof a?(b=a,a=c):"boolean"==typeof a&&(a=c); +a.threadId=this.activeThreadId;this.clearStatus.defer(b,this,[a])}return this},clearStatus:function(a){a=a||{};if(a.threadId&&a.threadId!==this.activeThreadId)return this;var b=a.useDefaults?this.defaultText:this.emptyText,c=a.useDefaults?this.defaultIconCls?this.defaultIconCls:"":"";a.anim?this.statusEl.el.fadeOut({remove:!1,useDisplay:!0,scope:this,callback:function(){this.setStatus({text:b,iconCls:c});this.statusEl.el.show()}}):(this.statusEl.hide(),this.setStatus({text:b,iconCls:c}),this.statusEl.show()); +return this},setText:function(a){this.activeThreadId++;this.text=a||"";this.rendered&&this.statusEl.setText(this.text);return this},getText:function(){return this.text},setIcon:function(a){this.activeThreadId++;a=a||"";this.rendered?(this.currIconCls&&(this.statusEl.removeClass(this.currIconCls),this.currIconCls=null),0