fix the widths on the input boxes, whitespace changes too

This commit is contained in:
Damien Churchill 2011-05-06 19:02:54 +01:00
parent d362a6ceba
commit 06f025f4bd
1 changed files with 70 additions and 70 deletions

View File

@ -1,6 +1,6 @@
/*!
* Deluge.add.UrlWindow.js
*
*
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -33,75 +33,75 @@
Ext.namespace('Deluge.add');
Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
title: _('Add from Url'),
modal: true,
plain: true,
layout: 'fit',
width: 350,
height: 155,
title: _('Add from Url'),
modal: true,
plain: true,
layout: 'fit',
width: 350,
height: 155,
buttonAlign: 'center',
closeAction: 'hide',
bodyStyle: 'padding: 10px 5px;',
iconCls: 'x-deluge-add-url-window-icon',
initComponent: function() {
Deluge.add.UrlWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAddClick, this);
var form = this.add({
xtype: 'form',
defaultType: 'textfield',
baseCls: 'x-plain',
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);
},
onAddClick: function(field, e) {
if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
buttonAlign: 'center',
closeAction: 'hide',
bodyStyle: 'padding: 10px 5px;',
iconCls: 'x-deluge-add-url-window-icon',
var field = this.urlField;
var url = field.getValue();
var cookies = this.cookieField.getValue();
var torrentId = this.createTorrentId();
deluge.client.web.download_torrent_from_url(url, cookies, {
success: this.onDownload,
scope: this,
torrentId: torrentId
});
this.hide();
this.fireEvent('beforeadd', torrentId, url);
},
onDownload: function(filename, obj, resp, req) {
this.urlField.setValue('');
deluge.client.web.get_torrent_info(filename, {
success: this.onGotInfo,
scope: this,
filename: filename,
torrentId: req.options.torrentId
});
},
onGotInfo: function(info, obj, response, request) {
info['filename'] = request.options.filename;
this.fireEvent('add', request.options.torrentId, info);
}
initComponent: function() {
Deluge.add.UrlWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAddClick, this);
var form = this.add({
xtype: 'form',
defaultType: 'textfield',
baseCls: 'x-plain',
labelWidth: 55
});
this.urlField = form.add({
fieldLabel: _('Url'),
id: 'url',
name: 'url',
width: '97%'
});
this.urlField.on('specialkey', this.onAdd, this);
this.cookieField = form.add({
fieldLabel: _('Cookies'),
id: 'cookies',
name: 'cookies',
width: '97%'
});
this.cookieField.on('specialkey', this.onAdd, this);
},
onAddClick: function(field, e) {
if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
var field = this.urlField;
var url = field.getValue();
var cookies = this.cookieField.getValue();
var torrentId = this.createTorrentId();
deluge.client.web.download_torrent_from_url(url, cookies, {
success: this.onDownload,
scope: this,
torrentId: torrentId
});
this.hide();
this.fireEvent('beforeadd', torrentId, url);
},
onDownload: function(filename, obj, resp, req) {
this.urlField.setValue('');
deluge.client.web.get_torrent_info(filename, {
success: this.onGotInfo,
scope: this,
filename: filename,
torrentId: req.options.torrentId
});
},
onGotInfo: function(info, obj, response, request) {
info['filename'] = request.options.filename;
this.fireEvent('add', request.options.torrentId, info);
}
});