diff --git a/deluge/ui/web/js/ext-extensions-debug.js b/deluge/ui/web/js/ext-extensions-debug.js index c41501ac8..8bf134931 100644 --- a/deluge/ui/web/js/ext-extensions-debug.js +++ b/deluge/ui/web/js/ext-extensions-debug.js @@ -55,17 +55,17 @@ Ext.override(Ext.layout.FormLayout, { } }); /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.4.0 + * Copyright(c) 2006-2011 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ Ext.ns('Ext.ux.tree'); /** * @class Ext.ux.tree.TreeGrid * @extends Ext.tree.TreePanel - * + * * @xtype treegrid */ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { @@ -79,14 +79,14 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { enableSort : true, reserveScrollOffset : true, enableHdMenu : true, - + columnsText : 'Columns', initComponent : function() { if(!this.root) { this.root = new Ext.tree.AsyncTreeNode({text: 'Root'}); } - + // initialize the loader var l = this.loader; if(!l){ @@ -98,36 +98,28 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { }else if(Ext.isObject(l) && !l.load){ l = new Ext.ux.tree.TreeGridLoader(l); } - else if(l) { - l.createNode = function(attr) { - if (!attr.uiProvider) { - attr.uiProvider = Ext.ux.tree.TreeGridNodeUI; - } - return Ext.tree.TreeLoader.prototype.createNode.call(this, attr); - } - } this.loader = l; - - Ext.ux.tree.TreeGrid.superclass.initComponent.call(this); - + + Ext.ux.tree.TreeGrid.superclass.initComponent.call(this); + this.initColumns(); - + if(this.enableSort) { this.treeGridSorter = new Ext.ux.tree.TreeGridSorter(this, this.enableSort); } - + if(this.columnResize){ this.colResizer = new Ext.tree.ColumnResizer(this.columnResize); this.colResizer.init(this); } - + var c = this.columns; - if(!this.internalTpl){ + if(!this.internalTpl){ this.internalTpl = new Ext.XTemplate( '
', @@ -137,7 +129,7 @@ Ext.ux.tree.TreeGrid = Ext.extend(Ext.tree.TreePanel, { '', ' |
+ new Ext.ux.tree.TreeGridSorter(myTreeGrid, {
+ folderSort: true,
+ dir: "desc",
+ sortType: function(node) {
+ // sort by a custom, typed attribute:
+ return parseInt(node.id, 10);
+ }
+ });
+
+ * @constructor
+ * @param {TreeGrid} tree
+ * @param {Object} config
*/
Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
/**
@@ -850,32 +865,36 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
tree.on('headerclick', this.onHeaderClick, this);
tree.ddAppendOnly = true;
- me = this;
+ var me = this;
this.defaultSortFn = function(n1, n2){
- var dsc = me.dir && me.dir.toLowerCase() == 'desc';
- var p = me.property || 'text';
- var sortType = me.sortType;
- var fs = me.folderSort;
- var cs = me.caseSensitive === true;
- var leafAttr = me.leafAttr || 'leaf';
+ var desc = me.dir && me.dir.toLowerCase() == 'desc',
+ prop = me.property || 'text',
+ sortType = me.sortType,
+ caseSensitive = me.caseSensitive === true,
+ leafAttr = me.leafAttr || 'leaf',
+ attr1 = n1.attributes,
+ attr2 = n2.attributes;
- if(fs){
- if(n1.attributes[leafAttr] && !n2.attributes[leafAttr]){
+ if(me.folderSort){
+ if(attr1[leafAttr] && !attr2[leafAttr]){
return 1;
}
- if(!n1.attributes[leafAttr] && n2.attributes[leafAttr]){
+ if(!attr1[leafAttr] && attr2[leafAttr]){
return -1;
}
}
- var v1 = sortType ? sortType(n1.attributes[p]) : (cs ? n1.attributes[p] : n1.attributes[p].toUpperCase());
- var v2 = sortType ? sortType(n2.attributes[p]) : (cs ? n2.attributes[p] : n2.attributes[p].toUpperCase());
- if(v1 < v2){
- return dsc ? +1 : -1;
- }else if(v1 > v2){
- return dsc ? -1 : +1;
+ var prop1 = attr1[prop],
+ prop2 = attr2[prop],
+ v1 = sortType ? sortType(prop1) : (caseSensitive ? prop1 : prop1.toUpperCase());
+ v2 = sortType ? sortType(prop2) : (caseSensitive ? prop2 : prop2.toUpperCase());
+
+ if(v1 < v2){
+ return desc ? +1 : -1;
+ }else if(v1 > v2){
+ return desc ? -1 : +1;
}else{
- return 0;
+ return 0;
}
};
@@ -884,11 +903,12 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
},
onAfterTreeRender : function() {
- var hmenu = this.tree.hmenu;
- hmenu.insert(0,
- {itemId:'asc', text: this.sortAscText, cls: 'xg-hmenu-sort-asc'},
- {itemId:'desc', text: this.sortDescText, cls: 'xg-hmenu-sort-desc'}
- );
+ 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');
},
@@ -921,15 +941,16 @@ Ext.ux.tree.TreeGridSorter = Ext.extend(Ext.tree.TreeSorter, {
// private
updateSortIcon : function(col, dir){
- var sc = this.sortClasses;
- var hds = this.tree.innerHd.select('td').removeClass(sc);
+ var sc = this.sortClasses,
+ hds = this.tree.innerHd.select('td').removeClass(sc);
hds.item(col).addClass(sc[dir == 'desc' ? 1 : 0]);
}
-});/*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
+});
+/*!
+ * Ext JS Library 3.4.0
+ * Copyright(c) 2006-2011 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
*/
Ext.ns('Ext.ux.grid');
@@ -977,14 +998,14 @@ Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
Ext.ux.grid.BufferView.superclass.initTemplates.call(this);
var ts = this.templates;
// empty div to act as a place holder for a row
- ts.rowHolder = new Ext.Template(
- ''
+ ts.rowHolder = new Ext.Template(
+ ''
);
ts.rowHolder.disableFormats = true;
ts.rowHolder.compile();
ts.rowBody = new Ext.Template(
- '