]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/html/default.css
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 2 Jan 2018 23:00:27 +0000 (23:00 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 2 Jan 2018 23:00:27 +0000 (23:00 +0000)
lib/js/jquery.min.js [new symlink]
www/dbq/dbq.php
www/dbq/html/default.css
www/dbq/html/default.js

diff --git a/lib/js/jquery.min.js b/lib/js/jquery.min.js
new file mode 120000 (symlink)
index 0000000..b817253
--- /dev/null
@@ -0,0 +1 @@
+jquery-3.2.1.min.js
\ No newline at end of file
index 39a9bcb40484c57c1388e520fe0bad67e593e8b3..423a52f9047b018bc4801384b5f175b5f72c38bb 100644 (file)
@@ -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
index 2cb69ebc731917bda9b18d6c121a66e58d98a2c4..239f5503986e913f25eea9060f5c4f6b8cf22535 100644 (file)
@@ -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%;
index db8da16fe8ce0942be1026a57c6fc4c58320865c..0e33df677c4360ae8c68e87bc8fc868f1fd6141d 100644 (file)
@@ -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 + '&nbsp;All';
+    a.innerHTML = document.querySelector("th.delete").innerHTML;// + '&nbsp;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);