diff --git a/changedetectionio/static/images/search.png b/changedetectionio/static/images/search.png deleted file mode 100644 index 69755f00..00000000 Binary files a/changedetectionio/static/images/search.png and /dev/null differ diff --git a/changedetectionio/static/js/tbltools.js b/changedetectionio/static/js/tbltools.js index 71f910c2..859cccc3 100644 --- a/changedetectionio/static/js/tbltools.js +++ b/changedetectionio/static/js/tbltools.js @@ -2,6 +2,8 @@ // must be a var for keyChar and keyCode use var CONSTANT_ESCAPE_KEY = 27; +var CONSTANT_S_KEY = 83; +var CONSTANT_s_KEY = 115; // global sorting vars (new window is always last_changed, descending) var loading; @@ -29,6 +31,14 @@ function storeScrollAndSearch() { sessionStorage.setItem('scrollpos', window.pageYOffset); sessionStorage.setItem('searchtxt', document.getElementById("txtInput").value); } +// (ctl)-alt-s search hotkey +document.onkeyup=function(e){ + var e = e || window.event; // for IE to cover IEs window event-object + if(e.altKey && (e.which == CONSTANT_S_KEY || e.which == CONSTANT_s_KEY)) { + document.getElementById("txtInput").focus(); + return false; + } +} // page load functions function load_functions() { @@ -85,11 +95,7 @@ function sortTable(n) { x = parseFloat(x); y = parseFloat(y); } - if (n == 1) { // handle the checkbox column - x = rows[i].querySelector('input[type=checkbox]').checked; - y = rows[i + 1].querySelector('input[type=checkbox]').checked; - } - if (n == 2 || n == 3) { // handle the play/pause and viewed/unviewed columns + if (n == 1) { // handle play/pause column x = rows[i].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src; y = rows[i + 1].getElementsByTagName("TD")[n].getElementsByTagName("img")[0].src; } @@ -147,7 +153,7 @@ function sortTable(n) { // save sorting sessionStorage.setItem("sort_column", n); sessionStorage.setItem("sort_order", (dir == "asc") ? 0 : 1); - // restripe + // restripe rows restripe(); } @@ -209,8 +215,8 @@ function tblSearch(evt) { filter = input.value.toUpperCase(); table = document.getElementById("watch-table"); tr = table.getElementsByTagName("tr"); - for (i = 0; i < tr.length; i++) { - td = tr[i].getElementsByTagName("td")[5]; // col 5 is the hidden title/url column + for (i = 1; i < tr.length; i++) { // skip header + td = tr[i].getElementsByTagName("td")[3]; // col 3 is the hidden title/url column if (td) { txtValue = td.textContent || td.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { @@ -219,9 +225,13 @@ function tblSearch(evt) { else { tr[i].style.display = "none"; } - } + } } + // restripe rows restripe(); + if (code == CONSTANT_ESCAPE_KEY) { + document.getElementById("watch-table-wrapper").focus(); + } } // restripe after searching or sorting @@ -230,22 +240,31 @@ function restripe () { var table = document.getElementById("watch-table"); var rows = table.getElementsByTagName("tr"); - for (i = 0; i < rows.length; i++) { // skip thead row 0 + for (i = 1; i < rows.length; i++) { // skip header if (rows[i].style.display !== "none") { visrows.push(rows[i]); } } for (i=0 ; iChangeDetection.io {% endif %} - {% if current_diff_url %} + {% if current_diff_url %} {{ current_diff_url }} {% else %} {% if new_version_available and not (has_password and not current_user.is_authenticated) %} diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index e6110419..95ae2bc5 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -17,28 +17,15 @@ -
-
-
- All - {% for tag in tags %} - {% if tag != "" %} - {{ tag }} - {% endif %} - {% endfor %} -
- -
+
+
+ All + {% for tag in tags %} + {% if tag != "" %} + {{ tag }} + {% endif %} + {% endfor %} +
- - -