gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-playground] branch master updated: add index and js


From: gnunet
Subject: [GNUnet-SVN] [taler-playground] branch master updated: add index and js detection playground
Date: Wed, 07 Mar 2018 15:32:33 +0100

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

dold pushed a commit to branch master
in repository playground.

The following commit(s) were added to refs/heads/master by this push:
     new 3d49d09  add index and js detection playground
3d49d09 is described below

commit 3d49d093aba931cb1977ed01f5c384209c62ac93
Author: Florian Dold <address@hidden>
AuthorDate: Wed Mar 7 15:32:28 2018 +0100

    add index and js detection playground
---
 talerplayground/playground/playground.py           |  4 +-
 .../playground/templates/detection-js.html         | 26 ++++++
 talerplayground/playground/templates/index.html    | 99 ++++++++++------------
 3 files changed, 76 insertions(+), 53 deletions(-)

diff --git a/talerplayground/playground/playground.py 
b/talerplayground/playground/playground.py
index 759bd7a..d70f049 100644
--- a/talerplayground/playground/playground.py
+++ b/talerplayground/playground/playground.py
@@ -102,5 +102,7 @@ def internal_error(e):
 
 @app.route("/")
 def index():
-    return flask.render_template("templates/index.html", 
merchant_currency=CURRENCY)
+    return flask.render_template("templates/index.html")
 
address@hidden("detection-js")
+    return flask.render_template("templates/detection-js.html")
diff --git a/talerplayground/playground/templates/detection-js.html 
b/talerplayground/playground/templates/detection-js.html
new file mode 100644
index 0000000..e10bef8
--- /dev/null
+++ b/talerplayground/playground/templates/detection-js.html
@@ -0,0 +1,26 @@
+{% extends "templates/base.html" %}
+
+{% block scripts %}
+<script src="static/web-common/taler-wallet-lib.js"></script>
+<script>
+let logEl = document.getElementById("log");
+function log(s) {
+  logEl.innerText = logEl.innerText + "\n" + s;
+}
+taler.onPresent(() => {
+  log("present at" + new Date());
+});
+taler.onAbsent(() => {
+  log("absent at" + new Date());
+});
+</script>
+{% endblock %}
+
+{% block main %}
+<h1>Taler Playground: JS Detection</h1>
+
+<pre id="log">
+  Detection log:
+</pre>
+
+{% endblock %}
diff --git a/talerplayground/playground/templates/index.html 
b/talerplayground/playground/templates/index.html
index b384362..4a3d8a2 100644
--- a/talerplayground/playground/templates/index.html
+++ b/talerplayground/playground/templates/index.html
@@ -1,57 +1,52 @@
 {% extends "templates/base.html" %}
 
 {% block main %}
-<h1 lang="en">Welcome to the Taler Donation "Shop" Demo</h1>
-
-<p>This toy donations website shows the user experience for donations with 
Taler.
-You are paying with an imaginary currency ({{ merchant_currency }}).
-</p>
-
-<div class="taler-installed-hide">
-  <h2>Installing the Taler wallet</h2>
-  First, you need to install the Taler wallet browser extension.
-  Install the wallet
-  <span id="install-done" style="visibility: hidden">(done)</span>
-  <ul>
-    <li>from the app store for <a 
href="https://chrome.google.com/webstore/detail/gnu-taler-wallet/millncjiddlpgdmkklmhfadpacifaonc";>Google
-        Chrome and Chromium</a>
-    </li>
-    <li>By visiting our <a href="https://taler.net/wallet";>installation 
page</a> for other platforms.
-    </li>
-  </ul>
-  Wallets for other browsers will be provided in the near future.
-</div>
-
-<div class="taler-installed-show">
-  <p>Please select a project, the amount (*) of {{ merchant_currency }} you
-    wish to donate, and enter the name that will appear on your receipt:</p>
-
-  <form name="tform" action="checkout" method="GET" class="pure-form">
-    <div class="participation" id="fake-shop">
-      <select name="donation_receiver">
-        <option value="GNUnet">GNUnet</option>
-        <option value="Taler">GNU Taler</option>
-        <option value="Tor">Tor</option>
-      </select>
-      <select id="taler-donation" name="donation_amount">
-        <option value="{{ merchant_currency }}:0.1">0.1 {{ merchant_currency 
}}</option>
-        <option value="{{ merchant_currency }}:1">1 {{ merchant_currency 
}}</option>
-        <option value="{{ merchant_currency }}:6">5 {{ merchant_currency 
}}</option>
-        <option value="{{ merchant_currency }}:10">10 {{ merchant_currency 
}}</option>
-      </select>
-      <input type="text" name="donation_donor" value="Anonymous Donor" />
-      <input type="submit" class="pure-button pure-button-primary" 
value="Donate!" />
-    </div>
-  </form>
-  <p>
-    (*) To make it a bit more fun, the 5 {{ merchant_currency }} option is
-    deliberately implemented with a fault: the merchant will try to make you
-    donate 6 {{ merchant_currency }} instead of the 5 {{ merchant_currency }} 
you
-    got to see.  But do not worry, you will be given the opportunity to review
-    the final offer from the merchant in a window secured by the Taler
-    extension.  That way, you can spot the error before committing to an
-    incorrect contract.
-  </p>
-</div>
+<h1>Taler Playground</h1>
+
+This page demonstrates some features not used in the other demos.  Mostly used 
for testing
+wallets or experimenting with more obscure features.
+
+The following pages are available:
+<ul>
+
+  <li>
+    <a href="detection-js">JavaScript presence detection</a>
+  </li>
+
+  <li>
+    <a href="detection-css">CSS-based presence detection</a>
+  </li>
+
+  <li>
+    <a href="detection-css-wrong">wrong CSS-based presence detection</a>
+    <p>
+      The <code>data-taler-nojs</code> tag is missing here, and thus wallets
+      should not do anything on the site.
+    </p>
+  </li>
+
+  <li>
+    <a href="pay-js">payment triggering with JS</a>
+  </li>
+
+  <li>
+    <a href="pay-retry">pay retry</a>
+    <p>
+      Tests if the wallet properly re-tries payments, the first request to
+      <code>/pay</code> will fail two times before it succeeds.
+    </p>
+  </li>
+
+  <li>
+    <a href="stateless">state-less payments</a>
+    <p>
+      Advanced payment logic that is secure against denial of service in the
+      sense that the server only stores state when the user presents a payment.
+    </p>
+  </li>
+
+</ul>
+
+
 
 {% endblock %}

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



reply via email to

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