gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Spinning


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontends] branch master updated: Spinning wheel in backoffice interface when waiting for results.
Date: Wed, 01 Mar 2017 14:46:23 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant-frontends.

The following commit(s) were added to refs/heads/master by this push:
     new 2bfcefa  Spinning wheel in backoffice interface when waiting for 
results.
2bfcefa is described below

commit 2bfcefae4afecac15800336c267a1b115ba6dda9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Mar 1 14:45:41 2017 +0100

    Spinning wheel in backoffice interface when waiting for results.
---
 talerfrontends/blog/static/backoffice.js      | 14 ++++++++++----
 talerfrontends/blog/static/popup.css          | 15 +++++++++++++++
 talerfrontends/blog/templates/backoffice.html |  1 +
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/talerfrontends/blog/static/backoffice.js 
b/talerfrontends/blog/static/backoffice.js
index d3d4729..fe1e7e5 100644
--- a/talerfrontends/blog/static/backoffice.js
+++ b/talerfrontends/blog/static/backoffice.js
@@ -147,22 +147,28 @@ function fill_table(history){
     row.appendChild(td_timestamp);
     tbody.appendChild(row);
     }
-  table.style.visibility = "";
+
+  function remove_loader(){
+    var loader = document.getElementsByClassName("loader")[0]; 
+    loader.style.visibility = "hidden";
+    table.style.visibility = "";
+  }
+  window.setTimeout(remove_loader, 900);
 }
 
 function get_more_history(){
   /*FIXME: do add one week to TIMESTAMP*/
   START += 20;
 
+  var loader = document.getElementsByClassName("loader")[0]; 
+  loader.style.visibility = "visible";
   var req = new XMLHttpRequest();
   req.open("GET", 
`/history?timestamp=${TIMESTAMP}&instance=${INSTANCE}&start=${START}`, true);
   req.onload = function(){
     if(req.readyState == 4 && req.status == 200){
       var history = JSON.parse(req.responseText); 
-      if(!history)
+      if(!history){
         console.log("Got invalid JSON");
-      if(0 == history.length){
-        console.log("Got no transactions");
         return;
       }
       fill_table(history);
diff --git a/talerfrontends/blog/static/popup.css 
b/talerfrontends/blog/static/popup.css
index c12ba70..f7164fe 100644
--- a/talerfrontends/blog/static/popup.css
+++ b/talerfrontends/blog/static/popup.css
@@ -59,3 +59,18 @@ th {
     width: 70%;
   }
 }
+
+.loader {
+  margin-left: 30%;
+  border: 7px solid #f3f3f3; /* Light grey */
+  border-top: 7px solid #696969; /* Blue */
+  border-radius: 50%;
+  width: 40px;
+  height: 40px;
+  animation: spin 2s linear infinite;
+}
+
address@hidden spin {
+  0% { transform: rotate(0deg); }
+  100% { transform: rotate(360deg); }
+}
diff --git a/talerfrontends/blog/templates/backoffice.html 
b/talerfrontends/blog/templates/backoffice.html
index 89428dd..c57e213 100644
--- a/talerfrontends/blog/templates/backoffice.html
+++ b/talerfrontends/blog/templates/backoffice.html
@@ -14,6 +14,7 @@
       </tr>
     </tbody>
   </table>
+  <div class="loader"></div>
   <div id="popup1" class="overlay">
     <div class="popup">
       <h2>

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]