Author: damoxc
Revision: 5573
Log:
add a cookies field to the url window
Diff:
Modified: trunk/deluge/ui/web/js/Deluge.Add.File.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Add.File.js 2009-07-29 10:17:10 UTC (rev
5572)
+++ trunk/deluge/ui/web/js/Deluge.Add.File.js 2009-07-29 16:05:27 UTC (rev
5573)
@@ -44,19 +44,17 @@
modal: true,
plain: true,
title: _('Add from File'),
- iconCls: 'x-deluge-add-file',
- buttons: [{
- text: _('Add'),
- handler: this.onAdd,
- scope: this
- }]
+ iconCls: 'x-deluge-add-file'
}, config);
Ext.deluge.add.UrlWindow.superclass.constructor.call(this,
config);
},
initComponent: function() {
- Ext.deluge.add.UrlWindow.superclass.initComponent.call(this);
- this.form = this.add(new Ext.form.FormPanel({
+ Ext.deluge.add.FileWindow.superclass.initComponent.call(this);
+ this.addButton(_('Add'), this.onAdd, this);
+
+ this.form = this.add({
+ xtype: 'form',
baseCls: 'x-plain',
labelWidth: 55,
autoHeight: true,
@@ -71,7 +69,7 @@
text: _('Browse') + '...'
}
}]
- }));
+ });
},
onAdd: function(field, e) {
Modified: trunk/deluge/ui/web/js/Deluge.Add.Url.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Add.Url.js 2009-07-29 10:17:10 UTC (rev
5572)
+++ trunk/deluge/ui/web/js/Deluge.Add.Url.js 2009-07-29 16:05:27 UTC (rev
5573)
@@ -37,49 +37,50 @@
config = Ext.apply({
layout: 'fit',
width: 350,
- height: 115,
+ height: 155,
bodyStyle: 'padding: 10px 5px;',
buttonAlign: 'center',
closeAction: 'hide',
modal: true,
plain: true,
title: _('Add from Url'),
- iconCls: 'x-deluge-add-url-window-icon',
- buttons: [{
- text: _('Add'),
- handler: this.onAdd,
- scope: this
- }]
+ iconCls: 'x-deluge-add-url-window-icon'
}, config);
Ext.deluge.add.UrlWindow.superclass.constructor.call(this,
config);
},
initComponent: function() {
Ext.deluge.add.UrlWindow.superclass.initComponent.call(this);
- this.form = this.add(new Ext.form.FormPanel({
+ this.addButton(_('Add'), this.onAdd, this);
+
+ var form = this.add({
+ xtype: 'form',
defaultType: 'textfield',
baseCls: 'x-plain',
- labelWidth: 55,
- items: [{
- fieldLabel: _('Url'),
- id: 'url',
- name: 'url',
- inputType: 'url',
- anchor: '100%',
- listeners: {
- 'specialkey': {
- fn: this.onAdd,
- scope: this
- }
- }
- }]
- }));
+ labelWidth: 55
+ });
+
+ this.urlField = form.add({
+ fieldLabel: _('Url'),
+ id: 'url',
+ name: 'url',
+ anchor: '100%'
+ });
+ this.urlField.on('specialkey', this.onAdd, this);
+
+ this.cookieField = form.add({
+ fieldLabel: _('Cookies'),
+ id: 'cookies',
+ name: 'cookies',
+ anchor: '100%'
+ });
+ this.cookieField.on('specialkey', this.onAdd, this);
},
onAdd: function(field, e) {
if (field.id == 'url' && e.getKey() != e.ENTER) return;
- var field = this.form.items.get('url');
+ var field = this.urlField;
var url = field.getValue();
var torrentId = this.createTorrentId();
@@ -93,7 +94,7 @@
},
onDownload: function(filename, obj, resp, req) {
- this.form.items.get('url').setValue('');
+ this.urlField.setValue('');
Deluge.Client.web.get_torrent_info(filename, {
success: this.onGotInfo,
scope: this,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---