sync: sync upstream code

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-07-16 12:22:39 +08:00
parent 32fbe503b9
commit 305d4b88da
9 changed files with 47 additions and 25 deletions

View File

@@ -1883,7 +1883,11 @@ function GetPrivKey()
var Key = sessionStorage[WALLET_KEY_NAME];
if(!Key)
Key = Storage.getItem(WALLET_KEY_NAME);
return Key;
if(Key && typeof Key === "string" && Key.length >= 64)
return Key;
else
return "";
};
function GetPubKey()
@@ -1891,7 +1895,11 @@ function GetPubKey()
var Key = sessionStorage[WALLET_PUB_KEY_NAME];
if(!Key)
Key = Storage.getItem(WALLET_PUB_KEY_NAME);
return Key;
if(Key && typeof Key === "string" && Key.length >= 64)
return Key;
else
return "";
};
function SetPrivKey(StrPrivKey)
@@ -1942,3 +1950,11 @@ function XORHash(arr1,arr2,length)
}
return arr3;
};
function Right(Str,count)
{
if(Str.length > count)
return Str.substr(Str.length - count, count);
else
return Str.substr(0, Str.length);
};

View File

@@ -131,6 +131,8 @@ function LoadValues()
var StrDelList = localStorage["DelList"];
if(StrDelList)
DelList = JSON.parse(StrDelList);
if(typeof DelList !== "object")
DelList = {};
if(LoadValuesByArr(SaveIdArr))
{
ChangeLang();
@@ -409,9 +411,21 @@ function SetAccountsCard(Data,AccountsDataStr)
var Str = StrAccCardTemplate;
Str = Str.replace("AccCardTemplate", "idCard" + Item.Num);
Str = Str.replace(/{Item.Num}/g, Item.Num);
Str = Str.replace("{Value.SumCOIN}", Item.Value.SumCOIN);
Str = Str.replace("{Value.SumCENT}", Item.Value.SumCENT);
Str = Str.replace("{Value.CurrencyName}", CurrencyName(Item.Currency));
var Str1, Str2, StrCurrencyName;
if(Item.Value.SumCOIN || Item.Value.SumCENT)
{
Str1 = Item.Value.SumCOIN;
Str2 = "," + Right("000000000" + Item.Value.SumCENT, 9);
}
else
{
Str1 = "";
Str2 = "";
}
StrCurrencyName = CurrencyName(Item.Currency);
Str = Str.replace("{Value.SumCOIN}", Str1);
Str = Str.replace("{Value.SumCENT}", Str2);
Str = Str.replace("{Value.CurrencyName}", StrCurrencyName);
var CurrencyObj = Item.CurrencyObj;
if(!CurrencyObj)
CurrencyObj = {IconBlockNum:0, Num:0};

View File

@@ -214,7 +214,7 @@
<a onclick="OpenHistoryPage({Item.Num})" class="prod-card__id prod-card__id--mobile-active pointer">{Item.Num}</a>
<a onclick="OpenHistoryPage({Item.Num})" target='_blank' class="prod-card__id prod-card__id--desktop pointer">{Item.Num}</a>
<div class="prod-card__heading">
<span class="prod-card__coins-count">{Value.SumCOIN}<sup>,{Value.SumCENT}</sup><br>
<span class="prod-card__coins-count">{Value.SumCOIN}<sup>{Value.SumCENT}</sup><br>
<span class="light-grey-text small-text mob-hidden">{Value.CurrencyName}</span>
</span>
<span class="prod-card__currency prod-card__currency--with-dot">