diff options
Diffstat (limited to 'plugins/webbox/html/webbox.js')
-rw-r--r-- | plugins/webbox/html/webbox.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/plugins/webbox/html/webbox.js b/plugins/webbox/html/webbox.js index 602f76d..7ded25f 100644 --- a/plugins/webbox/html/webbox.js +++ b/plugins/webbox/html/webbox.js @@ -49,10 +49,13 @@ function loadContents(dir) { type = ""; } - result += "<tr " + + mouseupdown = "onmousedown=\"entryMouseDown('" + listElements[i].textContent + "')\" " + - "onmouseup=\"entryMouseUp('" + listElements[i].textContent + "')\"" + - "><td class=\"type\">" + type + "</td><td class=\"name\">" + listElements[i].textContent + "</td></tr>"; + "onmouseup=\"entryMouseUp('" + listElements[i].textContent + "')\""; + result += "<tr>" + + "<td class=\"selector\" onclick=\"toggleSelection('" + listElements[i].textContent + "')\">☐</td>" + + "<td class=\"type\" " + mouseupdown + ">" + type + "</td>" + + "<td class=\"name\" " + mouseupdown + ">" + listElements[i].textContent + "</td></tr>"; } } @@ -137,6 +140,9 @@ function clearSelection(filename) { row.classList.remove("selectedrow"); numberOfSelectedRows--; } + + var selectorElement = row.getElementsByClassName("selector")[0]; + selectorElement.innerHTML = "☐"; } function setSelection(filename) { @@ -150,6 +156,9 @@ function setSelection(filename) { row.classList.add("selectedrow"); numberOfSelectedRows++; } + + var selectorElement = row.getElementsByClassName("selector")[0]; + selectorElement.innerHTML = "☑"; } function toggleSelection(filename) { @@ -159,13 +168,20 @@ function toggleSelection(filename) { var row = getRow(filename); + var selector_sign; + if (row.classList.contains("selectedrow")) { row.classList.remove("selectedrow"); numberOfSelectedRows--; + selector_sign = "☐" } else { row.classList.add("selectedrow"); numberOfSelectedRows++; + selector_sign = "☑" } + + var selectorElement = row.getElementsByClassName("selector")[0]; + selectorElement.innerHTML = selector_sign; } function mouseTimeoutFunction(filename) { |