refactor the currency selection when initializing the application in a cleaner and safer way.
This commit is contained in:
parent
07b64959ca
commit
94994a1930
2 changed files with 22 additions and 24 deletions
|
@ -13161,13 +13161,12 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
|
||||||
document.getElementById("seedpoolarea").style.display = "block";
|
document.getElementById("seedpoolarea").style.display = "block";
|
||||||
}
|
}
|
||||||
// change currency
|
// change currency
|
||||||
janin.currency.useCurrency(4);
|
var currency = ninja.getQueryString()["currency"] || "bitcoin";
|
||||||
if (ninja.getQueryString()["currency"] != undefined) {
|
currency = currency.toLowerCase();
|
||||||
for(i = 0; i < janin.currencies.length; i++) {
|
for(i = 0; i < janin.currencies.length; i++) {
|
||||||
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
|
if (janin.currencies[i].name.toLowerCase() == currency)
|
||||||
janin.currency.useCurrency(i);
|
janin.currency.useCurrency(i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// populate currency dropdown list
|
// populate currency dropdown list
|
||||||
var select = document.getElementById("currency");
|
var select = document.getElementById("currency");
|
||||||
var options = "";
|
var options = "";
|
||||||
|
|
|
@ -6,13 +6,12 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
|
||||||
document.getElementById("seedpoolarea").style.display = "block";
|
document.getElementById("seedpoolarea").style.display = "block";
|
||||||
}
|
}
|
||||||
// change currency
|
// change currency
|
||||||
janin.currency.useCurrency(4);
|
var currency = ninja.getQueryString()["currency"] || "bitcoin";
|
||||||
if (ninja.getQueryString()["currency"] != undefined) {
|
currency = currency.toLowerCase();
|
||||||
for(i = 0; i < janin.currencies.length; i++) {
|
for(i = 0; i < janin.currencies.length; i++) {
|
||||||
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
|
if (janin.currencies[i].name.toLowerCase() == currency)
|
||||||
janin.currency.useCurrency(i);
|
janin.currency.useCurrency(i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// populate currency dropdown list
|
// populate currency dropdown list
|
||||||
var select = document.getElementById("currency");
|
var select = document.getElementById("currency");
|
||||||
var options = "";
|
var options = "";
|
||||||
|
|
Loading…
Add table
Reference in a new issue