From 15cb970023496977a995fb72aae7376be4ef15f8 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Wed, 17 Aug 2016 12:04:33 +0200 Subject: wallet install: version check --- wallet-installation.html | 88 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/wallet-installation.html b/wallet-installation.html index dee64681..5d695255 100644 --- a/wallet-installation.html +++ b/wallet-installation.html @@ -32,28 +32,51 @@ for the JavaScript code in this page. */ + var chrome_min_version = '47.0.2526'; + function onSuccess() { console.log("installation successful"); - document.getElementById("install-result").innerText = "(installation was successful)"; + document.getElementById("install-result").appendChild(document.createTextNode("Installation was successful.")); } function onFailure(detail) { console.error("installation failed:", detail); - document.getElementById("install-result").innerText = "(failed: " + detail + ")"; + document.getElementById("install-result").appendChild(document.createTextNode("Installation failed: " + detail)); } function installWallet() { - chrome.webstore.install("https://chrome.google.com/webstore/detail/millncjiddlpgdmkklmhfadpacifaonc", onSuccess, onFailure); + if (window.chrome) { + chrome.webstore.install("https://chrome.google.com/webstore/detail/millncjiddlpgdmkklmhfadpacifaonc", onSuccess, onFailure); + } else { + onFailure("Google Chrome or Chromium is required for installation."); + } + } + + try { + taler.onPresent(function () { + document.getElementById("box-present").style.display = "inherit"; + document.getElementById("box-not-present").style.display = "none"; + }); + taler.onAbsent(function () { + document.getElementById("box-present").style.display = "none"; + document.getElementById("box-not-present").style.display = "inherit"; + }); + } catch (err) { } - taler.onPresent(function () { - document.getElementById("box-present").style.display = "inherit"; - document.getElementById("box-not-present").style.display = "none"; - }); - taler.onAbsent(function () { - document.getElementById("box-present").style.display = "none"; - document.getElementById("box-not-present").style.display = "inherit"; - }); + function onLoad() { + if (typeof window.chrome != "object") { + document.getElementById("error-chrome").style.display = "inherit"; + } else { + var m = navigator.userAgent.match(/Chrome\/([0-9.]+)/); + if (null == m || m[1] < chrome_min_version) { + document.getElementById('chrome-min-version').appendChild(document.createTextNode(chrome_min_version)); + document.getElementById('error-chrome-version').style.display = "inherit"; + } + } + } + + document.addEventListener('DOMContentLoaded', onLoad); @@ -76,26 +106,34 @@

Install the Taler wallet

-

+

Google Chrome / Chromium

+

+ Google Chrome or Chromium + is required, but it appears you don't have it installed. +

+

+ Google Chrome or Chromium + version or newer is required, but it appears you have an older version.

- Wallets for other browsers will be provided in the near future. -

+ +

Other browsers

+

Wallets for other browsers will be provided in the near future.

-- cgit v1.2.3 From 72c5b56b2439fa54fb3079e95dbf3390e19461be Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Wed, 17 Aug 2016 12:08:45 +0200 Subject: wallet install: css --- wallet-installation.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wallet-installation.html b/wallet-installation.html index 5d695255..551f97f6 100644 --- a/wallet-installation.html +++ b/wallet-installation.html @@ -99,6 +99,10 @@ #install-result { font-weight: bold; } + + main ul li { + margin-bottom: 1em; + } -- cgit v1.2.3