diff options
author | Florian Dold <florian.dold@gmail.com> | 2015-12-17 13:30:34 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2015-12-17 13:30:34 +0100 |
commit | b93638b6935e7fb179385cd38a1691372b4c8432 (patch) | |
tree | e36ab895ff4a39599d626cf0ff70e965f68ae9b2 /extension/pages | |
parent | c3a9888dfe308e063fc9edaebcc834d8d1896224 (diff) |
Add types, simplify balance display.
Diffstat (limited to 'extension/pages')
-rw-r--r-- | extension/pages/confirm-contract.js | 10 | ||||
-rw-r--r-- | extension/pages/confirm-contract.tsx | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/extension/pages/confirm-contract.js b/extension/pages/confirm-contract.js index fe16bcbca..c59ac90a9 100644 --- a/extension/pages/confirm-contract.js +++ b/extension/pages/confirm-contract.js @@ -16,15 +16,15 @@ Handlebars.registerHelper('prettyAmount', function (amount) { return v.toFixed(2) + " " + amount.currency; }); document.addEventListener("DOMContentLoaded", (e) => { - let contract = JSON.parse(query.contract); - console.dir(contract); + let offer = JSON.parse(query.offer); + console.dir(offer); let source = $_("contract-template").innerHTML; let template = Handlebars.compile(source); - let html = template(contract.contract); + let html = template(offer.contract); $_("render-contract").innerHTML = html; - document.getElementById("confirm-purchase").addEventListener("click", (e) => { + document.getElementById("confirm-pay").addEventListener("click", (e) => { let d = clone(query); - chrome.runtime.sendMessage({ type: 'confirm-purchase', detail: d }, (resp) => { + chrome.runtime.sendMessage({ type: 'confirm-pay', detail: d }, (resp) => { if (resp.success === true) { document.location.href = resp.backlink; } diff --git a/extension/pages/confirm-contract.tsx b/extension/pages/confirm-contract.tsx index e12fdfd2d..811e2e001 100644 --- a/extension/pages/confirm-contract.tsx +++ b/extension/pages/confirm-contract.tsx @@ -24,19 +24,18 @@ Handlebars.registerHelper('prettyAmount', function(amount) { document.addEventListener("DOMContentLoaded", (e) => { - let contract = JSON.parse(query.contract); - console.dir(contract); + let offer = JSON.parse(query.offer); + console.dir(offer); let source = $_("contract-template").innerHTML; let template = Handlebars.compile(source); - let html = template(contract.contract); + let html = template(offer.contract); $_("render-contract").innerHTML = html; - - document.getElementById("confirm-purchase").addEventListener("click", (e) => { + document.getElementById("confirm-pay").addEventListener("click", (e) => { let d = clone(query); - chrome.runtime.sendMessage({type:'confirm-purchase', detail: d}, (resp) => { + chrome.runtime.sendMessage({type:'confirm-pay', detail: d}, (resp) => { if (resp.success === true) { document.location.href = resp.backlink; } else { @@ -46,7 +45,6 @@ document.addEventListener("DOMContentLoaded", (e) => { <pre>${resp.text}</pre>`; } }); - }); }); |