From 491f4a44385a4fca481c2ac338fca4aba1d00dd3 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 18 Apr 2009 16:20:07 +0000 Subject: [PATCH] move the classes in deluge-ext to ext-extensions and remove deluge-ext --- deluge/ui/web/js/build.sh | 2 +- deluge/ui/web/js/deluge-ext.js | 285 ----------------------- deluge/ui/web/js/ext-extensions-debug.js | 277 +++++++++++++++++++++- deluge/ui/web/js/ext-extensions.js | 2 +- 4 files changed, 277 insertions(+), 289 deletions(-) delete mode 100644 deluge/ui/web/js/deluge-ext.js diff --git a/deluge/ui/web/js/build.sh b/deluge/ui/web/js/build.sh index e5c44250b..335538b6f 100755 --- a/deluge/ui/web/js/build.sh +++ b/deluge/ui/web/js/build.sh @@ -1,4 +1,4 @@ -DELUGE_FILES="rpc.js deluge.js deluge-ext.js deluge-login.js deluge-menus.js deluge-bars.js deluge-connections.js deluge-torrents.js deluge-details.js deluge-add.js deluge-preferences.js deluge-ui.js" +DELUGE_FILES="rpc.js deluge.js deluge-login.js deluge-menus.js deluge-bars.js deluge-connections.js deluge-torrents.js deluge-details.js deluge-add.js deluge-preferences.js deluge-ui.js" ALL_FILES="ext-extensions-debug.js $DELUGE_FILES" scan() { diff --git a/deluge/ui/web/js/deluge-ext.js b/deluge/ui/web/js/deluge-ext.js deleted file mode 100644 index 1a9ac563e..000000000 --- a/deluge/ui/web/js/deluge-ext.js +++ /dev/null @@ -1,285 +0,0 @@ -/* -Script: deluge-ext.js - Container for all classes that extend Exts native classes. - -Copyright: - (C) Damien Churchill 2009 - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, write to: - The Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor - Boston, MA 02110-1301, USA. -*/ - -Deluge.ProgressBar = Ext.extend(Ext.ProgressBar, { - initComponent: function() { - Deluge.ProgressBar.superclass.initComponent.call(this); - }, - - updateProgress: function(value, text, animate) { - this.value = value || 0; - if (text) { - this.updateText(text); - } - - if (this.rendered) { - var w = Math.floor(value*this.el.dom.firstChild.offsetWidth / 100.0); - this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate)); - if (this.textTopEl) { - //textTopEl should be the same width as the bar so overflow will clip as the bar moves - this.textTopEl.removeClass('x-hidden').setWidth(w); - } - } - this.fireEvent('update', this, value, text); - return this; - } -}); -Ext.reg('deluge-progressbar', Deluge.ProgressBar); - -Ext.tree.ColumnTree = Ext.extend(Ext.tree.TreePanel, { - lines:false, - borderWidth: Ext.isBorderBox ? 0 : 2, // the combined left/right border for each cell - cls:'x-column-tree', - - onRender : function(){ - Ext.tree.ColumnTree.superclass.onRender.apply(this, arguments); - this.headers = this.body.createChild( - {cls:'x-tree-headers'},this.innerCt.dom); - - var cols = this.columns, c; - var totalWidth = 0; - - for(var i = 0, len = cols.length; i < len; i++){ - c = cols[i]; - totalWidth += c.width; - this.headers.createChild({ - cls:'x-tree-hd ' + (c.cls?c.cls+'-hd':''), - cn: { - cls:'x-tree-hd-text', - html: c.header - }, - style:'width:'+(c.width-this.borderWidth)+'px;' - }); - } - this.headers.createChild({cls:'x-clear'}); - // prevent floats from wrapping when clipped - this.headers.setWidth(totalWidth); - this.innerCt.setWidth(totalWidth); - } -}); - -Ext.tree.ColumnTreeNode = Ext.extend(Ext.tree.TreeNode, { - - setColumnValue: function(index, value) { - var t = this.getOwnerTree(); - var oldValue = this[t.columns[index].dataIndex]; - this[t.columns[index].dataIndex] = value; - this.attributes[[t.columns[index].dataIndex]] = value; - if (this.rendered) { - this.ui.onColumnValueChange(this, index, value, oldValue); - } - this.fireEvent('columnvaluechange', this, index, value, oldValue); - } -}); - -Ext.tree.ColumnNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { - focus: Ext.emptyFn, // prevent odd scrolling behavior - - onColumnValueChange: function(n, colIndex, value, oldValue) { - if (this.rendered) { - var c = n.getOwnerTree().columns[colIndex]; - this.columnNodes[colIndex].innerHTML = (c.renderer ? c.renderer(value, n, null) : value); - } - }, - - renderElements : function(n, a, targetNode, bulkRender){ - this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; - - var t = n.getOwnerTree(); - var cols = t.columns; - var bw = t.borderWidth; - var c = cols[0]; - - var cb = typeof a.checked == 'boolean'; - var href = a.href ? a.href : Ext.isGecko ? "" : "#"; - - var buf = [ - '
  • ', - '
    ', - '',this.indentMarkup,"", - '', - '', - cb ? ('' : '/>')) : '', - '', - '', n.text || (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"", - "
    "]; - for(var i = 1, len = cols.length; i < len; i++){ - c = cols[i]; - - buf.push('
    ', - '
    ',(c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"
    ", - "
    "); - } - 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]; - var cs = this.elNode.firstChild.childNodes; - this.indentNode = cs[0]; - this.ecNode = cs[1]; - this.iconNode = cs[2]; - var index = 3; - if(cb){ - this.checkbox = cs[3]; - // fix for IE6 - this.checkbox.defaultChecked = this.checkbox.checked; - index++; - } - this.anchor = cs[index]; - this.columnNodes = [cs[index].firstChild]; - for(var i = 1, len = cols.length; i < len; i++){ - this.columnNodes[i] = this.elNode.childNodes[i].firstChild; - } - } -}); - -Ext.form.FileUploadField = Ext.extend(Ext.form.TextField, { - /** - * @cfg {String} buttonText The button text to display on the upload button (defaults to - * 'Browse...'). Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text - * value will be used instead if available. - */ - buttonText: 'Browse...', - /** - * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible - * text field (defaults to false). If true, all inherited TextField members will still be available. - */ - buttonOnly: false, - /** - * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field - * (defaults to 3). Note that this only applies if {@link #buttonOnly} = false. - */ - buttonOffset: 3, - /** - * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object. - */ - - // private - readOnly: true, - - /** - * @hide - * @method autoSize - */ - autoSize: Ext.emptyFn, - - // private - initComponent: function(){ - Ext.form.FileUploadField.superclass.initComponent.call(this); - - this.addEvents( - /** - * @event fileselected - * Fires when the underlying file input field's value has changed from the user - * selecting a new file from the system file selection dialog. - * @param {Ext.form.FileUploadField} this - * @param {String} value The file value returned by the underlying file input field - */ - 'fileselected' - ); - }, - - // private - 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'}); - this.el.addClass('x-form-file-text'); - this.el.dom.removeAttribute('name'); - - this.fileInput = this.wrap.createChild({ - id: this.getFileInputId(), - name: this.name||this.getId(), - cls: 'x-form-file', - tag: 'input', - type: 'file', - size: 1 - }); - - var btnCfg = Ext.applyIf(this.buttonCfg || {}, { - text: this.buttonText - }); - this.button = new Ext.Button(Ext.apply(btnCfg, { - renderTo: this.wrap - })); - - if(this.buttonOnly){ - this.el.hide(); - this.wrap.setWidth(this.button.getEl().getWidth()); - } - - this.fileInput.on('change', function(){ - var v = this.fileInput.dom.value; - this.setValue(v); - this.fireEvent('fileselected', this, v); - }, this); - }, - - // private - getFileInputId: function(){ - return this.id+'-file'; - }, - - // private - onResize : function(w, h){ - Ext.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); - } - }, - - // private - preFocus : Ext.emptyFn, - - // private - getResizeEl : function(){ - return this.wrap; - }, - - // private - getPositionEl : function(){ - return this.wrap; - }, - - // private - alignErrorIcon : function(){ - this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); - } - -}); -Ext.reg('fileuploadfield', Ext.form.FileUploadField); diff --git a/deluge/ui/web/js/ext-extensions-debug.js b/deluge/ui/web/js/ext-extensions-debug.js index 6f0dece7a..b9b0eda1f 100644 --- a/deluge/ui/web/js/ext-extensions-debug.js +++ b/deluge/ui/web/js/ext-extensions-debug.js @@ -458,7 +458,6 @@ Ext.extend(Ext.ux.form.Spinner.DateStrategy, Ext.ux.form.Spinner.Strategy, { }); - /*** * Concrete Strategy: Time */ @@ -472,4 +471,278 @@ Ext.extend(Ext.ux.form.Spinner.TimeStrategy, Ext.ux.form.Spinner.DateStrategy, { incrementConstant : Date.MINUTE, alternateIncrementValue : 1, alternateIncrementConstant : Date.HOUR -}); \ No newline at end of file +}); + +Ext.tree.ColumnTree = Ext.extend(Ext.tree.TreePanel, { + lines:false, + borderWidth: Ext.isBorderBox ? 0 : 2, // the combined left/right border for each cell + cls:'x-column-tree', + + onRender : function(){ + Ext.tree.ColumnTree.superclass.onRender.apply(this, arguments); + this.headers = this.body.createChild( + {cls:'x-tree-headers'},this.innerCt.dom); + + var cols = this.columns, c; + var totalWidth = 0; + + for(var i = 0, len = cols.length; i < len; i++){ + c = cols[i]; + totalWidth += c.width; + this.headers.createChild({ + cls:'x-tree-hd ' + (c.cls?c.cls+'-hd':''), + cn: { + cls:'x-tree-hd-text', + html: c.header + }, + style:'width:'+(c.width-this.borderWidth)+'px;' + }); + } + this.headers.createChild({cls:'x-clear'}); + // prevent floats from wrapping when clipped + this.headers.setWidth(totalWidth); + this.innerCt.setWidth(totalWidth); + } +}); + +Ext.tree.ColumnTreeNode = Ext.extend(Ext.tree.TreeNode, { + + setColumnValue: function(index, value) { + var t = this.getOwnerTree(); + var oldValue = this[t.columns[index].dataIndex]; + this[t.columns[index].dataIndex] = value; + this.attributes[[t.columns[index].dataIndex]] = value; + if (this.rendered) { + this.ui.onColumnValueChange(this, index, value, oldValue); + } + this.fireEvent('columnvaluechange', this, index, value, oldValue); + } +}); + +Ext.tree.ColumnNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { + focus: Ext.emptyFn, // prevent odd scrolling behavior + + onColumnValueChange: function(n, colIndex, value, oldValue) { + if (this.rendered) { + var c = n.getOwnerTree().columns[colIndex]; + this.columnNodes[colIndex].innerHTML = (c.renderer ? c.renderer(value, n, null) : value); + } + }, + + renderElements : function(n, a, targetNode, bulkRender){ + this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : ''; + + var t = n.getOwnerTree(); + var cols = t.columns; + var bw = t.borderWidth; + var c = cols[0]; + + var cb = typeof a.checked == 'boolean'; + var href = a.href ? a.href : Ext.isGecko ? "" : "#"; + + var buf = [ + '
  • ', + '
    ', + '',this.indentMarkup,"", + '', + '', + cb ? ('' : '/>')) : '', + '', + '', n.text || (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"", + "
    "]; + for(var i = 1, len = cols.length; i < len; i++){ + c = cols[i]; + + buf.push('
    ', + '
    ',(c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"
    ", + "
    "); + } + 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]; + var cs = this.elNode.firstChild.childNodes; + this.indentNode = cs[0]; + this.ecNode = cs[1]; + this.iconNode = cs[2]; + var index = 3; + if(cb){ + this.checkbox = cs[3]; + // fix for IE6 + this.checkbox.defaultChecked = this.checkbox.checked; + index++; + } + this.anchor = cs[index]; + this.columnNodes = [cs[index].firstChild]; + for(var i = 1, len = cols.length; i < len; i++){ + this.columnNodes[i] = this.elNode.childNodes[i].firstChild; + } + } +}); + +Ext.form.FileUploadField = Ext.extend(Ext.form.TextField, { + /** + * @cfg {String} buttonText The button text to display on the upload button (defaults to + * 'Browse...'). Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text + * value will be used instead if available. + */ + buttonText: 'Browse...', + /** + * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible + * text field (defaults to false). If true, all inherited TextField members will still be available. + */ + buttonOnly: false, + /** + * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field + * (defaults to 3). Note that this only applies if {@link #buttonOnly} = false. + */ + buttonOffset: 3, + /** + * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object. + */ + + // private + readOnly: true, + + /** + * @hide + * @method autoSize + */ + autoSize: Ext.emptyFn, + + // private + initComponent: function(){ + Ext.form.FileUploadField.superclass.initComponent.call(this); + + this.addEvents( + /** + * @event fileselected + * Fires when the underlying file input field's value has changed from the user + * selecting a new file from the system file selection dialog. + * @param {Ext.form.FileUploadField} this + * @param {String} value The file value returned by the underlying file input field + */ + 'fileselected' + ); + }, + + // private + 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'}); + this.el.addClass('x-form-file-text'); + this.el.dom.removeAttribute('name'); + + this.fileInput = this.wrap.createChild({ + id: this.getFileInputId(), + name: this.name||this.getId(), + cls: 'x-form-file', + tag: 'input', + type: 'file', + size: 1 + }); + + var btnCfg = Ext.applyIf(this.buttonCfg || {}, { + text: this.buttonText + }); + this.button = new Ext.Button(Ext.apply(btnCfg, { + renderTo: this.wrap + })); + + if(this.buttonOnly){ + this.el.hide(); + this.wrap.setWidth(this.button.getEl().getWidth()); + } + + this.fileInput.on('change', function(){ + var v = this.fileInput.dom.value; + this.setValue(v); + this.fireEvent('fileselected', this, v); + }, this); + }, + + // private + getFileInputId: function(){ + return this.id+'-file'; + }, + + // private + onResize : function(w, h){ + Ext.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); + } + }, + + // private + preFocus : Ext.emptyFn, + + // private + getResizeEl : function(){ + return this.wrap; + }, + + // private + getPositionEl : function(){ + return this.wrap; + }, + + // private + alignErrorIcon : function(){ + this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); + } + +}); +Ext.reg('fileuploadfield', Ext.form.FileUploadField); + +/** + * Ext.ux.FullProgressBar Class + * + * @author Damien Churchill + * @version 1.2 + * + * @class Ext.deluge.ProgressBar + * @extends Ext.ProgressBar + * @constructor + * @param {Object} config Configuration options + */ +Ext.ux.FullProgressBar = Ext.extend(Ext.ProgressBar, { + initComponent: function() { + Ext.ux.FullProgressBar.superclass.initComponent.call(this); + }, + + updateProgress: function(value, text, animate) { + this.value = value || 0; + if (text) { + this.updateText(text); + } + + if (this.rendered) { + var w = Math.floor(value*this.el.dom.firstChild.offsetWidth / 100.0); + this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate)); + if (this.textTopEl) { + //textTopEl should be the same width as the bar so overflow will clip as the bar moves + this.textTopEl.removeClass('x-hidden').setWidth(w); + } + } + this.fireEvent('update', this, value, text); + return this; + } +}); +Ext.reg('fullprogressbar', Ext.ux.FullProgressBar); \ No newline at end of file diff --git a/deluge/ui/web/js/ext-extensions.js b/deluge/ui/web/js/ext-extensions.js index 6ef21f9a8..39eda21a0 100644 --- a/deluge/ui/web/js/ext-extensions.js +++ b/deluge/ui/web/js/ext-extensions.js @@ -1 +1 @@ -Ext.namespace("Ext.ux.form");Ext.ux.form.Spinner=function(a){Ext.ux.form.Spinner.superclass.constructor.call(this,a);this.addEvents({spin:true,spinup:true,spindown:true})};Ext.extend(Ext.ux.form.Spinner,Ext.form.TriggerField,{triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,strategy:undefined,onRender:function(b,a){Ext.ux.form.Spinner.superclass.onRender.call(this,b,a);this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.show().setRight((Ext.isIE)?1:2);this.splitter.show().setTop(10);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.initSpinner()},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){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);this.repeater.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.on("mouseover",this.onMouseOver,this,{preventDefault:true});this.trigger.on("mouseout",this.onMouseOut,this,{preventDefault:true});this.trigger.on("mousemove",this.onMouseMove,this,{preventDefault:true});this.trigger.on("mousedown",this.onMouseDown,this,{preventDefault:true});this.trigger.on("mouseup",this.onMouseUp,this,{preventDefault:true});this.wrap.on("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);if("object"==typeof this.strategy&&this.strategy.xtype){switch(this.strategy.xtype){case"number":this.strategy=new Ext.ux.form.Spinner.NumberStrategy(this.strategy);break;case"date":this.strategy=new Ext.ux.form.Spinner.DateStrategy(this.strategy);break;case"time":this.strategy=new Ext.ux.form.Spinner.TimeStrategy(this.strategy);break;default:delete (this.strategy);break}delete (this.strategy.xtype)}if(this.strategy==undefined){this.strategy=new Ext.ux.form.Spinner.NumberStrategy()}},onMouseOver:function(){if(this.disabled){return}var a=this.getMiddle();this.__tmphcls=(Ext.EventObject.getPageY()a)&&this.__tmphcls=="x-form-spinner-overup")||((Ext.EventObject.getPageY()0){this.onSpinUp();a.stopEvent()}else{if(b<0){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){return}var b=Ext.fly(this.dd.getDragEl()).getTop();var a="";if(this._previousY>b){a="Up"}if(this._previousYthis.maxValue){a=this.maxValue}return this.fixPrecision(a)},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))}});Ext.ux.form.Spinner.DateStrategy=function(a){Ext.ux.form.Spinner.DateStrategy.superclass.constructor.call(this,a)};Ext.extend(Ext.ux.form.Spinner.DateStrategy,Ext.ux.form.Spinner.Strategy,{defaultValue:new Date(),format:"Y-m-d",incrementValue:1,incrementConstant:Date.DAY,alternateIncrementValue:1,alternateIncrementConstant:Date.MONTH,spin:function(d,g,e){Ext.ux.form.Spinner.DateStrategy.superclass.spin.call(this);var a=d.getRawValue();a=Date.parseDate(a,this.format);var c=(g==true)?-1:1;var f=(e==true)?this.alternateIncrementValue:this.incrementValue;var b=(e==true)?this.alternateIncrementConstant:this.incrementConstant;if(typeof this.defaultValue=="string"){this.defaultValue=Date.parseDate(this.defaultValue,this.format)}a=(a)?a.add(b,c*f):this.defaultValue;a=this.fixBoundries(a);d.setRawValue(Ext.util.Format.date(a,this.format))},fixBoundries:function(b){var d=b;var c=(typeof this.minValue=="string")?Date.parseDate(this.minValue,this.format):this.minValue;var a=(typeof this.maxValue=="string")?Date.parseDate(this.maxValue,this.format):this.maxValue;if(this.minValue!=undefined&&da){d=a}return d}});Ext.ux.form.Spinner.TimeStrategy=function(a){Ext.ux.form.Spinner.TimeStrategy.superclass.constructor.call(this,a)};Ext.extend(Ext.ux.form.Spinner.TimeStrategy,Ext.ux.form.Spinner.DateStrategy,{format:"H:i",incrementValue:1,incrementConstant:Date.MINUTE,alternateIncrementValue:1,alternateIncrementConstant:Date.HOUR}); \ No newline at end of file +Ext.namespace("Ext.ux.form");Ext.ux.form.Spinner=function(a){Ext.ux.form.Spinner.superclass.constructor.call(this,a);this.addEvents({spin:true,spinup:true,spindown:true})};Ext.extend(Ext.ux.form.Spinner,Ext.form.TriggerField,{triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,strategy:undefined,onRender:function(b,a){Ext.ux.form.Spinner.superclass.onRender.call(this,b,a);this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.show().setRight((Ext.isIE)?1:2);this.splitter.show().setTop(10);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.initSpinner()},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){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);this.repeater.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.on("mouseover",this.onMouseOver,this,{preventDefault:true});this.trigger.on("mouseout",this.onMouseOut,this,{preventDefault:true});this.trigger.on("mousemove",this.onMouseMove,this,{preventDefault:true});this.trigger.on("mousedown",this.onMouseDown,this,{preventDefault:true});this.trigger.on("mouseup",this.onMouseUp,this,{preventDefault:true});this.wrap.on("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);if("object"==typeof this.strategy&&this.strategy.xtype){switch(this.strategy.xtype){case"number":this.strategy=new Ext.ux.form.Spinner.NumberStrategy(this.strategy);break;case"date":this.strategy=new Ext.ux.form.Spinner.DateStrategy(this.strategy);break;case"time":this.strategy=new Ext.ux.form.Spinner.TimeStrategy(this.strategy);break;default:delete (this.strategy);break}delete (this.strategy.xtype)}if(this.strategy==undefined){this.strategy=new Ext.ux.form.Spinner.NumberStrategy()}},onMouseOver:function(){if(this.disabled){return}var a=this.getMiddle();this.__tmphcls=(Ext.EventObject.getPageY()a)&&this.__tmphcls=="x-form-spinner-overup")||((Ext.EventObject.getPageY()0){this.onSpinUp();a.stopEvent()}else{if(b<0){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){return}var b=Ext.fly(this.dd.getDragEl()).getTop();var a="";if(this._previousY>b){a="Up"}if(this._previousYthis.maxValue){a=this.maxValue}return this.fixPrecision(a)},fixPrecision:function(b){var a=isNaN(b);if(!this.allowDecimals||this.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.decimalPrecision))}});Ext.ux.form.Spinner.DateStrategy=function(a){Ext.ux.form.Spinner.DateStrategy.superclass.constructor.call(this,a)};Ext.extend(Ext.ux.form.Spinner.DateStrategy,Ext.ux.form.Spinner.Strategy,{defaultValue:new Date(),format:"Y-m-d",incrementValue:1,incrementConstant:Date.DAY,alternateIncrementValue:1,alternateIncrementConstant:Date.MONTH,spin:function(d,g,e){Ext.ux.form.Spinner.DateStrategy.superclass.spin.call(this);var a=d.getRawValue();a=Date.parseDate(a,this.format);var c=(g==true)?-1:1;var f=(e==true)?this.alternateIncrementValue:this.incrementValue;var b=(e==true)?this.alternateIncrementConstant:this.incrementConstant;if(typeof this.defaultValue=="string"){this.defaultValue=Date.parseDate(this.defaultValue,this.format)}a=(a)?a.add(b,c*f):this.defaultValue;a=this.fixBoundries(a);d.setRawValue(Ext.util.Format.date(a,this.format))},fixBoundries:function(b){var d=b;var c=(typeof this.minValue=="string")?Date.parseDate(this.minValue,this.format):this.minValue;var a=(typeof this.maxValue=="string")?Date.parseDate(this.maxValue,this.format):this.maxValue;if(this.minValue!=undefined&&da){d=a}return d}});Ext.ux.form.Spinner.TimeStrategy=function(a){Ext.ux.form.Spinner.TimeStrategy.superclass.constructor.call(this,a)};Ext.extend(Ext.ux.form.Spinner.TimeStrategy,Ext.ux.form.Spinner.DateStrategy,{format:"H:i",incrementValue:1,incrementConstant:Date.MINUTE,alternateIncrementValue:1,alternateIncrementConstant:Date.HOUR});Ext.tree.ColumnTree=Ext.extend(Ext.tree.TreePanel,{lines:false,borderWidth:Ext.isBorderBox?0:2,cls:"x-column-tree",onRender:function(){Ext.tree.ColumnTree.superclass.onRender.apply(this,arguments);this.headers=this.body.createChild({cls:"x-tree-headers"},this.innerCt.dom);var e=this.columns,f;var b=0;for(var d=0,a=e.length;d
    ','
    ','',this.indentMarkup,"",'','',f?('':"/>")):"",'",'',e.text||(m.renderer?m.renderer(q[m.dataIndex],e,q):q[m.dataIndex]),"","
    "];for(var g=1,k=p.length;g','
    ',(m.renderer?m.renderer(q[m.dataIndex],e,q):q[m.dataIndex]),"
    ","
    ")}d.push('
    ','',"");if(r!==true&&e.nextSibling&&e.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",e.nextSibling.ui.getEl(),d.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",l,d.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var j=this.elNode.firstChild.childNodes;this.indentNode=j[0];this.ecNode=j[1];this.iconNode=j[2];var h=3;if(f){this.checkbox=j[3];this.checkbox.defaultChecked=this.checkbox.checked;h++}this.anchor=j[h];this.columnNodes=[j[h].firstChild];for(var g=1,k=p.length;g