refactor the currency selection when initializing the application in a cleaner and safer way.

This commit is contained in:
Michael Muré 2014-07-02 21:30:35 +02:00
parent 07b64959ca
commit 94994a1930
2 changed files with 22 additions and 24 deletions

View file

@ -10317,11 +10317,11 @@ janin.currencies = [
janin.currency.createCurrency ("Fastcoin", 0x60, 0xe0, "8", "a" , "frxe8F7gQdiAVgy4mRXjpXH5vN1wyta1db"),
janin.currency.createCurrency ("Feathercoin",0x0e, 0x8e, "5", "N" , "6dxAP6oacHsove5X2kZPpddcT1Am167YzC"),
janin.currency.createCurrency ("Fluttercoin",0x23, 0xa3, "6", "R" , "FJioRLt3gLtqk3tUdMhwjAVo1sdWjRuwqt"),
janin.currency.createCurrency ("Fuelcoin",0x24, 0xa4, "6", "R" , ""),
janin.currency.createCurrency ("Fuelcoin", 0x24, 0xa4, "6", "R" , ""),
janin.currency.createCurrency ("GlobalBoost",0x26, 0xa6, "6", "R" , "GeXdH1WhzA7ayYim9sdCCQKcVukUq1W8LJ"),
janin.currency.createCurrency ("Goodcoin", 0x26, 0xa6, "6", "R" , "GM3kAbQGaMVAYk8U3CrVGhSwz1hZaF6gVM"),
janin.currency.createCurrency ("Gridcoin", 0x25, 0xa5, "6", "R" , "FyYkg3xhJVcVzMMw8JKfQaBxA9DAVhivq4"),
janin.currency.createCurrency ("Guldencoin",0x26, 0xa6, "6", "R" , ""),
janin.currency.createCurrency ("Guldencoin", 0x26, 0xa6, "6", "R" , ""),
janin.currency.createCurrency ("Guncoin", 0x27, 0xa7, "6", "R" , "GwVej6c3tF9GqEdSKmwJiUDWtQVK2wY9fP"),
janin.currency.createCurrency ("HTMLCoin", 0x1e, 0x9e, "6", "Q" , "DP4AVuekGEatNmpCL99m46k8THwS9yNVqy"),
janin.currency.createCurrency ("Litecoin", 0x30, 0xb0, "6", "T" , "LiScnsyPcqsyxn1fx92BcFguryXcw4DgCy"),
@ -13161,12 +13161,11 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
document.getElementById("seedpoolarea").style.display = "block";
}
// change currency
janin.currency.useCurrency(4);
if (ninja.getQueryString()["currency"] != undefined) {
for(i = 0; i < janin.currencies.length; i++) {
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
var currency = ninja.getQueryString()["currency"] || "bitcoin";
currency = currency.toLowerCase();
for(i = 0; i < janin.currencies.length; i++) {
if (janin.currencies[i].name.toLowerCase() == currency)
janin.currency.useCurrency(i);
}
}
// populate currency dropdown list
var select = document.getElementById("currency");

View file

@ -6,12 +6,11 @@ if (ninja.getQueryString()["showseedpool"] == "true" || ninja.getQueryString()["
document.getElementById("seedpoolarea").style.display = "block";
}
// change currency
janin.currency.useCurrency(4);
if (ninja.getQueryString()["currency"] != undefined) {
for(i = 0; i < janin.currencies.length; i++) {
if (janin.currencies[i].name.toLowerCase() == ninja.getQueryString()["currency"].toLowerCase())
var currency = ninja.getQueryString()["currency"] || "bitcoin";
currency = currency.toLowerCase();
for(i = 0; i < janin.currencies.length; i++) {
if (janin.currencies[i].name.toLowerCase() == currency)
janin.currency.useCurrency(i);
}
}
// populate currency dropdown list
var select = document.getElementById("currency");