diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-26 00:10:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-26 00:10:34 +0200 |
commit | 0fac38315ba0e742fc5ef88008e25c15041f2313 (patch) | |
tree | bf8113ec9226e5d3bb578a801a40a602ac3a0f42 | |
parent | d54e608b7943937e333247279e8bde0802eadc6e (diff) | |
parent | 72c5b56b2439fa54fb3079e95dbf3390e19461be (diff) | |
download | www-0fac38315ba0e742fc5ef88008e25c15041f2313.tar.gz www-0fac38315ba0e742fc5ef88008e25c15041f2313.zip |
Merge branch 'master' of git+ssh://taler.net/var/git/www
-rw-r--r-- | wallet-installation.html | 92 |
1 files changed, 67 insertions, 25 deletions
diff --git a/wallet-installation.html b/wallet-installation.html index dee64681..551f97f6 100644 --- a/wallet-installation.html +++ b/wallet-installation.html | |||
@@ -32,28 +32,51 @@ | |||
32 | for the JavaScript code in this page. | 32 | for the JavaScript code in this page. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | var chrome_min_version = '47.0.2526'; | ||
36 | |||
35 | function onSuccess() { | 37 | function onSuccess() { |
36 | console.log("installation successful"); | 38 | console.log("installation successful"); |
37 | document.getElementById("install-result").innerText = "(installation was successful)"; | 39 | document.getElementById("install-result").appendChild(document.createTextNode("Installation was successful.")); |
38 | } | 40 | } |
39 | 41 | ||
40 | function onFailure(detail) { | 42 | function onFailure(detail) { |
41 | console.error("installation failed:", detail); | 43 | console.error("installation failed:", detail); |
42 | document.getElementById("install-result").innerText = "(failed: " + detail + ")"; | 44 | document.getElementById("install-result").appendChild(document.createTextNode("Installation failed: " + detail)); |
43 | } | 45 | } |
44 | 46 | ||
45 | function installWallet() { | 47 | function installWallet() { |
46 | chrome.webstore.install("https://chrome.google.com/webstore/detail/millncjiddlpgdmkklmhfadpacifaonc", onSuccess, onFailure); | 48 | if (window.chrome) { |
49 | chrome.webstore.install("https://chrome.google.com/webstore/detail/millncjiddlpgdmkklmhfadpacifaonc", onSuccess, onFailure); | ||
50 | } else { | ||
51 | onFailure("Google Chrome or Chromium is required for installation."); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | try { | ||
56 | taler.onPresent(function () { | ||
57 | document.getElementById("box-present").style.display = "inherit"; | ||
58 | document.getElementById("box-not-present").style.display = "none"; | ||
59 | }); | ||
60 | taler.onAbsent(function () { | ||
61 | document.getElementById("box-present").style.display = "none"; | ||
62 | document.getElementById("box-not-present").style.display = "inherit"; | ||
63 | }); | ||
64 | } catch (err) { | ||
47 | } | 65 | } |
48 | 66 | ||
49 | taler.onPresent(function () { | 67 | function onLoad() { |
50 | document.getElementById("box-present").style.display = "inherit"; | 68 | if (typeof window.chrome != "object") { |
51 | document.getElementById("box-not-present").style.display = "none"; | 69 | document.getElementById("error-chrome").style.display = "inherit"; |
52 | }); | 70 | } else { |
53 | taler.onAbsent(function () { | 71 | var m = navigator.userAgent.match(/Chrome\/([0-9.]+)/); |
54 | document.getElementById("box-present").style.display = "none"; | 72 | if (null == m || m[1] < chrome_min_version) { |
55 | document.getElementById("box-not-present").style.display = "inherit"; | 73 | document.getElementById('chrome-min-version').appendChild(document.createTextNode(chrome_min_version)); |
56 | }); | 74 | document.getElementById('error-chrome-version').style.display = "inherit"; |
75 | } | ||
76 | } | ||
77 | } | ||
78 | |||
79 | document.addEventListener('DOMContentLoaded', onLoad); | ||
57 | </script> | 80 | </script> |
58 | 81 | ||
59 | <style type="text/css"> | 82 | <style type="text/css"> |
@@ -64,10 +87,21 @@ | |||
64 | padding: 0.5em; | 87 | padding: 0.5em; |
65 | } | 88 | } |
66 | .bluebox { | 89 | .bluebox { |
67 | background-color: #C2C6FF; | 90 | background-color: #C2C6FF; |
68 | border: solid; | 91 | border: solid; |
69 | border-radius: 5px; | 92 | border-radius: 5px; |
70 | padding: 0.5em; | 93 | padding: 0.5em; |
94 | } | ||
95 | .error { | ||
96 | font-style: italic; | ||
97 | display: none; | ||
98 | } | ||
99 | #install-result { | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | main ul li { | ||
104 | margin-bottom: 1em; | ||
71 | } | 105 | } |
72 | </style> | 106 | </style> |
73 | </head> | 107 | </head> |
@@ -76,26 +110,34 @@ | |||
76 | <h1>Install the Taler wallet</h1> | 110 | <h1>Install the Taler wallet</h1> |
77 | 111 | ||
78 | <main style="display:inline-block;"> | 112 | <main style="display:inline-block;"> |
79 | <p> | 113 | <h2>Google Chrome / Chromium</h2> |
114 | <p id="error-chrome" class="error"> | ||
115 | <a href="https://www.google.com/chrome">Google Chrome</a> or <a href="https://www.chromium.org/">Chromium</a> | ||
116 | is required, but it appears you don't have it installed. | ||
117 | </p> | ||
118 | <p id="error-chrome-version" class="error"> | ||
119 | <a href="https://www.google.com/chrome">Google Chrome</a> or <a href="https://www.chromium.org/">Chromium</a> | ||
120 | version <span id="chrome-min-version"></span> or newer is required, but it appears you have an older version.</p> | ||
80 | <ul> | 121 | <ul> |
81 | <li>from the app store for | 122 | <li> |
82 | <a href="https://chrome.google.com/webstore/detail/gnu-taler-wallet/millncjiddlpgdmkklmhfadpacifaonc">Google | 123 | <a href="https://chrome.google.com/webstore/detail/gnu-taler-wallet/millncjiddlpgdmkklmhfadpacifaonc">Install from the Chrome Web Store</a> |
83 | Chrome and Chromium</a> | ||
84 | </li> | 124 | </li> |
85 | <li id="inline-install-chrome">from this page: | 125 | <li id="inline-install-chrome"> |
86 | <button onclick="installWallet()" id="install-button"> | 126 | <button onclick="installWallet()" id="install-button"> |
87 | install now | 127 | Install from this page |
88 | </button> <span id="install-result"></span> | 128 | </button> |
129 | <div id="install-result"></div> | ||
89 | </li> | 130 | </li> |
90 | </ul> | 131 | </ul> |
91 | Wallets for other browsers will be provided in the near future. | 132 | |
92 | </p> | 133 | <h2>Other browsers</h2> |
134 | <p>Wallets for other browsers will be provided in the near future.</p> | ||
93 | <p class="greenbox" id="box-present" style="display:none"> | 135 | <p class="greenbox" id="box-present" style="display:none"> |
94 | Congratulations, you have installed the Taler wallet. | 136 | Congratulations, you have installed the Taler wallet. |
95 | Check out the <a href="https://demo.taler.net/">demo</a>. | 137 | Check out the <a href="https://demo.taler.net/">demo</a>. |
96 | </p> | 138 | </p> |
97 | <p class="bluebox" id="box-not-present" style="display:none"> | 139 | <p class="bluebox" id="box-not-present" style="display:none"> |
98 | You don't have a wallet installed yet. | 140 | You don't have a wallet installed yet. |
99 | </p> | 141 | </p> |
100 | </main> | 142 | </main> |
101 | </body> | 143 | </body> |