upgrade to ext js 3.1
This commit is contained in:
parent
1ac0403f05
commit
cd24acd74f
|
@ -380,8 +380,8 @@ Ext.deluge.add.AddWindow = Ext.extend(Ext.deluge.add.Window, {
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Ext.deluge.add.AddWindow.superclass.initComponent.call(this);
|
Ext.deluge.add.AddWindow.superclass.initComponent.call(this);
|
||||||
|
|
||||||
this.addButton(_('Cancel'), this.onCancel, this);
|
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||||
this.addButton(_('Add'), this.onAdd, this);
|
this.addButton(_('Add'), this.onAddClick, this);
|
||||||
|
|
||||||
function torrentRenderer(value, p, r) {
|
function torrentRenderer(value, p, r) {
|
||||||
if (r.data['info_hash']) {
|
if (r.data['info_hash']) {
|
||||||
|
@ -465,8 +465,9 @@ Ext.deluge.add.AddWindow = Ext.extend(Ext.deluge.add.Window, {
|
||||||
this.optionsPanel.clear();
|
this.optionsPanel.clear();
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function() {
|
onAddClick: function() {
|
||||||
var torrents = [];
|
var torrents = [];
|
||||||
|
if (!this.grid) return;
|
||||||
this.grid.getStore().each(function(r) {
|
this.grid.getStore().each(function(r) {
|
||||||
var id = r.get('info_hash');
|
var id = r.get('info_hash');
|
||||||
torrents.push({
|
torrents.push({
|
||||||
|
@ -483,7 +484,7 @@ Ext.deluge.add.AddWindow = Ext.extend(Ext.deluge.add.Window, {
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel: function() {
|
onCancelClick: function() {
|
||||||
this.clear();
|
this.clear();
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
|
@ -61,7 +61,7 @@ Copyright:
|
||||||
this.addEvents('hostadded');
|
this.addEvents('hostadded');
|
||||||
|
|
||||||
this.addButton(_('Close'), this.hide, this);
|
this.addButton(_('Close'), this.hide, this);
|
||||||
this.addButton(_('Add'), this.onAdd, this);
|
this.addButton(_('Add'), this.onAddClick, this);
|
||||||
|
|
||||||
this.on('hide', this.onHide, this);
|
this.on('hide', this.onHide, this);
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ Copyright:
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function() {
|
onAddClick: function() {
|
||||||
var host = this.hostField.getValue();
|
var host = this.hostField.getValue();
|
||||||
var port = this.portField.getValue();
|
var port = this.portField.getValue();
|
||||||
var username = this.usernameField.getValue();
|
var username = this.usernameField.getValue();
|
||||||
|
@ -221,7 +221,7 @@ Copyright:
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Add'),
|
text: _('Add'),
|
||||||
icon: '/icons/add.png',
|
icon: '/icons/add.png',
|
||||||
handler: this.onAdd,
|
handler: this.onAddClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
id: 'cm-remove',
|
id: 'cm-remove',
|
||||||
|
@ -298,7 +298,7 @@ Copyright:
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function(button, e) {
|
onAddClick: function(button, e) {
|
||||||
if (!this.addWindow) {
|
if (!this.addWindow) {
|
||||||
this.addWindow = new Ext.deluge.AddConnectionWindow();
|
this.addWindow = new Ext.deluge.AddConnectionWindow();
|
||||||
this.addWindow.on('hostadded', this.onHostAdded, this);
|
this.addWindow.on('hostadded', this.onHostAdded, this);
|
||||||
|
|
|
@ -54,8 +54,8 @@ Copyright:
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Ext.deluge.AddTracker.superclass.initComponent.call(this);
|
Ext.deluge.AddTracker.superclass.initComponent.call(this);
|
||||||
|
|
||||||
this.addButton(_('Cancel'), this.onCancel, this);
|
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||||
this.addButton(_('Add'), this.onAdd, this);
|
this.addButton(_('Add'), this.onAddClick, this);
|
||||||
this.addEvents('add');
|
this.addEvents('add');
|
||||||
|
|
||||||
this.form = this.add({
|
this.form = this.add({
|
||||||
|
@ -71,12 +71,7 @@ Copyright:
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel: function() {
|
onAddClick: function() {
|
||||||
this.form.getForm().findField('trackers').setValue('');
|
|
||||||
this.hide();
|
|
||||||
},
|
|
||||||
|
|
||||||
onAdd: function() {
|
|
||||||
var trackers = this.form.getForm().findField('trackers').getValue();
|
var trackers = this.form.getForm().findField('trackers').getValue();
|
||||||
trackers = trackers.split('\n');
|
trackers = trackers.split('\n');
|
||||||
|
|
||||||
|
@ -89,6 +84,11 @@ Copyright:
|
||||||
this.fireEvent('add', cleaned);
|
this.fireEvent('add', cleaned);
|
||||||
this.hide();
|
this.hide();
|
||||||
this.form.getForm().findField('trackers').setValue('');
|
this.form.getForm().findField('trackers').setValue('');
|
||||||
|
},
|
||||||
|
|
||||||
|
onCancelClick: function() {
|
||||||
|
this.form.getForm().findField('trackers').setValue('');
|
||||||
|
this.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -224,31 +224,31 @@ Copyright:
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Up'),
|
text: _('Up'),
|
||||||
icon: '/icons/up.png',
|
icon: '/icons/up.png',
|
||||||
handler: this.onUp,
|
handler: this.onUpClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Down'),
|
text: _('Down'),
|
||||||
icon: '/icons/down.png',
|
icon: '/icons/down.png',
|
||||||
handler: this.onDown,
|
handler: this.onDownClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, '->', {
|
}, '->', {
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Add'),
|
text: _('Add'),
|
||||||
icon: '/icons/add.png',
|
icon: '/icons/add.png',
|
||||||
handler: this.onAdd,
|
handler: this.onAddClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Edit'),
|
text: _('Edit'),
|
||||||
icon: '/icons/edit_trackers.png',
|
icon: '/icons/edit_trackers.png',
|
||||||
handler: this.onEdit,
|
handler: this.onEditClick,
|
||||||
scope: this
|
scope: this
|
||||||
}, {
|
}, {
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
text: _('Remove'),
|
text: _('Remove'),
|
||||||
icon: '/icons/remove.png',
|
icon: '/icons/remove.png',
|
||||||
handler: this.onRemove,
|
handler: this.onRemoveClick,
|
||||||
scope: this
|
scope: this
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -256,7 +256,7 @@ Copyright:
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function() {
|
onAddClick: function() {
|
||||||
this.addWindow.show();
|
this.addWindow.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -279,11 +279,11 @@ Copyright:
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel: function() {
|
onCancelClick: function() {
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
onEdit: function() {
|
onEditClick: function() {
|
||||||
var r = this.grid.getSelectionModel().getSelected();
|
var r = this.grid.getSelectionModel().getSelected();
|
||||||
this.editWindow.show(r);
|
this.editWindow.show(r);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
(function() {
|
Ext.deluge.Statusbar = Ext.extend(Ext.Toolbar, {
|
||||||
Ext.deluge.Statusbar = Ext.extend(Ext.StatusBar, {
|
|
||||||
constructor: function(config) {
|
constructor: function(config) {
|
||||||
config = Ext.apply({
|
config = Ext.apply({
|
||||||
id: 'deluge-statusbar',
|
id: 'deluge-statusbar',
|
||||||
|
@ -61,10 +60,10 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
onConnect: function() {
|
onConnect: function() {
|
||||||
this.setStatus({
|
//this.setStatus({
|
||||||
iconCls: 'x-connected',
|
// iconCls: 'x-connected',
|
||||||
text: ''
|
// text: ''
|
||||||
});
|
//});
|
||||||
if (!this.created) this.createButtons();
|
if (!this.created) this.createButtons();
|
||||||
else {
|
else {
|
||||||
this.items.each(function(item) {
|
this.items.each(function(item) {
|
||||||
|
@ -75,7 +74,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
onDisconnect: function() {
|
onDisconnect: function() {
|
||||||
this.clearStatus({useDefaults:true});
|
//this.clearStatus({useDefaults:true});
|
||||||
this.items.each(function(item) {
|
this.items.each(function(item) {
|
||||||
item.hide();
|
item.hide();
|
||||||
item.disable();
|
item.disable();
|
||||||
|
@ -148,6 +147,5 @@
|
||||||
Deluge.Menus.Download.setValue(stats.max_download);
|
Deluge.Menus.Download.setValue(stats.max_download);
|
||||||
Deluge.Menus.Upload.setValue(stats.max_upload);
|
Deluge.Menus.Upload.setValue(stats.max_upload);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Deluge.Statusbar = new Ext.deluge.Statusbar();
|
Deluge.Statusbar = new Ext.deluge.Statusbar();
|
||||||
})();
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ Copyright:
|
||||||
value = new Number(value);
|
value = new Number(value);
|
||||||
var progress = value;
|
var progress = value;
|
||||||
var text = r.data['state'] + ' ' + value.toFixed(2) + '%'
|
var text = r.data['state'] + ' ' + value.toFixed(2) + '%'
|
||||||
var width = new Number(this.style.match(/\w+:\s*(\d+)\w+/)[1]) - 8;
|
//var width = new Number(this.style.match(/\w+:\s*(\d+)\w+/)[1]) - 8;
|
||||||
return Deluge.progressBar(value, width, text);
|
return Deluge.progressBar(value, this.width - 8, text);
|
||||||
}
|
}
|
||||||
function seedsRenderer(value, p, r) {
|
function seedsRenderer(value, p, r) {
|
||||||
if (r.data['total_seeds'] > -1) {
|
if (r.data['total_seeds'] > -1) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -309,7 +309,7 @@ class TopLevel(resource.Resource):
|
||||||
]
|
]
|
||||||
|
|
||||||
__debug_scripts = [
|
__debug_scripts = [
|
||||||
"/js/ext-base.js",
|
"/js/ext-base-debug.js",
|
||||||
"/js/ext-all-debug.js",
|
"/js/ext-all-debug.js",
|
||||||
"/js/ext-extensions-debug.js",
|
"/js/ext-extensions-debug.js",
|
||||||
"/config.js",
|
"/config.js",
|
||||||
|
|
Loading…
Reference in New Issue