From 67c6aedc1c1a3cea130dfb5fe9bd5047a90b0e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Thu, 8 May 2014 10:27:51 +0200 Subject: [PATCH] dynamic html title depending on selected currency --- index.html | 5 ++++- src/janin.currency.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7bc4331..2070672 100644 --- a/index.html +++ b/index.html @@ -6658,9 +6658,12 @@ janin.currency = { useCurrency: function(index) { janin.selectedCurrency = janin.currencies[index]; - var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png"; + var coinImgUrl = "logos/" + janin.currency.name().toLowerCase() + ".png"; document.getElementById("coinLogoImg").src = coinImgUrl; + // Update title depending on currency + document.title = janin.currency.name() + "'s paper wallet generator"; + // Regenerate a new wallet when not expensive ninja.wallets.singlewallet.generateNewAddressAndKey(); ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value); diff --git a/src/janin.currency.js b/src/janin.currency.js index b545ca5..77f0485 100644 --- a/src/janin.currency.js +++ b/src/janin.currency.js @@ -36,9 +36,12 @@ janin.currency = { useCurrency: function(index) { janin.selectedCurrency = janin.currencies[index]; - var coinImgUrl = "logos/" + janin.selectedCurrency.name.toLowerCase() + ".png"; + var coinImgUrl = "logos/" + janin.currency.name().toLowerCase() + ".png"; document.getElementById("coinLogoImg").src = coinImgUrl; + // Update title depending on currency + document.title = janin.currency.name() + "'s paper wallet generator"; + // Regenerate a new wallet when not expensive ninja.wallets.singlewallet.generateNewAddressAndKey(); ninja.wallets.paperwallet.build(document.getElementById('paperpassphrase').value);