From 282d4fd0adcd7b6d81f5da788c23a8f2e553a180 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 2 Jan 2018 19:32:10 +0000 Subject: [PATCH] www/dbq/html/default.js --- www/dbq/dbq.php | 2 +- www/dbq/html/default.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index b00e788a..bdb73249 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -442,7 +442,7 @@ class DbQ extends nb { # NB 11.12.17 $rm = $this->table->base.'/rm'.$args; $rm = $this->uri_add_referer($this->table->base.'/rm'); $r['delete'] = '' - .'
' + .'' .'Delete' .$this->form_hidden($r) .'
' diff --git a/www/dbq/html/default.js b/www/dbq/html/default.js index 7374a13e..34d694dc 100644 --- a/www/dbq/html/default.js +++ b/www/dbq/html/default.js @@ -128,4 +128,20 @@ document.addEventListener("DOMContentLoaded", function() { ); }); + if (document.querySelector("DISABLE th.delete")) { + var a = document.createElement('a'); + a.setAttribute('href','#'); + a.innerHTML = document.querySelector("th.delete").innerHTML + ' All'; + document.querySelector("th.delete").innerHTML = ''; + a.onclick = function() { + var items = document.querySelectorAll("form.rm"); + for (i = 0; i < items.length; ++i) { + var e = items[i]; + e.submit(); + } + return false; + }; + document.querySelector("th.delete").appendChild(a); + } + }); -- 2.47.3