Changeset 0d665d7


Ignore:
Timestamp:
05/06/2011 06:02:54 PM (14 years ago)
Author:
Damien Churchill <damoxc@gmail.com>
Children:
871d9ac
Parents:
aef2a8
Message:

fix the widths on the input boxes, whitespace changes too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/web/js/deluge-all/add/UrlWindow.js

    raef2a8 r0d665d7  
    11/*!
    22 * Deluge.add.UrlWindow.js
    3  * 
     3 *
    44 * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
    55 *
     
    3434Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
    3535
    36         title: _('Add from Url'),
    37         modal: true,
    38         plain: true,
    39         layout: 'fit',
    40         width: 350,
    41         height: 155,
     36    title: _('Add from Url'),
     37    modal: true,
     38    plain: true,
     39    layout: 'fit',
     40    width: 350,
     41    height: 155,
    4242
    43         buttonAlign: 'center',
    44         closeAction: 'hide',
    45         bodyStyle: 'padding: 10px 5px;',
    46         iconCls: 'x-deluge-add-url-window-icon',
    47        
    48         initComponent: function() {
    49                 Deluge.add.UrlWindow.superclass.initComponent.call(this);
    50                 this.addButton(_('Add'), this.onAddClick, this);
    51                
    52                 var form = this.add({
    53                         xtype: 'form',
    54                         defaultType: 'textfield',
    55                         baseCls: 'x-plain',
    56                         labelWidth: 55
    57                 });
    58                
    59                 this.urlField = form.add({
    60                         fieldLabel: _('Url'),
    61                         id: 'url',
    62                         name: 'url',
    63                         anchor: '100%'
    64                 });
    65                 this.urlField.on('specialkey', this.onAdd, this);
    66                
    67                 this.cookieField = form.add({
    68                         fieldLabel: _('Cookies'),
    69                         id: 'cookies',
    70                         name: 'cookies',
    71                         anchor: '100%'
    72                 });
    73                 this.cookieField.on('specialkey', this.onAdd, this);
    74         },
    75        
    76         onAddClick: function(field, e) {
    77                 if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
     43    buttonAlign: 'center',
     44    closeAction: 'hide',
     45    bodyStyle: 'padding: 10px 5px;',
     46    iconCls: 'x-deluge-add-url-window-icon',
    7847
    79                 var field = this.urlField;
    80                 var url = field.getValue();
    81                 var cookies = this.cookieField.getValue();
    82                 var torrentId = this.createTorrentId();
    83                
    84                 deluge.client.web.download_torrent_from_url(url, cookies, {
    85                         success: this.onDownload,
    86                         scope: this,
    87                         torrentId: torrentId
    88                 });
    89                 this.hide();
    90                 this.fireEvent('beforeadd', torrentId, url);
    91         },
    92        
    93         onDownload: function(filename, obj, resp, req) {
    94                 this.urlField.setValue('');
    95                 deluge.client.web.get_torrent_info(filename, {
    96                         success: this.onGotInfo,
    97                         scope: this,
    98                         filename: filename,
    99                         torrentId: req.options.torrentId
    100                 });
    101         },
    102        
    103         onGotInfo: function(info, obj, response, request) {
    104                 info['filename'] = request.options.filename;
    105                 this.fireEvent('add', request.options.torrentId, info);
    106         }
     48    initComponent: function() {
     49        Deluge.add.UrlWindow.superclass.initComponent.call(this);
     50        this.addButton(_('Add'), this.onAddClick, this);
     51
     52        var form = this.add({
     53            xtype: 'form',
     54            defaultType: 'textfield',
     55            baseCls: 'x-plain',
     56            labelWidth: 55
     57        });
     58
     59        this.urlField = form.add({
     60            fieldLabel: _('Url'),
     61            id: 'url',
     62            name: 'url',
     63            width: '97%'
     64        });
     65        this.urlField.on('specialkey', this.onAdd, this);
     66
     67        this.cookieField = form.add({
     68            fieldLabel: _('Cookies'),
     69            id: 'cookies',
     70            name: 'cookies',
     71            width: '97%'
     72        });
     73        this.cookieField.on('specialkey', this.onAdd, this);
     74    },
     75
     76    onAddClick: function(field, e) {
     77        if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
     78
     79        var field = this.urlField;
     80        var url = field.getValue();
     81        var cookies = this.cookieField.getValue();
     82        var torrentId = this.createTorrentId();
     83
     84        deluge.client.web.download_torrent_from_url(url, cookies, {
     85            success: this.onDownload,
     86            scope: this,
     87            torrentId: torrentId
     88        });
     89        this.hide();
     90        this.fireEvent('beforeadd', torrentId, url);
     91    },
     92
     93    onDownload: function(filename, obj, resp, req) {
     94        this.urlField.setValue('');
     95        deluge.client.web.get_torrent_info(filename, {
     96            success: this.onGotInfo,
     97            scope: this,
     98            filename: filename,
     99            torrentId: req.options.torrentId
     100        });
     101    },
     102
     103    onGotInfo: function(info, obj, response, request) {
     104        info['filename'] = request.options.filename;
     105        this.fireEvent('add', request.options.torrentId, info);
     106    }
    107107});
Note: See TracChangeset for help on using the changeset viewer.