commit 281d39c6afbd4133ab1f13acd0915276f45a9b57
parent e4c6f08f6b96bc8f41b19f69a2d9dbb428b8a467
Author: Florian Dold <florian.dold@gmail.com>
Date: Mon, 29 Feb 2016 04:38:16 +0100
use taler-presence JS from web-common
Diffstat:
4 files changed, 3 insertions(+), 64 deletions(-)
diff --git a/examples/shop/checkout.php b/examples/shop/checkout.php
@@ -29,7 +29,7 @@
for the JavaScript code in this page.
*/
</script>
- <script type="application/javascript" src="taler-presence.js"></script>
+ <script type="application/javascript" src="web-common/taler-presence.js"></script>
</head>
<body>
<!--
diff --git a/examples/shop/fulfillment.php b/examples/shop/fulfillment.php
@@ -3,7 +3,7 @@
<head>
<title>Taler's "Demo" Shop</title>
<link rel="stylesheet" type="text/css" href="style.css">
- <script type="application/javascript" src="taler-presence.js"></script>
+ <script type="application/javascript" src="web-common/taler-presence.js"></script>
<script type="application/javascript">
function executePayment(H_contract, pay_url, offering_url) {
var detail = {
diff --git a/examples/shop/index.php b/examples/shop/index.php
@@ -6,7 +6,7 @@ require_once "../../copylib/config.php";
<head>
<title>Taler Donation Demo</title>
<link rel="stylesheet" type="text/css" href="style.css">
- <script src="taler-presence.js" type="text/javascript"></script>
+ <script src="web-common/taler-presence.js" type="text/javascript"></script>
<script type="text/javascript">
<?php
echo "\tvar shop_currency = '$MERCHANT_CURRENCY';\n";
diff --git a/examples/shop/taler-presence.js b/examples/shop/taler-presence.js
@@ -1,61 +0,0 @@
-/* @licstart The following is the entire license notice for the
- JavaScript code in this page.
-
- Copyright (C) 2016 GNUnet e.V.
-
- The JavaScript code in this page is free software: you can
- redistribute it and/or modify it under the terms of the GNU
- Lesser General Public License (GNU LGPL) as published by the Free Software
- Foundation, either version 2.1 of the License, or (at your option)
- any later version. The code is distributed WITHOUT ANY WARRANTY;
- without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU LGPL for more details.
-
- As additional permission under GNU LGPL version 2.1 section 7, you
- may distribute non-source (e.g., minimized or compacted) forms of
- that code without the copy of the GNU LGPL normally required by
- section 4, provided you include this license notice and a URL
- through which recipients can access the Corresponding Source.
-
- @licend The above is the entire license notice
- for the JavaScript code in this page.
-*/
-
-function handleInstall() {
- var show = document.getElementsByClassName("taler-installed-show");
- var hide = document.getElementsByClassName("taler-installed-hide");
- for (var i = 0; i < show.length; i++) {
- show[i].style.display = "";
- }
- for (var i = 0; i < hide.length; i++) {
- hide[i].style.display = "none";
- }
-};
-
-function handleUninstall() {
- var show = document.getElementsByClassName("taler-installed-show");
- var hide = document.getElementsByClassName("taler-installed-hide");
- for (var i = 0; i < show.length; i++) {
- show[i].style.display = "none";
- }
- for (var i = 0; i < hide.length; i++) {
- hide[i].style.display = "";
- }
-};
-
-function probeTaler() {
- var eve = new Event("taler-probe");
- console.log("probing taler");
- document.dispatchEvent(eve);
-}
-
-document.addEventListener("taler-wallet-present", handleInstall, false);
-document.addEventListener("taler-unload", handleUninstall, false);
-document.addEventListener("taler-load", handleInstall, false);
-
-function initTaler() {
- handleUninstall();
- probeTaler();
-}
-
-window.addEventListener("load", initTaler, false);