Module: deluge Branch: master Commit: 48876fa45c67339472c041922b599930d9693270
Author: Damien Churchill <[email protected]> Date: Wed Mar 31 11:35:30 2010 +0100 tidy up the file window and fix using Deluge.Client still --- deluge/ui/web/js/deluge-all/add/File.js | 40 +++++++++++++++++-------------- 1 files changed, 22 insertions(+), 18 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/add/File.js b/deluge/ui/web/js/deluge-all/add/File.js index 95851f9..dfae5e3 100644 --- a/deluge/ui/web/js/deluge-all/add/File.js +++ b/deluge/ui/web/js/deluge-all/add/File.js @@ -29,25 +29,25 @@ * this exception statement from your version. If you delete this exception * statement from all source files in the program, then also delete it here. */ +Ext.ns('Deluge.add'); -Ext.namespace('Ext.deluge.add'); +/** + * @class Deluge.add.FileWindow + * @extends Deluge.add.Window + */ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, { - constructor: function(config) { - config = Ext.apply({ - 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' - }, config); - Deluge.add.FileWindow.superclass.constructor.call(this, config); - }, - + + title: _('Add from File'), + layout: 'fit', + width: 350, + height: 115, + modal: true, + plain: true, + buttonAlign: 'center', + closeAction: 'hide', + bodyStyle: 'padding: 10px 5px;', + iconCls: 'x-deluge-add-file' + initComponent: function() { Deluge.add.FileWindow.superclass.initComponent.call(this); this.addButton(_('Add'), this.onAddClick, this); @@ -72,6 +72,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, { }); }, + // private onAddClick: function(field, e) { if (this.form.getForm().isValid()) { this.torrentId = this.createTorrentId(); @@ -88,21 +89,24 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, { } }, + // private onGotInfo: function(info, obj, response, request) { info['filename'] = request.options.filename; this.fireEvent('add', this.torrentId, info); }, + // private onUploadFailure: function(form, action) { this.hide(); }, + // private onUploadSuccess: function(fp, upload) { this.hide(); if (upload.result.success) { var filename = upload.result.files[0]; this.form.getForm().findField('torrentFile').setValue(''); - Deluge.Client.web.get_torrent_info(filename, { + deluge.client.web.get_torrent_info(filename, { success: this.onGotInfo, scope: this, filename: filename -- 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.
