Tue Sep 3 09:01:40 CST 2019 Source Update...
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
var NumDappGet=0;
|
||||
var NumDappInfo=0;
|
||||
var DAPPPREFIX="DAPP-";
|
||||
var MAX_DELTA_IGNORE_BUFFER=10;
|
||||
|
||||
|
||||
//DAPP TRANSFER
|
||||
@@ -70,8 +71,8 @@
|
||||
case "getstorage":
|
||||
{
|
||||
Data.Value=Storage.getItem(DAPPPREFIX+DapNumber+"-"+Data.Key);
|
||||
if(Data.Value)
|
||||
Data.Value=JSON.parse(Data.Value);
|
||||
if(Data.Value && Data.Value!=="undefined")
|
||||
try {Data.Value=JSON.parse(Data.Value);}catch (e){};
|
||||
SendMessage(Data);
|
||||
break;
|
||||
}
|
||||
@@ -83,8 +84,8 @@
|
||||
case "getcommon":
|
||||
{
|
||||
Data.Value=Storage.getItem(DAPPPREFIX+Data.Key);
|
||||
if(Data.Value)
|
||||
Data.Value=JSON.parse(Data.Value);
|
||||
if(Data.Value && Data.Value!=="undefined")
|
||||
try {Data.Value=JSON.parse(Data.Value);}catch (e){};
|
||||
SendMessage(Data);
|
||||
break;
|
||||
}
|
||||
@@ -136,16 +137,27 @@
|
||||
{
|
||||
if(SetData)
|
||||
{
|
||||
//ToLog("glSession="+glSession+" RES:"+SetData.result+" SetData.cache="+SetData.cache+" CurBlockNum="+SetData.CurBlockNum);
|
||||
|
||||
Data.Err=!SetData.result;
|
||||
Data.cache=SetData.cache;
|
||||
if(SetData.result)
|
||||
{
|
||||
CONFIG_DATA=SetData;
|
||||
SMART=SetData.Smart;
|
||||
BASE_ACCOUNT=SetData.Account;
|
||||
SetBlockChainConstant(SetData);
|
||||
if(SetData.cache)
|
||||
{
|
||||
for(var key in SetData)
|
||||
CONFIG_DATA[key]=SetData[key];
|
||||
SetData=CONFIG_DATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONFIG_DATA=SetData;
|
||||
SMART=SetData.Smart;
|
||||
BASE_ACCOUNT=SetData.Account;
|
||||
SetArrLog(SetData.ArrLog);
|
||||
}
|
||||
|
||||
NumDappInfo=SetData.NumDappInfo;
|
||||
SetArrLog(SetData.ArrLog);
|
||||
SetBlockChainConstant(SetData);
|
||||
|
||||
|
||||
for(var key in SetData)
|
||||
@@ -179,11 +191,13 @@
|
||||
case "DappTransactionList":
|
||||
{
|
||||
|
||||
if(Data.cmd==="DappBlockFile")
|
||||
if(Data.cmd==="DappBlockFile"
|
||||
&& Data.Params.BlockNum<=CONFIG_DATA.CurBlockNum-MAX_DELTA_IGNORE_BUFFER)
|
||||
{
|
||||
|
||||
//check storage
|
||||
var StrKeyStorage=Data.Params.BlockNum+"-"+Data.Params.TrNum;
|
||||
|
||||
//ToLog("StrKeyStorage: "+StrKeyStorage);
|
||||
var Storage2=sessionStorage;
|
||||
var SavedTextData=Storage2[StrKeyStorage];
|
||||
if(SavedTextData)
|
||||
@@ -277,6 +291,12 @@
|
||||
CreateNewAccount(Data.Currency);
|
||||
break;
|
||||
}
|
||||
case "ReloadDapp":
|
||||
{
|
||||
ReloadDapp();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +398,7 @@
|
||||
{
|
||||
var StrPath=GetProtocolServerPath(MainServer);
|
||||
|
||||
|
||||
//поддрежка старого кода dapp (после обновления dapp этот код возможно будет удален)
|
||||
SetData.Body=SetData.Body.replace(/.\/CSS\/[0-9a-z_-]+.css\">/g,StrPath+"$&");
|
||||
SetData.Body=SetData.Body.replace(/.\/JS\/[0-9a-z_-]+.js\">/g,StrPath+"$&");
|
||||
@@ -407,6 +428,14 @@
|
||||
<script type="text/javascript" src="./JS/terahashlib.js"><\/script>\
|
||||
'+SriptLW+SetData.Body;
|
||||
|
||||
|
||||
|
||||
|
||||
SetData.Body+=$("idModalCSS").outerHTML;
|
||||
SetData.Body+=$("idOverlay").outerHTML;
|
||||
SetData.Body+=$("idConfirm").outerHTML;
|
||||
|
||||
|
||||
iframe.srcdoc=SetData.Body;
|
||||
document.getElementsByTagName('body')[0].appendChild(iframe);
|
||||
|
||||
@@ -455,7 +484,6 @@
|
||||
StrRef='<A class="btcreate" href="'+GetWalletLink()+'">Accounts</A>';
|
||||
}
|
||||
|
||||
//var Str='<DIV style="background-color: #c8ecff;">For install this app press: <button class="btcreate" onclick="InstallApp()">Create account</button> or goto '+StrRef+' tab and Set smart number <B>'+SMART.Num+'</B> to your account<DIV>';
|
||||
var Str='<DIV style="background-color: #c8ecff;">For install this app press: <button class="btcreate" onclick="InstallApp()">Create account</button><DIV>';
|
||||
SetStatus(Str);
|
||||
}
|
||||
@@ -662,7 +690,7 @@
|
||||
CloseMenu();
|
||||
}
|
||||
break;
|
||||
case 115:
|
||||
case 116:
|
||||
e.preventDefault();
|
||||
ReloadDapp();
|
||||
break;
|
||||
@@ -814,6 +842,7 @@
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<DIV id="idStatus" class="top"></DIV>
|
||||
@@ -821,16 +850,77 @@
|
||||
<div id="idMenuList" class="top open">
|
||||
<div class="item" onclick="OpenWalletPage();">Open wallet page</div>
|
||||
<div class="item" onclick="RunDappFromFile();" id="idRunItem">Load from file...</div>
|
||||
<div class="item" onclick="ReloadDapp();">F4: Rerun</div>
|
||||
<div class="item" onclick="ReloadDapp();">F5: ReRun</div>
|
||||
<div class="item" onclick="window.location.reload();">Reset</div>
|
||||
<div class="item" onclick="InstallApp();" id="idCreateItem">Create account with DApp NNN</div>
|
||||
</div>
|
||||
</DIV>
|
||||
<input type="file" id="idFile" style="display: none">
|
||||
|
||||
<!--modal support dor dapp-->
|
||||
<style id="idModalCSS">
|
||||
/*modal support*/
|
||||
#idOverlay
|
||||
{
|
||||
background: rgba(68, 83, 104, 0.65);
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
display: none;
|
||||
}
|
||||
.ModalDlg
|
||||
{
|
||||
z-index: 1000;
|
||||
padding: 30px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #727473;
|
||||
box-shadow: 0px 8px 10px rgba(68, 83, 104, 0.15);
|
||||
color: #000;
|
||||
position: fixed;
|
||||
margin: 0 auto;
|
||||
top: 30%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
max-width: 250px;
|
||||
width: 87%;
|
||||
}
|
||||
|
||||
.bt-confirm
|
||||
{
|
||||
border-radius: 4px;
|
||||
min-height: 14px;
|
||||
margin: 5px;
|
||||
width: 100px;
|
||||
height: 36px;
|
||||
|
||||
color:white;
|
||||
background-color: #53687e;
|
||||
border-color: #445368;
|
||||
}
|
||||
|
||||
.bt-confirm:hover
|
||||
{
|
||||
color: #cb763a;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="idOverlay" onclick="closeModal()" style="display: none;"></div>
|
||||
<section id="idConfirm" class="ModalDlg" style="display: none;">
|
||||
<DIV align='center'>
|
||||
<h2 id="idConfirmTitle">Confirm</h2>
|
||||
<p id="idConfirmText">A you sure?</p>
|
||||
<button class="bt-confirm" onclick="OnConfirmOK()">OK</button>
|
||||
<button class="bt-confirm" onclick="closeModal()">Cancel</button>
|
||||
</DIV>
|
||||
</section>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
var glDebugPath="";
|
||||
//glDebugPath="./dapp-smart/mixer/mixer.html";
|
||||
//{"HTMLBlock":2303846,"HTMLTr":0}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user