diff --git a/deluge/data/revision b/deluge/data/revision index 4a484d7af..e69de29bb 100644 --- a/deluge/data/revision +++ b/deluge/data/revision @@ -1 +0,0 @@ -4118 \ No newline at end of file diff --git a/deluge/plugins/label/label/data/test1.js b/deluge/plugins/label/label/data/test1.js index 3ea951f57..3623b40f7 100644 --- a/deluge/plugins/label/label/data/test1.js +++ b/deluge/plugins/label/label/data/test1.js @@ -1,5 +1,72 @@ -/*testing include_javascript*/ /* -yep it works. -window.alert("test-plugin-javascript"); +# Copyright (C) 2008 Martijn Voncken +# License : GPL v3. */ + + +popup_icon = "/static/images/tango/emblem-symbolic-link.png" /*the best i could find in 15 minutes, i still hate it.*/ + +Plugins = {} + +function _(str) { + return str /*#todo : translations; see Deluge.Strings.get*/ +} + +Plugins.Label = { + /*onload:*/ + initialize: function() { + $$('.filter_label').each(Plugins.Label.addPopup); + + var menu = new Widgets.PopupMenu() + menu.add(this.menu); + menu.addEvent('action', function(e) { + Plugins.Label.labelAction(e.action, e.value) + }.bind(this)); + + }, + /*add menu to html-ui*/ + addPopup: function (el) { + var label_id = el.id.substring(13) /*crop of "filter_label_"*/ + el.innerHTML = "" + el.innerHTML; + }, + + /*callback handler*/ + labelAction: function(action, label_id) { + func = Plugins.Label[action]; + func(label_id); + }, + /*menu callbacks:*/ + add: function(label_id) { + alert("Add Label:" + label_id); + }, + edit: function() { + alert("Edit Label:" + label_id); + }, + remove: function() { + alert("Remove Label:" + label_id); + }, + + /*popup menu definition*/ + menu:[ + { + type:'text', + action:'add', + text: _('Add Label'), + icon:'/static/images/tango/pause.png' + }, + { + type: 'text', + action: 'edit', + text: _('Label Options'), + icon: '/static/images/tango/start.png' + }, + { + type: 'text', + action: 'remove', + text: _('Remove Label'), + icon: '/static/images/tango/start.png' + } + ] +}; + +window.addEvent('domready', Plugins.Label.initialize); diff --git a/deluge/ui/webui/templates/white/header.html b/deluge/ui/webui/templates/white/header.html index c8bac2f83..82c24edd7 100644 --- a/deluge/ui/webui/templates/white/header.html +++ b/deluge/ui/webui/templates/white/header.html @@ -8,6 +8,9 @@ $def with (title, active_tab="NONE") + + + $for js in include_javascript: diff --git a/deluge/ui/webui/templates/white/index.html b/deluge/ui/webui/templates/white/index.html index 9fe7f8e50..5c78d965d 100644 --- a/deluge/ui/webui/templates/white/index.html +++ b/deluge/ui/webui/templates/white/index.html @@ -1,5 +1,4 @@ $def with (torrent_list, label_filters) - $:render.header(_("Deluge : Torrent List"), 'home') diff --git a/deluge/ui/webui/templates/white/part_label_filters.html b/deluge/ui/webui/templates/white/part_label_filters.html index 779ea12b9..0f6acb2ef 100644 --- a/deluge/ui/webui/templates/white/part_label_filters.html +++ b/deluge/ui/webui/templates/white/part_label_filters.html @@ -21,27 +21,30 @@ $if get_config("show_keyword_search"): >

- $for cat in filter_items.keys(): -
$id_to_label(cat)
+
$id_to_label(cat)