Author: damoxc
Revision: 5125
Log:
remove pointless privatising
Diff:
Modified: trunk/deluge/ui/web/js/Deluge.Details.Details.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Details.Details.js 2009-04-21 21:45:56 UTC
(rev 5124)
+++ trunk/deluge/ui/web/js/Deluge.Details.Details.js 2009-04-21 21:46:20 UTC
(rev 5125)
@@ -21,59 +21,57 @@
Boston, MA 02110-1301, USA.
*/
-(function() {
- Ext.deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
- title: _('Details'),
- cls: 'x-deluge-status',
+Ext.deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
+ title: _('Details'),
+ cls: 'x-deluge-status',
+
+ onRender: function(ct, position) {
+ Ext.deluge.details.DetailsTab.superclass.onRender.call(this,
ct, position);
+ this.load({
+ url: '/render/tab_details.html',
+ text: _('Loading') + '...'
+ });
+ this.getUpdater().on('update', this.onPanelUpdate, this);
+ },
+
+ clear: function() {
+ if (!this.fields) return;
+ for (var k in this.fields) {
+ this.fields[k].innerHTML = '';
+ }
+ },
+
+ update: function(torrentId) {
+ if (!this.fields) this.getFields();
+ Deluge.Client.core.get_torrent_status(torrentId,
Deluge.Keys.Details, {
+ success: this.onRequestComplete,
+ scope: this,
+ torrentId: torrentId
+ });
+ },
+
+ onPanelUpdate: function(el, response) {
+ this.fields = {};
+ Ext.each(Ext.query('dd', this.body.dom), function(field) {
+ this.fields[field.className] = field;
+ }, this);
+ },
+
+ onRequestComplete: function(torrent, options) {
+ var data = {
+ torrent_name: torrent.name,
+ hash: options.torrentId,
+ path: torrent.save_path,
+ size: fsize(torrent.total_size),
+ files: torrent.num_files,
+ status: torrent.tracker_status,
+ tracker: torrent.tracker,
+ comment: torrent.comment
+ };
- onRender: function(ct, position) {
-
Ext.deluge.details.DetailsTab.superclass.onRender.call(this, ct, position);
- this.load({
- url: '/render/tab_details.html',
- text: _('Loading') + '...'
- });
- this.getUpdater().on('update', this.onPanelUpdate,
this);
- },
-
- clear: function() {
- if (!this.fields) return;
- for (var k in this.fields) {
- this.fields[k].innerHTML = '';
- }
- },
-
- update: function(torrentId) {
- if (!this.fields) this.getFields();
- Deluge.Client.core.get_torrent_status(torrentId,
Deluge.Keys.Details, {
- success: this.onRequestComplete,
- scope: this,
- torrentId: torrentId
- });
- },
-
- onPanelUpdate: function(el, response) {
- this.fields = {};
- Ext.each(Ext.query('dd', this.body.dom),
function(field) {
- this.fields[field.className] = field;
- }, this);
- },
-
- onRequestComplete: function(torrent, options) {
- var data = {
- torrent_name: torrent.name,
- hash: options.torrentId,
- path: torrent.save_path,
- size: fsize(torrent.total_size),
- files: torrent.num_files,
- status: torrent.tracker_status,
- tracker: torrent.tracker,
- comment: torrent.comment
- };
-
- for (var field in this.fields) {
- this.fields[field].innerHTML = data[field];
- }
+ for (var field in this.fields) {
+ this.fields[field].innerHTML = data[field];
}
- });
- Deluge.Details.add(new Ext.deluge.details.DetailsTab());
-})();
\ No newline at end of file
+ }
+});
+Deluge.Details.add(new Ext.deluge.details.DetailsTab());
\ No newline at end of file
Modified: trunk/deluge/ui/web/js/Deluge.Details.Status.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Details.Status.js 2009-04-21 21:45:56 UTC
(rev 5124)
+++ trunk/deluge/ui/web/js/Deluge.Details.Status.js 2009-04-21 21:46:20 UTC
(rev 5125)
@@ -21,89 +21,87 @@
Boston, MA 02110-1301, USA.
*/
-(function() {
- Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
- title: _('Status'),
+Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
+ title: _('Status'),
+
+ onRender: function(ct, position) {
+ Ext.deluge.details.StatusTab.superclass.onRender.call(this, ct,
position);
- onRender: function(ct, position) {
-
Ext.deluge.details.StatusTab.superclass.onRender.call(this, ct, position);
-
- this.progressBar = this.add({
- xtype: 'fullprogressbar',
- cls: 'x-deluge-status-progressbar'
- });
-
- this.status = this.add({
- cls: 'x-deluge-status',
- border: false,
- listeners: {
- 'render': {
- fn: function(panel) {
- panel.load({
- url:
'/render/tab_status.html',
- text:
_('Loading') + '...'
- });
-
panel.getUpdater().on('update', this.onPanelUpdate, this);
- },
- scope: this
- }
- }
- });
- },
+ this.progressBar = this.add({
+ xtype: 'fullprogressbar',
+ cls: 'x-deluge-status-progressbar'
+ });
- clear: function() {
- if (!this.fields) return;
- this.progressBar.updateProgress(0, ' ');
- for (var k in this.fields) {
- this.fields[k].innerHTML = '';
+ this.status = this.add({
+ cls: 'x-deluge-status',
+ border: false,
+ listeners: {
+ 'render': {
+ fn: function(panel) {
+ panel.load({
+ url:
'/render/tab_status.html',
+ text: _('Loading') +
'...'
+ });
+ panel.getUpdater().on('update',
this.onPanelUpdate, this);
+ },
+ scope: this
+ }
}
- },
+ });
+ },
+
+ clear: function() {
+ if (!this.fields) return;
+ this.progressBar.updateProgress(0, ' ');
+ for (var k in this.fields) {
+ this.fields[k].innerHTML = '';
+ }
+ },
+
+ update: function(torrentId) {
+ if (!this.fields) this.getFields();
+ Deluge.Client.core.get_torrent_status(torrentId,
Deluge.Keys.Status, {
+ success: this.onRequestComplete,
+ scope: this
+ });
+ },
+
+ onPanelUpdate: function(el, response) {
+ this.fields = {};
+ Ext.each(Ext.query('dd', this.status.body.dom), function(field)
{
+ this.fields[field.className] = field;
+ }, this);
+ },
+
+ onRequestComplete: function(status) {
+ seeders = status.total_seeds > -1 ? status.num_seeds + ' (' +
status.total_seeds + ')' : status.num_seeds
+ peers = status.total_peers > -1 ? status.num_peers + ' (' +
status.total_peers + ')' : status.num_peers
+ var data = {
+ downloaded: fsize(status.total_done) + ' (' +
fsize(status.total_payload_download) + ')',
+ uploaded: fsize(status.total_uploaded) + ' (' +
fsize(status.total_payload_upload) + ')',
+ share: status.ratio.toFixed(3),
+ announce: ftime(status.next_announce),
+ tracker_status: status.tracker_status,
+ downspeed: fspeed(status.download_payload_rate),
+ upspeed: fspeed(status.upload_payload_rate),
+ eta: ftime(status.eta),
+ pieces: status.num_pieces + ' (' +
fsize(status.piece_length) + ')',
+ seeders: seeders,
+ peers: peers,
+ avail: status.distributed_copies.toFixed(3),
+ active_time: ftime(status.active_time),
+ seeding_time: ftime(status.seeding_time),
+ seed_rank: status.seed_rank,
+ auto_managed: 'False',
+ time_added: fdate(status.time_added)
+ }
+ if (status.is_auto_managed) {data.auto_managed = 'True'}
- update: function(torrentId) {
- if (!this.fields) this.getFields();
- Deluge.Client.core.get_torrent_status(torrentId,
Deluge.Keys.Status, {
- success: this.onRequestComplete,
- scope: this
- });
- },
-
- onPanelUpdate: function(el, response) {
- this.fields = {};
- Ext.each(Ext.query('dd', this.status.body.dom),
function(field) {
- this.fields[field.className] = field;
- }, this);
- },
-
- onRequestComplete: function(status) {
- seeders = status.total_seeds > -1 ? status.num_seeds +
' (' + status.total_seeds + ')' : status.num_seeds
- peers = status.total_peers > -1 ? status.num_peers + '
(' + status.total_peers + ')' : status.num_peers
- var data = {
- downloaded: fsize(status.total_done) + ' (' +
fsize(status.total_payload_download) + ')',
- uploaded: fsize(status.total_uploaded) + ' (' +
fsize(status.total_payload_upload) + ')',
- share: status.ratio.toFixed(3),
- announce: ftime(status.next_announce),
- tracker_status: status.tracker_status,
- downspeed: fspeed(status.download_payload_rate),
- upspeed: fspeed(status.upload_payload_rate),
- eta: ftime(status.eta),
- pieces: status.num_pieces + ' (' +
fsize(status.piece_length) + ')',
- seeders: seeders,
- peers: peers,
- avail: status.distributed_copies.toFixed(3),
- active_time: ftime(status.active_time),
- seeding_time: ftime(status.seeding_time),
- seed_rank: status.seed_rank,
- auto_managed: 'False',
- time_added: fdate(status.time_added)
- }
- if (status.is_auto_managed) {data.auto_managed = 'True'}
-
- for (var field in this.fields) {
- this.fields[field].innerHTML = data[field];
- }
- var text = status.state + ' ' +
status.progress.toFixed(2) + '%';
- this.progressBar.updateProgress(status.progress, text);
+ for (var field in this.fields) {
+ this.fields[field].innerHTML = data[field];
}
- });
- Deluge.Details.add(new Ext.deluge.details.StatusTab());
-})();
\ No newline at end of file
+ var text = status.state + ' ' + status.progress.toFixed(2) +
'%';
+ this.progressBar.updateProgress(status.progress, text);
+ }
+});
+Deluge.Details.add(new Ext.deluge.details.StatusTab());
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---