summaryrefslogtreecommitdiffhomepage
path: root/plugins/webbox/html/webbox.js
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-11 08:40:32 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-11 08:40:32 +0200
commit09781f62d0357636e1e4065331a5786a4262e555 (patch)
tree911f976f9f408c81792fee2fadd77beed998d10b /plugins/webbox/html/webbox.js
parent6c1cc0b2c854dd56dcb6238816a6ce2cb493c71c (diff)
webbox: Selection via checkbox
Diffstat (limited to 'plugins/webbox/html/webbox.js')
-rw-r--r--plugins/webbox/html/webbox.js22
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 + "')\">&#9744;</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 = "&#9744;";
}
function setSelection(filename) {
@@ -150,6 +156,9 @@ function setSelection(filename) {
row.classList.add("selectedrow");
numberOfSelectedRows++;
}
+
+ var selectorElement = row.getElementsByClassName("selector")[0];
+ selectorElement.innerHTML = "&#9745;";
}
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 = "&#9744;"
} else {
row.classList.add("selectedrow");
numberOfSelectedRows++;
+ selector_sign = "&#9745;"
}
+
+ var selectorElement = row.getElementsByClassName("selector")[0];
+ selectorElement.innerHTML = selector_sign;
}
function mouseTimeoutFunction(filename) {