Browse Source

Added priority actions to Web UI right-click menu

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
fefda39284
  1. BIN
      src/Icons/skin/arrow-right.gif
  2. 1
      src/icons.qrc
  3. 34
      src/webui/css/style.css
  4. 8
      src/webui/index.html
  5. 11
      src/webui/scripts/mocha-init.js
  6. 14
      src/webui/transferlist.html

BIN
src/Icons/skin/arrow-right.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 B

1
src/icons.qrc

@ -49,6 +49,7 @@ @@ -49,6 +49,7 @@
<file>Icons/skin/queued.png</file>
<file>Icons/skin/checking.png</file>
<file>Icons/skin/handle-icon.gif</file>
<file>Icons/skin/arrow-right.gif</file>
<file>Icons/skin/filterinactive.png</file>
<file>Icons/skin/decrease.png</file>
<file>Icons/skin/play22.png</file>

34
src/webui/css/style.css

@ -161,13 +161,39 @@ a.propButton img { @@ -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 { @@ -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 */

8
src/webui/index.html

@ -93,6 +93,14 @@ @@ -93,6 +93,14 @@
<li><a href="#Pause" class="pause">_(Pause)</a></li>
<li class="separator"><a href="#Delete" class="delete">_(Delete)</a></li>
<li><a href="#DeleteHD" class="deleteHD">_(Delete from HD)</a></li>
<li class="separator"><a href="#priority" class="priority arrow-right">_(Priority)</a>
<ul>
<li><a href="#prioTop" class="prioTop">_(Move to top)</a></li>
<li><a href="#prioUp" class="prioUp">_(Move up)</a></li>
<li><a href="#prioDown" class="prioDown">_(Move down)</a></li>
<li><a href="#prioBottom" class="prioBottom">_(Move to bottom)</a></li>
</ul>
</li>
<li class="separator"><a href="#DownloadLimit" class="downloadLimit">_(Limit download rate)</a></li>
<li><a href="#UploadLimit" class="uploadLimit">_(Limit upload rate)</a></li>
<li class="separator"><a href="#ForceRecheck" class="recheck">_(Force recheck)</a></li>

11
src/webui/scripts/mocha-init.js

@ -204,7 +204,7 @@ initializeWindows = function(){ @@ -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(){ @@ -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();

14
src/webui/transferlist.html

@ -37,6 +37,18 @@ @@ -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 @@ @@ -52,4 +64,4 @@
myTable.setup('myTable', 4, context_menu);
</script>
</script>

Loading…
Cancel
Save