diff options
Diffstat (limited to 'deluge/ui/web/js/extjs/ext-extensions-debug.js')
-rw-r--r-- | deluge/ui/web/js/extjs/ext-extensions-debug.js | 338 |
1 files changed, 167 insertions, 171 deletions
diff --git a/deluge/ui/web/js/extjs/ext-extensions-debug.js b/deluge/ui/web/js/extjs/ext-extensions-debug.js index a5b4a60..8a05e61 100644 --- a/deluge/ui/web/js/extjs/ext-extensions-debug.js +++ b/deluge/ui/web/js/extjs/ext-extensions-debug.js @@ -50,7 +50,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { autoSize: Ext.emptyFn, // private - initComponent: function() { + initComponent: function () { Ext.ux.form.FileUploadField.superclass.initComponent.call(this); this.addEvents( @@ -66,7 +66,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { }, // private - onRender: function(ct, position) { + onRender: function (ct, position) { Ext.ux.form.FileUploadField.superclass.onRender.call( this, ct, @@ -97,30 +97,30 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { this.resizeEl = this.positionEl = this.wrap; }, - bindListeners: function() { + bindListeners: function () { this.fileInput.on({ scope: this, - mouseenter: function() { + mouseenter: function () { this.button.addClass(['x-btn-over', 'x-btn-focus']); }, - mouseleave: function() { + mouseleave: function () { this.button.removeClass([ 'x-btn-over', 'x-btn-focus', 'x-btn-click', ]); }, - mousedown: function() { + mousedown: function () { this.button.addClass('x-btn-click'); }, - mouseup: function() { + mouseup: function () { this.button.removeClass([ 'x-btn-over', 'x-btn-focus', 'x-btn-click', ]); }, - change: function() { + change: function () { var value = this.fileInput.dom.files; // Fallback to value. if (!value) value = this.fileInput.dom.value; @@ -130,7 +130,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { }); }, - createFileInput: function() { + createFileInput: function () { this.fileInput = this.wrap.createChild({ id: this.getFileInputId(), name: this.name || this.getId(), @@ -142,7 +142,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { this.fileInput.dom.multiple = this.multiple; }, - reset: function() { + reset: function () { if (this.rendered) { this.fileInput.remove(); this.createFileInput(); @@ -152,12 +152,12 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { }, // private - getFileInputId: function() { + getFileInputId: function () { return this.id + '-file'; }, // private - onResize: function(w, h) { + onResize: function (w, h) { Ext.ux.form.FileUploadField.superclass.onResize.call(this, w, h); this.wrap.setWidth(w); @@ -172,23 +172,23 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { }, // private - onDestroy: function() { + onDestroy: function () { Ext.ux.form.FileUploadField.superclass.onDestroy.call(this); Ext.destroy(this.fileInput, this.button, this.wrap); }, - onDisable: function() { + onDisable: function () { Ext.ux.form.FileUploadField.superclass.onDisable.call(this); this.doDisable(true); }, - onEnable: function() { + onEnable: function () { Ext.ux.form.FileUploadField.superclass.onEnable.call(this); this.doDisable(false); }, // private - doDisable: function(disabled) { + doDisable: function (disabled) { this.fileInput.dom.disabled = disabled; this.button.setDisabled(disabled); }, @@ -197,7 +197,7 @@ Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, { preFocus: Ext.emptyFn, // private - alignErrorIcon: function() { + alignErrorIcon: function () { this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); }, }); @@ -218,8 +218,8 @@ Ext.form.FileUploadField = Ext.ux.form.FileUploadField; // Allow radiogroups to be treated as a single form element. Ext.override(Ext.form.RadioGroup, { - afterRender: function() { - this.items.each(function(i) { + afterRender: function () { + this.items.each(function (i) { this.relayEvents(i, ['check']); }, this); if (this.lazyValue) { @@ -230,21 +230,21 @@ Ext.override(Ext.form.RadioGroup, { Ext.form.RadioGroup.superclass.afterRender.call(this); }, - getName: function() { + getName: function () { return this.items.first().getName(); }, - getValue: function() { + getValue: function () { return this.items.first().getGroupValue(); }, - setValue: function(v) { + setValue: function (v) { if (!this.items.each) { this.value = v; this.lazyValue = true; return; } - this.items.each(function(item) { + this.items.each(function (item) { if (item.rendered) { var checked = item.el.getValue() == String(v); item.el.dom.checked = checked; @@ -277,7 +277,7 @@ Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, { onBlur: Ext.emptyFn, adjustSize: Ext.BoxComponent.prototype.adjustSize, - constructor: function(config) { + constructor: function (config) { var spinnerConfig = Ext.copyTo( {}, config, @@ -299,23 +299,23 @@ Ext.ux.form.SpinnerField = Ext.extend(Ext.form.NumberField, { }, // private - getResizeEl: function() { + getResizeEl: function () { return this.wrap; }, // private - getPositionEl: function() { + getPositionEl: function () { return this.wrap; }, // private - alignErrorIcon: function() { + alignErrorIcon: function () { if (this.wrap) { this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]); } }, - validateBlur: function() { + validateBlur: function () { return true; }, }); @@ -362,7 +362,7 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, { colCfg: {}, // private - onRender: function(ct, position) { + onRender: function (ct, position) { if (!this.el) { var panelCfg = { cls: this.groupCls, @@ -419,9 +419,8 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, { // Generate the column configs with the correct width setting for (var i = 0; i < numCols; i++) { var cc = Ext.apply({ items: [] }, colCfg); - cc[ - this.columns[i] <= 1 ? 'columnWidth' : 'width' - ] = this.columns[i]; + cc[this.columns[i] <= 1 ? 'columnWidth' : 'width'] = + this.columns[i]; if (this.defaults) { cc.defaults = Ext.apply( cc.defaults || {}, @@ -470,14 +469,14 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, { } } - var fields = this.panel.findBy(function(c) { + var fields = this.panel.findBy(function (c) { return c.isFormField; }, this); this.items = new Ext.util.MixedCollection(); this.items.addAll(fields); - this.items.each(function(field) { + this.items.each(function (field) { field.on('spin', this.onFieldChange, this); field.on('change', this.onFieldChange, this); }, this); @@ -498,45 +497,45 @@ Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, { Ext.ux.form.SpinnerGroup.superclass.onRender.call(this, ct, position); }, - onFieldChange: function(spinner) { + onFieldChange: function (spinner) { this.fireEvent('change', this, this.getValue()); }, initValue: Ext.emptyFn, - getValue: function() { + getValue: function () { var value = [this.items.getCount()]; - this.items.each(function(item, i) { + this.items.each(function (item, i) { value[i] = Number(item.getValue()); }); return value; }, - getRawValue: function() { + getRawValue: function () { var value = [this.items.getCount()]; - this.items.each(function(item, i) { + this.items.each(function (item, i) { value[i] = Number(item.getRawValue()); }); return value; }, - setValue: function(value) { + setValue: function (value) { if (!this.rendered) { this.value = value; this.lazyValueSet = true; } else { - this.items.each(function(item, i) { + this.items.each(function (item, i) { item.setValue(value[i]); }); } }, - setRawValue: function(value) { + setRawValue: function (value) { if (!this.rendered) { this.rawValue = value; this.lazyRawValueSet = true; } else { - this.items.each(function(item, i) { + this.items.each(function (item, i) { item.setRawValue(value[i]); }); } @@ -566,7 +565,7 @@ Ext.namespace('Ext.ux.form'); Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, { cls: 'x-toggle-field', - initComponent: function() { + initComponent: function () { Ext.ux.form.ToggleField.superclass.initComponent.call(this); this.toggle = new Ext.form.Checkbox(); @@ -577,7 +576,7 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, { }); }, - onRender: function(ct, position) { + onRender: function (ct, position) { if (!this.el) { this.panel = new Ext.Panel({ cls: this.groupCls, @@ -595,16 +594,13 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, { this.panel.add(this.input); this.panel.doLayout(); - this.toggle - .getEl() - .parent() - .setStyle('padding-right', '10px'); + this.toggle.getEl().parent().setStyle('padding-right', '10px'); } Ext.ux.form.ToggleField.superclass.onRender.call(this, ct, position); }, // private - onResize: function(w, h) { + onResize: function (w, h) { this.panel.setSize(w, h); this.panel.doLayout(); @@ -613,7 +609,7 @@ Ext.ux.form.ToggleField = Ext.extend(Ext.form.Field, { this.input.setSize(inputWidth, h); }, - onToggleCheck: function(toggle, checked) { + onToggleCheck: function (toggle, checked) { this.input.setDisabled(!checked); }, }); @@ -666,7 +662,7 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { */ cleanDelay: 500, - initTemplates: function() { + initTemplates: function () { Ext.ux.grid.BufferView.superclass.initTemplates.call(this); var ts = this.templates; // empty div to act as a place holder for a row @@ -688,23 +684,23 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { ts.rowBody.compile(); }, - getStyleRowHeight: function() { + getStyleRowHeight: function () { return Ext.isBorderBox ? this.rowHeight + this.borderHeight : this.rowHeight; }, - getCalculatedRowHeight: function() { + getCalculatedRowHeight: function () { return this.rowHeight + this.borderHeight; }, - getVisibleRowCount: function() { + getVisibleRowCount: function () { var rh = this.getCalculatedRowHeight(), visibleHeight = this.scroller.dom.clientHeight; return visibleHeight < 1 ? 0 : Math.ceil(visibleHeight / rh); }, - getVisibleRows: function() { + getVisibleRows: function () { var count = this.getVisibleRowCount(), sc = this.scroller.dom.scrollTop, start = @@ -717,7 +713,7 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { }; }, - doRender: function(cs, rs, ds, startRow, colCount, stripe, onlyBody) { + doRender: function (cs, rs, ds, startRow, colCount, stripe, onlyBody) { var ts = this.templates, ct = ts.cell, rt = ts.row, @@ -782,18 +778,18 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { return buf.join(''); }, - isRowRendered: function(index) { + isRowRendered: function (index) { var row = this.getRow(index); return row && row.childNodes.length > 0; }, - syncScroll: function() { + syncScroll: function () { Ext.ux.grid.BufferView.superclass.syncScroll.apply(this, arguments); this.update(); }, // a (optionally) buffered method to update contents of gridview - update: function() { + update: function () { if (this.scrollDelay) { if (!this.renderTask) { this.renderTask = new Ext.util.DelayedTask(this.doUpdate, this); @@ -804,14 +800,14 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { } }, - onRemove: function(ds, record, index, isUpdate) { + onRemove: function (ds, record, index, isUpdate) { Ext.ux.grid.BufferView.superclass.onRemove.apply(this, arguments); if (isUpdate !== true) { this.update(); } }, - doUpdate: function() { + doUpdate: function () { if (this.getVisibleRowCount() > 0) { var g = this.grid, cm = g.colModel, @@ -839,14 +835,14 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { }, // a buffered method to clean rows - clean: function() { + clean: function () { if (!this.cleanTask) { this.cleanTask = new Ext.util.DelayedTask(this.doClean, this); } this.cleanTask.delay(this.cleanDelay); }, - doClean: function() { + doClean: function () { if (this.getVisibleRowCount() > 0) { var vr = this.getVisibleRows(); vr.first -= this.cacheSize; @@ -869,7 +865,7 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { } }, - removeTask: function(name) { + removeTask: function (name) { var task = this[name]; if (task && task.cancel) { task.cancel(); @@ -877,13 +873,13 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { } }, - destroy: function() { + destroy: function () { this.removeTask('cleanTask'); this.removeTask('renderTask'); Ext.ux.grid.BufferView.superclass.destroy.call(this); }, - layout: function() { + layout: function () { Ext.ux.grid.BufferView.superclass.layout.call(this); this.update(); }, @@ -902,7 +898,7 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, { // remove spaces for hidden elements and make show(), hide(), enable() and disable() act on // the label. don't use hideLabel with this. Ext.override(Ext.layout.FormLayout, { - renderItem: function(c, position, target) { + renderItem: function (c, position, target) { if ( c && !c.rendered && @@ -942,7 +938,7 @@ Ext.override(Ext.layout.FormLayout, { * @author Damien Churchill <damoxc@gmail.com> */ Ext.override(Ext.tree.MultiSelectionModel, { - onNodeClick: function(node, e) { + onNodeClick: function (node, e) { if (e.ctrlKey && this.isSelected(node)) { this.unselect(node); } else if (e.shiftKey && !this.isSelected(node)) { @@ -963,7 +959,7 @@ Ext.override(Ext.tree.MultiSelectionModel, { } // Select all the nodes - parentNode.eachChild(function(n) { + parentNode.eachChild(function (n) { var i = parentNode.indexOf(n); if (fi < i && i < li) { this.select(n, e, true, true); @@ -977,7 +973,7 @@ Ext.override(Ext.tree.MultiSelectionModel, { } }, - select: function(node, e, keepExisting, suppressEvent) { + select: function (node, e, keepExisting, suppressEvent) { if (keepExisting !== true) { this.clearSelections(true); } @@ -1023,7 +1019,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { columnsText: 'Columns', - initComponent: function() { + initComponent: function () { if (!this.root) { this.root = new Ext.tree.AsyncTreeNode({ text: 'Root' }); } @@ -1095,7 +1091,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { } }, - initColumns: function() { + initColumns: function () { var cs = this.columns, len = cs.length, columns = [], @@ -1124,7 +1120,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { this.columns = columns; }, - onRender: function() { + onRender: function () { Ext.tree.TreePanel.superclass.onRender.apply(this, arguments); this.el.addClass('x-treegrid'); @@ -1173,7 +1169,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { } }, - setRootNode: function(node) { + setRootNode: function (node) { node.attributes.uiProvider = Ext.ux.tree.TreeGridRootNodeUI; node = Ext.ux.tree.TreeGrid.superclass.setRootNode.call(this, node); if (this.innerCt) { @@ -1184,7 +1180,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { return node; }, - clearInnerCt: function() { + clearInnerCt: function () { if (Ext.isIE) { var dom = this.innerCt.dom; while (dom.firstChild) { @@ -1195,7 +1191,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { } }, - initEvents: function() { + initEvents: function () { Ext.ux.tree.TreeGrid.superclass.initEvents.apply(this, arguments); this.mon(this.innerBody, 'scroll', this.syncScroll, this); @@ -1207,7 +1203,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }); }, - onResize: function(w, h) { + onResize: function (w, h) { Ext.ux.tree.TreeGrid.superclass.onResize.apply(this, arguments); var bd = this.innerBody.dom; @@ -1231,7 +1227,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { this.setScrollOffset(sw); } else { var me = this; - setTimeout(function() { + setTimeout(function () { me.setScrollOffset( bd.offsetWidth - bd.clientWidth > 10 ? sw : 0 ); @@ -1240,7 +1236,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { } }, - updateColumnWidths: function() { + updateColumnWidths: function () { var cols = this.columns, colCount = cols.length, groups = this.outerCt.query('colgroup'), @@ -1279,7 +1275,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { this.syncHeaderScroll(); }, - getVisibleColumns: function() { + getVisibleColumns: function () { var columns = [], cs = this.columns, len = cs.length, @@ -1293,7 +1289,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { return columns; }, - getTotalColumnWidth: function() { + getTotalColumnWidth: function () { var total = 0; for ( var i = 0, cs = this.getVisibleColumns(), len = cs.length; @@ -1305,13 +1301,13 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { return total; }, - setScrollOffset: function(scrollOffset) { + setScrollOffset: function (scrollOffset) { this.scrollOffset = scrollOffset; this.updateColumnWidths(); }, // private - handleHdDown: function(e, t) { + handleHdDown: function (e, t) { var hd = e.getTarget('.x-treegrid-hd'); if (hd && Ext.fly(t).hasClass('x-grid3-hd-btn')) { @@ -1329,7 +1325,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { this.hmenu.on( 'hide', - function() { + function () { Ext.fly(hd).removeClass('x-grid3-hd-menu-open'); }, this, @@ -1344,7 +1340,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }, // private - handleHdOver: function(e, t) { + handleHdOver: function (e, t) { var hd = e.getTarget('.x-treegrid-hd'); if (hd && !this.headersDisabled) { index = this.findHeaderIndex(hd); @@ -1362,7 +1358,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }, // private - handleHdOut: function(e, t) { + handleHdOut: function (e, t) { var hd = e.getTarget('.x-treegrid-hd'); if (hd && (!Ext.isIE || !e.within(hd, true))) { this.activeHdRef = null; @@ -1371,7 +1367,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { } }, - findHeaderIndex: function(hd) { + findHeaderIndex: function (hd) { hd = hd.dom || hd; var cs = hd.parentNode.childNodes; for (var i = 0, c; (c = cs[i]); i++) { @@ -1383,7 +1379,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }, // private - beforeColMenuShow: function() { + beforeColMenuShow: function () { var cols = this.columns, colCount = cols.length, i, @@ -1406,7 +1402,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }, // private - handleHdMenuClick: function(item) { + handleHdMenuClick: function (item) { var index = this.hdCtxIndex, id = item.getItemId(); @@ -1427,7 +1423,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { return true; }, - setColumnVisible: function(index, visible) { + setColumnVisible: function (index, visible) { this.columns[index].hidden = !visible; this.updateColumnWidths(); }, @@ -1435,26 +1431,26 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { /** * Scrolls the grid to the top */ - scrollToTop: function() { + scrollToTop: function () { this.innerBody.dom.scrollTop = 0; this.innerBody.dom.scrollLeft = 0; }, // private - syncScroll: function() { + syncScroll: function () { this.syncHeaderScroll(); var mb = this.innerBody.dom; this.fireEvent('bodyscroll', mb.scrollLeft, mb.scrollTop); }, // private - syncHeaderScroll: function() { + syncHeaderScroll: function () { var mb = this.innerBody.dom; this.innerHd.dom.scrollLeft = mb.scrollLeft; this.innerHd.dom.scrollLeft = mb.scrollLeft; // second time for IE (1/2 time first fails, other browsers ignore) }, - registerNode: function(n) { + 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); @@ -1480,17 +1476,17 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { */ minWidth: 14, - constructor: function(config) { + constructor: function (config) { Ext.apply(this, config); Ext.tree.ColumnResizer.superclass.constructor.call(this); }, - init: function(tree) { + init: function (tree) { this.tree = tree; tree.on('render', this.initEvents, this); }, - initEvents: function(tree) { + initEvents: function (tree) { tree.mon(tree.innerHd, 'mousemove', this.handleHdMove, this); this.tracker = new Ext.dd.DragTracker({ onBeforeStart: this.onBeforeStart.createDelegate(this), @@ -1504,7 +1500,7 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { tree.on('beforedestroy', this.tracker.destroy, this.tracker); }, - handleHdMove: function(e, t) { + handleHdMove: function (e, t) { var hw = 5, x = e.getPageX(), hd = e.getTarget('.x-treegrid-hd', 3, true); @@ -1539,12 +1535,12 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { } }, - onBeforeStart: function(e) { + onBeforeStart: function (e) { this.dragHd = this.activeHd; return !!this.dragHd; }, - onStart: function(e) { + onStart: function (e) { this.dragHeadersDisabled = this.tree.headersDisabled; this.tree.headersDisabled = true; this.proxy = this.tree.body.createChild({ cls: 'x-treegrid-resizer' }); @@ -1563,14 +1559,14 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { this.tree.innerBody.translatePoints(this.hdX).left; }, - onDrag: function(e) { + onDrag: function (e) { var cursorX = this.tracker.getXY()[0]; this.proxy.setWidth( (cursorX - this.hdX).constrain(this.minWidth, this.maxWidth) ); }, - onEnd: function(e) { + onEnd: function (e) { var nw = this.proxy.getWidth(), tree = this.tree, disabled = this.dragHeadersDisabled; @@ -1581,7 +1577,7 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { tree.columns[this.hdIndex].width = nw; tree.updateColumnWidths(); - setTimeout(function() { + setTimeout(function () { tree.headersDisabled = disabled; }, 100); }, @@ -1592,9 +1588,9 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { * licensing@sencha.com * http://www.sencha.com/license */ -(function() { +(function () { Ext.override(Ext.list.Column, { - init: function() { + init: function () { var types = Ext.data.Types, st = this.sortType; @@ -1637,7 +1633,7 @@ Ext.tree.ColumnResizer = Ext.extend(Ext.util.Observable, { * @extends Ext.tree.TreeLoader */ Ext.ux.tree.TreeGridLoader = Ext.extend(Ext.tree.TreeLoader, { - createNode: function(attr) { + createNode: function (attr) { if (!attr.uiProvider) { attr.uiProvider = Ext.ux.tree.TreeGridNodeUI; } @@ -1657,7 +1653,7 @@ Ext.ux.tree.TreeGridLoader = Ext.extend(Ext.tree.TreeLoader, { Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { isTreeGridNodeUI: true, - renderElements: function(n, a, targetNode, bulkRender) { + renderElements: function (n, a, targetNode, bulkRender) { var t = n.getOwnerTree(), cols = t.columns, c = cols[0], @@ -1757,7 +1753,7 @@ Ext.ux.tree.TreeGridNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { }, // private - animExpand: function(cb) { + animExpand: function (cb) { this.ctNode.style.display = ''; Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this, cb); }, @@ -1767,7 +1763,7 @@ Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { isTreeGridNodeUI: true, // private - render: function() { + render: function () { if (!this.rendered) { this.wrap = this.ctNode = this.node.ownerTree.innerCt.dom; this.node.expanded = true; @@ -1777,13 +1773,13 @@ Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { // weird table-layout: fixed issue in webkit var ct = this.ctNode; ct.style.tableLayout = null; - (function() { + (function () { ct.style.tableLayout = 'fixed'; }.defer(1)); } }, - destroy: function() { + destroy: function () { if (this.elNode) { Ext.dd.Registry.unregister(this.elNode.id); } @@ -1804,7 +1800,7 @@ Ext.ux.tree.TreeGridRootNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { */ Ext.override(Ext.ux.tree.TreeGridNodeUI, { - updateColumns: function() { + updateColumns: function () { if (!this.rendered) return; var a = this.node.attributes, @@ -1827,7 +1823,7 @@ Ext.override(Ext.ux.tree.TreeGridNodeUI, { }, }); Ext.tree.RenderColumn = Ext.extend(Ext.tree.Column, { - constructor: function(c) { + constructor: function (c) { c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}'); c.tpl.format = c.renderer; c.tpl.col = this; @@ -1877,7 +1873,7 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { */ sortDescText: 'Sort Descending', - constructor: function(tree, config) { + constructor: function (tree, config) { if (!Ext.isObject(config)) { config = { property: tree.columns[0].dataIndex || 'text', @@ -1895,7 +1891,7 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { tree.ddAppendOnly = true; var me = this; - this.defaultSortFn = function(n1, n2) { + this.defaultSortFn = function (n1, n2) { var desc = me.dir && me.dir.toLowerCase() == 'desc', prop = me.property || 'text', sortType = me.sortType, @@ -1938,7 +1934,7 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { tree.on('headermenuclick', this.onHeaderMenuClick, this); }, - onAfterTreeRender: function() { + onAfterTreeRender: function () { if (this.tree.hmenu) { this.tree.hmenu.insert( 0, @@ -1957,14 +1953,14 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { this.updateSortIcon(0, 'asc'); }, - onHeaderMenuClick: function(c, id, index) { + onHeaderMenuClick: function (c, id, index) { if (id === 'asc' || id === 'desc') { this.onHeaderClick(c, null, index); return false; } }, - onHeaderClick: function(c, el, i) { + onHeaderClick: function (c, el, i) { if (c && !this.tree.headersDisabled) { var me = this; @@ -1976,7 +1972,7 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { : this.caseSensitive; me.sortFn = c.sortFn || this.defaultSortFn; - this.tree.root.cascade(function(n) { + this.tree.root.cascade(function (n) { if (!n.isLeaf()) { me.updateSort(me.tree, n); } @@ -1987,13 +1983,13 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, { }, // private - updateSortIcon: function(col, 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 = function (options) { Ext.ux.JSLoader.scripts[++Ext.ux.JSLoader.index] = { url: options.url, success: true, @@ -2007,7 +2003,7 @@ Ext.ux.JSLoader = function(options) { Ext.Ajax.request({ url: options.url, scriptIndex: Ext.ux.JSLoader.index, - success: function(response, options) { + success: function (response, options) { var script = Ext.ux.JSLoader.scripts[options.scriptIndex]; try { eval(response.responseText); @@ -2019,7 +2015,7 @@ Ext.ux.JSLoader = function(options) { script.onLoad.call(script.scope, script.options); } }, - failure: function(response, options) { + failure: function (response, options) { var script = Ext.ux.JSLoader.scripts[options.scriptIndex]; script.success = false; script.onError(script.options, response.status); @@ -2028,7 +2024,7 @@ Ext.ux.JSLoader = function(options) { }; Ext.ux.JSLoader.index = 0; Ext.ux.JSLoader.scripts = []; -Ext.ux.JSLoader.stdError = function(options, e) { +Ext.ux.JSLoader.stdError = function (options, e) { window.alert( 'Error loading script:\n\n' + options.url + '\n\nstatus: ' + e ); @@ -2053,13 +2049,13 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { defaultValue: 0, accelerate: false, - constructor: function(config) { + constructor: function (config) { Ext.ux.Spinner.superclass.constructor.call(this, config); Ext.apply(this, config); this.mimicing = false; }, - init: function(field) { + init: function (field) { this.field = field; field.afterMethod('onRender', this.doRender, this); @@ -2071,7 +2067,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { field.beforeMethod('onDestroy', this.doDestroy, this); }, - doRender: function(ct, position) { + doRender: function (ct, position) { var el = (this.el = this.field.getEl()); var f = this.field; @@ -2116,7 +2112,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { this.initSpinner(); }, - doAfterRender: function() { + doAfterRender: function () { var y; if (Ext.isIE && this.el.getY() != (y = this.trigger.getY())) { this.el.position(); @@ -2124,14 +2120,14 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { } }, - doEnable: function() { + doEnable: function () { if (this.wrap) { this.disabled = false; this.wrap.removeClass(this.field.disabledClass); } }, - doDisable: function() { + doDisable: function () { if (this.wrap) { this.disabled = true; this.wrap.addClass(this.field.disabledClass); @@ -2139,14 +2135,14 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { } }, - doResize: function(w, h) { + 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() { + doFocus: function () { if (!this.mimicing) { this.wrap.addClass('x-trigger-wrap-focus'); this.mimicing = true; @@ -2163,21 +2159,21 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, // private - checkTab: function(e) { + checkTab: function (e) { if (e.getKey() == e.TAB) { this.triggerBlur(); } }, // private - mimicBlur: function(e) { + mimicBlur: function (e) { if (!this.wrap.contains(e.target) && this.field.validateBlur(e)) { this.triggerBlur(); } }, // private - triggerBlur: function() { + triggerBlur: function () { this.mimicing = false; Ext.get(Ext.isIE ? document.body : document).un( 'mousedown', @@ -2190,12 +2186,12 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { this.field.onBlur.call(this.field); }, - initTrigger: function() { + initTrigger: function () { this.trigger.addClassOnOver('x-form-trigger-over'); this.trigger.addClassOnClick('x-form-trigger-click'); }, - initSpinner: function() { + initSpinner: function () { this.field.addEvents({ spin: true, spinup: true, @@ -2203,22 +2199,22 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }); this.keyNav = new Ext.KeyNav(this.el, { - up: function(e) { + up: function (e) { e.preventDefault(); this.onSpinUp(); }, - down: function(e) { + down: function (e) { e.preventDefault(); this.onSpinDown(); }, - pageUp: function(e) { + pageUp: function (e) { e.preventDefault(); this.onSpinUpAlternate(); }, - pageDown: function(e) { + pageDown: function (e) { e.preventDefault(); this.onSpinDownAlternate(); }, @@ -2252,7 +2248,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { this.dd.onDrag = this.onDrag.createDelegate(this); }, - onMouseOver: function() { + onMouseOver: function () { if (this.disabled) { return; } @@ -2265,12 +2261,12 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onMouseOut: function() { + onMouseOut: function () { this.trigger.removeClass(this.tmpHoverClass); }, //private - onMouseMove: function() { + onMouseMove: function () { if (this.disabled) { return; } @@ -2285,7 +2281,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onMouseDown: function() { + onMouseDown: function () { if (this.disabled) { return; } @@ -2298,12 +2294,12 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onMouseUp: function() { + onMouseUp: function () { this.trigger.removeClass(this.tmpClickClass); }, //private - onTriggerClick: function() { + onTriggerClick: function () { if (this.disabled || this.el.dom.readOnly) { return; } @@ -2313,7 +2309,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - getMiddle: function() { + getMiddle: function () { var t = this.trigger.getTop(); var h = this.trigger.getHeight(); var middle = t + h / 2; @@ -2322,7 +2318,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { //private //checks if control is allowed to spin - isSpinnable: function() { + isSpinnable: function () { if (this.disabled || this.el.dom.readOnly) { Ext.EventObject.preventDefault(); //prevent scrolling when disabled/readonly return false; @@ -2330,7 +2326,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { return true; }, - handleMouseWheel: function(e) { + handleMouseWheel: function (e) { //disable scrolling when not focused if (this.wrap.hasClass('x-trigger-wrap-focus') == false) { return; @@ -2347,18 +2343,18 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - startDrag: function() { + startDrag: function () { this.proxy.show(); this._previousY = Ext.fly(this.dd.getDragEl()).getTop(); }, //private - endDrag: function() { + endDrag: function () { this.proxy.hide(); }, //private - onDrag: function() { + onDrag: function () { if (this.disabled) { return; } @@ -2379,7 +2375,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onSpinUp: function() { + onSpinUp: function () { if (this.isSpinnable() == false) { return; } @@ -2394,7 +2390,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onSpinDown: function() { + onSpinDown: function () { if (this.isSpinnable() == false) { return; } @@ -2409,7 +2405,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onSpinUpAlternate: function() { + onSpinUpAlternate: function () { if (this.isSpinnable() == false) { return; } @@ -2419,7 +2415,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, //private - onSpinDownAlternate: function() { + onSpinDownAlternate: function () { if (this.isSpinnable() == false) { return; } @@ -2428,7 +2424,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { this.field.fireEvent('spindown', this); }, - spin: function(down, alternate) { + spin: function (down, alternate) { var v = parseFloat(this.field.getValue()); var incr = alternate == true @@ -2441,7 +2437,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { this.field.setRawValue(v); }, - fixBoundries: function(value) { + fixBoundries: function (value) { var v = value; if (this.field.minValue != undefined && v < this.field.minValue) { @@ -2455,7 +2451,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { }, // private - fixPrecision: function(value) { + fixPrecision: function (value) { var nan = isNaN(value); if ( !this.field.allowDecimals || @@ -2470,7 +2466,7 @@ Ext.ux.Spinner = Ext.extend(Ext.util.Observable, { ); }, - doDestroy: function() { + doDestroy: function () { if (this.trigger) { this.trigger.remove(); } @@ -2692,7 +2688,7 @@ sb.setStatus({ activeThreadId: 0, // private - initComponent: function() { + initComponent: function () { if (this.statusAlign == 'right') { this.cls += ' x-status-right'; } @@ -2700,7 +2696,7 @@ sb.setStatus({ }, // private - afterRender: function() { + afterRender: function () { Ext.ux.StatusBar.superclass.afterRender.call(this); var right = this.statusAlign == 'right'; @@ -2769,7 +2765,7 @@ statusBar.setStatus({ </code></pre> * @return {Ext.ux.StatusBar} this */ - setStatus: function(o) { + setStatus: function (o) { o = o || {}; if (typeof o == 'string') { @@ -2816,7 +2812,7 @@ statusBar.setStatus({ * </ul> * @return {Ext.ux.StatusBar} this */ - clearStatus: function(o) { + clearStatus: function (o) { o = o || {}; if (o.threadId && o.threadId !== this.activeThreadId) { @@ -2839,7 +2835,7 @@ statusBar.setStatus({ remove: false, useDisplay: true, scope: this, - callback: function() { + callback: function () { this.setStatus({ text: text, iconCls: iconCls, @@ -2865,7 +2861,7 @@ statusBar.setStatus({ * @param {String} text (optional) The text to set (defaults to '') * @return {Ext.ux.StatusBar} this */ - setText: function(text) { + setText: function (text) { this.activeThreadId++; this.text = text || ''; if (this.rendered) { @@ -2878,7 +2874,7 @@ statusBar.setStatus({ * Returns the current status text. * @return {String} The status text */ - getText: function() { + getText: function () { return this.text; }, @@ -2888,7 +2884,7 @@ statusBar.setStatus({ * @param {String} iconCls (optional) The icon class to set (defaults to '', and any current icon class is removed) * @return {Ext.ux.StatusBar} this */ - setIcon: function(cls) { + setIcon: function (cls) { this.activeThreadId++; cls = cls || ''; @@ -2917,7 +2913,7 @@ statusBar.setStatus({ * {@link #busyIconCls} will be used in conjunction with all of the default options for {@link #setStatus}. * @return {Ext.ux.StatusBar} this */ - showBusy: function(o) { + showBusy: function (o) { if (typeof o == 'string') { o = { text: o }; } |