diff options
author | Florian Dold <florian.dold@gmail.com> | 2015-12-20 20:34:20 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2015-12-20 20:34:20 +0100 |
commit | 604cb2f80473c23f76afd37670a1a7249ae170a3 (patch) | |
tree | 12783d32e3a1cc17a113db4c8a9e1ff66a69414e /extension/pages/confirm-create-reserve.js | |
parent | 8e80bbbbb8489532e1f2a5c9b632e5ead4a6ec68 (diff) |
Missing files, payment
Diffstat (limited to 'extension/pages/confirm-create-reserve.js')
-rw-r--r-- | extension/pages/confirm-create-reserve.js | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/extension/pages/confirm-create-reserve.js b/extension/pages/confirm-create-reserve.js index 5c35121e3..8e8d7e798 100644 --- a/extension/pages/confirm-create-reserve.js +++ b/extension/pages/confirm-create-reserve.js @@ -1,43 +1,41 @@ "use strict"; - -let url = URI(document.location.href); -let query = URI.parseQuery(url.query()); - -function updateAmount() { - let showAmount = document.getElementById("show-amount"); - console.log("Query is " + JSON.stringify(query)); - let s = query.amount_str; - if (!s) { - document.body.innerHTML = "Oops, something went wrong."; - return; - } - showAmount.textContent = s; -} - -function clone(obj) { - // This is faster than it looks ... - return JSON.parse(JSON.stringify(obj)); -} - -document.addEventListener("DOMContentLoaded", (e) => { - updateAmount(); - - document.getElementById("confirm").addEventListener("click", (e) => { - let d = clone(query); - d.mint = document.getElementById('mint-url').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. - The bank responded with HTTP status code ${resp.status}. - Here is some more info: - <pre>${resp.text}</pre>`; - } +var ConfirmCreateReserve; +(function (ConfirmCreateReserve) { + let url = URI(document.location.href); + let query = URI.parseQuery(url.query()); + function updateAmount() { + let showAmount = document.getElementById("show-amount"); + console.log("Query is " + JSON.stringify(query)); + let s = query.amount_str; + if (!s) { + document.body.innerHTML = "Oops, something went wrong."; + return; + } + showAmount.textContent = s; + } + function clone(obj) { + // This is faster than it looks ... + return JSON.parse(JSON.stringify(obj)); + } + document.addEventListener("DOMContentLoaded", (e) => { + updateAmount(); + document.getElementById("confirm").addEventListener("click", (e) => { + let d = clone(query); + d.mint = document.getElementById('mint-url').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. + The bank responded with HTTP status code ${resp.status}. + Here is some more info: + <pre>${resp.text}</pre> + </div>`; + } + }); + }); }); - - }); -}); - - +})(ConfirmCreateReserve || (ConfirmCreateReserve = {})); |