From d2f1cb3234cbeca88903efcfd0d7d406fbece53c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 26 Jan 2016 17:21:17 +0100 Subject: fix #4153 and #0004154 --- extension/pages/confirm-contract.html | 23 ++------ extension/pages/confirm-contract.js | 90 ++++++++++++++++------------- extension/pages/confirm-contract.tsx | 79 ++++++++++++------------- extension/pages/confirm-create-reserve.html | 4 +- extension/pages/confirm-create-reserve.js | 46 ++++++++------- extension/pages/confirm-create-reserve.tsx | 40 ++++++------- 6 files changed, 141 insertions(+), 141 deletions(-) (limited to 'extension/pages') diff --git a/extension/pages/confirm-contract.html b/extension/pages/confirm-contract.html index d851af350..2a2166888 100644 --- a/extension/pages/confirm-contract.html +++ b/extension/pages/confirm-contract.html @@ -4,17 +4,14 @@ Taler Wallet: Confirm Reserve Creation - - - + + + + + - - + + diff --git a/extension/pages/confirm-create-reserve.js b/extension/pages/confirm-create-reserve.js index 193f496a6..ca9ef4099 100644 --- a/extension/pages/confirm-create-reserve.js +++ b/extension/pages/confirm-create-reserve.js @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2015 GNUnet e.V. + (C) 2015-2016 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -13,27 +13,26 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, If not, see */ -"use strict"; -var ConfirmCreateReserve; -(function (ConfirmCreateReserve) { - var url = URI(document.location.href); - var query = URI.parseQuery(url.query()); - function updateAmount() { - var showAmount = document.getElementById("show-amount"); - console.log("Query is " + JSON.stringify(query)); - var s = query.amount_str; - if (!s) { - document.body.innerHTML = "Oops, something went wrong."; - return; +System.register([], function(exports_1) { + "use strict"; + function main() { + function updateAmount() { + var showAmount = document.getElementById("show-amount"); + console.log("Query is " + JSON.stringify(query)); + var s = query.amount_str; + if (!s) { + document.body.innerHTML = "Oops, something went wrong."; + return; + } + showAmount.textContent = s; } - showAmount.textContent = s; - } - document.addEventListener("DOMContentLoaded", function (e) { + var url = URI(document.location.href); + var query = URI.parseQuery(url.query()); updateAmount(); document.getElementById("confirm").addEventListener("click", function (e) { var d = Object.assign({}, query); d.mint = document.getElementById('mint-url').value; - chrome.runtime.sendMessage({ type: 'confirm-reserve', detail: d }, function (resp) { + var cb = function (resp) { if (resp.success === true) { document.location.href = resp.backlink; } @@ -41,8 +40,15 @@ var ConfirmCreateReserve; document.body.innerHTML = "Oops, something went wrong. It looks like the bank could not\n transfer funds to the mint. Please go back to your bank's website\n to check what happened."; } - }); + }; + chrome.runtime.sendMessage({ type: 'confirm-reserve', detail: d }, cb); }); - }); -})(ConfirmCreateReserve || (ConfirmCreateReserve = {})); + } + exports_1("main", main); + return { + setters:[], + execute: function() { + } + } +}); //# sourceMappingURL=confirm-create-reserve.js.map \ No newline at end of file diff --git a/extension/pages/confirm-create-reserve.tsx b/extension/pages/confirm-create-reserve.tsx index 38776ee6b..88af96466 100644 --- a/extension/pages/confirm-create-reserve.tsx +++ b/extension/pages/confirm-create-reserve.tsx @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2015 GNUnet e.V. + (C) 2015-2016 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -16,11 +16,8 @@ "use strict"; -namespace ConfirmCreateReserve { - - let url = URI(document.location.href); - let query: any = URI.parseQuery(url.query()); +export function main() { function updateAmount() { let showAmount = document.getElementById("show-amount"); console.log("Query is " + JSON.stringify(query)); @@ -32,26 +29,25 @@ namespace ConfirmCreateReserve { showAmount.textContent = s; } + let url = URI(document.location.href); + let query: any = URI.parseQuery(url.query()); + + updateAmount(); - document.addEventListener("DOMContentLoaded", (e) => { - updateAmount(); + document.getElementById("confirm").addEventListener("click", (e) => { + let d = Object.assign({}, query); + d.mint = (document.getElementById('mint-url') as HTMLInputElement).value; - document.getElementById("confirm").addEventListener("click", (e) => { - let d = Object.assign({}, query); - d.mint = (document.getElementById('mint-url') as HTMLInputElement).value; - chrome.runtime.sendMessage({type:'confirm-reserve', detail: d}, - (resp) => { - if (resp.success === true) { - document.location.href = resp.backlink; - } else { - document.body.innerHTML = - `Oops, something went wrong. It looks like the bank could not + const cb = (resp) => { + if (resp.success === true) { + document.location.href = resp.backlink; + } else { + document.body.innerHTML = + `Oops, something went wrong. It looks like the bank could not transfer funds to the mint. Please go back to your bank's website to check what happened.`; - } - }); - - }); + } + }; + chrome.runtime.sendMessage({type: 'confirm-reserve', detail: d}, cb); }); - } \ No newline at end of file -- cgit v1.2.3