From fefda39284215a353e70267878c9153321e2a598 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 15 Aug 2010 08:49:19 +0000 Subject: [PATCH] Added priority actions to Web UI right-click menu --- src/Icons/skin/arrow-right.gif | Bin 0 -> 54 bytes src/icons.qrc | 1 + src/webui/css/style.css | 34 ++++++++++++++++++++++++++++++-- src/webui/index.html | 8 ++++++++ src/webui/scripts/mocha-init.js | 11 +++++++++-- src/webui/transferlist.html | 14 ++++++++++++- 6 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 src/Icons/skin/arrow-right.gif diff --git a/src/Icons/skin/arrow-right.gif b/src/Icons/skin/arrow-right.gif new file mode 100644 index 0000000000000000000000000000000000000000..da97e6814f8ddaeb13dba4cb61cb023b6fbaff8d GIT binary patch literal 54 zcmZ?wbhEHbIcons/skin/queued.png Icons/skin/checking.png Icons/skin/handle-icon.gif + Icons/skin/arrow-right.gif Icons/skin/filterinactive.png Icons/skin/decrease.png Icons/skin/play22.png diff --git a/src/webui/css/style.css b/src/webui/css/style.css index 3591a73cf..61f524fea 100644 --- a/src/webui/css/style.css +++ b/src/webui/css/style.css @@ -161,13 +161,39 @@ a.propButton img { } /* context menu specific */ -#contextmenu { border:1px solid #999; padding:0; background:#eee; list-style-type:none; display:none; } +#contextmenu { border:1px solid #999; padding:0; background:#eee; list-style-type:none; display:none; width: 164px;} #contextmenu .separator { border-top:1px solid #999; } -#contextmenu li { margin:0; padding:0; } +#contextmenu li { margin:0; padding:0;} #contextmenu li a { display:block; padding:5px 10px 5px 35px; font-size:12px; text-decoration:none; font-family:tahoma,arial,sans-serif; color:#000; background-position:8px 2px; background-repeat:no-repeat; } #contextmenu li a:hover { background-color:#ddd; } #contextmenu li a.disabled { color:#ccc; font-style:italic; } #contextmenu li a.disabled:hover { background-color:#eee; } +#contextmenu li ul { + padding: 0; + border:1px solid #999; padding:0; background:#eee; + list-style-type:none; + position: absolute; + left: -999em; + z-index: 8000; + margin: -29px 0 0 164px; + width: 164px; +} +#contextmenu li ul li a { + position: relative; +} +#contextmenu li a.arrow-right, #contextmenu li a:hover.arrow-right { + background-image: url(../images/skin/arrow-right.gif); + background-repeat: no-repeat; + background-position: right center; +} +#contextmenu li:hover ul, +#contextmenu li.ieHover ul, +#contextmenu li li.ieHover ul, +#contextmenu li li li.ieHover ul, +#contextmenu li li:hover ul, +#contextmenu li li li:hover ul { /* lists nested under hovered list items */ + left: auto; +} /* context menu items */ #contextmenu li a.pause { background-image:url(../images/skin/pause22.png); } @@ -177,6 +203,10 @@ a.propButton img { #contextmenu li a.deleteHD { background-image:url(../images/skin/delete_perm22.png); } #contextmenu li a.uploadLimit { background-image:url(../images/skin/seeding.png); } #contextmenu li a.downloadLimit { background-image:url(../images/skin/download.png); } +#contextmenu li a.prioTop { background-image:url(../images/oxygen/go-top.png); } +#contextmenu li a.prioUp { background-image:url(../images/oxygen/go-up.png); } +#contextmenu li a.prioDown { background-image:url(../images/oxygen/go-down.png); } +#contextmenu li a.prioBottom { background-image:url(../images/oxygen/go-bottom.png); } /* Sliders */ diff --git a/src/webui/index.html b/src/webui/index.html index 3e28d20a8..8e5abb019 100644 --- a/src/webui/index.html +++ b/src/webui/index.html @@ -93,6 +93,14 @@
  • _(Pause)
  • _(Delete)
  • _(Delete from HD)
  • +
  • _(Priority) + +
  • _(Limit download rate)
  • _(Limit upload rate)
  • _(Force recheck)
  • diff --git a/src/webui/scripts/mocha-init.js b/src/webui/scripts/mocha-init.js index 22dff6dd1..490a60514 100644 --- a/src/webui/scripts/mocha-init.js +++ b/src/webui/scripts/mocha-init.js @@ -204,7 +204,7 @@ initializeWindows = function(){ } }; - ['pause','resume','decreasePrio','increasePrio','recheck'].each(function(item) { + ['pause','resume','decreasePrio','increasePrio', 'topPrio', 'bottomPrio', 'recheck'].each(function(item) { addClickEvent(item, function(e){ new Event(e).stop(); var h = myTable.selectedIds(); @@ -221,7 +221,14 @@ initializeWindows = function(){ }); }); - + setPriorityFN = function(cmd) { + var h = myTable.selectedIds(); + if(h.length){ + h.each(function(hash, index){ + new Request({url: '/command/'+cmd, method: 'post', data: {hash: hash}}).send(); + }); + } + } addClickEvent('bug', function(e){ new Event(e).stop(); diff --git a/src/webui/transferlist.html b/src/webui/transferlist.html index 5997cde3c..b5425449d 100644 --- a/src/webui/transferlist.html +++ b/src/webui/transferlist.html @@ -37,6 +37,18 @@ Pause: function(element, ref) { pauseFN(); }, + prioTop: function(element, ref) { + setPriorityFN('topPrio'); + }, + prioUp: function(element, ref) { + setPriorityFN('increasePrio'); + }, + prioDown: function(element, ref) { + setPriorityFN('decreasePrio'); + }, + prioBottom: function(element, ref) { + setPriorityFN('bottomPrio'); + }, ForceRecheck: function(element, ref) { recheckFN(); }, @@ -52,4 +64,4 @@ myTable.setup('myTable', 4, context_menu); - \ No newline at end of file +