From: Nicolas Boisselier Date: Wed, 21 Dec 2016 16:57:46 +0000 (+0000) Subject: dbq X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=fed20fbd6b1b8191f3708af2f55b1fc8e8719e37;p=nb.git dbq --- diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index c5e6d56f..bf6fcbd2 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -191,25 +191,27 @@ function form_submit_clean(f) { document.addEventListener("DOMContentLoaded", function() { for (var e of document.querySelectorAll("form")) { e.onsubmit = function() { - form_submit_clean(this); - return false; + return form_submit_clean(this); }; } - - for (var e of document.querySelectorAll(".menu select.limit")) { + document.getElementById("table").removeAttribute("name"); + document.getElementById("format").removeAttribute("name"); + for (var e of document.querySelectorAll(".menu select.tables, .menu select.format")) { e.onchange = function() { - this.form.submit(); + var format = document.getElementById("format").value; + if (format == "table") format = "html"; + window.location = "./" + document.getElementById("table").value + "." + format; return false; }; } - document.getElementById("table").removeAttribute("name"); - document.getElementById("format").removeAttribute("name"); - for (var e of document.querySelectorAll(".menu select.tables, .menu select.format")) { + + for (var e of document.querySelectorAll(".menu select.limit")) { e.onchange = function() { - window.location = "./" + document.getElementById("table").value + "." + document.getElementById("format").value; + this.form.submit(); return false; }; } + if (document.querySelector(".nav.bottom")) { document.querySelector("table.rows").insertAdjacentHTML("beforebegin","
"+document.querySelector(".nav.bottom").innerHTML+"
"); }