From 06f025f4bdece32c7e21cc07b4dd7d788f974d4e Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 6 May 2011 19:02:54 +0100 Subject: [PATCH] fix the widths on the input boxes, whitespace changes too --- deluge/ui/web/js/deluge-all/add/UrlWindow.js | 140 +++++++++---------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/add/UrlWindow.js b/deluge/ui/web/js/deluge-all/add/UrlWindow.js index 963be0264..2fa8199d6 100644 --- a/deluge/ui/web/js/deluge-all/add/UrlWindow.js +++ b/deluge/ui/web/js/deluge-all/add/UrlWindow.js @@ -1,6 +1,6 @@ /*! * Deluge.add.UrlWindow.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * 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); + } });