mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
label js
This commit is contained in:
parent
cf1720b2b6
commit
3f86e440bd
2 changed files with 11 additions and 9 deletions
|
@ -7,13 +7,11 @@
|
||||||
popup_icon = "/static/images/tango/emblem-symbolic-link.png" /*the best i could find in 15 minutes, i still hate it.*/
|
popup_icon = "/static/images/tango/emblem-symbolic-link.png" /*the best i could find in 15 minutes, i still hate it.*/
|
||||||
|
|
||||||
Plugins = {}
|
Plugins = {}
|
||||||
|
|
||||||
Plugins.Label = {
|
Plugins.Label = {
|
||||||
/*onload:*/
|
initialize : function() {
|
||||||
initialize: function() {
|
|
||||||
this.bound = {
|
this.bound = {
|
||||||
addPopup: this.addPopup.bind(this),
|
addPopup: this.addPopup.bind(this),
|
||||||
labelAction: this.labelAction.bindWithEvent(this)
|
labelAction: this.labelAction.bindWithEvent(this),
|
||||||
};
|
};
|
||||||
|
|
||||||
$$('.filter_label').each(this.bound.addPopup);
|
$$('.filter_label').each(this.bound.addPopup);
|
||||||
|
@ -21,13 +19,16 @@ Plugins.Label = {
|
||||||
var menu = new Widgets.PopupMenu();
|
var menu = new Widgets.PopupMenu();
|
||||||
menu.add(this.menu);
|
menu.add(this.menu);
|
||||||
menu.addEvent('action', this.bound.labelAction);
|
menu.addEvent('action', this.bound.labelAction);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/*add menu to html-ui*/
|
/*add menu to html-ui*/
|
||||||
addPopup: function (el) {
|
addPopup: function (el) {
|
||||||
|
|
||||||
var label_id = el.id.substring(13); /*crop of "filter_label_"*/
|
var label_id = el.id.substring(13); /*crop of "filter_label_"*/
|
||||||
el.addEvent('click', function(el) {
|
el.addEvent('contextmenu', function(el) {
|
||||||
alert('popup:' + label_id);
|
alert('popup menu here : [label="' + label_id + '"] (using this.menu definitions)');
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -73,4 +74,7 @@ Plugins.Label = {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEvent('domready', Plugins.Label.initialize);
|
window.addEvent('domready', function(e) {
|
||||||
|
Plugins.Label.initialize();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,8 @@ $def with (title, active_tab="NONE")
|
||||||
<script language="javascript" src="$base/static/mootools-1.2-more.js"></script>
|
<script language="javascript" src="$base/static/mootools-1.2-more.js"></script>
|
||||||
<script language="javascript" src="$base/static/mooui.js"></script>
|
<script language="javascript" src="$base/static/mooui.js"></script>
|
||||||
<script language="javascript" src="$base/gettext.js"></script>
|
<script language="javascript" src="$base/gettext.js"></script>
|
||||||
<!--
|
|
||||||
$for js in include_javascript:
|
$for js in include_javascript:
|
||||||
<script language="javascript" src="$base$js"></script>
|
<script language="javascript" src="$base$js"></script>
|
||||||
-->
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue