[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Implement
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Implementing XHR within the helper function. |
Date: |
Tue, 28 Feb 2017 18:44:25 +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 92c675e Implementing XHR within the helper function.
92c675e is described below
commit 92c675e920a99f70ad3e2779f4002f7068fd399f
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Feb 28 18:44:12 2017 +0100
Implementing XHR within the helper function.
---
talerfrontends/blog/static/backoffice.js | 34 +++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/talerfrontends/blog/static/backoffice.js
b/talerfrontends/blog/static/backoffice.js
index 781c3c4..7ddc264 100644
--- a/talerfrontends/blog/static/backoffice.js
+++ b/talerfrontends/blog/static/backoffice.js
@@ -28,6 +28,9 @@
"use strict";
var FRACTION = 100000000;
+var DAYS = 10;
+var START = 0;
+var INSTANCE = "FSF";
function amount_to_string(amount){
var number = Number(amount.value) + (Number(amount.fraction)/FRACTION);
@@ -106,10 +109,6 @@ function track_order(order_id, instance){
req.send();
}
-function get_more_history(){
- console.log("Scrolled to the bottom.");
-}
-
/**
* Append results to the table showing results.
*/
@@ -135,10 +134,31 @@ function fill_table(history){
table.style.visibility = "";
}
-function get_history(){
+function get_more_history(){
+ DAYS += 10;
+ START += 20;
- var DAYS = 10;
- var INSTANCE = "FSF";
+ var req = new XMLHttpRequest();
+ req.open("GET", `/history?days=${DAYS}&instance=${INSTANCE}&start=${START}`,
true);
+ req.onload = function(){
+ if(req.readyState == 4 && req.status == 200){
+ var history = JSON.parse(req.responseText);
+ if(!history)
+ console.log("Got invalid JSON");
+ if(0 == history.length){
+ console.log("Got no transactions");
+ return;
+ }
+ fill_table(history);
+ }
+ else{
+ console.log("error: status != 200");
+ }
+ }
+ req.send();
+}
+
+function get_history(){
var req = new XMLHttpRequest();
req.open("GET", `/history?days=${DAYS}&instance=${INSTANCE}`, true);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontends] branch master updated: Implementing XHR within the helper function.,
gnunet <=