From: Nicolas Boisselier Date: Tue, 2 Jan 2018 23:00:27 +0000 (+0000) Subject: www/dbq/html/default.css X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a544eb40494b07be2f20ebf12a1966482b11246a;p=nb.git www/dbq/html/default.css --- diff --git a/lib/js/jquery.min.js b/lib/js/jquery.min.js new file mode 120000 index 00000000..b8172530 --- /dev/null +++ b/lib/js/jquery.min.js @@ -0,0 +1 @@ +jquery-3.2.1.min.js \ No newline at end of file diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 39a9bcb4..423a52f9 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -69,7 +69,10 @@ class DbQ extends nb { # Page public $css = '/default'.(PRODUCTION ? '.min' : '').'.css'; - public $js = '/default'.(PRODUCTION ? '.min' : '').'.js'; + public $js = [ + '/js/jquery.min.js', + '/default'.(PRODUCTION ? '.min' : '').'.js', + ]; public $ext; # Others diff --git a/www/dbq/html/default.css b/www/dbq/html/default.css index 2cb69ebc..239f5503 100644 --- a/www/dbq/html/default.css +++ b/www/dbq/html/default.css @@ -12,6 +12,31 @@ body { color: #444444; } +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.loader { + border: 16px solid #FFFFFF; + border-radius: 50%; + border-top: 16px solid #000000; + padding: 0; + margin: 0 auto 0 auto; + width: 8em; + height: 8em; + animation: spin 2s linear infinite; + display: block; +} + +body.loader { + margin-top: 8em; +} + +.loader * { + display: none !important; +} + h1 { margin: 0 0 0.2em 0; font-size: 180%; diff --git a/www/dbq/html/default.js b/www/dbq/html/default.js index db8da16f..0e33df67 100644 --- a/www/dbq/html/default.js +++ b/www/dbq/html/default.js @@ -131,10 +131,11 @@ document.addEventListener("DOMContentLoaded", function() { if (document.querySelector("th.delete")) { var a = document.createElement('a'); a.setAttribute('href','#'); - a.innerHTML = document.querySelector("th.delete").innerHTML + ' All'; + a.innerHTML = document.querySelector("th.delete").innerHTML;// + ' All'; document.querySelector("th.delete").innerHTML = ''; a.onclick = function() { var forms = document.querySelectorAll("form.rm"); + document.querySelector(".rows").className = 'loader'; for (j = 0; j < forms.length; ++j) { var f = forms[j]; var url = f.getAttribute('action'); @@ -145,13 +146,15 @@ document.addEventListener("DOMContentLoaded", function() { params.push(e.name+'='+encodeURI(e.value)); } var xhttp = new XMLHttpRequest(); - xhttp.open("POST", url, false); + xhttp.open("POST", url, true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhttp.onload = function (e) { if (xhttp.readyState === 4) { } } + xhttp.onload = function (e) { if (xhttp.readyState === 4) { + if ( j != forms.length ) return; + location.reload(); + } } xhttp.send(params.join('&')); //console.log(params.join('&')); }//); - location.reload(); return false; }; document.querySelector("th.delete").appendChild(a);