Commit 6fecb8ec authored by Eriksson Monteiro's avatar Eriksson Monteiro

update millix bar

parent af785a09
...@@ -122,6 +122,8 @@ ...@@ -122,6 +122,8 @@
<include name="IDR_MILLIX_BAR_JS" file="resources\millix\millix_bar.js" type="BINDATA" /> <include name="IDR_MILLIX_BAR_JS" file="resources\millix\millix_bar.js" type="BINDATA" />
<include name="IDR_MILLIX_WS_HTML" file="resources\millix\millix_ws.html" type="BINDATA" /> <include name="IDR_MILLIX_WS_HTML" file="resources\millix\millix_ws.html" type="BINDATA" />
<include name="IDR_MILLIX_WS_JS" file="resources\millix\millix_ws.js" type="BINDATA" /> <include name="IDR_MILLIX_WS_JS" file="resources\millix\millix_ws.js" type="BINDATA" />
<include name="IDR_MILLIX_WS_JQUERY" file="resources\millix\vendor\jquery.js" type="BINDATA" />
<include name="IDR_MILLIX_WS_JQUERY_NICE_SCROLL" file="resources\millix\vendor\jquery.nicescroll.js" type="BINDATA" />
<!-- app --> <!-- app -->
<include name="IDR_MILLIX_APP_HTML" file="resources\millix\millix_app.html" type="BINDATA" /> <include name="IDR_MILLIX_APP_HTML" file="resources\millix\millix_app.html" type="BINDATA" />
<include name="IDR_MILLIX_APP_JS" file="resources\millix\millix_app.js" type="BINDATA" /> <include name="IDR_MILLIX_APP_JS" file="resources\millix\millix_app.js" type="BINDATA" />
......
html, body { html, body {
height: 40px; height: 40px;
margin: 0px; margin: 0px;
min-width: 1520px;
} }
body { body {
...@@ -111,9 +112,9 @@ a { ...@@ -111,9 +112,9 @@ a {
min-height: 0.125rem; min-height: 0.125rem;
} }
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { /*.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
width: 96%; width: 96%;
} }*/
.col-1-sm { .col-1-sm {
width: 4.33%; width: 4.33%;
...@@ -173,47 +174,59 @@ a { ...@@ -173,47 +174,59 @@ a {
display: none; display: none;
} }
@media only screen and (min-width: 45em) { /*@media only screen and (min-width: 45em) {
/* 720px */ 720px }*/
.col-1 {
.col-1 {
width: 4.33%; width: 4.33%;
} }
.col-2 {
.col-2 {
width: 12.66%; width: 12.66%;
} }
.col-3 {
.col-3 {
width: 21%; width: 21%;
} }
.col-4 {
.col-4 {
width: 29.33%; width: 29.33%;
} }
.col-5 {
.col-5 {
width: 37.66%; width: 37.66%;
} }
.col-6 {
.col-6 {
width: 46%; width: 46%;
} }
.col-7 {
.col-7 {
width: 54.33%; width: 54.33%;
} }
.col-8 {
.col-8 {
width: 62.66%; width: 62.66%;
} }
.col-9 {
.col-9 {
width: 71%; width: 71%;
} }
.col-10 {
.col-10 {
width: 79.33%; width: 79.33%;
} }
.col-11 {
.col-11 {
width: 87.66%; width: 87.66%;
} }
.col-12 {
.col-12 {
width: 96%; width: 96%;
} }
.hidden-sm {
.hidden-sm {
display: block; display: block;
}
} }
.btn { .btn {
...@@ -301,7 +314,7 @@ dark mode ...@@ -301,7 +314,7 @@ dark mode
color: rgba(241, 243, 244, 1); color: rgba(241, 243, 244, 1);
} }
input:focus{ input:focus {
outline: none; outline: none;
} }
...@@ -311,7 +324,7 @@ input:focus{ ...@@ -311,7 +324,7 @@ input:focus{
margin-top: 0px; margin-top: 0px;
border: solid 1px lightgray; border: solid 1px lightgray;
border-radius: 4px 0px 0px 4px; border-radius: 4px 0px 0px 4px;
width:200px; width: 200px;
padding-left: 10px; padding-left: 10px;
} }
...@@ -375,3 +388,35 @@ input:focus{ ...@@ -375,3 +388,35 @@ input:focus{
transform: translateX(-100%); transform: translateX(-100%);
} }
} }
.loader {
margin-top: 5px;
border: 2px solid #f3f3f3;
border-radius: 50%;
border-top: 2px solid #353535;
width: 6px;
height: 6px;
-webkit-animation: spin 1s linear infinite;
/* Safari */
animation: spin 1s linear infinite;
}
/* Safari */
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
\ No newline at end of file
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<script src="tangled://resources/js/util.js"></script> <script src="tangled://resources/js/util.js"></script>
<script src="strings.js"></script> <script src="strings.js"></script>
<script src="millix_bar.js"></script> <script src="millix_bar.js"></script>
<script src="jquery.js"></script>
<script src="jquery.nicescroll.js"></script>
</head> </head>
<body style="font-family:$i18n{fontfamily};" class="noselect"> <body style="font-family:$i18n{fontfamily};" class="noselect">
...@@ -40,7 +42,9 @@ ...@@ -40,7 +42,9 @@
</svg> </svg>
</i> </i>
</div> </div>
<div class="col-9 m-0 ml-5" id="balance_stable"></div> <div class="col-9 m-0 ml-5" id="balance_stable">
<div id="loading_holder" style="display: inline-flex;"><span style="margin-right: 4px;">loading</span><div class="loader"></div></div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-3 m-0 right"> <div class="col-3 m-0 right">
...@@ -54,7 +58,8 @@ ...@@ -54,7 +58,8 @@
</svg> </svg>
</i> </i>
</div> </div>
<div class="col-9 m-0 ml-5" id="balance_pending"></div> <div class="col-9 m-0 ml-5" id="balance_pending">
</div>
</div> </div>
</div> </div>
<div class="col-4 m-0" id="btn_holder"> <div class="col-4 m-0" id="btn_holder">
......
...@@ -68,6 +68,7 @@ cr.define('millix_bar', function () { ...@@ -68,6 +68,7 @@ cr.define('millix_bar', function () {
function activateWallet() { function activateWallet() {
walletLocked = false; walletLocked = false;
updateNodeStat(null);
if (unlockFromBar) { if (unlockFromBar) {
refreshMillixWallet(); refreshMillixWallet();
} }
...@@ -86,6 +87,7 @@ cr.define('millix_bar', function () { ...@@ -86,6 +87,7 @@ cr.define('millix_bar', function () {
} }
function deactivateWallet() { function deactivateWallet() {
updateNodeStat(null);
walletLocked = true; walletLocked = true;
console.log("[deactivateWallet]"); console.log("[deactivateWallet]");
document.getElementById('unlocked_wallet').classList.add("hidden"); document.getElementById('unlocked_wallet').classList.add("hidden");
...@@ -107,12 +109,10 @@ cr.define('millix_bar', function () { ...@@ -107,12 +109,10 @@ cr.define('millix_bar', function () {
millixAPIFrame.contentWindow.postMessage({ millixAPIFrame.contentWindow.postMessage({
type: 'read_stat_stop' type: 'read_stat_stop'
}, 'chrome-untrusted://millix-ws/'); }, 'chrome-untrusted://millix-ws/');
updateNodeStat(null);
} }
function updateNodeStat(nodeStat) { function updateNodeStat(nodeStat) {
if (walletLocked) { if (walletLocked && nodeStat) {
return; return;
} }
...@@ -146,6 +146,7 @@ cr.define('millix_bar', function () { ...@@ -146,6 +146,7 @@ cr.define('millix_bar', function () {
*/ */
function initialize() { function initialize() {
console.log("[initialize]"); console.log("[initialize]");
$("body").niceScroll();
if (loadTimeData.getBoolean('is_dark_theme')) { if (loadTimeData.getBoolean('is_dark_theme')) {
document.body.classList.add('dark'); document.body.classList.add('dark');
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -115,6 +115,8 @@ MillixBarUI::MillixBarUI(content::WebUI* web_ui) ...@@ -115,6 +115,8 @@ MillixBarUI::MillixBarUI(content::WebUI* web_ui)
// Add required resources. // Add required resources.
html_source->AddResourcePath("millix_bar.css", IDR_MILLIX_BAR_CSS); html_source->AddResourcePath("millix_bar.css", IDR_MILLIX_BAR_CSS);
html_source->AddResourcePath("millix_bar.js", IDR_MILLIX_BAR_JS); html_source->AddResourcePath("millix_bar.js", IDR_MILLIX_BAR_JS);
html_source->AddResourcePath("jquery.js", IDR_MILLIX_WS_JQUERY);
html_source->AddResourcePath("jquery.nicescroll.js", IDR_MILLIX_WS_JQUERY_NICE_SCROLL);
html_source->AddResourcePath("deposit.mp3", IDR_MILLIX_APP_DEPOSIT_MP3); html_source->AddResourcePath("deposit.mp3", IDR_MILLIX_APP_DEPOSIT_MP3);
html_source->AddBoolean( html_source->AddBoolean(
"is_dark_theme", "is_dark_theme",
...@@ -122,6 +124,8 @@ MillixBarUI::MillixBarUI(content::WebUI* web_ui) ...@@ -122,6 +124,8 @@ MillixBarUI::MillixBarUI(content::WebUI* web_ui)
html_source->UseStringsJs(); html_source->UseStringsJs();
html_source->SetDefaultResource(IDR_MILLIX_BAR_HTML); html_source->SetDefaultResource(IDR_MILLIX_BAR_HTML);
html_source->DisableTrustedTypesCSP();
html_source->OverrideContentSecurityPolicy( html_source->OverrideContentSecurityPolicy(
network::mojom::CSPDirectiveName::ScriptSrc, network::mojom::CSPDirectiveName::ScriptSrc,
"script-src tangled://resources 'self' 'unsafe-inline';"); "script-src tangled://resources 'self' 'unsafe-inline';");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment