fix the spacer image trying to be retrieved from extjs.com

This commit is contained in:
Damien Churchill 2009-04-02 18:09:34 +00:00
commit 221d1875ff
4 changed files with 67 additions and 11 deletions

View file

@ -96,16 +96,20 @@ input {
background: url('/icons/add.png') no-repeat 2px; background: url('/icons/add.png') no-repeat 2px;
} }
.x-deluge-add-file { /*.x-deluge-add-file {
background: url('/icons/add_file.png'); background: url('/icons/add_file.png');
padding-left: 20px; padding-left: 20px;
} }*/
.x-form-file-wrap, .x-form-file { .x-form-file-wrap, .x-form-file {
cursor: pointer; cursor: pointer;
} }
/* Add Url Window */ /* Add Url Window */
.x-deluge-add-file, .x-btn .x-deluge-add-file {
background: url('/icons/add_file.png') no-repeat 2px;
}
.x-deluge-add-url-window-icon { .x-deluge-add-url-window-icon {
background: url('/icons/add_url.png') no-repeat 2px; background: url('/icons/add_url.png') no-repeat 2px;
} }

BIN
deluge/ui/web/images/s.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View file

@ -50,6 +50,10 @@ Deluge.Add = {
this.Window.hide(); this.Window.hide();
}, },
onFile: function() {
this.File.Window.show();
},
onRender: function(window) { onRender: function(window) {
new Ext.tree.TreeSorter(this.Files, { new Ext.tree.TreeSorter(this.Files, {
folderSort: true folderSort: true
@ -160,8 +164,10 @@ Deluge.Add.Grid = new Ext.grid.GridPanel({
{ {
id: 'file', id: 'file',
cls: 'x-btn-text-icon', cls: 'x-btn-text-icon',
icon: '/icons/add_file.png', iconCls: 'x-deluge-add-file',
text: _('File') text: _('File'),
handler: Deluge.Add.onFile,
scope: Deluge.Add
}, { }, {
id: 'url', id: 'url',
cls: 'x-btn-text-icon', cls: 'x-btn-text-icon',
@ -201,11 +207,52 @@ Deluge.Add.Options = new Ext.TabPanel({
}] }]
}); });
Deluge.Add.File = {
}
Deluge.Add.File.form = new Ext.form.FormPanel({
defaultType: 'textfield',
id: 'fileAddForm',
baseCls: 'x-plain',
labelWidth: 55,
items: [new Ext.form.FileUploadField({
fieldLabel: _('File'),
id: 'file',
name: 'file',
listeners: {
'specialkey': {
fn: Deluge.Add.File.onAdd,
scope: Deluge.Add.File
}
}
})]
});
Deluge.Add.File.Window = new Ext.Window({
layout: 'fit',
width: 350,
height: 115,
bodyStyle: 'padding: 10px 5px;',
buttonAlign: 'center',
closeAction: 'hide',
modal: true,
plain: true,
title: _('Add from File'),
iconCls: 'x-deluge-add-file',
items: Deluge.Add.File.form,
buttons: [{
text: _('Add'),
handler: Deluge.Add.File.onAdd,
scope: Deluge.Add.File
}]
});
Deluge.Add.Url = { Deluge.Add.Url = {
onAdd: function(field, e) { onAdd: function(field, e) {
if (field.id == 'url' && e.getKey() != e.ENTER) return; if (field.id == 'url' && e.getKey() != e.ENTER) return;
var field = this.Form.items.get('url'); var field = this.form.items.get('url');
var url = field.getValue(); var url = field.getValue();
Deluge.Client.web.download_torrent_from_url(url, { Deluge.Client.web.download_torrent_from_url(url, {
@ -222,12 +269,12 @@ Deluge.Add.Url = {
onGotInfo: function(info) { onGotInfo: function(info) {
var bound = Deluge.Add.onTorrentAdded.bind(Deluge.Add) var bound = Deluge.Add.onTorrentAdded.bind(Deluge.Add)
this.Form.items.get('url').setValue(''); this.form.items.get('url').setValue('');
bound(info); bound(info);
} }
} }
Deluge.Add.Url.Form = new Ext.form.FormPanel({ Deluge.Add.Url.form = new Ext.form.FormPanel({
defaultType: 'textfield', defaultType: 'textfield',
id: 'urlAddForm', id: 'urlAddForm',
baseCls: 'x-plain', baseCls: 'x-plain',
@ -258,7 +305,7 @@ Deluge.Add.Url.Window = new Ext.Window({
plain: true, plain: true,
title: _('Add from Url'), title: _('Add from Url'),
iconCls: 'x-deluge-add-url-window-icon', iconCls: 'x-deluge-add-url-window-icon',
items: Deluge.Add.Url.Form, items: Deluge.Add.Url.form,
buttons: [{ buttons: [{
text: _('Add'), text: _('Add'),
handler: Deluge.Add.Url.onAdd, handler: Deluge.Add.Url.onAdd,
@ -288,5 +335,10 @@ Deluge.Add.Window = new Ext.Window({
handler: Deluge.Add.onAdd, handler: Deluge.Add.onAdd,
scope: Deluge.Add scope: Deluge.Add
}], }],
listeners: {'render': {fn: Deluge.Add.onRender, scope: Deluge.Add}} listeners: {
'render': {
fn: Deluge.Add.onRender,
scope: Deluge.Add
}
}
}); });

File diff suppressed because one or more lines are too long