diff --git a/deluge/ui/webui/static/deluge.js b/deluge/ui/webui/static/deluge.js index b5dd5570d..b301a4e8d 100644 --- a/deluge/ui/webui/static/deluge.js +++ b/deluge/ui/webui/static/deluge.js @@ -106,6 +106,7 @@ on_click_action = on_click_do_nothing; /*toobar buttons, */ function toolbar_post(url, selected) { if ((!selected) || (state.selected_rows.length > 0)) { + var ids = state.selected_rows.join(','); var ids = state.selected_rows.join(','); var form = $('toolbar_form'); form.action = url +ids; @@ -125,6 +126,38 @@ function toolbar_get(url , selected) { return false; } + +/*arrow-navigation*/ +torrent_table = {} +torrent_table.select_prev = function () { + //torrent_tab + var prev_id = state.selected_rows[0]; + var i = torrent_table.torrents.indexOf(prev_id); + var id = torrent_table.torrents[i - 1]; + deselect_all_rows(); + select_row(id); + open_inner_details(id); +} +torrent_table.select_next = function () { + var prev_id = state.selected_rows[0]; + var i = torrent_table.torrents.indexOf(prev_id); + var id = torrent_table.torrents[i + 1]; + deselect_all_rows(); + select_row(id); + open_inner_details(id); +} +torrent_table.keydown = function (oEvent) { + switch(oEvent.keyCode) { + case 38: //up arrow + torrent_table.select_prev(); + break; + case 40: //down arrow + torrent_table.select_next(); + break; + } +}; + + /*stuff copied from various places:*/ /*http://www.w3schools.com/js/js_cookies.asp*/ function setCookie(c_name,value,expiredays) @@ -149,4 +182,23 @@ if (document.cookie.length>0) } } return "" -} \ No newline at end of file +} + + + + + + + + + + + + + + + + + + + diff --git a/deluge/ui/webui/templates/advanced/part_torrent_list.html b/deluge/ui/webui/templates/advanced/part_torrent_list.html index cd20460b5..577e607dc 100644 --- a/deluge/ui/webui/templates/advanced/part_torrent_list.html +++ b/deluge/ui/webui/templates/advanced/part_torrent_list.html @@ -2,16 +2,20 @@ $def with (torrent_list, organize_filters) - +
+ $:(sort_head('state', 'S'))