summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deluge/plugins/label/label/data/label.js21
-rw-r--r--deluge/ui/webui/static/deluge-moo.js23
-rw-r--r--deluge/ui/webui/static/refresh.js2
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/Rpc.js51
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-add.js151
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-bars.js112
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-details.js144
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-menus.js32
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-mime.js28
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-preferences.js82
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-torrent-grid.js42
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge-ui.js24
-rw-r--r--deluge/ui/webui/templates/ajax/static/js/deluge.js24
-rw-r--r--deluge/ui/webui/templates/classic/gettext.js21
-rw-r--r--setup.py1
15 files changed, 473 insertions, 285 deletions
diff --git a/deluge/plugins/label/label/data/label.js b/deluge/plugins/label/label/data/label.js
index c67e56047..62efcec83 100644
--- a/deluge/plugins/label/label/data/label.js
+++ b/deluge/plugins/label/label/data/label.js
@@ -1,6 +1,22 @@
/*
-# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
-# License : GPL v3.
+# Copyright (C) Martijn Voncken 2008 <mvoncken@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, write to:
+# The Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor
+# Boston, MA 02110-1301, USA.
+#
*/
@@ -77,4 +93,3 @@ Plugins.Label = {
window.addEvent('domready', function(e) {
Plugins.Label.initialize();
});
-
diff --git a/deluge/ui/webui/static/deluge-moo.js b/deluge/ui/webui/static/deluge-moo.js
index d0fca53e8..c8005dacc 100644
--- a/deluge/ui/webui/static/deluge-moo.js
+++ b/deluge/ui/webui/static/deluge-moo.js
@@ -1,6 +1,22 @@
/*
-(c) Martijn Voncken mvoncken@gmail.com
-License: GPL v3
+# Copyright (C) Martijn Voncken 2008 <mvoncken@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, write to:
+# The Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor
+# Boston, MA 02110-1301, USA.
+#
*/
@@ -57,6 +73,3 @@ var InputSensitivitySetter = new Class({
},this);
}
});
-
-
-
diff --git a/deluge/ui/webui/static/refresh.js b/deluge/ui/webui/static/refresh.js
index 2b8c43516..5c76384ea 100644
--- a/deluge/ui/webui/static/refresh.js
+++ b/deluge/ui/webui/static/refresh.js
@@ -20,7 +20,7 @@
quick and dirty auto-refresh timer.
Our users have waited too long for a new auto-refresh.
-I need to get things done (even if it's ot pretty). ;with the least dependencies for a backport to 1.05
+I need to get things done (even if it's not pretty). ;with the least dependencies for a backport to 1.05
*/
var seconds=0;
var refresh_secs = 10;
diff --git a/deluge/ui/webui/templates/ajax/static/js/Rpc.js b/deluge/ui/webui/templates/ajax/static/js/Rpc.js
index daeb288df..c381f9b99 100644
--- a/deluge/ui/webui/templates/ajax/static/js/Rpc.js
+++ b/deluge/ui/webui/templates/ajax/static/js/Rpc.js
@@ -2,12 +2,29 @@
Script: Rpc.js
A JSON-RPC proxy built ontop of mootools.
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
Class: JSON.RPC
Class to create a proxy to a json-rpc interface on a server.
-
+
Example:
client = new JSON.RPC('/json/rpc');
client.hello_world({
@@ -21,18 +38,18 @@ Copyright:
alert(result);
}
});
-
+
Returns:
The proxy that can be used to directly call methods on the server.
*/
JSON.RPC = new Class({
Implements: Options,
-
+
options: {
async: true,
methods: []
},
-
+
initialize: function(url, options) {
this.setOptions(options)
this.url = url
@@ -45,23 +62,23 @@ JSON.RPC = new Class({
}, this)
}
},
-
+
/*
Property: _parseargs
Internal method for parsing the arguments given to the method
-
+
Arguments:
args - A list of the methods arguments
-
+
Returns:
An options object with the arguments set as options.params
-
+
*/
_parseargs: function(args) {
var params = $A(args), options = params.getLast()
if ($type(options) == 'object') {
var option_keys = ['async', 'onRequest', 'onComplete',
- 'onSuccess', 'onFailure', 'onException', 'onCancel'], keys =
+ 'onSuccess', 'onFailure', 'onException', 'onCancel'], keys =
new Hash(options).getKeys(), is_option = false
option_keys.each(function(key) {
@@ -69,7 +86,7 @@ JSON.RPC = new Class({
is_option = true
}
})
-
+
if (is_option) {
params.erase(options)
} else {
@@ -79,19 +96,19 @@ JSON.RPC = new Class({
options.params = params
return options
},
-
+
/*
Property: _execute
An internal method to make the call to the rpc page
-
+
Arguements:
method - the name of the method
options - An options dict providing any additional options for the
call.
-
+
Example:
alert(client.hello_world({async: false;}));
-
+
Returns:
If not async returns the json result
*/
@@ -99,7 +116,7 @@ JSON.RPC = new Class({
options = $pick(options, {})
options.params = $pick(options.params, [])
options.async = $pick(options.async, this.options.async)
-
+
data = JSON.encode({
method: method,
params: options.params,
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js
index 889514b44..ee789187a 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js
@@ -1,12 +1,25 @@
/*
Script: deluge-add.js
Contains the add torrent window and the torrent creator window.
-
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
Deluge.Widgets.AddWindow = new Class({
@@ -17,7 +30,7 @@ Deluge.Widgets.AddWindow = new Class({
title: _('Add Torrents'),
url: '/template/render/html/window_add_torrent.html'
},
-
+
initialize: function() {
this.parent();
this.bound = {
@@ -32,7 +45,7 @@ Deluge.Widgets.AddWindow = new Class({
this.addEvent('loaded', this.bound.onLoad);
this.addEvent('show', this.bound.onShow);
},
-
+
onLoad: function(e) {
this.content.id = 'addTorrent';
this.torrents = this.content.getElement('select');
@@ -43,28 +56,28 @@ Deluge.Widgets.AddWindow = new Class({
this.optionsTab = new Deluge.Widgets.AddTorrent.OptionsTab();
this.tabs.addPage(this.filesTab);
this.tabs.addPage(this.optionsTab);
-
+
this.fileWindow = new Deluge.Widgets.AddTorrent.File();
this.fileWindow.addEvent('torrentAdded', this.bound.onTorrentAdded);
this.fileButton = this.content.getElement('button.file');
this.fileButton.addEvent('click', function(e) {
this.fileWindow.show();
}.bindWithEvent(this));
-
+
this.urlWindow = new Deluge.Widgets.AddTorrent.Url();
- this.urlWindow.addEvent('torrentAdded', this.bound.onTorrentAdded);
+ this.urlWindow.addEvent('torrentAdded', this.bound.onTorrentAdded);
this.urlButton = this.content.getElement('button.url');
this.urlButton.addEvent('click', function(e) {
this.urlWindow.show();
}.bindWithEvent(this));
-
+
this.removeButton = this.content.getElement('button.remove');
this.removeButton.addEvent('click', this.bound.onRemoveClick);
-
+
this.content.getElement('button.add').addEvent('click', this.bound.onAdd);
this.content.getElement('button.cancel').addEvent('click', this.bound.onCancel);
},
-
+
onTorrentAdded: function(torrentInfo) {
var option = new Element('option');
option.set('value', torrentInfo['info_hash']);
@@ -74,11 +87,11 @@ Deluge.Widgets.AddWindow = new Class({
this.torrents.grab(option);
this.torrentInfo[torrentInfo['info_hash']] = torrentInfo;
},
-
+
onTorrentChanged: function(e) {
this.filesTab.setTorrent(this.torrentInfo[this.torrents.value]);
},
-
+
onAdd: function(e) {
torrents = new Array();
$each(this.torrentInfo, function(torrent) {
@@ -90,18 +103,18 @@ Deluge.Widgets.AddWindow = new Class({
Deluge.Client.add_torrents(torrents);
this.onCancel()
},
-
+
onShow: function(e) {
this.optionsTab.getDefaults();
},
-
+
onCancel: function(e) {
this.hide();
this.torrents.empty();
this.torrentInfo.empty();
this.filesTab.table.empty();
},
-
+
onRemoveClick: function(e) {
delete this.torrentInfo[this.torrents.value];
this.torrents.options[this.torrents.selectedIndex].dispose();
@@ -113,13 +126,13 @@ Deluge.Widgets.AddTorrent = {}
Deluge.Widgets.AddTorrent.File = new Class({
Extends: Widgets.Window,
-
+
options: {
width: 400,
height: 100,
title: _('From File')
},
-
+
initialize: function() {
this.parent();
this.bound = {
@@ -147,35 +160,35 @@ Deluge.Widgets.AddTorrent.File = new Class({
this.content.grab(this.iframe);
this.iframe.addEvent('load', this.bound.onLoad);
},
-
+
onLoad: function(e) {
var body = $(this.iframe.contentDocument.body);
var form = body.getElement('form');
var cancelButton = form.getElement('button.cancel');
cancelButton.addEvent('click', this.bound.onCancel);
-
+
var fileInputs = form.getElement('div.fileInputs');
var fileInput = fileInputs.getElement('input');
fileInput.set('opacity', 0.000001);
var fakeFile = fileInputs.getElement('div').getElement('input');
-
+
fileInput.addEvent('change', function(e) {
fakeFile.value = fileInput.value;
});
-
+
form.addEvent('submit', this.bound.onSubmit);
this.iframe.removeEvent('load', this.bound.onLoad);
},
-
+
onCancel: function(e) {
this.hide();
},
-
+
onSubmit: function(e) {
this.iframe.addEvent('load', this.bound.onComplete);
this.iframe.set('opacity', 0);
},
-
+
onComplete: function(e) {
filename = $(this.iframe.contentDocument.body).get('text');
this.hide();
@@ -183,7 +196,7 @@ Deluge.Widgets.AddTorrent.File = new Class({
onSuccess: this.bound.onGetInfoSuccess
});
},
-
+
onGetInfoSuccess: function(info) {
if (info) this.fireEvent('torrentAdded', info);
}
@@ -191,13 +204,13 @@ Deluge.Widgets.AddTorrent.File = new Class({
Deluge.Widgets.AddTorrent.Url = new Class({
Extends: Widgets.Window,
-
+
options: {
width: 300,
height: 100,
title: _('From Url')
},
-
+
initialize: function() {
this.parent();
this.bound = {
@@ -206,7 +219,7 @@ Deluge.Widgets.AddTorrent.Url = new Class({
onDownloadSuccess: this.onDownloadSuccess.bindWithEvent(this),
onGetInfoSuccess: this.onGetInfoSuccess.bindWithEvent(this)
};
-
+
this.form = new Element('form');
this.urlInput = new Element('input', {
'type': 'text',
@@ -224,11 +237,11 @@ Deluge.Widgets.AddTorrent.Url = new Class({
this.form.grab(this.urlInput).grab(new Element('br'));
this.form.grab(this.okButton).grab(this.cancelButton);
this.content.grab(this.form);
-
+
this.okButton.addEvent('click', this.bound.onOkClick);
this.cancelButton.addEvent('click', this.bound.onCancelClick);
},
-
+
onOkClick: function(e) {
e.stop();
var url = this.urlInput.get('value');
@@ -237,19 +250,19 @@ Deluge.Widgets.AddTorrent.Url = new Class({
});
this.hide();
},
-
+
onCancelClick: function(e) {
e.stop();
this.urlInput.set('value', '');
this.hide();
},
-
+
onDownloadSuccess: function(filename) {
Deluge.Client.get_torrent_info(filename, {
onSuccess: this.bound.onGetInfoSuccess
});
},
-
+
onGetInfoSuccess: function(info) {
this.fireEvent('torrentAdded', info);
}
@@ -257,20 +270,20 @@ Deluge.Widgets.AddTorrent.Url = new Class({
Deluge.Widgets.AddTorrent.FilesTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/add_torrent_files.html'
},
-
+
initialize: function() {
this.addEvent('loaded', this.onLoad.bindWithEvent(this));
this.parent('Files');
},
-
+
onLoad: function(e) {
- this.table = this.element.getElement('table');
+ this.table = this.element.getElement('table');
},
-
+
setTorrent: function(torrent) {
this.table.empty();
if (!torrent) return;
@@ -292,19 +305,19 @@ Deluge.Widgets.AddTorrent.FilesTab = new Class({
Deluge.Widgets.AddTorrent.OptionsTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/add_torrent_options.html'
},
-
+
initialize: function() {
this.parent('Options');
this.addEvent('loaded', this.onLoad.bindWithEvent(this));
},
-
+
onLoad: function(e) {
this.form = this.element.getElement('form');
-
+
new Widgets.Spinner(this.form.max_download_speed_per_torrent, {
step: 10,
precision: 1,
@@ -313,7 +326,7 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
low: -1
}
});
-
+
new Widgets.Spinner(this.form.max_upload_speed_per_torrent, {
step: 10,
precision: 1,
@@ -322,7 +335,7 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
low: -1
}
});
-
+
new Widgets.Spinner(this.form.max_connections_per_torrent, {
step: 1,
precision: 0,
@@ -331,7 +344,7 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
low: -1
}
});
-
+
new Widgets.Spinner(this.form.max_upload_slots_per_torrent, {
step: 1,
precision: 0,
@@ -341,7 +354,7 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
}
});
},
-
+
getDefaults: function() {
var keys = [
'add_paused',
@@ -357,12 +370,12 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
onSuccess: this.onGetConfigSuccess.bindWithEvent(this)
});
},
-
+
onGetConfigSuccess: function(config) {
this.default_config = config;
this.setFormToDefault();
},
-
+
setFormToDefault: function() {
this.form.add_paused.checked = config['add_paused'];
$each(this.form.compact_allocation, function(el) {
@@ -378,22 +391,22 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({
$$W(this.form.max_connections_per_torrent).setValue(config['max_connections_per_torrent']);
$$W(this.form.max_upload_slots_per_torrent).setValue(config['max_upload_slots_per_torrent']);
},
-
+
setTorrent: function(torrent) {
-
+
}
});
Deluge.Widgets.CreateTorrent = new Class({
Extends: Widgets.Window,
-
+
options: {
width: 400,
height: 400,
title: _('Create Torrent'),
url: '/template/render/html/window_create_torrent.html'
},
-
+
initialize: function() {
this.parent();
this.bound = {
@@ -403,21 +416,21 @@ Deluge.Widgets.CreateTorrent = new Class({
}
this.addEvent('loaded', this.bound.onLoad);
},
-
+
onLoad: function(e) {
this.tabs = new Deluge.Widgets.CreateTorrent.Tabs(this.content.getElement('.moouiTabs'));
this.fileButton = this.content.getElement('button.file');
this.folderButton = this.content.getElement('button.folder');
this.content.id = 'createTorrent';
-
+
this.fileButton.addEvent('click', this.bound.onFileClick);
},
-
+
onFileClick: function(e) {
var desktop = google.gears.factory.create('beta.desktop');
desktop.openFiles(this.onFilesPicked.bind(this));
},
-
+
onFilesPicked: function(files) {
for (var i = 0; i < files.length; i++) {
alert(files[i].blob);
@@ -427,7 +440,7 @@ Deluge.Widgets.CreateTorrent = new Class({
Deluge.Widgets.CreateTorrent.Tabs = new Class({
Extends: Widgets.Tabs,
-
+
initialize: function(element) {
this.parent(element);
this.info = new Deluge.Widgets.CreateTorrent.InfoTab();
@@ -443,11 +456,11 @@ Deluge.Widgets.CreateTorrent.Tabs = new Class({
Deluge.Widgets.CreateTorrent.InfoTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/create_torrent_info.html'
},
-
+
initialize: function() {
this.parent('Info');
}
@@ -455,11 +468,11 @@ Deluge.Widgets.CreateTorrent.InfoTab = new Class({
Deluge.Widgets.CreateTorrent.TrackersTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/create_torrent_trackers.html'
},
-
+
initialize: function() {
this.parent('Trackers');
}
@@ -467,11 +480,11 @@ Deluge.Widgets.CreateTorrent.TrackersTab = new Class({
Deluge.Widgets.CreateTorrent.WebseedsTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/create_torrent_webseeds.html'
},
-
+
initialize: function() {
this.parent('Webseeds');
}
@@ -479,11 +492,11 @@ Deluge.Widgets.CreateTorrent.WebseedsTab = new Class({
Deluge.Widgets.CreateTorrent.OptionsTab = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/create_torrent_options.html'
},
-
+
initialize: function() {
this.parent('Options');
}
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js
index 331fe6f1b..9ab485721 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js
@@ -2,11 +2,25 @@
Script: deluge-bars.js
Contains the various bars (Sidebar, Toolbar, Statusbar) used within Deluge.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
Class: Deluge.Widgets.Toolbar
@@ -22,7 +36,7 @@ Copyright:
Deluge.Widgets.Toolbar = new Class({
Implements: Events,
Extends: Widgets.Base,
-
+
initialize: function() {
this.parent($('toolbar'));
this.buttons = this.element.getFirst();
@@ -39,54 +53,54 @@ Deluge.Widgets.Toolbar = new Class({
/*
Class: Deluge.Widgets.StatusBar
Class to manage the bottom status bar
-
+
Example:
status = new Deluge.Widgets.StatusBar();
-
+
Returns:
An instance of the class wrapped about the status div
*/
Deluge.Widgets.StatusBar = new Class({
Extends: Widgets.Base,
-
+
initialize: function() {
this.parent($('status'));
this.bound = {
onContextMenu: this.onContextMenu.bindWithEvent(this)
};
-
+
this.element.getElements('li').each(function(el) {
this[el.id] = el;
}, this);
this.incoming_connections.setStyle('display', 'none');
-
+
this.connections.addEvent('contextmenu', this.bound.onContextMenu);
var menu = new Widgets.PopupMenu();
menu.add(Deluge.Menus.Connections);
menu.addEvent('action', this.onMenuAction);
this.connections.store('menu', menu);
-
+
this.downspeed.addEvent('contextmenu', this.bound.onContextMenu);
menu = new Widgets.PopupMenu();
menu.add(Deluge.Menus.Download);
menu.addEvent('action', this.onMenuAction);
this.downspeed.store('menu', menu);
-
+
this.upspeed.addEvent('contextmenu', this.bound.onContextMenu);
menu = new Widgets.PopupMenu();
menu.add(Deluge.Menus.Upload);
menu.addEvent('action', this.onMenuAction);
this.upspeed.store('menu', menu);
},
-
+
/*
Property: update
Takes thes stats part of the update_ui rpc call and
performs the required changes on the statusbar.
-
+
Arguments:
stats - A dictionary of the returned stats
-
+
Example:
statusbar.update(data['stats']);
*/
@@ -97,20 +111,20 @@ Deluge.Widgets.StatusBar = new Class({
this.dht.set('text', stats.dht_nodes);
this.free_space.set('text', stats.free_space.toBytes());
if (stats.has_incoming_connections) {
- this.incoming_connections.setStyle('display', 'none');
+ this.incoming_connections.setStyle('display', 'none');
} else {
this.incoming_connections.setStyle('display', 'inline');
}
},
-
+
/*
Property: onContextMenu
Event handler for when certain parts of the statusbar have been
right clicked.
-
+
Arguments:
e - The event args
-
+
Example:
el.addEvent('contextmenu', this.onContextMenu.bindWithEvent(this));
*/
@@ -119,16 +133,16 @@ Deluge.Widgets.StatusBar = new Class({
var menu = e.target.retrieve('menu');
if (menu) menu.show(e);
},
-
+
/*
Property: onMenuAction
Event handler for when an item in one of the menus is clicked.
Note that it does not need to be bound as it doesn't use `this`
anywhere within the method.
-
+
Arguments:
e - The event args
-
+
Example:
menu.addEvent('action', this.onMenuAction);
*/
@@ -145,17 +159,17 @@ Deluge.Widgets.StatusBar = new Class({
/*
Class: Deluge.Wdigets.Labels
Class to manage the filtering labels in the sidebar
-
+
Example:
labels = new Deluge.Widgets.Labels();
-
+
Returns:
An instance of the class wrapped about the labels div
*/
Deluge.Widgets.Labels = new Class({
-
+
Extends: Widgets.Base,
-
+
initialize: function() {
this.parent($('labels'));
this.bound = {
@@ -163,15 +177,15 @@ Deluge.Widgets.Labels = new Class({
};
this.filters = {};
},
-
+
/*
Property: update
Takes thes filters part of the update_ui rpc call and
performs the required changes on the filtering
-
+
Arguments:
filters - A dictionary of the available filters
-
+
Example:
labels.update({'state': [['All', '3'], ['Downloading', '2']]);
*/
@@ -194,13 +208,13 @@ Deluge.Widgets.Labels = new Class({
}
}, this);
},
-
+
/*
Property: labelClicked
-
+
Arguments:
e - The event args
-
+
Example:
labelSection.addEvent('labelClicked', this.bound.labelClicked);
*/
@@ -217,26 +231,26 @@ Deluge.Widgets.Labels = new Class({
/*
Class: Deluge.Widgets.LabelSection
Class to manage a section of filters within the labels block
-
+
Arguments:
string (the name of the section)
-
+
Returns:
A widget with the ability to manage the filters
*/
Deluge.Widgets.LabelSection = new Class({
-
+
Extends: Widgets.Base,
-
+
regex: /([\w]+)\s\((\d)\)/,
-
+
initialize: function(name) {
this.parent(new Element('div'));
this.name = name;
this.bound = {
'clicked': this.clicked.bindWithEvent(this)
}
-
+
name = name.replace('_', ' ');
parts = name.split(' ');
name = '';
@@ -246,21 +260,21 @@ Deluge.Widgets.LabelSection = new Class({
part = firstLetter + part.substring(1);
name += part + ' ';
});
-
+
this.header = new Element('h3').set('text', name);
this.list = new Element('ul');
-
+
this.element.grab(this.header);
this.element.grab(this.list);
},
-
+
/*
Property: update
Updates the filters list
-
+
Arguments:
values - a list of name/count values for the filters
-
+
Example:
labelSection.update([['All', '3'], ['Downloading', '2']]);
*/
@@ -283,7 +297,7 @@ Deluge.Widgets.LabelSection = new Class({
}
el.set('text', name + ' (' + count +')');
}, this);
-
+
// Clean out any labels that are no longer returned
this.list.getElements('li').each(function(el) {
var hasName = false;
@@ -291,20 +305,20 @@ Deluge.Widgets.LabelSection = new Class({
if (hasName) return;
hasName = el.hasClass(name);
});
-
+
if (!hasName) {
el.destroy();
}
});
},
-
+
/*
Property: clicked
Event handler for when a list item is clicked
-
+
Arguments:
e - The event args
-
+
Example:
listItem.addEvent('click', this.clicked.bindWithEvent(this));
*/
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-details.js b/deluge/ui/webui/templates/ajax/static/js/deluge-details.js
index cc84c6701..1485bfaef 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-details.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-details.js
@@ -2,25 +2,39 @@
Script: deluge-details.js
Contains the tabs for the torrent details.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
Deluge.Widgets.Details = new Class({
Extends: Widgets.Tabs,
-
+
initialize: function() {
this.parent($$('#details .mooui-tabs')[0]);
-
+
this.statistics = new Deluge.Widgets.StatisticsPage();
this.details = new Deluge.Widgets.DetailsPage();
this.files = new Deluge.Widgets.FilesPage();
this.peers = new Deluge.Widgets.PeersPage();
this.options = new Deluge.Widgets.OptionsPage();
-
+
this.addPage(this.statistics);
this.addPage(this.details);
this.addPage(this.files);
@@ -30,7 +44,7 @@ Deluge.Widgets.Details = new Class({
this.update(this.torrentId);
}.bindWithEvent(this));
this.addEvent('resize', this.resized.bindWithEvent(this));
-
+
this.files.addEvent('menuAction', function(e) {
files = [];
this.files.grid.getSelected().each(function(file) {
@@ -40,7 +54,7 @@ Deluge.Widgets.Details = new Class({
this.fireEvent('filesAction', e);
}.bindWithEvent(this));
},
-
+
keys: {
0: Deluge.Keys.Statistics,
1: Deluge.Keys.Details,
@@ -48,7 +62,7 @@ Deluge.Widgets.Details = new Class({
3: Deluge.Keys.Peers,
4: Deluge.Keys.Options
},
-
+
clear: function() {
this.pages.each(function(page) {
page.element.getChildren().each(function(el) {
@@ -57,7 +71,7 @@ Deluge.Widgets.Details = new Class({
if (page.clear) page.clear();
});
},
-
+
update: function(torrentId) {
this.torrentId = torrentId;
if (!this.torrentId) {
@@ -75,7 +89,7 @@ Deluge.Widgets.Details = new Class({
}.bindWithEvent(this)
});
},
-
+
resized: function(event) {
this.pages.each(function(page) {
page.getSizeModifiers();
@@ -89,16 +103,16 @@ Deluge.Widgets.Details = new Class({
Deluge.Widgets.StatisticsPage = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/tab_statistics.html'
},
-
+
initialize: function() {
this.parent(_('Statistics'));
this.addEvent('loaded', this.onLoad.bindWithEvent(this));
},
-
+
onLoad: function(e) {
this.element.id = 'statistics';
this.bar = new Widgets.ProgressBar();
@@ -107,19 +121,19 @@ Deluge.Widgets.StatisticsPage = new Class({
this.bar.update('', 0);
this.addEvent('resize', this.onResize.bindWithEvent(this));
},
-
+
onResize: function(e) {
if (!$defined(this.bar)) return;
this.bar.set('width', this.getWidth() - 12);
},
-
+
clear: function() {
if (this.bar) this.bar.update('', 0);
this.element.getElements('dd').each(function(item) {
item.set('text', '');
}, this);
},
-
+
update: function(torrent) {
var data = {
downloaded: torrent.total_done.toBytes()+' ('+torrent.total_payload_download.toBytes()+')',
@@ -140,10 +154,10 @@ Deluge.Widgets.StatisticsPage = new Class({
}
var text = torrent.state + ' ' + torrent.progress.toFixed(2) + '%';
this.bar.update(text, torrent.progress);
-
+
if (torrent.is_auto_managed) {data.auto_managed = 'True'}
else {data.auto_managed = 'False'};
-
+
this.element.getElements('dd').each(function(item) {
item.set('text', data[item.getProperty('class')]);
}, this);
@@ -152,21 +166,21 @@ Deluge.Widgets.StatisticsPage = new Class({
Deluge.Widgets.DetailsPage = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/tab_details.html'
},
-
+
initialize: function() {
this.parent(_('Details'));
},
-
+
clear: function() {
this.element.getElements('dd').each(function(item) {
item.set('text', '');
}, this);
},
-
+
update: function(torrent) {
var data = {
torrent_name: torrent.name,
@@ -185,7 +199,7 @@ Deluge.Widgets.DetailsPage = new Class({
Deluge.Widgets.FilesGrid = new Class({
Extends: Widgets.DataGrid,
-
+
options: {
columns: [
{name: 'filename',text: 'Filename',type:'text',width: 350},
@@ -194,21 +208,21 @@ Deluge.Widgets.FilesGrid = new Class({
{name: 'priority',text: 'Priority',type:'icon',width: 150}
]
},
-
+
priority_texts: {
0: 'Do Not Download',
1: 'Normal Priority',
2: 'High Priority',
5: 'Highest Priority'
},
-
+
priority_icons: {
0: '/static/images/16/process-stop.png',
1: '/template/static/icons/16/gtk-yes.png',
2: '/static/images/16/queue-down.png',
5: '/static/images/16/go-bottom.png'
},
-
+
initialize: function(element, options) {
this.parent(element, options);
var menu = new Widgets.PopupMenu();
@@ -220,7 +234,7 @@ Deluge.Widgets.FilesGrid = new Class({
icon: this.priority_icons[index]
});
}, this);
-
+
menu.addEvent('action', function(e) {
e = {
action: e.action,
@@ -228,20 +242,20 @@ Deluge.Widgets.FilesGrid = new Class({
};
this.fireEvent('menuAction', e);
}.bind(this));
-
+
this.addEvent('rowMenu', function(e) {
e.stop();
menu.row = e.row;
menu.show(e);
})
},
-
+
clear: function() {
this.rows.empty();
this.body.empty();
this.render();
},
-
+
updateFiles: function(torrent) {
torrent.files.each(function(file) {
var p = torrent.file_priorities[file.index];
@@ -249,7 +263,7 @@ Deluge.Widgets.FilesGrid = new Class({
text:this.priority_texts[p],
icon:this.priority_icons[p]
};
-
+
var percent = torrent.file_progress[file.index]*100.0;
row = {
id: torrent.id + '-' + file.index,
@@ -261,7 +275,7 @@ Deluge.Widgets.FilesGrid = new Class({
},
fileIndex: file.index,
torrentId: torrent.id
-
+
};
if (this.has(row.id)) {
this.updateRow(row, true);
@@ -275,49 +289,49 @@ Deluge.Widgets.FilesGrid = new Class({
Deluge.Widgets.FilesPage = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/tab_files.html'
},
-
+
initialize: function(el) {
this.parent(_('Files'));
this.torrentId = -1;
this.addEvent('loaded', this.loaded.bindWithEvent(this));
this.addEvent('resize', this.resized.bindWithEvent(this));
},
-
+
loaded: function(event) {
this.grid = new Deluge.Widgets.FilesGrid('files');
this.grid.addEvent('menuAction', this.menuAction.bindWithEvent(this));
-
+
if (this.beenResized) {
this.resized(this.beenResized);
delete this.beenResized;
};
},
-
+
clear: function() {
if (this.grid) this.grid.clear();
},
-
+
resized: function(e) {
if (!this.grid) {
this.beenResized = e;
return;
};
-
+
this.element.getPadding();
this.grid.sets({
width: e.width - this.element.padding.x,
height: e.height - this.element.padding.y
});
},
-
+
menuAction: function(e) {
this.fireEvent('menuAction', e);
},
-
+
update: function(torrent) {
if (this.torrentId != torrent.id) {
this.torrentId = torrent.id;
@@ -330,17 +344,17 @@ Deluge.Widgets.FilesPage = new Class({
Deluge.Widgets.PeersPage = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/tab_peers.html'
},
-
+
initialize: function(el) {
this.parent(_('Peers'));
this.addEvent('resize', this.resized.bindWithEvent(this));
this.addEvent('loaded', this.loaded.bindWithEvent(this));
},
-
+
loaded: function(event) {
this.grid = new Widgets.DataGrid($('peers'), {
columns: [
@@ -356,26 +370,26 @@ Deluge.Widgets.PeersPage = new Class({
delete this.been_resized;
};
},
-
+
resized: function(e) {
if (!this.grid) {
this.been_resized = e;
return;
};
-
+
this.element.getPadding();
this.grid.sets({
width: e.width - this.element.padding.x,
height: e.height - this.element.padding.y
});
},
-
+
clear: function() {
if (!this.grid) return;
this.grid.rows.empty();
this.grid.body.empty();
},
-
+
update: function(torrent) {
if (this.torrentId != torrent.id) {
this.torrentId = torrent.id;
@@ -406,7 +420,7 @@ Deluge.Widgets.PeersPage = new Class({
}
peers.include(peer.ip);
}, this);
-
+
this.grid.rows.each(function(row) {
if (!peers.contains(row.id)) {
row.element.destroy();
@@ -419,11 +433,11 @@ Deluge.Widgets.PeersPage = new Class({
Deluge.Widgets.OptionsPage = new Class({
Extends: Widgets.TabPage,
-
+
options: {
url: '/template/render/html/tab_options.html'
},
-
+
initialize: function() {
if (!this.element)
this.parent(_('Options'));
@@ -431,7 +445,7 @@ Deluge.Widgets.OptionsPage = new Class({
this.loaded(event);
}.bindWithEvent(this));
},
-
+
loaded: function(event) {
this.bound = {
apply: this.apply.bindWithEvent(this),
@@ -457,7 +471,7 @@ Deluge.Widgets.OptionsPage = new Class({
el.focused = false;
});
}, this);
-
+
new Widgets.Spinner(this.form.max_download_speed, {
step: 10,
precision: 1,
@@ -465,7 +479,7 @@ Deluge.Widgets.OptionsPage = new Class({
high: null,
low: -1
}
- });
+ });
new Widgets.Spinner(this.form.max_upload_speed, {
step: 10,
precision: 1,
@@ -473,7 +487,7 @@ Deluge.Widgets.OptionsPage = new Class({
high: null,
low: -1
}
- });
+ });
new Widgets.Spinner(this.form.max_connections, {
step: 1,
precision: 0,
@@ -481,7 +495,7 @@ Deluge.Widgets.OptionsPage = new Class({
high: null,
low: -1
}
- });
+ });
new Widgets.Spinner(this.form.max_upload_slots, {
step: 1,
precision: 0,
@@ -489,7 +503,7 @@ Deluge.Widgets.OptionsPage = new Class({
high: null,
low: -1
}
- });
+ });
new Widgets.Spinner(this.form.stop_ratio, {
step: 1,
precision: 1,
@@ -498,11 +512,11 @@ Deluge.Widgets.OptionsPage = new Class({
low: -1
}
});
-
+
this.form.apply_options.addEvent('click', this.bound.apply);
this.form.reset_options.addEvent('click', this.bound.reset);
},
-
+
apply: function(event) {
if (!this.torrentId) return;
var changed = this.changed[this.torrentId];
@@ -516,7 +530,7 @@ Deluge.Widgets.OptionsPage = new Class({
}.bindWithEvent(this)
});
},
-
+
clear: function() {
if (!this.form) return;
$$W(this.form.max_download_speed).setValue(0);
@@ -531,7 +545,7 @@ Deluge.Widgets.OptionsPage = new Class({
this.form.private.disabled = false;
this.form.prioritize_first_last.checked = false;
},
-
+
reset: function(event) {
if (this.torrentId) {
delete this.changed[this.torrentId];
@@ -543,7 +557,7 @@ Deluge.Widgets.OptionsPage = new Class({
}.bindWithEvent(this)
});
},
-
+
update: function(torrent) {
this.torrentId = torrent.id;
$each(torrent, function(value, key) {
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-menus.js b/deluge/ui/webui/templates/ajax/static/js/deluge-menus.js
index 39eeb359a..0b853e3a4 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-menus.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-menus.js
@@ -2,11 +2,25 @@
Script: deluge-menus.js
Contains the layout for all the popup menus used within the ajax ui.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
Deluge.Menus = {
@@ -240,7 +254,7 @@ Deluge.Menus = {
}
]
},
- {type: 'seperator'},
+ {type: 'seperator'},
{
type: 'text',
action: 'update_tracker',
@@ -301,7 +315,7 @@ Deluge.Menus = {
icon: '/static/images/16/move.png'
}
],
-
+
Connections: [
{
type: 'text',
@@ -340,7 +354,7 @@ Deluge.Menus = {
text: _('Unlimited')
}
],
-
+
Download: [
{
type: 'text',
@@ -379,7 +393,7 @@ Deluge.Menus = {
text: _('Unlimited')
}
],
-
+
Upload: [
{
type: 'text',
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-mime.js b/deluge/ui/webui/templates/ajax/static/js/deluge-mime.js
index 7b75acab3..093994807 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-mime.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-mime.js
@@ -2,11 +2,25 @@
Script: deluge-mime.js
Library for converting mimetypes to extensions and vica versa.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
Object: Deluge.Mime
@@ -136,12 +150,12 @@ Deluge.Mime = {
'.avi': 'video/x-msvideo',
'.movie': 'video/x-sgi-movie'
}),
-
+
getMimeType: function(filename) {
var extension = filename.match(/^.*(\.\w+)$/)
if (extension) extension = extension[1]
else return null;
-
+
if (this.types_map.has(extension)) return this.types_map[extension];
else return null;
}
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-preferences.js b/deluge/ui/webui/templates/ajax/static/js/deluge-preferences.js
index 9c1c3600d..9ad32e6f5 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-preferences.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-preferences.js
@@ -3,11 +3,25 @@ Script: deluge-preferences.js
Contains the classes that provides the preferences window with
functionality
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
Deluge.Widgets.PreferencesCategory = new Class({
@@ -20,7 +34,7 @@ Deluge.Widgets.PluginPreferencesCategory = new Class({
Deluge.Widgets.GenericPreferences = new Class({
Extends: Deluge.Widgets.PreferencesCategory,
-
+
initialize: function(name, options) {
this.parent(name, options)
this.core = true;
@@ -41,16 +55,16 @@ Deluge.Widgets.GenericPreferences = new Class({
});
}.bindWithEvent(this));
},
-
+
update: function(config) {
this.fireEvent('beforeUpdate');
- this.original = config;
+ this.original = config;
this.changed = new Hash();
this.inputs = this.form.getElements('input, select');
this.inputs.each(function(input) {
if (!input.name) return;
if (!$defined(config[input.name])) return;
-
+
widget = $$W(input);
if (widget) {
widget.setValue(config[input.name]);
@@ -71,7 +85,7 @@ Deluge.Widgets.GenericPreferences = new Class({
input.checked = true;
}
}
-
+
input.addEvent('change', function(el) {
if (input.type == 'checkbox') {
if (this.original[input.name] == input.checked) {
@@ -111,18 +125,18 @@ Deluge.Widgets.GenericPreferences = new Class({
Deluge.Widgets.WebUIPreferences = new Class({
Extends: Deluge.Widgets.GenericPreferences,
-
+
options: {
url: '/template/render/html/preferences_webui.html'
},
-
+
initialize: function() {
this.parent('Web UI');
this.core = false;
this.addEvent('beforeUpdate', this.beforeUpdate.bindWithEvent(this));
this.addEvent('update', this.updated.bindWithEvent(this));
},
-
+
beforeUpdate: function(event) {
var templates = Deluge.Client.get_webui_templates({async: false});
this.form.template.empty();
@@ -132,16 +146,16 @@ Deluge.Widgets.WebUIPreferences = new Class({
this.form.template.grab(option);
}, this);
},
-
+
updated: function(event) {
if (this.form.template.value != 'ajax')
this.form.theme.disabled = true;
else
this.form.theme.disabled = false;
-
+
var theme = this.form.theme.getElement('option[value="' + Cookie.read('theme') + '"]')
theme.selected = true
-
+
this.form.template.addEvent('change', function(e) {
if (this.form.template.value != 'ajax') {
this.form.theme.disabled = true;
@@ -154,7 +168,7 @@ Deluge.Widgets.WebUIPreferences = new Class({
}
}.bindWithEvent(this));
},
-
+
apply: function() {
Deluge.UI.setTheme(this.form.theme.value);
Deluge.Client.set_webui_config(this.changed, {
@@ -173,7 +187,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
title: 'Preferences',
url: '/template/render/html/window_preferences.html'
},
-
+
initialize: function() {
this.parent();
this.categories = [];
@@ -181,18 +195,18 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.addEvent('loaded', this.loaded.bindWithEvent(this));
this.addEvent('beforeShow', this.beforeShown.bindWithEvent(this));
},
-
+
loaded: function(event) {
this.catlist = this.content.getElement('.categories ul');
this.pages = this.content.getElement('.pref_pages');
this.title = this.pages.getElement('h3');
-
+
this.reset = this.content.getElement('.buttons .reset');
this.apply = this.content.getElement('.buttons .apply');
this.apply.addEvent('click', this.applied.bindWithEvent(this));
-
+
this.webui = new Deluge.Widgets.WebUIPreferences();
-
+
this.download = new Deluge.Widgets.GenericPreferences('Download', {
url: '/template/render/html/preferences_download.html'
});
@@ -208,7 +222,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.queue = new Deluge.Widgets.GenericPreferences('Queue', {
url: '/template/render/html/preferences_queue.html'
});
-
+
this.addCategory(this.webui);
this.addCategory(this.download);
this.addCategory(this.network);
@@ -216,11 +230,11 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.addCategory(this.daemon);
this.addCategory(this.queue);
},
-
+
addCategory: function(category) {
this.categories.include(category);
var categoryIndex = this.categories.indexOf(category);
-
+
var tab = new Element('li');
tab.set('text', category.name);
tab.addEvent('click', function(e) {
@@ -230,14 +244,14 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.catlist.grab(tab);
this.pages.grab(category.addClass('deluge-prefs-page'));
-
-
+
+
if (this.currentPage < 0) {
this.currentPage = categoryIndex;
this.select(categoryIndex);
};
},
-
+
select: function(id) {
this.categories[this.currentPage].removeClass('deluge-prefs-page-active');
this.categories[this.currentPage].tab.removeClass('deluge-prefs-active');
@@ -247,13 +261,13 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.currentPage = id;
this.fireEvent('pageChanged');
},
-
+
applied: function(event) {
var config = {};
this.categories.each(function(category) {
config = $merge(config, category.getConfig());
});
-
+
if ($defined(config['end_listen_port']) || $defined(config['start_listen_port'])) {
var startport = $pick(config['start_listen_port'], this.config['listen_ports'][0]);
var endport = $pick(config['end_listen_port'], this.config['listen_ports'][1]);
@@ -261,7 +275,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
delete config['start_listen_port'];
config['listen_ports'] = [startport, endport];
}
-
+
if ($defined(config['end_outgoing_port']) || $defined(config['start_outgoing_port'])) {
var startport = $pick(config['start_outgoing_port'], this.config['outgoing_ports'][0]);
var endport = $pick(config['end_outgoing_port'], this.config['outgoing_ports'][1]);
@@ -269,7 +283,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
delete config['start_outgoing_port'];
config['outgoing_ports'] = [startport, endport];
}
-
+
Deluge.Client.set_config(config, {
onSuccess: function(e) {
this.hide();
@@ -286,7 +300,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
// in order to not have to modify the generic preferences class.
this.config['start_listen_port'] = this.config['listen_ports'][0];
this.config['end_listen_port'] = this.config['listen_ports'][1];
-
+
this.config['start_outgoing_port'] = this.config['outgoing_ports'][0];
this.config['end_outgoing_port'] = this.config['outgoing_ports'][1];
@@ -294,7 +308,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.categories.each(function(category) {
if (category.update && category.core) category.update(this.config);
}, this);
-
+
// Update the config for the webui pages.
var webconfig = Deluge.Client.get_webui_config({async: false});
this.webui.update(webconfig);
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-torrent-grid.js b/deluge/ui/webui/templates/ajax/static/js/deluge-torrent-grid.js
index 6e5161329..2e2636d27 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-torrent-grid.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-torrent-grid.js
@@ -2,11 +2,25 @@
Script: deluge-torrent-grid.js
Contains the Deluge torrent grid.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
Class: Deluge.Widgets.TorrentGrid
@@ -21,7 +35,7 @@ Copyright:
*/
Deluge.Widgets.TorrentGrid = new Class({
Extends: Widgets.DataGrid,
-
+
options: {
columns: [
{name: 'number',text: '#',type:'number',width: 20},
@@ -37,7 +51,7 @@ Deluge.Widgets.TorrentGrid = new Class({
{name: 'avail',text: 'Avail.',type:'number',width: 60}
]
},
-
+
icons: {
'Downloading': '/pixmaps/downloading16.png',
'Seeding': '/pixmaps/seeding16.png',
@@ -46,19 +60,19 @@ Deluge.Widgets.TorrentGrid = new Class({
'Error': '/pixmaps/alert16.png',
'Checking': '/pixmaps/checking16.png'
},
-
+
/*
Property: getSelectedTorrentIds
Helper function to quickly return the torrent ids of the currently
selected torrents in the grid.
-
+
Example:
var ids = '';
grid.getSelectedTorrentIds.each(function(id) {
ids += id + '\n';
});
alert(ids);
-
+
Returns:
A list containing the currently selected torrent ids.
*/
@@ -69,14 +83,14 @@ Deluge.Widgets.TorrentGrid = new Class({
});
return torrentIds;
},
-
+
/*
Property: updateTorrents
Event handler for when a list item is clicked
-
+
Arguments:
e - The event args
-
+
Example:
listItem.addEvent('click', this.clicked.bindWithEvent(this));
*/
@@ -107,7 +121,7 @@ Deluge.Widgets.TorrentGrid = new Class({
this.addRow(row, true);
};
}, this);
-
+
// remove any torrents no longer in the grid.
this.rows.each(function(row) {
if (!torrents.has(row.id)) {
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-ui.js b/deluge/ui/webui/templates/ajax/static/js/deluge-ui.js
index 3c58ff144..9773184df 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge-ui.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge-ui.js
@@ -2,11 +2,25 @@
Script: deluge-ui.js
Ties all the other scripts together to build up the Deluge AJAX UI.
-License:
- General Public License v3
-
-Copyright:
- Damien Churchill (c) 2008 <damoxc@gmail.com>
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
Object: Deluge.UI
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge.js b/deluge/ui/webui/templates/ajax/static/js/deluge.js
index f1f7d6aae..cc6c5506e 100644
--- a/deluge/ui/webui/templates/ajax/static/js/deluge.js
+++ b/deluge/ui/webui/templates/ajax/static/js/deluge.js
@@ -2,8 +2,24 @@
* Script: deluge.js
* The core script for the deluge ajax ui
*
- * Copyright:
- * Damien Churchill (c) 2008 <damoxc@gmail.com>
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
var Deluge = $empty;
@@ -14,13 +30,13 @@ Deluge.Keys = {
'total_seeds', 'num_peers', 'total_peers', 'download_payload_rate',
'upload_payload_rate', 'eta', 'ratio', 'distributed_copies',
'is_auto_managed'
- ],
+ ],
Statistics: [
'total_done', 'total_payload_download', 'total_uploaded',
'total_payload_upload', 'next_announce', 'tracker_status', 'num_pieces',
'piece_length', 'is_auto_managed', 'active_time', 'seeding_time',
'seed_rank'
- ],
+ ],
Files: [
'files', 'file_progress', 'file_priorities'
],
diff --git a/deluge/ui/webui/templates/classic/gettext.js b/deluge/ui/webui/templates/classic/gettext.js
index 832c4b4a9..49ddb8ce9 100644
--- a/deluge/ui/webui/templates/classic/gettext.js
+++ b/deluge/ui/webui/templates/classic/gettext.js
@@ -3,8 +3,25 @@
* A script file that is run through the template renderer in order for
* translated strings to be retrieved.
*
- * Copyright:
- * Damien Churchill (c) 2008
+ *
+ * Copyright (C) Damien Churchill 2008 <damoxc@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ *
*/
GetText = {
diff --git a/setup.py b/setup.py
index 878bf165a..4ee627a81 100644
--- a/setup.py
+++ b/setup.py
@@ -383,7 +383,6 @@ setup(
"i18n/*.pot",
"i18n/*/LC_MESSAGES/*.mo",
"ui/webui/scripts/*",
- "ui/webui/ssl/*",
"ui/webui/static/*.css",
"ui/webui/static/*.js",
"ui/webui/static/images/*.png",