aboutsummaryrefslogtreecommitdiff
path: root/cmd/monfront/templates/footer.html
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2021-12-02 17:54:14 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2021-12-02 17:54:14 +0100
commitfa05045d31c05c8928020f05f1d281901d983b2b (patch)
tree2ed3bac60302bfb14535a169f4b3e10d18fc6120 /cmd/monfront/templates/footer.html
parent41d4805d584161ca16b8187194385e47c36422a6 (diff)
cmd/monfront - import monfront from separate repository
This is the import from the separate monfront repository. The history could not be imported, but this should suffice.
Diffstat (limited to 'cmd/monfront/templates/footer.html')
-rw-r--r--cmd/monfront/templates/footer.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/cmd/monfront/templates/footer.html b/cmd/monfront/templates/footer.html
new file mode 100644
index 0000000..124b585
--- /dev/null
+++ b/cmd/monfront/templates/footer.html
@@ -0,0 +1,76 @@
+ <script type="text/javascript">
+ function row_head_click_event(event) {
+ check = false;
+ current = event.target;
+ while (current != null) {
+ if (current.nodeName == 'TABLE') {
+ break;
+ }
+ if (current.nodeName == 'TR') {
+ check = !current.children[0].children[0].checked;
+ current.children[0].children[0].checked = check;
+ }
+ current = current.parentNode;
+ }
+ lines = current.children[1].children
+ for (i = 0; i < lines.length; i++) {
+ select_row(event, lines[i], lines[i].children[0].children[0], check);
+ }
+ }
+ function row_click_event(event) {
+ if (event.target.nodeName == 'INPUT') {
+ return;
+ }
+ current = event.target;
+ while (current = current.parentNode) {
+ if (current.nodeName == 'BODY') {
+ break;
+ }
+ if (current.nodeName != 'TR') {
+ continue;
+ }
+ e = current.children[0].children[0];
+ check = !e.checked;
+ select_row(event, current, e, check);
+ break;
+ }
+ }
+ function select_row(event, row, input, check) {
+ if (input != event.target) {
+ input.checked = check;
+ }
+ if (input.checked) {
+ row.classList.add("selected");
+ } else {
+ row.classList.remove("selected");
+ }
+ input.focus();
+ }
+
+ for (selector of ['thead > tr', 'thead input']) {
+ els = document.querySelectorAll(selector);
+ for (i = 0; i < els.length; i++) {
+ els[i].addEventListener('click', {handleEvent: row_head_click_event});
+ }
+ }
+ for (selector of ['tbody > tr', 'tbody input']) {
+ els = document.querySelectorAll(selector);
+ for (i = 0; i < els.length; i++) {
+ els[i].addEventListener('click', {handleEvent: row_click_event});
+ }
+ }
+ butt = document.querySelectorAll('button[type=button][name=create_check]');
+ for (i = 0; i < butt.length; i++) {
+ butt[i].addEventListener('click', {handleEvent: function(event){
+ cur = document.querySelector('#create_check').style.display;
+ console.log("meh: " + cur);
+ if (cur == 'block') {
+ document.querySelector('#create_check').style.display = 'none';
+ } else {
+ document.querySelector('#create_check').style.display = 'block';
+ }
+ }});
+ }
+ </script>
+ </body>
+</html>