update HTML file...
17
a.sh
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
EXT=js
|
|
||||||
DIST=ts
|
|
||||||
for name in `ls *.${EXT}`; do
|
|
||||||
mv $name ${name%.${EXT}}.${DIST}
|
|
||||||
done
|
|
||||||
: Function;
|
|
||||||
global.
|
|
||||||
: any
|
|
||||||
as any
|
|
||||||
|
|
||||||
BlockNumDB
|
|
||||||
BlockNumDBMin
|
|
||||||
UseTruncateBlockDB
|
|
||||||
ContextSendLoadToBegin
|
|
||||||
|
|
||||||
|
|
@ -1,440 +1,440 @@
|
|||||||
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');
|
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--blue-grey: #445368;
|
--blue-grey: #445368;
|
||||||
--light-blue: #718CAF;
|
--light-blue: #718CAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: "Roboto", "Arial", sans-serif;
|
font-family: "Roboto", "Arial", sans-serif;
|
||||||
|
|
||||||
color: #445368;
|
color: #445368;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
main {
|
main {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::before,
|
*::before,
|
||||||
*::after {
|
*::after {
|
||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*::placeholder {
|
*::placeholder {
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
font-family: "Roboto";
|
font-family: "Roboto";
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover,
|
a:hover,
|
||||||
a:focus {
|
a:focus {
|
||||||
color: #718CAF;
|
color: #718CAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #445368;
|
background: #445368;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
padding: 15px 25px;
|
padding: 15px 25px;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3);
|
box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:hover,
|
.btn:hover,
|
||||||
.btn:focus {
|
.btn:focus {
|
||||||
background: #718CAF;
|
background: #718CAF;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn[disabled],
|
.btn[disabled],
|
||||||
.btn.disabled {
|
.btn.disabled {
|
||||||
opacity: .3;
|
opacity: .3;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.reconnect {
|
.reconnect {
|
||||||
background-image: url("./../PIC/reload.svg");
|
background-image: url("./../PIC/reload.svg");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 18px 18px;
|
background-size: 18px 18px;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
width: 27px;
|
width: 27px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.reconnect span {
|
.reconnect span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.grey-btn {
|
.grey-btn {
|
||||||
border: none;
|
border: none;
|
||||||
background: #F2F2F2;
|
background: #F2F2F2;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
color: #000;
|
color: #000;
|
||||||
height: 27px;
|
height: 27px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background: linear-gradient(270deg, #3D4C61 0%, #445368 100%);
|
background: linear-gradient(270deg, #3D4C61 0%, #445368 100%);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
.header__wrapper {
|
.header__wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header__logo {
|
.header__logo {
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
.header__logo-link:hover {
|
.header__logo-link:hover {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.header__right {
|
.header__right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.header__right select {
|
.header__right select {
|
||||||
/* background: var(--blue-grey); */
|
/* background: var(--blue-grey); */
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
.white-select {
|
.white-select {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.header__nav {
|
.header__nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.page-pagination {
|
.page-pagination {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
.page-pagination__num {
|
.page-pagination__num {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
.page-pagination .btn {
|
.page-pagination .btn {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
.page-pagination .btn:first-of-type {
|
.page-pagination .btn:first-of-type {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
.page-pagination .btn:last-of-type {
|
.page-pagination .btn:last-of-type {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
.back-link {
|
.back-link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
.back-link span {
|
.back-link span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--blue-grey);
|
color: var(--blue-grey);
|
||||||
background: url("./../PIC/right-arrow.svg") no-repeat;
|
background: url("./../PIC/right-arrow.svg") no-repeat;
|
||||||
background-size: 18px 18px;
|
background-size: 18px 18px;
|
||||||
transform: translateY(-50%) rotate(180deg);
|
transform: translateY(-50%) rotate(180deg);
|
||||||
height: 18px;
|
height: 18px;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
.back-link:hover::before,
|
.back-link:hover::before,
|
||||||
.back-link:focus::before {
|
.back-link:focus::before {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.back-link--history {
|
.back-link--history {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link--history::before {
|
.back-link--history::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link--history span {
|
.back-link--history span {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 23px;
|
padding-left: 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header__logo--history {
|
.header__logo--history {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page {
|
.history-page {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: 110px;
|
padding-bottom: 110px;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding: 65px 15px 10px;
|
padding: 65px 15px 10px;
|
||||||
}
|
}
|
||||||
.history-page__id {
|
.history-page__id {
|
||||||
margin-bottom: 7px;
|
margin-bottom: 7px;
|
||||||
|
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
}
|
}
|
||||||
.history-page__id-count {
|
.history-page__id-count {
|
||||||
max-width: 140px;
|
max-width: 140px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
|
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-align-last: left;
|
text-align-last: left;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
border: none;
|
border: none;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
.history-page__description {
|
.history-page__description {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 17px;
|
margin-bottom: 17px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
.history-page__balance {
|
.history-page__balance {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
.history-page__tera-icon {
|
.history-page__tera-icon {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 0 15px 15px;
|
padding: 15px 0 15px 15px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.history-page__table .grid {
|
.history-page__table .grid {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
.history-page__table-wrap {
|
.history-page__table-wrap {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
.history-page__table th {
|
.history-page__table th {
|
||||||
background: var(--blue-grey);
|
background: var(--blue-grey);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 0 20px 0 10px;
|
padding: 0 20px 0 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align-last: left;
|
text-align-last: left;
|
||||||
}
|
}
|
||||||
.history-page__table th:first-child {
|
.history-page__table th:first-child {
|
||||||
border-top-left-radius: 5px;
|
border-top-left-radius: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table th:last-child {
|
.history-page__table th:last-child {
|
||||||
border-top-right-radius: 5px;
|
border-top-right-radius: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table .grid tr td {
|
.history-page__table .grid tr td {
|
||||||
padding: 8px 10px 6px;
|
padding: 8px 10px 6px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #C4C4C4;
|
border: 1px solid #C4C4C4;
|
||||||
}
|
}
|
||||||
.history-page__table .grid tr td:first-of-type {
|
.history-page__table .grid tr td:first-of-type {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__table .grid tr td.code
|
.history-page__table .grid tr td.code
|
||||||
{
|
{
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
width: 340px;
|
width: 340px;
|
||||||
min-width:200px;
|
min-width:200px;
|
||||||
font-family: "courier new", "times new roman", monospace;
|
font-family: "courier new", "times new roman", monospace;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page__table .grid tr td.hash
|
.history-page__table .grid tr td.hash
|
||||||
{
|
{
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
width: 160px;
|
width: 160px;
|
||||||
font-family: "courier new", "times new roman", monospace;
|
font-family: "courier new", "times new roman", monospace;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding: 65px 33px 10px;
|
padding: 65px 33px 10px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 33px;
|
padding: 15px 33px;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.header {
|
.header {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
}
|
}
|
||||||
.fixed-status .grey-btn {
|
.fixed-status .grey-btn {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
.reconnect {
|
.reconnect {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
background-position: 11px 11px;
|
background-position: 11px 11px;
|
||||||
}
|
}
|
||||||
.main-logo {
|
.main-logo {
|
||||||
width: 125px;
|
width: 125px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
.back-link {
|
.back-link {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
}
|
}
|
||||||
.back-link span {
|
.back-link span {
|
||||||
display: inline;
|
display: inline;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
.back-link--history span {
|
.back-link--history span {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 960px) {
|
@media (min-width: 960px) {
|
||||||
.header__logo {
|
.header__logo {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
.reconnect.grey-btn {
|
.reconnect.grey-btn {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
padding-left: 39px;
|
padding-left: 39px;
|
||||||
background-position: 11px 11px;
|
background-position: 11px 11px;
|
||||||
}
|
}
|
||||||
.reconnect span {
|
.reconnect span {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
.history-page {
|
.history-page {
|
||||||
padding-right: 40px;
|
padding-right: 40px;
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding: 65px 0 10px;
|
padding: 65px 0 10px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 0 10px;
|
padding: 15px 0 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
.header__wrapper {
|
.header__wrapper {
|
||||||
max-width: 1150px;
|
max-width: 1150px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding-top: 60px;
|
padding-top: 60px;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
.history-page__id {
|
.history-page__id {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__id-count {
|
.history-page__id-count {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__description {
|
.history-page__description {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__balance {
|
.history-page__balance {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 30px 15px;
|
padding: 30px 15px;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.page-pagination {
|
.page-pagination {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,201 +1,201 @@
|
|||||||
/*Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons*/
|
/*Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons Buttons*/
|
||||||
|
|
||||||
/*TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader*/
|
/*TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader TabHeader*/
|
||||||
#TabHeader th
|
#TabHeader th
|
||||||
{
|
{
|
||||||
/*border: 1px solid black;*/
|
/*border: 1px solid black;*/
|
||||||
width:205px;
|
width:205px;
|
||||||
|
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #22547f;
|
background-color: #22547f;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
}
|
}
|
||||||
.bttab
|
.bttab
|
||||||
{
|
{
|
||||||
background-color: black;
|
background-color: black;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*User action*/
|
/*User action*/
|
||||||
.btdoit
|
.btdoit
|
||||||
{
|
{
|
||||||
width: 130px;
|
width: 130px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.btdoitm
|
.btdoitm
|
||||||
{
|
{
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*All buttons*/
|
/*All buttons*/
|
||||||
.bt
|
.bt
|
||||||
{
|
{
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.bt:hover,button:hover
|
.bt:hover,button:hover
|
||||||
{
|
{
|
||||||
filter: brightness(120%);
|
filter: brightness(120%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.bt:active
|
.bt:active
|
||||||
{
|
{
|
||||||
cursor: progress;
|
cursor: progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.btlong
|
.btlong
|
||||||
{
|
{
|
||||||
width: 160px;
|
width: 160px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btopen
|
.btopen
|
||||||
{
|
{
|
||||||
width: 136px;
|
width: 136px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btsmall
|
.btsmall
|
||||||
{
|
{
|
||||||
width: 10px;
|
width: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idSendList
|
#idSendList
|
||||||
{
|
{
|
||||||
width: 800px;
|
width: 800px;
|
||||||
border: 0 solid black;
|
border: 0 solid black;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PaiListInfo
|
#PaiListInfo
|
||||||
{
|
{
|
||||||
width: 800px;
|
width: 800px;
|
||||||
height:20px;
|
height:20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btinvoice
|
.btinvoice
|
||||||
{
|
{
|
||||||
width: 133px;
|
width: 133px;
|
||||||
min-width: 133px;
|
min-width: 133px;
|
||||||
max-width: 133px;
|
max-width: 133px;
|
||||||
height:40px;
|
height:40px;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
background-image: url('/HTML/PIC/invoice.png');
|
background-image: url('/HTML/PIC/invoice.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
}
|
}
|
||||||
.btinvoice_use
|
.btinvoice_use
|
||||||
{
|
{
|
||||||
width: 110px;
|
width: 110px;
|
||||||
min-width: 110px;
|
min-width: 110px;
|
||||||
max-width: 110px;
|
max-width: 110px;
|
||||||
height:62px;
|
height:62px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#idCounters
|
#idCounters
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/counters.png');
|
background-image: url('/HTML/PIC/counters.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idChains
|
#idChains
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/chains.png');
|
background-image: url('/HTML/PIC/chains.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#idMonitor
|
#idMonitor
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/monitor.png');
|
background-image: url('/HTML/PIC/monitor.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idConsole
|
#idConsole
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/console.png');
|
background-image: url('/HTML/PIC/console.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size:16px;
|
background-size:16px;
|
||||||
}
|
}
|
||||||
#idOpenSmart
|
#idOpenSmart
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/smart.png');
|
background-image: url('/HTML/PIC/smart.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size:16px;
|
background-size:16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idNetwork
|
#idNetwork
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/network.png');
|
background-image: url('/HTML/PIC/network.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size:16px;
|
background-size:16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idDown
|
#idDown
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/down.png');
|
background-image: url('/HTML/PIC/down.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idUp
|
#idUp
|
||||||
{
|
{
|
||||||
background-image: url('/HTML/PIC/up.png');
|
background-image: url('/HTML/PIC/up.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 16px;
|
background-size: 16px;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
|
|
||||||
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 1);
|
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.btexlporer
|
.btexlporer
|
||||||
{
|
{
|
||||||
width: 136px;
|
width: 136px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
input[type="checkbox"]
|
input[type="checkbox"]
|
||||||
{
|
{
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
@ -1,90 +1,90 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
|
Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
|
||||||
Some correct by vtools
|
Some correct by vtools
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.hljs {
|
.hljs {
|
||||||
display: block;
|
display: block;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
background: #eff5eb;
|
background: #eff5eb;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-comment,
|
.hljs-comment,
|
||||||
.hljs-quote {
|
.hljs-quote {
|
||||||
color: #800;
|
color: #800;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-keyword,
|
.hljs-keyword,
|
||||||
.hljs-selector-tag,
|
.hljs-selector-tag,
|
||||||
.hljs-section,
|
.hljs-section,
|
||||||
.hljs-title,
|
.hljs-title,
|
||||||
.hljs-name {
|
.hljs-name {
|
||||||
color: #008;
|
color: #008;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-variable,
|
.hljs-variable,
|
||||||
.hljs-template-variable {
|
.hljs-template-variable {
|
||||||
color: #660;
|
color: #660;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-string,
|
.hljs-string,
|
||||||
.hljs-selector-attr,
|
.hljs-selector-attr,
|
||||||
.hljs-selector-pseudo,
|
.hljs-selector-pseudo,
|
||||||
.hljs-regexp {
|
.hljs-regexp {
|
||||||
color: #080;
|
color: #080;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-literal,
|
.hljs-literal,
|
||||||
.hljs-symbol,
|
.hljs-symbol,
|
||||||
.hljs-bullet,
|
.hljs-bullet,
|
||||||
.hljs-meta,
|
.hljs-meta,
|
||||||
.hljs-number,
|
.hljs-number,
|
||||||
.hljs-link {
|
.hljs-link {
|
||||||
color: #066;
|
color: #066;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-title,
|
.hljs-title,
|
||||||
.hljs-doctag,
|
.hljs-doctag,
|
||||||
.hljs-type,
|
.hljs-type,
|
||||||
.hljs-attr,
|
.hljs-attr,
|
||||||
.hljs-built_in,
|
.hljs-built_in,
|
||||||
.hljs-builtin-name,
|
.hljs-builtin-name,
|
||||||
.hljs-params {
|
.hljs-params {
|
||||||
color: #606;
|
color: #606;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-attribute,
|
.hljs-attribute,
|
||||||
.hljs-subst {
|
.hljs-subst {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-formula {
|
.hljs-formula {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-selector-id,
|
.hljs-selector-id,
|
||||||
.hljs-selector-class {
|
.hljs-selector-class {
|
||||||
color: #9B703F
|
color: #9B703F
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-addition {
|
.hljs-addition {
|
||||||
background-color: #baeeba;
|
background-color: #baeeba;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-deletion {
|
.hljs-deletion {
|
||||||
background-color: #ffc8bd;
|
background-color: #ffc8bd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-doctag,
|
.hljs-doctag,
|
||||||
.hljs-strong {
|
.hljs-strong {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs-emphasis {
|
.hljs-emphasis {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
@ -1,440 +1,440 @@
|
|||||||
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');
|
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&subset=cyrillic');
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--blue-grey: #445368;
|
--blue-grey: #445368;
|
||||||
--light-blue: #718CAF;
|
--light-blue: #718CAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: "Roboto", "Arial", sans-serif;
|
font-family: "Roboto", "Arial", sans-serif;
|
||||||
|
|
||||||
color: #445368;
|
color: #445368;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
main {
|
main {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::before,
|
*::before,
|
||||||
*::after {
|
*::after {
|
||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*::placeholder {
|
*::placeholder {
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
font-family: "Roboto";
|
font-family: "Roboto";
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover,
|
a:hover,
|
||||||
a:focus {
|
a:focus {
|
||||||
color: #718CAF;
|
color: #718CAF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #445368;
|
background: #445368;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
padding: 15px 25px;
|
padding: 15px 25px;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3);
|
box-shadow: 0px 5px 10px rgba(68, 83, 104, 0.3);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 21px;
|
line-height: 21px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:hover,
|
.btn:hover,
|
||||||
.btn:focus {
|
.btn:focus {
|
||||||
background: #718CAF;
|
background: #718CAF;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn[disabled],
|
.btn[disabled],
|
||||||
.btn.disabled {
|
.btn.disabled {
|
||||||
opacity: .3;
|
opacity: .3;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.reconnect {
|
.reconnect {
|
||||||
background-image: url("./../PIC/reload.svg");
|
background-image: url("./../PIC/reload.svg");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 18px 18px;
|
background-size: 18px 18px;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
width: 27px;
|
width: 27px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.reconnect span {
|
.reconnect span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.grey-btn {
|
.grey-btn {
|
||||||
border: none;
|
border: none;
|
||||||
background: #F2F2F2;
|
background: #F2F2F2;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
color: #000;
|
color: #000;
|
||||||
height: 27px;
|
height: 27px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background: linear-gradient(270deg, #3D4C61 0%, #445368 100%);
|
background: linear-gradient(270deg, #3D4C61 0%, #445368 100%);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
.header__wrapper {
|
.header__wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header__logo {
|
.header__logo {
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
.header__logo-link:hover {
|
.header__logo-link:hover {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.header__right {
|
.header__right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.header__right select {
|
.header__right select {
|
||||||
/* background: var(--blue-grey); */
|
/* background: var(--blue-grey); */
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
.white-select {
|
.white-select {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.header__nav {
|
.header__nav {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.header__wallet-set {
|
.header__wallet-set {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.header__wallet-link {
|
.header__wallet-link {
|
||||||
color: rgba(255, 255, 255, 0.6);
|
color: rgba(255, 255, 255, 0.6);
|
||||||
display: block;
|
display: block;
|
||||||
padding: 13px 15px 9px 15px;
|
padding: 13px 15px 9px 15px;
|
||||||
}
|
}
|
||||||
.header__wallet-link:hover,
|
.header__wallet-link:hover,
|
||||||
.header__wallet-link:focus {
|
.header__wallet-link:focus {
|
||||||
background: #55657C;
|
background: #55657C;
|
||||||
}
|
}
|
||||||
.header__wallet-link span {
|
.header__wallet-link span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.header__wallet-link:active,
|
.header__wallet-link:active,
|
||||||
.header__wallet-link.active {
|
.header__wallet-link.active {
|
||||||
box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25);
|
box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25);
|
||||||
}
|
}
|
||||||
.dapps-page__pagination,
|
.dapps-page__pagination,
|
||||||
.page-pagination {
|
.page-pagination {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
.page-pagination__num {
|
.page-pagination__num {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
.page-pagination .btn {
|
.page-pagination .btn {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin: 0 5px;
|
margin: 0 5px;
|
||||||
}
|
}
|
||||||
.page-pagination .btn:first-of-type {
|
.page-pagination .btn:first-of-type {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
.page-pagination .btn:last-of-type {
|
.page-pagination .btn:last-of-type {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link {
|
.back-link {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.back-link span {
|
.back-link span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--blue-grey);
|
color: var(--blue-grey);
|
||||||
background: url("./../PIC/right-arrow.svg") no-repeat;
|
background: url("./../PIC/right-arrow.svg") no-repeat;
|
||||||
background-size: 18px 18px;
|
background-size: 18px 18px;
|
||||||
transform: translateY(-50%) rotate(180deg);
|
transform: translateY(-50%) rotate(180deg);
|
||||||
height: 18px;
|
height: 18px;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
.back-link:hover::before,
|
.back-link:hover::before,
|
||||||
.back-link:focus::before {
|
.back-link:focus::before {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.header__logo--history {
|
.header__logo--history {
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link--history {
|
.back-link--history {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link--history::before {
|
.back-link--history::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-link--history span {
|
.back-link--history span {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 23px;
|
padding-left: 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page {
|
.history-page {
|
||||||
padding-bottom: 110px;
|
padding-bottom: 110px;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 10px 15px 10px;
|
padding: 10px 15px 10px;
|
||||||
}
|
}
|
||||||
.history-page__id {
|
.history-page__id {
|
||||||
margin-bottom: 7px;
|
margin-bottom: 7px;
|
||||||
|
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
}
|
}
|
||||||
.history-page__id-count {
|
.history-page__id-count {
|
||||||
max-width: 140px;
|
max-width: 140px;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
|
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-align-last: left;
|
text-align-last: left;
|
||||||
color: #445368;
|
color: #445368;
|
||||||
border: none;
|
border: none;
|
||||||
background: #f2f2f2;
|
background: #f2f2f2;
|
||||||
}
|
}
|
||||||
.history-page__description {
|
.history-page__description {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-bottom: 17px;
|
margin-bottom: 17px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
.history-page__balance {
|
.history-page__balance {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
.history-page__tera-icon {
|
.history-page__tera-icon {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 0 15px 15px;
|
padding: 15px 0 15px 15px;
|
||||||
}
|
}
|
||||||
.history-page__table .grid {
|
.history-page__table .grid {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
.history-page__table-wrap {
|
.history-page__table-wrap {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
.history-page__table th {
|
.history-page__table th {
|
||||||
background: var(--blue-grey);
|
background: var(--blue-grey);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 0 20px 0 10px;
|
padding: 0 20px 0 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align-last: left;
|
text-align-last: left;
|
||||||
}
|
}
|
||||||
.history-page__table th:first-child {
|
.history-page__table th:first-child {
|
||||||
border-top-left-radius: 5px;
|
border-top-left-radius: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table th:last-child {
|
.history-page__table th:last-child {
|
||||||
border-top-right-radius: 5px;
|
border-top-right-radius: 5px;
|
||||||
}
|
}
|
||||||
.history-page__table .grid tr td {
|
.history-page__table .grid tr td {
|
||||||
padding: 2px 10px 0px;
|
padding: 2px 10px 0px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid #C4C4C4;
|
border: 1px solid #C4C4C4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page__table .grid tr th.direct {
|
.history-page__table .grid tr th.direct {
|
||||||
max-width:30px;
|
max-width:30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page__table .grid tr td.date
|
.history-page__table .grid tr td.date
|
||||||
{
|
{
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.history-page__table .grid tr td:first-of-type {
|
.history-page__table .grid tr td:first-of-type {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-page__table .grid tr td:first-of-type b {
|
.history-page__table .grid tr td:first-of-type b {
|
||||||
font-size: 16px!important;
|
font-size: 16px!important;
|
||||||
font-weight: 700!important;
|
font-weight: 700!important;
|
||||||
}
|
}
|
||||||
.history-page__table .grid tr td.desc {
|
.history-page__table .grid tr td.desc {
|
||||||
max-width: 170px;
|
max-width: 170px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding: 10px 33px 10px;
|
padding: 10px 33px 10px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 33px;
|
padding: 15px 33px;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.header {
|
.header {
|
||||||
height: 60px;
|
height: 60px;
|
||||||
}
|
}
|
||||||
.main-logo {
|
.main-logo {
|
||||||
width: 125px;
|
width: 125px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
.back-link {
|
.back-link {
|
||||||
display: block;
|
display: block;
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
}
|
}
|
||||||
.back-link span {
|
.back-link span {
|
||||||
display: inline;
|
display: inline;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.back-link::before {
|
.back-link::before {
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
.back-link--history span {
|
.back-link--history span {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 960px) {
|
@media (min-width: 960px) {
|
||||||
.header__logo {
|
.header__logo {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
.history-page {
|
.history-page {
|
||||||
padding-right: 40px;
|
padding-right: 40px;
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding: 10px 0 10px;
|
padding: 10px 0 10px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 15px 0 10px;
|
padding: 15px 0 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
.header__wrapper {
|
.header__wrapper {
|
||||||
max-width: 1150px;
|
max-width: 1150px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.history__text-block {
|
.history__text-block {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
.history-page__id {
|
.history-page__id {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__id-count {
|
.history-page__id-count {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__description {
|
.history-page__description {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.history-page__balance {
|
.history-page__balance {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
}
|
}
|
||||||
.history-page__table {
|
.history-page__table {
|
||||||
padding: 30px 15px;
|
padding: 30px 15px;
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.page-pagination {
|
.page-pagination {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,180 +1,180 @@
|
|||||||
/*STYLE STYLE STYLE*/
|
/*STYLE STYLE STYLE*/
|
||||||
/*STYLE STYLE STYLE*/
|
/*STYLE STYLE STYLE*/
|
||||||
/*STYLE STYLE STYLE*/
|
/*STYLE STYLE STYLE*/
|
||||||
/*STYLE STYLE STYLE*/
|
/*STYLE STYLE STYLE*/
|
||||||
|
|
||||||
|
|
||||||
root
|
root
|
||||||
{
|
{
|
||||||
--colorText:#000;
|
--colorText:#000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
|
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleBrown
|
body.styleBrown
|
||||||
{
|
{
|
||||||
--color0:#503F13;
|
--color0:#503F13;
|
||||||
--color1:#86754A;
|
--color1:#86754A;
|
||||||
--color2:#F5E5BB;
|
--color2:#F5E5BB;
|
||||||
--color3:#F5F0E3;
|
--color3:#F5F0E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
body.styleGreen
|
body.styleGreen
|
||||||
{
|
{
|
||||||
--color0:#204410;
|
--color0:#204410;
|
||||||
--color1:#4F7340;
|
--color1:#4F7340;
|
||||||
--color2:#CBF4BA;
|
--color2:#CBF4BA;
|
||||||
--color3:#E7F4E1;
|
--color3:#E7F4E1;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleBlue
|
body.styleBlue
|
||||||
{
|
{
|
||||||
--color0:#0D1B35;
|
--color0:#0D1B35;
|
||||||
--color1:#354259;
|
--color1:#354259;
|
||||||
--color2:#BED0F2;
|
--color2:#BED0F2;
|
||||||
--color3:#E1E7F2;
|
--color3:#E1E7F2;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleGray
|
body.styleGray
|
||||||
{
|
{
|
||||||
--color0:#424a5D;
|
--color0:#424a5D;
|
||||||
--color1:#5b6775;
|
--color1:#5b6775;
|
||||||
--color2:#FFFFFF;
|
--color2:#FFFFFF;
|
||||||
--color3:#f3f3f4;
|
--color3:#f3f3f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleContrast1
|
body.styleContrast1
|
||||||
{
|
{
|
||||||
--color0:#101010;
|
--color0:#101010;
|
||||||
--color1:#303030;
|
--color1:#303030;
|
||||||
--color2: #b3cee8;
|
--color2: #b3cee8;
|
||||||
--color3:#FFFFFF;
|
--color3:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleContrast2
|
body.styleContrast2
|
||||||
{
|
{
|
||||||
--color0:#101010;
|
--color0:#101010;
|
||||||
--color1:#303030;
|
--color1:#303030;
|
||||||
--color2: #cee8df;
|
--color2: #cee8df;
|
||||||
--color3:#FFFFFF;
|
--color3:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleContrast3
|
body.styleContrast3
|
||||||
{
|
{
|
||||||
--color0:#101010;
|
--color0:#101010;
|
||||||
--color1:#303030;
|
--color1:#303030;
|
||||||
--color2: #e8e0d4;
|
--color2: #e8e0d4;
|
||||||
--color3:#FFFFFF;
|
--color3:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
body.univers .bt
|
body.univers .bt
|
||||||
{
|
{
|
||||||
background: var(--color1);
|
background: var(--color1);
|
||||||
color: var(--color2);
|
color: var(--color2);
|
||||||
}
|
}
|
||||||
body.univers
|
body.univers
|
||||||
{
|
{
|
||||||
background: var(--color2);
|
background: var(--color2);
|
||||||
}
|
}
|
||||||
|
|
||||||
body.univers table.grid
|
body.univers table.grid
|
||||||
{
|
{
|
||||||
background:var(--color3);
|
background:var(--color3);
|
||||||
}
|
}
|
||||||
|
|
||||||
body.univers .bttab
|
body.univers .bttab
|
||||||
{
|
{
|
||||||
background: var(--color1);
|
background: var(--color1);
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.univers .current
|
body.univers .current
|
||||||
{
|
{
|
||||||
background: var(--color0);
|
background: var(--color0);
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.univers input,textarea,select
|
body.univers input,textarea,select
|
||||||
{
|
{
|
||||||
background:white;
|
background:white;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*dark*/
|
/*dark*/
|
||||||
body.styleDark
|
body.styleDark
|
||||||
{
|
{
|
||||||
background: #282828;
|
background: #282828;
|
||||||
--colorText:white;
|
--colorText:white;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark .bt
|
body.styleDark .bt
|
||||||
{
|
{
|
||||||
background: #4c4c4c;
|
background: #4c4c4c;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #5a5a5a;
|
border: 1px solid #5a5a5a;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark .header_tr
|
body.styleDark .header_tr
|
||||||
{
|
{
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
body.styleDark table.grid
|
body.styleDark table.grid
|
||||||
{
|
{
|
||||||
background: #565656;
|
background: #565656;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark .bttab
|
body.styleDark .bttab
|
||||||
{
|
{
|
||||||
background: #202225;
|
background: #202225;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark .current
|
body.styleDark .current
|
||||||
{
|
{
|
||||||
background: #565b61;
|
background: #565b61;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark input,textarea,select
|
body.styleDark input,textarea,select
|
||||||
{
|
{
|
||||||
background:white;
|
background:white;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*bt*/
|
/*bt*/
|
||||||
body.styleDark button
|
body.styleDark button
|
||||||
{
|
{
|
||||||
background: #939393;
|
background: #939393;
|
||||||
border: 1px solid #282828;
|
border: 1px solid #282828;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark .bold
|
body.styleDark .bold
|
||||||
{
|
{
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark #idStatus
|
body.styleDark #idStatus
|
||||||
{
|
{
|
||||||
color: #fffabd;
|
color: #fffabd;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.styleDark #idOpenWallet
|
body.styleDark #idOpenWallet
|
||||||
{
|
{
|
||||||
border: 1px solid darkgrey;
|
border: 1px solid darkgrey;
|
||||||
}
|
}
|
||||||
|
@ -10,19 +10,23 @@
|
|||||||
|
|
||||||
const ipcRenderer = require('electron').ipcRenderer;
|
const ipcRenderer = require('electron').ipcRenderer;
|
||||||
|
|
||||||
function GetDataElectron(Method, ObjPost, Func) {
|
function GetDataElectron(Method,ObjPost,Func)
|
||||||
if (Func === undefined) {
|
{
|
||||||
|
if(Func === undefined)
|
||||||
|
{
|
||||||
Func = ObjPost;
|
Func = ObjPost;
|
||||||
ObjPost = null;
|
ObjPost = null;
|
||||||
}
|
}
|
||||||
var reply;
|
var reply;
|
||||||
try {
|
try
|
||||||
reply = ipcRenderer.sendSync('GetData', { path: Method, obj: ObjPost });
|
{
|
||||||
|
reply = ipcRenderer.sendSync('GetData', {path:Method, obj:ObjPost});
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
reply = undefined;
|
reply = undefined;
|
||||||
}
|
}
|
||||||
if (Func)
|
if(Func)
|
||||||
Func(reply);
|
Func(reply);
|
||||||
};
|
};
|
||||||
window.GetData = GetDataElectron;
|
window.GetData = GetDataElectron;
|
||||||
|
@ -11,82 +11,97 @@
|
|||||||
var MAX_SUM_TER = 1e9;
|
var MAX_SUM_TER = 1e9;
|
||||||
var MAX_SUM_CENT = 1e9;
|
var MAX_SUM_CENT = 1e9;
|
||||||
|
|
||||||
function ADD(Coin, Value2) {
|
function ADD(Coin,Value2)
|
||||||
|
{
|
||||||
Coin.SumCOIN += Value2.SumCOIN;
|
Coin.SumCOIN += Value2.SumCOIN;
|
||||||
Coin.SumCENT += Value2.SumCENT;
|
Coin.SumCENT += Value2.SumCENT;
|
||||||
if (Coin.SumCENT >= MAX_SUM_CENT) {
|
if(Coin.SumCENT >= MAX_SUM_CENT)
|
||||||
|
{
|
||||||
Coin.SumCENT -= MAX_SUM_CENT;
|
Coin.SumCENT -= MAX_SUM_CENT;
|
||||||
Coin.SumCOIN++;
|
Coin.SumCOIN++;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SUB(Coin, Value2) {
|
function SUB(Coin,Value2)
|
||||||
|
{
|
||||||
Coin.SumCOIN -= Value2.SumCOIN;
|
Coin.SumCOIN -= Value2.SumCOIN;
|
||||||
if (Coin.SumCENT >= Value2.SumCENT) {
|
if(Coin.SumCENT >= Value2.SumCENT)
|
||||||
|
{
|
||||||
Coin.SumCENT -= Value2.SumCENT;
|
Coin.SumCENT -= Value2.SumCENT;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Coin.SumCENT = MAX_SUM_CENT + Coin.SumCENT - Value2.SumCENT;
|
Coin.SumCENT = MAX_SUM_CENT + Coin.SumCENT - Value2.SumCENT;
|
||||||
Coin.SumCOIN--;
|
Coin.SumCOIN--;
|
||||||
}
|
}
|
||||||
if (Coin.SumCOIN < 0) {
|
if(Coin.SumCOIN < 0)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
function DIV(Coin, Value) {
|
function DIV(Coin,Value)
|
||||||
|
{
|
||||||
Coin.SumCOIN = Coin.SumCOIN / Value;
|
Coin.SumCOIN = Coin.SumCOIN / Value;
|
||||||
Coin.SumCENT = Math.floor(Coin.SumCENT / Value);
|
Coin.SumCENT = Math.floor(Coin.SumCENT / Value);
|
||||||
var SumCOIN = Math.floor(Coin.SumCOIN);
|
var SumCOIN = Math.floor(Coin.SumCOIN);
|
||||||
var SumCENT = Math.floor((Coin.SumCOIN - SumCOIN) * MAX_SUM_CENT);
|
var SumCENT = Math.floor((Coin.SumCOIN - SumCOIN) * MAX_SUM_CENT);
|
||||||
Coin.SumCOIN = SumCOIN;
|
Coin.SumCOIN = SumCOIN;
|
||||||
Coin.SumCENT = Coin.SumCENT + SumCENT;
|
Coin.SumCENT = Coin.SumCENT + SumCENT;
|
||||||
if (Coin.SumCENT >= MAX_SUM_CENT) {
|
if(Coin.SumCENT >= MAX_SUM_CENT)
|
||||||
|
{
|
||||||
Coin.SumCENT -= MAX_SUM_CENT;
|
Coin.SumCENT -= MAX_SUM_CENT;
|
||||||
Coin.SumCOIN++;
|
Coin.SumCOIN++;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
function FLOAT_FROM_COIN(Coin) {
|
function FLOAT_FROM_COIN(Coin)
|
||||||
|
{
|
||||||
var Sum = Coin.SumCOIN + Coin.SumCENT / MAX_SUM_CENT;
|
var Sum = Coin.SumCOIN + Coin.SumCENT / MAX_SUM_CENT;
|
||||||
return Sum;
|
return Sum;
|
||||||
};
|
};
|
||||||
|
|
||||||
function STRING_FROM_COIN(Coin) {
|
function STRING_FROM_COIN(Coin)
|
||||||
|
{
|
||||||
var Sum = FLOAT_FROM_COIN(Coin);
|
var Sum = FLOAT_FROM_COIN(Coin);
|
||||||
return Sum.toLocaleString(undefined, { useGrouping: true, style: 'decimal', maximumFractionDigits: 9 });
|
return Sum.toLocaleString(undefined, {useGrouping:true, style:'decimal', maximumFractionDigits:9});
|
||||||
};
|
};
|
||||||
|
|
||||||
function COIN_FROM_FLOAT(Sum) {
|
function COIN_FROM_FLOAT(Sum)
|
||||||
|
{
|
||||||
var SumCOIN = Math.floor(Sum);
|
var SumCOIN = Math.floor(Sum);
|
||||||
var SumCENT = Math.floor((Sum - SumCOIN) * MAX_SUM_CENT);
|
var SumCENT = Math.floor((Sum - SumCOIN) * MAX_SUM_CENT);
|
||||||
var Coin = { SumCOIN: SumCOIN, SumCENT: SumCENT };
|
var Coin = {SumCOIN:SumCOIN, SumCENT:SumCENT};
|
||||||
return Coin;
|
return Coin;
|
||||||
};
|
};
|
||||||
|
|
||||||
function COIN_FROM_FLOAT2(Sum) {
|
function COIN_FROM_FLOAT2(Sum)
|
||||||
|
{
|
||||||
var SumCOIN = Math.floor(Sum);
|
var SumCOIN = Math.floor(Sum);
|
||||||
var SumCENT = Math.floor(Sum * MAX_SUM_CENT - SumCOIN * MAX_SUM_CENT);
|
var SumCENT = Math.floor(Sum * MAX_SUM_CENT - SumCOIN * MAX_SUM_CENT);
|
||||||
var Coin = { SumCOIN: SumCOIN, SumCENT: SumCENT };
|
var Coin = {SumCOIN:SumCOIN, SumCENT:SumCENT};
|
||||||
return Coin;
|
return Coin;
|
||||||
};
|
};
|
||||||
if (typeof window === "object")
|
if(typeof window === "object")
|
||||||
window.COIN_FROM_FLOAT = COIN_FROM_FLOAT2;
|
window.COIN_FROM_FLOAT = COIN_FROM_FLOAT2;
|
||||||
|
|
||||||
function ISZERO(Coin) {
|
function ISZERO(Coin)
|
||||||
if (Coin.SumCOIN === 0 && Coin.SumCENT === 0)
|
{
|
||||||
|
if(Coin.SumCOIN === 0 && Coin.SumCENT === 0)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
function COIN_FROM_STRING(Str) {
|
function COIN_FROM_STRING(Str)
|
||||||
|
{
|
||||||
throw "TODO: COIN_FROM_STRING";
|
throw "TODO: COIN_FROM_STRING";
|
||||||
};
|
};
|
||||||
if (typeof global === "object") {
|
if(typeof global === "object")
|
||||||
|
{
|
||||||
global.ADD = ADD;
|
global.ADD = ADD;
|
||||||
global.SUB = SUB;
|
global.SUB = SUB;
|
||||||
global.DIV = DIV;
|
global.DIV = DIV;
|
||||||
|
@ -11,9 +11,10 @@
|
|||||||
var MAX_SUPER_VALUE_POW = (1 << 30) * 2;
|
var MAX_SUPER_VALUE_POW = (1 << 30) * 2;
|
||||||
window.TYPE_TRANSACTION_CREATE = 100;
|
window.TYPE_TRANSACTION_CREATE = 100;
|
||||||
|
|
||||||
function GetHashWithValues(hash0, value1, value2, bNotCopy) {
|
function GetHashWithValues(hash0,value1,value2,bNotCopy)
|
||||||
|
{
|
||||||
var hash;
|
var hash;
|
||||||
if (bNotCopy)
|
if(bNotCopy)
|
||||||
hash = hash0;
|
hash = hash0;
|
||||||
else
|
else
|
||||||
hash = hash0.slice();
|
hash = hash0.slice();
|
||||||
@ -29,14 +30,20 @@ function GetHashWithValues(hash0, value1, value2, bNotCopy) {
|
|||||||
return arrhash;
|
return arrhash;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetPowPower(arrhash) {
|
function GetPowPower(arrhash)
|
||||||
|
{
|
||||||
var SumBit = 0;
|
var SumBit = 0;
|
||||||
for (var i = 0; i < arrhash.length; i++) {
|
for(var i = 0; i < arrhash.length; i++)
|
||||||
|
{
|
||||||
var byte = arrhash[i];
|
var byte = arrhash[i];
|
||||||
for (var b = 7; b >= 0; b--) {
|
for(var b = 7; b >= 0; b--)
|
||||||
if ((byte >> b) & 1) {
|
{
|
||||||
|
if((byte >> b) & 1)
|
||||||
|
{
|
||||||
return SumBit;
|
return SumBit;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
SumBit++;
|
SumBit++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -44,25 +51,29 @@ function GetPowPower(arrhash) {
|
|||||||
return SumBit;
|
return SumBit;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetPowValue(arrhash) {
|
function GetPowValue(arrhash)
|
||||||
|
{
|
||||||
var value = (arrhash[0] << 23) * 2 + (arrhash[1] << 16) + (arrhash[2] << 8) + arrhash[3];
|
var value = (arrhash[0] << 23) * 2 + (arrhash[1] << 16) + (arrhash[2] << 8) + arrhash[3];
|
||||||
value = value * 256 + arrhash[4];
|
value = value * 256 + arrhash[4];
|
||||||
value = value * 256 + arrhash[5];
|
value = value * 256 + arrhash[5];
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
function CreateNoncePOWExtern(arr0, BlockNum, count, startnone) {
|
function CreateNoncePOWExtern(arr0,BlockNum,count,startnone)
|
||||||
|
{
|
||||||
var arr = [];
|
var arr = [];
|
||||||
for (var i = 0; i < arr0.length; i++)
|
for(var i = 0; i < arr0.length; i++)
|
||||||
arr[i] = arr0[i];
|
arr[i] = arr0[i];
|
||||||
if (!startnone)
|
if(!startnone)
|
||||||
startnone = 0;
|
startnone = 0;
|
||||||
var maxnonce = 0;
|
var maxnonce = 0;
|
||||||
var supervalue = MAX_SUPER_VALUE_POW;
|
var supervalue = MAX_SUPER_VALUE_POW;
|
||||||
for (var nonce = startnone; nonce <= startnone + count; nonce++) {
|
for(var nonce = startnone; nonce <= startnone + count; nonce++)
|
||||||
|
{
|
||||||
var arrhash = GetHashWithValues(arr, nonce, BlockNum, true);
|
var arrhash = GetHashWithValues(arr, nonce, BlockNum, true);
|
||||||
var value = GetPowValue(arrhash);
|
var value = GetPowValue(arrhash);
|
||||||
if (value < supervalue) {
|
if(value < supervalue)
|
||||||
|
{
|
||||||
maxnonce = nonce;
|
maxnonce = nonce;
|
||||||
supervalue = value;
|
supervalue = value;
|
||||||
}
|
}
|
||||||
@ -71,7 +82,8 @@ function CreateNoncePOWExtern(arr0, BlockNum, count, startnone) {
|
|||||||
};
|
};
|
||||||
window.TR_TICKET_HASH_LENGTH = 10;
|
window.TR_TICKET_HASH_LENGTH = 10;
|
||||||
|
|
||||||
function CreateHashBody(body, Num, Nonce) {
|
function CreateHashBody(body,Num,Nonce)
|
||||||
|
{
|
||||||
var length = body.length - 12;
|
var length = body.length - 12;
|
||||||
body[length + 0] = Num & 0xFF;
|
body[length + 0] = Num & 0xFF;
|
||||||
body[length + 1] = (Num >>> 8) & 0xFF;
|
body[length + 1] = (Num >>> 8) & 0xFF;
|
||||||
@ -88,7 +100,7 @@ function CreateHashBody(body, Num, Nonce) {
|
|||||||
body[length + 5] = 0;
|
body[length + 5] = 0;
|
||||||
var HASH = sha3(body);
|
var HASH = sha3(body);
|
||||||
var FullHashTicket = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
var FullHashTicket = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
for (var i = 0; i < TR_TICKET_HASH_LENGTH; i++)
|
for(var i = 0; i < TR_TICKET_HASH_LENGTH; i++)
|
||||||
FullHashTicket[i] = HASH[i];
|
FullHashTicket[i] = HASH[i];
|
||||||
WriteUintToArrOnPos(FullHashTicket, Num, TR_TICKET_HASH_LENGTH);
|
WriteUintToArrOnPos(FullHashTicket, Num, TR_TICKET_HASH_LENGTH);
|
||||||
return sha3(FullHashTicket);
|
return sha3(FullHashTicket);
|
||||||
@ -99,16 +111,18 @@ window.MIN_POWER_POW_TR = 0;
|
|||||||
window.CONSENSUS_PERIOD_TIME = 1000;
|
window.CONSENSUS_PERIOD_TIME = 1000;
|
||||||
window.FIRST_TIME_BLOCK = 1530446400000;
|
window.FIRST_TIME_BLOCK = 1530446400000;
|
||||||
window.NEW_SIGN_TIME = 25500000;
|
window.NEW_SIGN_TIME = 25500000;
|
||||||
window.SetBlockChainConstant = function(Data) {
|
window.SetBlockChainConstant = function (Data)
|
||||||
|
{
|
||||||
var DeltaServerClient = new Date() - Data.CurTime;
|
var DeltaServerClient = new Date() - Data.CurTime;
|
||||||
if (!Data.DELTA_CURRENT_TIME)
|
if(!Data.DELTA_CURRENT_TIME)
|
||||||
Data.DELTA_CURRENT_TIME = 0;
|
Data.DELTA_CURRENT_TIME = 0;
|
||||||
window.DELTA_CURRENT_TIME2 = Data.DELTA_CURRENT_TIME - DeltaServerClient;
|
window.DELTA_CURRENT_TIME2 = Data.DELTA_CURRENT_TIME - DeltaServerClient;
|
||||||
window.MIN_POWER_POW_TR = DELTA_POWER_POW_TR + Data.MIN_POWER_POW_TR;
|
window.MIN_POWER_POW_TR = DELTA_POWER_POW_TR + Data.MIN_POWER_POW_TR;
|
||||||
window.FIRST_TIME_BLOCK = Data.FIRST_TIME_BLOCK;
|
window.FIRST_TIME_BLOCK = Data.FIRST_TIME_BLOCK;
|
||||||
window.NEW_SIGN_TIME = Data.NEW_SIGN_TIME;
|
window.NEW_SIGN_TIME = Data.NEW_SIGN_TIME;
|
||||||
window.CONSENSUS_PERIOD_TIME = Data.CONSENSUS_PERIOD_TIME;
|
window.CONSENSUS_PERIOD_TIME = Data.CONSENSUS_PERIOD_TIME;
|
||||||
window.GetCurrentBlockNumByTime = function() {
|
window.GetCurrentBlockNumByTime = function ()
|
||||||
|
{
|
||||||
var CurrentTime = Date.now() + DELTA_CURRENT_TIME2;
|
var CurrentTime = Date.now() + DELTA_CURRENT_TIME2;
|
||||||
var CurTimeNum = CurrentTime - FIRST_TIME_BLOCK;
|
var CurTimeNum = CurrentTime - FIRST_TIME_BLOCK;
|
||||||
var StartBlockNum = Math.floor((CurTimeNum + CONSENSUS_PERIOD_TIME) / CONSENSUS_PERIOD_TIME);
|
var StartBlockNum = Math.floor((CurTimeNum + CONSENSUS_PERIOD_TIME) / CONSENSUS_PERIOD_TIME);
|
||||||
@ -116,15 +130,18 @@ window.SetBlockChainConstant = function(Data) {
|
|||||||
};
|
};
|
||||||
window.NWMODE = Data.NWMODE;
|
window.NWMODE = Data.NWMODE;
|
||||||
};
|
};
|
||||||
window.GetCurrentBlockNumByTime = function() {
|
window.GetCurrentBlockNumByTime = function ()
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetBlockNumTr(arr) {
|
function GetBlockNumTr(arr)
|
||||||
|
{
|
||||||
var BlockNum = window.DELTA_FOR_TIME_TX + GetCurrentBlockNumByTime();
|
var BlockNum = window.DELTA_FOR_TIME_TX + GetCurrentBlockNumByTime();
|
||||||
if (arr[0] === TYPE_TRANSACTION_CREATE) {
|
if(arr[0] === TYPE_TRANSACTION_CREATE)
|
||||||
|
{
|
||||||
var BlockNum2 = Math.floor(BlockNum / 10) * 10;
|
var BlockNum2 = Math.floor(BlockNum / 10) * 10;
|
||||||
if (BlockNum2 < BlockNum)
|
if(BlockNum2 < BlockNum)
|
||||||
BlockNum2 = BlockNum2 + 10;
|
BlockNum2 = BlockNum2 + 10;
|
||||||
BlockNum = BlockNum2;
|
BlockNum = BlockNum2;
|
||||||
}
|
}
|
||||||
@ -134,20 +151,26 @@ var LastCreatePOWTrType = 0;
|
|||||||
var LastCreatePOWBlockNum = 0;
|
var LastCreatePOWBlockNum = 0;
|
||||||
var LastCreatePOWHash = [255, 255, 255, 255];
|
var LastCreatePOWHash = [255, 255, 255, 255];
|
||||||
|
|
||||||
function CreateHashBodyPOWInnerMinPower(arr, MinPow, startnonce) {
|
function CreateHashBodyPOWInnerMinPower(arr,MinPow,startnonce)
|
||||||
|
{
|
||||||
var TrType = arr[0];
|
var TrType = arr[0];
|
||||||
var BlockNum = GetBlockNumTr(arr);
|
var BlockNum = GetBlockNumTr(arr);
|
||||||
if (MinPow === undefined) {
|
if(MinPow === undefined)
|
||||||
|
{
|
||||||
MinPow = MIN_POWER_POW_TR + Math.log2(arr.length / 128);
|
MinPow = MIN_POWER_POW_TR + Math.log2(arr.length / 128);
|
||||||
}
|
}
|
||||||
var nonce = startnonce;
|
var nonce = startnonce;
|
||||||
while (1) {
|
while(1)
|
||||||
|
{
|
||||||
var arrhash = CreateHashBody(arr, BlockNum, nonce);
|
var arrhash = CreateHashBody(arr, BlockNum, nonce);
|
||||||
var power = GetPowPower(arrhash);
|
var power = GetPowPower(arrhash);
|
||||||
if (power >= MinPow) {
|
if(power >= MinPow)
|
||||||
if (LastCreatePOWBlockNum === BlockNum && LastCreatePOWTrType === TrType && CompareArr(LastCreatePOWHash, arrhash) > 0) {
|
{
|
||||||
|
if(LastCreatePOWBlockNum === BlockNum && LastCreatePOWTrType === TrType && CompareArr(LastCreatePOWHash, arrhash) > 0)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
LastCreatePOWBlockNum = BlockNum;
|
LastCreatePOWBlockNum = BlockNum;
|
||||||
LastCreatePOWTrType = TrType;
|
LastCreatePOWTrType = TrType;
|
||||||
LastCreatePOWHash = arrhash;
|
LastCreatePOWHash = arrhash;
|
||||||
@ -155,31 +178,35 @@ function CreateHashBodyPOWInnerMinPower(arr, MinPow, startnonce) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
nonce++;
|
nonce++;
|
||||||
if (nonce % 2000 === 0) {
|
if(nonce % 2000 === 0)
|
||||||
|
{
|
||||||
BlockNum = GetBlockNumTr(arr);
|
BlockNum = GetBlockNumTr(arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function CalcHashFromArray(ArrHashes, bOriginalSeq) {
|
function CalcHashFromArray(ArrHashes,bOriginalSeq)
|
||||||
if (bOriginalSeq === undefined)
|
{
|
||||||
|
if(bOriginalSeq === undefined)
|
||||||
ArrHashes.sort(CompareArr);
|
ArrHashes.sort(CompareArr);
|
||||||
var Buf = [];
|
var Buf = [];
|
||||||
for (var i = 0; i < ArrHashes.length; i++) {
|
for(var i = 0; i < ArrHashes.length; i++)
|
||||||
|
{
|
||||||
var Value = ArrHashes[i];
|
var Value = ArrHashes[i];
|
||||||
for (var n = 0; n < Value.length; n++)
|
for(var n = 0; n < Value.length; n++)
|
||||||
Buf.push(Value[n]);
|
Buf.push(Value[n]);
|
||||||
}
|
}
|
||||||
if (Buf.length === 0)
|
if(Buf.length === 0)
|
||||||
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
else
|
else
|
||||||
if (Buf.length === 32)
|
if(Buf.length === 32)
|
||||||
return Buf;
|
return Buf;
|
||||||
var Hash = shaarr(Buf);
|
var Hash = shaarr(Buf);
|
||||||
return Hash;
|
return Hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetArrFromValue(Num) {
|
function GetArrFromValue(Num)
|
||||||
|
{
|
||||||
var arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
var arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
arr[0] = Num & 0xFF;
|
arr[0] = Num & 0xFF;
|
||||||
arr[1] = (Num >>> 8) & 0xFF;
|
arr[1] = (Num >>> 8) & 0xFF;
|
||||||
@ -191,44 +218,54 @@ function GetArrFromValue(Num) {
|
|||||||
return arr;
|
return arr;
|
||||||
};
|
};
|
||||||
|
|
||||||
function LoadLib(Path) {
|
function LoadLib(Path)
|
||||||
|
{
|
||||||
var item = document.createElement('script');
|
var item = document.createElement('script');
|
||||||
item.type = "text/javascript";
|
item.type = "text/javascript";
|
||||||
item.src = Path;
|
item.src = Path;
|
||||||
document.getElementsByTagName('head')[0].appendChild(item);
|
document.getElementsByTagName('head')[0].appendChild(item);
|
||||||
};
|
};
|
||||||
|
|
||||||
function IsMS() {
|
function IsMS()
|
||||||
|
{
|
||||||
var ua = window.navigator.userAgent;
|
var ua = window.navigator.userAgent;
|
||||||
var msie = ua.indexOf("MSIE ");
|
var msie = ua.indexOf("MSIE ");
|
||||||
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
|
if(msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function LoadSignLib() {
|
function LoadSignLib()
|
||||||
if (window.SignLib)
|
{
|
||||||
return;
|
if(window.SignLib)
|
||||||
|
return ;
|
||||||
LoadLib("./JS/sign-lib-min.js");
|
LoadLib("./JS/sign-lib-min.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
function ComputeSecretWithCheck(PubKey, StrPrivKey, F) {
|
function ComputeSecretWithCheck(PubKey,StrPrivKey,F)
|
||||||
if (!window.SignLib) {
|
{
|
||||||
|
if(!window.SignLib)
|
||||||
|
{
|
||||||
SetError("Error - SignLib not installed");
|
SetError("Error - SignLib not installed");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
if (!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64) {
|
if(!IsHexStr(StrPrivKey) || StrPrivKey.length !== 64)
|
||||||
|
{
|
||||||
SetError("Error set PrivKey");
|
SetError("Error set PrivKey");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var PrivKey = Buffer.from(GetArrFromHex(StrPrivKey));
|
var PrivKey = Buffer.from(GetArrFromHex(StrPrivKey));
|
||||||
if (typeof PubKey === "string") {
|
if(typeof PubKey === "string")
|
||||||
if (!IsHexStr(PubKey) || PubKey.length !== 66) {
|
{
|
||||||
|
if(!IsHexStr(PubKey) || PubKey.length !== 66)
|
||||||
|
{
|
||||||
SetError("Error PubKey");
|
SetError("Error PubKey");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
PubKey = Buffer.from(GetArrFromHex(PubKey));
|
PubKey = Buffer.from(GetArrFromHex(PubKey));
|
||||||
}
|
}
|
||||||
@ -236,29 +273,35 @@ function ComputeSecretWithCheck(PubKey, StrPrivKey, F) {
|
|||||||
F(sha3(Result));
|
F(sha3(Result));
|
||||||
};
|
};
|
||||||
|
|
||||||
function ComputeSecret(Account, PubKey, F) {
|
function ComputeSecret(Account,PubKey,F)
|
||||||
if (GetPrivKey()) {
|
{
|
||||||
|
if(GetPrivKey())
|
||||||
|
{
|
||||||
ComputeSecretWithCheck(PubKey, GetPrivKey(), F);
|
ComputeSecretWithCheck(PubKey, GetPrivKey(), F);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
GetData("GetWalletInfo", { Account: Account }, function(Data) {
|
{
|
||||||
if (!Data || !Data.result)
|
GetData("GetWalletInfo", {Account:Account}, function (Data)
|
||||||
return;
|
{
|
||||||
|
if(!Data || !Data.result)
|
||||||
|
return ;
|
||||||
ComputeSecretWithCheck(PubKey, Data.PrivateKey, F);
|
ComputeSecretWithCheck(PubKey, Data.PrivateKey, F);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function Encrypt(ArrSecret, StartEncrypt, StrName, StrValue) {
|
function Encrypt(ArrSecret,StartEncrypt,StrName,StrValue)
|
||||||
|
{
|
||||||
var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt));
|
var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt));
|
||||||
var Arr = toUTF8Array(StrValue);
|
var Arr = toUTF8Array(StrValue);
|
||||||
return DoSecret(Arr, arrRnd);
|
return DoSecret(Arr, arrRnd);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Decrypt(ArrSecret, StartEncrypt, StrName, Arr) {
|
function Decrypt(ArrSecret,StartEncrypt,StrName,Arr)
|
||||||
if (!ArrSecret)
|
{
|
||||||
|
if(!ArrSecret)
|
||||||
return "".padEnd(Arr.length / 2, ".");
|
return "".padEnd(Arr.length / 2, ".");
|
||||||
if (typeof Arr === "string")
|
if(typeof Arr === "string")
|
||||||
Arr = GetArrFromHex(Arr);
|
Arr = GetArrFromHex(Arr);
|
||||||
var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt));
|
var arrRnd = sha3arr2(ArrSecret, sha3(StrName + StartEncrypt));
|
||||||
var Arr2 = DoSecret(Arr, arrRnd);
|
var Arr2 = DoSecret(Arr, arrRnd);
|
||||||
@ -266,15 +309,18 @@ function Decrypt(ArrSecret, StartEncrypt, StrName, Arr) {
|
|||||||
return Str;
|
return Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function DoSecret(Arr, arrRnd) {
|
function DoSecret(Arr,arrRnd)
|
||||||
|
{
|
||||||
var Arr2 = [];
|
var Arr2 = [];
|
||||||
var CryptID = 0;
|
var CryptID = 0;
|
||||||
var Pos = 0;
|
var Pos = 0;
|
||||||
while (Pos < Arr.length) {
|
while(Pos < Arr.length)
|
||||||
|
{
|
||||||
CryptID++;
|
CryptID++;
|
||||||
WriteUintToArrOnPos(arrRnd, CryptID, 0);
|
WriteUintToArrOnPos(arrRnd, CryptID, 0);
|
||||||
var CurBuf = sha3(arrRnd);
|
var CurBuf = sha3(arrRnd);
|
||||||
for (var i = 0; i < 32 && Pos < Arr.length; i++ , Pos++) {
|
for(var i = 0; i < 32 && Pos < Arr.length; i++, Pos++)
|
||||||
|
{
|
||||||
Arr2[Pos] = Arr[Pos] ^ CurBuf[i];
|
Arr2[Pos] = Arr[Pos] ^ CurBuf[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,22 +328,26 @@ function DoSecret(Arr, arrRnd) {
|
|||||||
};
|
};
|
||||||
var glEncryptInit = 0;
|
var glEncryptInit = 0;
|
||||||
|
|
||||||
function EncryptInit() {
|
function EncryptInit()
|
||||||
|
{
|
||||||
glEncryptInit++;
|
glEncryptInit++;
|
||||||
var Time = Date.now() - new Date(2019, 0, 1);
|
var Time = Date.now() - new Date(2019, 0, 1);
|
||||||
return Math.floor(Time * 100 + Math.random() * 100) * 100 + glEncryptInit;
|
return Math.floor(Time * 100 + Math.random() * 100) * 100 + glEncryptInit;
|
||||||
};
|
};
|
||||||
|
|
||||||
function EncryptID(ArrSecret, StartEncrypt, id) {
|
function EncryptID(ArrSecret,StartEncrypt,id)
|
||||||
|
{
|
||||||
var Value = $(id).value;
|
var Value = $(id).value;
|
||||||
Value = Value.padEnd(Value.length + random(5), " ");
|
Value = Value.padEnd(Value.length + random(5), " ");
|
||||||
return GetHexFromArr(Encrypt(ArrSecret, StartEncrypt, id, Value));
|
return GetHexFromArr(Encrypt(ArrSecret, StartEncrypt, id, Value));
|
||||||
};
|
};
|
||||||
|
|
||||||
function EncryptFields(ArrSecret, Params, ArrName) {
|
function EncryptFields(ArrSecret,Params,ArrName)
|
||||||
if (!Params.Crypto)
|
{
|
||||||
|
if(!Params.Crypto)
|
||||||
Params.Crypto = EncryptInit();
|
Params.Crypto = EncryptInit();
|
||||||
for (var i = 0; i < ArrName.length; i++) {
|
for(var i = 0; i < ArrName.length; i++)
|
||||||
|
{
|
||||||
var Name = ArrName[i];
|
var Name = ArrName[i];
|
||||||
var Value = Params[Name];
|
var Value = Params[Name];
|
||||||
Value = Value.padEnd(Value.length + random(5), " ");
|
Value = Value.padEnd(Value.length + random(5), " ");
|
||||||
@ -305,13 +355,17 @@ function EncryptFields(ArrSecret, Params, ArrName) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function DecryptFields(ArrSecret, Params, ArrName) {
|
function DecryptFields(ArrSecret,Params,ArrName)
|
||||||
for (var i = 0; i < ArrName.length; i++) {
|
{
|
||||||
|
for(var i = 0; i < ArrName.length; i++)
|
||||||
|
{
|
||||||
var Name = ArrName[i];
|
var Name = ArrName[i];
|
||||||
if (Params[Name]) {
|
if(Params[Name])
|
||||||
|
{
|
||||||
Params[Name] = Decrypt(ArrSecret, Params.Crypto, Name, GetArrFromHex(Params[Name]));
|
Params[Name] = Decrypt(ArrSecret, Params.Crypto, Name, GetArrFromHex(Params[Name]));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Params[Name] = "";
|
Params[Name] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,147 +9,181 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function SendPay(Data) {
|
function SendPay(Data)
|
||||||
|
{
|
||||||
Data.cmd = "pay";
|
Data.cmd = "pay";
|
||||||
SendData(Data);
|
SendData(Data);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetStorage(Key, Value) {
|
function SetStorage(Key,Value)
|
||||||
var Data = { cmd: "setstorage", Key: Key, Value: Value };
|
{
|
||||||
|
var Data = {cmd:"setstorage", Key:Key, Value:Value};
|
||||||
SendData(Data);
|
SendData(Data);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetStorage(Key, F) {
|
function GetStorage(Key,F)
|
||||||
var Data = { cmd: "getstorage", Key: Key };
|
{
|
||||||
|
var Data = {cmd:"getstorage", Key:Key};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetCommon(Key, Value) {
|
function SetCommon(Key,Value)
|
||||||
var Data = { cmd: "setcommon", Key: Key, Value: Value };
|
{
|
||||||
|
var Data = {cmd:"setcommon", Key:Key, Value:Value};
|
||||||
SendData(Data);
|
SendData(Data);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetCommon(Key, F) {
|
function GetCommon(Key,F)
|
||||||
var Data = { cmd: "getcommon", Key: Key };
|
{
|
||||||
|
var Data = {cmd:"getcommon", Key:Key};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetInfo(F, bUseCache) {
|
function GetInfo(F,bUseCache)
|
||||||
var Data = { cmd: "DappInfo", AllAccounts: ALL_ACCOUNTS, AllData: !bUseCache };
|
{
|
||||||
|
var Data = {cmd:"DappInfo", AllAccounts:ALL_ACCOUNTS, AllData:!bUseCache};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Call(Account, MethodName, Params, F) {
|
function Call(Account,MethodName,Params,F)
|
||||||
var Data = { cmd: "DappCall", MethodName: MethodName, Params: Params, Account: Account };
|
{
|
||||||
|
var Data = {cmd:"DappCall", MethodName:MethodName, Params:Params, Account:Account};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendCall(Account, MethodName, Params, FromNum) {
|
function SendCall(Account,MethodName,Params,FromNum)
|
||||||
if (!INFO.WalletCanSign) {
|
{
|
||||||
|
if(!INFO.WalletCanSign)
|
||||||
|
{
|
||||||
SetError("Pls, open wallet");
|
SetError("Pls, open wallet");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
var Data = { cmd: "DappSendCall", MethodName: MethodName, Params: Params, Account: Account, FromNum: FromNum };
|
var Data = {cmd:"DappSendCall", MethodName:MethodName, Params:Params, Account:Account, FromNum:FromNum};
|
||||||
SendData(Data);
|
SendData(Data);
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetWalletAccounts(F) {
|
function GetWalletAccounts(F)
|
||||||
var Data = { cmd: "DappWalletList" };
|
{
|
||||||
|
var Data = {cmd:"DappWalletList"};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetAccountList(Params, F) {
|
function GetAccountList(Params,F)
|
||||||
var Data = { cmd: "DappAccountList", Params: Params };
|
{
|
||||||
|
var Data = {cmd:"DappAccountList", Params:Params};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetSmartList(Params, F) {
|
function GetSmartList(Params,F)
|
||||||
var Data = { cmd: "DappSmartList", Params: Params };
|
{
|
||||||
|
var Data = {cmd:"DappSmartList", Params:Params};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetBlockList(Params, F) {
|
function GetBlockList(Params,F)
|
||||||
var Data = { cmd: "DappBlockList", Params: Params };
|
{
|
||||||
|
var Data = {cmd:"DappBlockList", Params:Params};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetTransactionList(Params, F) {
|
function GetTransactionList(Params,F)
|
||||||
var Data = { cmd: "DappTransactionList", Params: Params };
|
{
|
||||||
|
var Data = {cmd:"DappTransactionList", Params:Params};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function DappSmartHTMLFile(Smart, F) {
|
function DappSmartHTMLFile(Smart,F)
|
||||||
var Data = { cmd: "DappSmartHTMLFile", Params: { Smart: Smart } };
|
{
|
||||||
|
var Data = {cmd:"DappSmartHTMLFile", Params:{Smart:Smart}};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function DappBlockFile(BlockNum, TrNum, F) {
|
function DappBlockFile(BlockNum,TrNum,F)
|
||||||
var Data = { cmd: "DappBlockFile", Params: { BlockNum: BlockNum, TrNum: TrNum } };
|
{
|
||||||
|
var Data = {cmd:"DappBlockFile", Params:{BlockNum:BlockNum, TrNum:TrNum}};
|
||||||
SendData(Data, F);
|
SendData(Data, F);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetStatus(Str) {
|
function SetStatus(Str)
|
||||||
SendData({ cmd: "SetStatus", Message: Str });
|
{
|
||||||
|
SendData({cmd:"SetStatus", Message:Str});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetError(Str) {
|
function SetError(Str)
|
||||||
SendData({ cmd: "SetError", Message: Str });
|
{
|
||||||
|
SendData({cmd:"SetError", Message:Str});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetLocationPath(Str) {
|
function SetLocationPath(Str)
|
||||||
SendData({ cmd: "SetLocationHash", Message: Str });
|
{
|
||||||
|
SendData({cmd:"SetLocationHash", Message:Str});
|
||||||
};
|
};
|
||||||
|
|
||||||
function CreateNewAccount(Currency) {
|
function CreateNewAccount(Currency)
|
||||||
SendData({ cmd: "CreateNewAccount", Currency: Currency });
|
{
|
||||||
|
SendData({cmd:"CreateNewAccount", Currency:Currency});
|
||||||
};
|
};
|
||||||
|
|
||||||
function OpenLink(Str) {
|
function OpenLink(Str)
|
||||||
SendData({ cmd: "OpenLink", Message: Str });
|
{
|
||||||
|
SendData({cmd:"OpenLink", Message:Str});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetMobileMode() {
|
function SetMobileMode()
|
||||||
SendData({ cmd: "SetMobileMode" });
|
{
|
||||||
|
SendData({cmd:"SetMobileMode"});
|
||||||
};
|
};
|
||||||
|
|
||||||
function ComputeSecret(PubKey, F, Account) {
|
function ComputeSecret(PubKey,F,Account)
|
||||||
if (!INFO.WalletCanSign) {
|
{
|
||||||
|
if(!INFO.WalletCanSign)
|
||||||
|
{
|
||||||
SetError("Pls, open wallet");
|
SetError("Pls, open wallet");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!Account && USER_ACCOUNT.length)
|
if(!Account && USER_ACCOUNT.length)
|
||||||
Account = USER_ACCOUNT[0].Num;
|
Account = USER_ACCOUNT[0].Num;
|
||||||
if (typeof PubKey === "number") {
|
if(typeof PubKey === "number")
|
||||||
|
{
|
||||||
var AccNum = PubKey;
|
var AccNum = PubKey;
|
||||||
GetAccountList({ StartNum: AccNum, CountNum: 1 }, function(Err, Arr) {
|
GetAccountList({StartNum:AccNum, CountNum:1}, function (Err,Arr)
|
||||||
if (Err) {
|
{
|
||||||
|
if(Err)
|
||||||
|
{
|
||||||
SetError(Err);
|
SetError(Err);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
SendData({ cmd: "ComputeSecret", Account: Account, PubKey: Arr[0].PubKey.data }, F);
|
{
|
||||||
|
SendData({cmd:"ComputeSecret", Account:Account, PubKey:Arr[0].PubKey.data}, F);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
SendData({ cmd: "ComputeSecret", Account: Account, PubKey: PubKey }, F);
|
{
|
||||||
|
SendData({cmd:"ComputeSecret", Account:Account, PubKey:PubKey}, F);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function CheckInstall() {
|
function CheckInstall()
|
||||||
SendData({ cmd: "CheckInstall" });
|
{
|
||||||
|
SendData({cmd:"CheckInstall"});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendTransaction(Body, TR, SumPow, F) {
|
function SendTransaction(Body,TR,SumPow,F)
|
||||||
|
{
|
||||||
SetError("Cannt SEND TR: " + JSON.stringify(TR));
|
SetError("Cannt SEND TR: " + JSON.stringify(TR));
|
||||||
};
|
};
|
||||||
|
|
||||||
function CurrencyName(Num) {
|
function CurrencyName(Num)
|
||||||
|
{
|
||||||
var Name = MapCurrency[Num];
|
var Name = MapCurrency[Num];
|
||||||
if (!Name) {
|
if(!Name)
|
||||||
GetSmartList({ StartNum: Num, CountNum: 1, TokenGenerate: 1 }, function(Err, Arr) {
|
{
|
||||||
if (Err || Arr.length === 0)
|
GetSmartList({StartNum:Num, CountNum:1, TokenGenerate:1}, function (Err,Arr)
|
||||||
return;
|
{
|
||||||
|
if(Err || Arr.length === 0)
|
||||||
|
return ;
|
||||||
var Smart = Arr[0];
|
var Smart = Arr[0];
|
||||||
Name = GetTokenName(Smart.Num, Smart.ShortName);
|
Name = GetTokenName(Smart.Num, Smart.ShortName);
|
||||||
MapCurrency[Smart.Num] = Name;
|
MapCurrency[Smart.Num] = Name;
|
||||||
@ -160,15 +194,19 @@ function CurrencyName(Num) {
|
|||||||
};
|
};
|
||||||
var SendCountUpdate = 0;
|
var SendCountUpdate = 0;
|
||||||
|
|
||||||
function FindAllCurrency() {
|
function FindAllCurrency()
|
||||||
|
{
|
||||||
SendCountUpdate++;
|
SendCountUpdate++;
|
||||||
GetSmartList({ StartNum: 8, CountNum: 100, TokenGenerate: 1 }, function(Err, Arr) {
|
GetSmartList({StartNum:8, CountNum:100, TokenGenerate:1}, function (Err,Arr)
|
||||||
|
{
|
||||||
SendCountUpdate--;
|
SendCountUpdate--;
|
||||||
if (Err)
|
if(Err)
|
||||||
return;
|
return ;
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
var Smart = Arr[i];
|
var Smart = Arr[i];
|
||||||
if (!MapCurrency[Smart.Num]) {
|
if(!MapCurrency[Smart.Num])
|
||||||
|
{
|
||||||
var Name = GetTokenName(Smart.Num, Smart.ShortName);
|
var Name = GetTokenName(Smart.Num, Smart.ShortName);
|
||||||
MapCurrency[Smart.Num] = Name;
|
MapCurrency[Smart.Num] = Name;
|
||||||
}
|
}
|
||||||
@ -176,50 +214,62 @@ function FindAllCurrency() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetFilePath(Path) {
|
function GetFilePath(Path)
|
||||||
if (window.PROTOCOL_SERVER_PATH && Path.indexOf("file/")) {
|
{
|
||||||
if (Path.substr(0, 1) !== "/")
|
if(window.PROTOCOL_SERVER_PATH && Path.indexOf("file/"))
|
||||||
|
{
|
||||||
|
if(Path.substr(0, 1) !== "/")
|
||||||
Path = "/" + Path;
|
Path = "/" + Path;
|
||||||
Path = window.PROTOCOL_SERVER_PATH + Path;
|
Path = window.PROTOCOL_SERVER_PATH + Path;
|
||||||
}
|
}
|
||||||
return Path;
|
return Path;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetParamsFromPath(Name) {
|
function GetParamsFromPath(Name)
|
||||||
if (!OPEN_PATH)
|
{
|
||||||
|
if(!OPEN_PATH)
|
||||||
return undefined;
|
return undefined;
|
||||||
var arr = OPEN_PATH.split("&");
|
var arr = OPEN_PATH.split("&");
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
if (arr[i].indexOf(Name + "=") === 0) {
|
{
|
||||||
|
if(arr[i].indexOf(Name + "=") === 0)
|
||||||
|
{
|
||||||
return arr[i].split("=")[1];
|
return arr[i].split("=")[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetState(AccNum, F, FErr) {
|
function GetState(AccNum,F,FErr)
|
||||||
|
{
|
||||||
SendCountUpdate++;
|
SendCountUpdate++;
|
||||||
GetAccountList({ StartNum: AccNum, CountNum: 1 }, function(Err, Arr) {
|
GetAccountList({StartNum:AccNum, CountNum:1}, function (Err,Arr)
|
||||||
|
{
|
||||||
SendCountUpdate--;
|
SendCountUpdate--;
|
||||||
if (!Err && Arr.length) {
|
if(!Err && Arr.length)
|
||||||
|
{
|
||||||
var Item = Arr[0].SmartState;
|
var Item = Arr[0].SmartState;
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
F(Item);
|
F(Item);
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FErr) {
|
if(FErr)
|
||||||
|
{
|
||||||
FErr();
|
FErr();
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var glMapF = {};
|
var glMapF = {};
|
||||||
var glKeyF = 0;
|
var glKeyF = 0;
|
||||||
|
|
||||||
function SendData(Data, F) {
|
function SendData(Data,F)
|
||||||
if (!window.parent)
|
{
|
||||||
return;
|
if(!window.parent)
|
||||||
if (F) {
|
return ;
|
||||||
|
if(F)
|
||||||
|
{
|
||||||
glKeyF++;
|
glKeyF++;
|
||||||
Data.CallID = glKeyF;
|
Data.CallID = glKeyF;
|
||||||
glMapF[glKeyF] = F;
|
glMapF[glKeyF] = F;
|
||||||
@ -227,18 +277,22 @@ function SendData(Data, F) {
|
|||||||
window.parent.postMessage(Data, "*");
|
window.parent.postMessage(Data, "*");
|
||||||
};
|
};
|
||||||
|
|
||||||
function OnMessage(event) {
|
function OnMessage(event)
|
||||||
|
{
|
||||||
var Data = event.data;
|
var Data = event.data;
|
||||||
if (!Data || typeof Data !== "object")
|
if(!Data || typeof Data !== "object")
|
||||||
return;
|
return ;
|
||||||
var CallID = Data.CallID;
|
var CallID = Data.CallID;
|
||||||
var cmd = Data.cmd;
|
var cmd = Data.cmd;
|
||||||
if (CallID) {
|
if(CallID)
|
||||||
|
{
|
||||||
var F = glMapF[CallID];
|
var F = glMapF[CallID];
|
||||||
if (F) {
|
if(F)
|
||||||
|
{
|
||||||
delete Data.CallID;
|
delete Data.CallID;
|
||||||
delete Data.cmd;
|
delete Data.cmd;
|
||||||
switch (cmd) {
|
switch(cmd)
|
||||||
|
{
|
||||||
case "getstorage":
|
case "getstorage":
|
||||||
case "getcommon":
|
case "getcommon":
|
||||||
F(Data.Key, Data.Value);
|
F(Data.Key, Data.Value);
|
||||||
@ -269,40 +323,49 @@ function OnMessage(event) {
|
|||||||
delete glMapF[CallID];
|
delete glMapF[CallID];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
switch (cmd) {
|
{
|
||||||
|
switch(cmd)
|
||||||
|
{
|
||||||
case "History":
|
case "History":
|
||||||
var eventEvent = new CustomEvent("History", { detail: Data });
|
var eventEvent = new CustomEvent("History", {detail:Data});
|
||||||
window.dispatchEvent(eventEvent);
|
window.dispatchEvent(eventEvent);
|
||||||
break;
|
break;
|
||||||
case "OnEvent":
|
case "OnEvent":
|
||||||
if (window.OnEvent) {
|
if(window.OnEvent)
|
||||||
|
{
|
||||||
window.OnEvent(Data);
|
window.OnEvent(Data);
|
||||||
}
|
}
|
||||||
var eventEvent = new CustomEvent("Event", { detail: Data });
|
var eventEvent = new CustomEvent("Event", {detail:Data});
|
||||||
window.dispatchEvent(eventEvent);
|
window.dispatchEvent(eventEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function OpenRefFile(Str) {
|
function OpenRefFile(Str)
|
||||||
|
{
|
||||||
var Param = ParseFileName(Str);
|
var Param = ParseFileName(Str);
|
||||||
if (Param.BlockNum)
|
if(Param.BlockNum)
|
||||||
DappBlockFile(Param.BlockNum, Param.TrNum, function(Err, Body) {
|
DappBlockFile(Param.BlockNum, Param.TrNum, function (Err,Body)
|
||||||
|
{
|
||||||
document.write(Body);
|
document.write(Body);
|
||||||
});
|
});
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
OpenLink(Str);
|
OpenLink(Str);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SaveToStorageByArr(Arr) {
|
function SaveToStorageByArr(Arr)
|
||||||
|
{
|
||||||
SetStorage("VerSave", "1");
|
SetStorage("VerSave", "1");
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
var name = Arr[i];
|
var name = Arr[i];
|
||||||
var Item = $(name);
|
var Item = $(name);
|
||||||
if (Item) {
|
if(Item)
|
||||||
if (Item.type === "checkbox")
|
{
|
||||||
|
if(Item.type === "checkbox")
|
||||||
SetStorage(name, 0 + Item.checked);
|
SetStorage(name, 0 + Item.checked);
|
||||||
else
|
else
|
||||||
SetStorage(name, Item.value);
|
SetStorage(name, Item.value);
|
||||||
@ -310,74 +373,94 @@ function SaveToStorageByArr(Arr) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function LoadFromStorageByArr(Arr, F, bAll) {
|
function LoadFromStorageByArr(Arr,F,bAll)
|
||||||
GetStorage("VerSave", function(Key, Value) {
|
{
|
||||||
if (Value === "1") {
|
GetStorage("VerSave", function (Key,Value)
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
{
|
||||||
if (i === Arr.length - 1)
|
if(Value === "1")
|
||||||
|
{
|
||||||
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
|
if(i === Arr.length - 1)
|
||||||
LoadFromStorageById(Arr[i], F);
|
LoadFromStorageById(Arr[i], F);
|
||||||
else
|
else
|
||||||
LoadFromStorageById(Arr[i]);
|
LoadFromStorageById(Arr[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bAll && F)
|
if(bAll && F)
|
||||||
F(0);
|
F(0);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function LoadFromStorageById(Name, F) {
|
function LoadFromStorageById(Name,F)
|
||||||
GetStorage(Name, function(Key, Value) {
|
{
|
||||||
|
GetStorage(Name, function (Key,Value)
|
||||||
|
{
|
||||||
var Item = document.getElementById(Name);
|
var Item = document.getElementById(Name);
|
||||||
if (Item) {
|
if(Item)
|
||||||
if (Item.type === "checkbox")
|
{
|
||||||
|
if(Item.type === "checkbox")
|
||||||
Item.checked = parseInt(Value);
|
Item.checked = parseInt(Value);
|
||||||
else
|
else
|
||||||
Item.value = Value;
|
Item.value = Value;
|
||||||
}
|
}
|
||||||
if (F)
|
if(F)
|
||||||
F(Key, Value);
|
F(Key, Value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var SendCountDappParams = 0;
|
var SendCountDappParams = 0;
|
||||||
|
|
||||||
function GetDappParams(BNum, TrNum, F, bAll) {
|
function GetDappParams(BNum,TrNum,F,bAll)
|
||||||
if (!BNum) {
|
{
|
||||||
if (bAll)
|
if(!BNum)
|
||||||
|
{
|
||||||
|
if(bAll)
|
||||||
F();
|
F();
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
SendCountDappParams++;
|
SendCountDappParams++;
|
||||||
DappBlockFile(BNum, TrNum, function(Err, Data) {
|
DappBlockFile(BNum, TrNum, function (Err,Data)
|
||||||
|
{
|
||||||
SendCountDappParams--;
|
SendCountDappParams--;
|
||||||
if (!Err && Data.Type === 135) {
|
if(!Err && Data.Type === 135)
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var Params = JSON.parse(Data.Params);
|
var Params = JSON.parse(Data.Params);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
if (Params) {
|
if(Params)
|
||||||
|
{
|
||||||
F(Params, Data.MethodName, Data.FromNum);
|
F(Params, Data.MethodName, Data.FromNum);
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bAll)
|
if(bAll)
|
||||||
F();
|
F();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function ()
|
||||||
|
{
|
||||||
var refs = document.getElementsByTagName("A");
|
var refs = document.getElementsByTagName("A");
|
||||||
for (var i = 0, L = refs.length; i < L; i++) {
|
for(var i = 0, L = refs.length; i < L; i++)
|
||||||
if (refs[i].href.indexOf("/file/") >= 0) {
|
{
|
||||||
refs[i].onclick = function() {
|
if(refs[i].href.indexOf("/file/") >= 0)
|
||||||
|
{
|
||||||
|
refs[i].onclick = function ()
|
||||||
|
{
|
||||||
OpenRefFile(this.href);
|
OpenRefFile(this.href);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (window.addEventListener) {
|
if(window.addEventListener)
|
||||||
|
{
|
||||||
window.addEventListener("message", OnMessage);
|
window.addEventListener("message", OnMessage);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
window.attachEvent("onmessage", OnMessage);
|
window.attachEvent("onmessage", OnMessage);
|
||||||
}
|
}
|
||||||
var SMART = {}, BASE_ACCOUNT = {}, INFO = {}, USER_ACCOUNT = [], USER_ACCOUNT_MAP = {}, OPEN_PATH = "", ACCOUNT_OPEN_NUM = 0;
|
var SMART = {}, BASE_ACCOUNT = {}, INFO = {}, USER_ACCOUNT = [], USER_ACCOUNT_MAP = {}, OPEN_PATH = "", ACCOUNT_OPEN_NUM = 0;
|
||||||
@ -385,10 +468,13 @@ var ALL_ACCOUNTS = 0;
|
|||||||
var WasStartInit = 0, WasStartInit2 = 0;
|
var WasStartInit = 0, WasStartInit2 = 0;
|
||||||
var eventInfo = new Event("UpdateInfo");
|
var eventInfo = new Event("UpdateInfo");
|
||||||
|
|
||||||
function UpdateDappInfo() {
|
function UpdateDappInfo()
|
||||||
GetInfo(function(Err, Data) {
|
{
|
||||||
if (Err) {
|
GetInfo(function (Err,Data)
|
||||||
return;
|
{
|
||||||
|
if(Err)
|
||||||
|
{
|
||||||
|
return ;
|
||||||
}
|
}
|
||||||
INFO = Data;
|
INFO = Data;
|
||||||
SMART = Data.Smart;
|
SMART = Data.Smart;
|
||||||
@ -398,32 +484,37 @@ function UpdateDappInfo() {
|
|||||||
SetBlockChainConstant(Data);
|
SetBlockChainConstant(Data);
|
||||||
USER_ACCOUNT = Data.ArrWallet;
|
USER_ACCOUNT = Data.ArrWallet;
|
||||||
USER_ACCOUNT_MAP = {};
|
USER_ACCOUNT_MAP = {};
|
||||||
for (var i = 0; i < USER_ACCOUNT.length; i++)
|
for(var i = 0; i < USER_ACCOUNT.length; i++)
|
||||||
USER_ACCOUNT_MAP[USER_ACCOUNT[i].Num] = USER_ACCOUNT[i];
|
USER_ACCOUNT_MAP[USER_ACCOUNT[i].Num] = USER_ACCOUNT[i];
|
||||||
if (window.OnInit && !WasStartInit) {
|
if(window.OnInit && !WasStartInit)
|
||||||
|
{
|
||||||
WasStartInit = 1;
|
WasStartInit = 1;
|
||||||
window.OnInit(1);
|
window.OnInit(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (window.OnUpdateInfo) {
|
if(window.OnUpdateInfo)
|
||||||
|
{
|
||||||
window.OnUpdateInfo();
|
window.OnUpdateInfo();
|
||||||
}
|
}
|
||||||
if (!WasStartInit2) {
|
if(!WasStartInit2)
|
||||||
|
{
|
||||||
WasStartInit2 = 1;
|
WasStartInit2 = 1;
|
||||||
var eventInit = new Event("Init");
|
var eventInit = new Event("Init");
|
||||||
window.dispatchEvent(eventInit);
|
window.dispatchEvent(eventInit);
|
||||||
}
|
}
|
||||||
window.dispatchEvent(eventInfo);
|
window.dispatchEvent(eventInfo);
|
||||||
if (Data.ArrEvent)
|
if(Data.ArrEvent)
|
||||||
for (var i = 0; i < Data.ArrEvent.length; i++) {
|
for(var i = 0; i < Data.ArrEvent.length; i++)
|
||||||
|
{
|
||||||
var Item = Data.ArrEvent[i];
|
var Item = Data.ArrEvent[i];
|
||||||
Item.cmd = "OnEvent";
|
Item.cmd = "OnEvent";
|
||||||
OnMessage({ data: Item });
|
OnMessage({data:Item});
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
};
|
};
|
||||||
window.addEventListener('load', function() {
|
window.addEventListener('load', function ()
|
||||||
if (!window.sha3)
|
{
|
||||||
|
if(!window.sha3)
|
||||||
LoadLib("./JS/sha3.js");
|
LoadLib("./JS/sha3.js");
|
||||||
UpdateDappInfo();
|
UpdateDappInfo();
|
||||||
setInterval(UpdateDappInfo, 1000);
|
setInterval(UpdateDappInfo, 1000);
|
||||||
|
@ -11,67 +11,80 @@
|
|||||||
var DiagramMap = {};
|
var DiagramMap = {};
|
||||||
var DiagramMapId = {};
|
var DiagramMapId = {};
|
||||||
var LMouseOn = false;
|
var LMouseOn = false;
|
||||||
if (!window.toStaticHTML)
|
if(!window.toStaticHTML)
|
||||||
toStaticHTML = function(Str) {
|
toStaticHTML = function (Str)
|
||||||
|
{
|
||||||
return Str;
|
return Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function Rigth(Str, Count) {
|
function Rigth(Str,Count)
|
||||||
if (Str.length < Count)
|
{
|
||||||
|
if(Str.length < Count)
|
||||||
return Str;
|
return Str;
|
||||||
else
|
else
|
||||||
return Str.substr(Str.length - Count);
|
return Str.substr(Str.length - Count);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetHTMLDiagramItem(Item, width) {
|
function SetHTMLDiagramItem(Item,width)
|
||||||
|
{
|
||||||
Item.mouseX = width - 50;
|
Item.mouseX = width - 50;
|
||||||
if (Item.Extern || Item.Delete)
|
if(Item.Extern || Item.Delete)
|
||||||
return;
|
return ;
|
||||||
var MinHeight = 80;
|
var MinHeight = 80;
|
||||||
if (!Item.id)
|
if(!Item.id)
|
||||||
Item.id = "DgrmId" + Item.num;
|
Item.id = "DgrmId" + Item.num;
|
||||||
DiagramMap[Item.name] = Item;
|
DiagramMap[Item.name] = Item;
|
||||||
DiagramMapId[Item.id] = Item;
|
DiagramMapId[Item.id] = Item;
|
||||||
if (Item.isLine) {
|
if(Item.isLine)
|
||||||
if (Item.text)
|
{
|
||||||
|
if(Item.text)
|
||||||
Str = "<BR><B>" + Item.text + '</B><INPUT type="button" class="delete" onclick="DeleteDiagram(\'' + Item.id + '\')" value="X">';
|
Str = "<BR><B>" + Item.text + '</B><INPUT type="button" class="delete" onclick="DeleteDiagram(\'' + Item.id + '\')" value="X">';
|
||||||
else
|
else
|
||||||
Str = "<HR>";
|
Str = "<HR>";
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
Str = '<BR><DIV>' + Item.text + '<INPUT type="button" class="delete" onclick="DeleteDiagram(\'' + Item.id + '\')" value="X"></DIV>\
|
{
|
||||||
|
Str = '<BR><DIV>' + Item.text + '<INPUT type="button" class="delete" onclick="DeleteDiagram(\'' + Item.id + '\')" value="X"></DIV>\
|
||||||
<BR><canvas class="DIAGRAM" width="' + width + '" height="' + MinHeight + '" id="' + Item.id + '"></canvas>';
|
<BR><canvas class="DIAGRAM" width="' + width + '" height="' + MinHeight + '" id="' + Item.id + '"></canvas>';
|
||||||
}
|
}
|
||||||
var ElBlock = document.getElementById("B" + Item.id);
|
var ElBlock = document.getElementById("B" + Item.id);
|
||||||
if (ElBlock)
|
if(ElBlock)
|
||||||
ElBlock.innerHTML = toStaticHTML(Str);
|
ElBlock.innerHTML = toStaticHTML(Str);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var diargams = document.getElementById("diargams");
|
var diargams = document.getElementById("diargams");
|
||||||
diargams.innerHTML = toStaticHTML(diargams.innerHTML + "<DIV id='B" + Item.id + "'>" + Str + "</DIV>");
|
diargams.innerHTML = toStaticHTML(diargams.innerHTML + "<DIV id='B" + Item.id + "'>" + Str + "</DIV>");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetDiagramMouseX(event, mode) {
|
function SetDiagramMouseX(event,mode)
|
||||||
if (event.srcElement && event.srcElement.className && event.srcElement.className.indexOf && event.srcElement.className.indexOf("DIAGRAM") >= 0) {
|
{
|
||||||
if (mode === "down")
|
if(event.srcElement && event.srcElement.className && event.srcElement.className.indexOf && event.srcElement.className.indexOf("DIAGRAM") >= 0)
|
||||||
|
{
|
||||||
|
if(mode === "down")
|
||||||
LMouseOn = true;
|
LMouseOn = true;
|
||||||
else
|
else
|
||||||
if (mode === "up")
|
if(mode === "up")
|
||||||
LMouseOn = false;
|
LMouseOn = false;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (LMouseOn === true) {
|
if(LMouseOn === true)
|
||||||
|
{
|
||||||
var obj = event.srcElement;
|
var obj = event.srcElement;
|
||||||
var mouse = getMouse(obj, event);
|
var mouse = getMouse(obj, event);
|
||||||
if (event.ctrlKey === true) {
|
if(event.ctrlKey === true)
|
||||||
for (var key in DiagramMapId) {
|
{
|
||||||
|
for(var key in DiagramMapId)
|
||||||
|
{
|
||||||
var Item = DiagramMapId[key];
|
var Item = DiagramMapId[key];
|
||||||
Item.mouseX = mouse.x;
|
Item.mouseX = mouse.x;
|
||||||
DrawDiagram(Item);
|
DrawDiagram(Item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var Item = DiagramMapId[obj.id];
|
var Item = DiagramMapId[obj.id];
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
Item.mouseX = mouse.x;
|
Item.mouseX = mouse.x;
|
||||||
DrawDiagram(Item);
|
DrawDiagram(Item);
|
||||||
}
|
}
|
||||||
@ -80,11 +93,12 @@ function SetDiagramMouseX(event, mode) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function DrawDiagram(Item) {
|
function DrawDiagram(Item)
|
||||||
if (Item.Delete)
|
{
|
||||||
return;
|
if(Item.Delete)
|
||||||
|
return ;
|
||||||
var arr = Item.arr;
|
var arr = Item.arr;
|
||||||
if (!arr)
|
if(!arr)
|
||||||
arr = Item.ArrList;
|
arr = Item.ArrList;
|
||||||
var arrX = Item.arrX;
|
var arrX = Item.arrX;
|
||||||
var GreenValue = Item.value;
|
var GreenValue = Item.value;
|
||||||
@ -93,69 +107,71 @@ function DrawDiagram(Item) {
|
|||||||
var StartServer = Item.starttime;
|
var StartServer = Item.starttime;
|
||||||
var mouseX = Item.mouseX;
|
var mouseX = Item.mouseX;
|
||||||
var KPrecision = Item.KPrecision;
|
var KPrecision = Item.KPrecision;
|
||||||
if (!KPrecision)
|
if(!KPrecision)
|
||||||
KPrecision = 1;
|
KPrecision = 1;
|
||||||
if (!arr)
|
if(!arr)
|
||||||
return;
|
return ;
|
||||||
var obj = document.getElementById(Item.id);
|
var obj = document.getElementById(Item.id);
|
||||||
var ctx = obj.getContext('2d');
|
var ctx = obj.getContext('2d');
|
||||||
var Left = 50;
|
var Left = 50;
|
||||||
var Top = 11;
|
var Top = 11;
|
||||||
var Button = 15;
|
var Button = 15;
|
||||||
var Right = 50;
|
var Right = 50;
|
||||||
if (Item.fillStyle)
|
if(Item.fillStyle)
|
||||||
ctx.fillStyle = Item.fillStyle;
|
ctx.fillStyle = Item.fillStyle;
|
||||||
else
|
else
|
||||||
ctx.fillStyle = "#FFF";
|
ctx.fillStyle = "#FFF";
|
||||||
ctx.fillRect(0, 0, obj.width, obj.height);
|
ctx.fillRect(0, 0, obj.width, obj.height);
|
||||||
if (arr.length <= 0)
|
if(arr.length <= 0)
|
||||||
return;
|
return ;
|
||||||
var Pow2 = 0;
|
var Pow2 = 0;
|
||||||
if (Item.name.substr(Item.name.length - 2) === "**")
|
if(Item.name.substr(Item.name.length - 2) === "**")
|
||||||
Pow2 = 1;
|
Pow2 = 1;
|
||||||
var MaxValue = arr[0];
|
var MaxValue = arr[0];
|
||||||
var MinValue = arr[0];
|
var MinValue = arr[0];
|
||||||
var AvgValue = 0;
|
var AvgValue = 0;
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
if (arr[i] > MaxValue)
|
{
|
||||||
|
if(arr[i] > MaxValue)
|
||||||
MaxValue = arr[i];
|
MaxValue = arr[i];
|
||||||
if (arr[i] < MinValue)
|
if(arr[i] < MinValue)
|
||||||
MinValue = arr[i];
|
MinValue = arr[i];
|
||||||
if (arr[i])
|
if(arr[i])
|
||||||
AvgValue += arr[i];
|
AvgValue += arr[i];
|
||||||
}
|
}
|
||||||
if (Item.name.substr(0, 4) !== "MAX:" || !Item.AvgValue)
|
if(Item.name.substr(0, 4) !== "MAX:" || !Item.AvgValue)
|
||||||
AvgValue = AvgValue / arr.length;
|
AvgValue = AvgValue / arr.length;
|
||||||
else
|
else
|
||||||
AvgValue = Item.AvgValue;
|
AvgValue = Item.AvgValue;
|
||||||
if (Pow2 && AvgValue)
|
if(Pow2 && AvgValue)
|
||||||
AvgValue = Math.pow(2, AvgValue) / 1000000;
|
AvgValue = Math.pow(2, AvgValue) / 1000000;
|
||||||
if (AvgValue < 50)
|
if(AvgValue < 50)
|
||||||
AvgValue = AvgValue.toFixed(2);
|
AvgValue = AvgValue.toFixed(2);
|
||||||
else
|
else
|
||||||
AvgValue = Math.floor(AvgValue);
|
AvgValue = Math.floor(AvgValue);
|
||||||
if (Item.MaxValue !== undefined)
|
if(Item.MaxValue !== undefined)
|
||||||
MaxValue = Item.MaxValue;
|
MaxValue = Item.MaxValue;
|
||||||
if (Pow2 && MaxValue)
|
if(Pow2 && MaxValue)
|
||||||
MaxValue = Math.pow(2, MaxValue) / 1000000;
|
MaxValue = Math.pow(2, MaxValue) / 1000000;
|
||||||
var HValue = MaxValue;
|
var HValue = MaxValue;
|
||||||
if (HValue <= 0)
|
if(HValue <= 0)
|
||||||
HValue = 1;
|
HValue = 1;
|
||||||
var KX = (obj.width - Left - Right) / arr.length;
|
var KX = (obj.width - Left - Right) / arr.length;
|
||||||
var KY = (obj.height - Top - Button) / HValue;
|
var KY = (obj.height - Top - Button) / HValue;
|
||||||
var DeltaY = 0;
|
var DeltaY = 0;
|
||||||
var bLine = Item.line;
|
var bLine = Item.line;
|
||||||
if (Item.zero) {
|
if(Item.zero)
|
||||||
|
{
|
||||||
bLine = 1;
|
bLine = 1;
|
||||||
DeltaY -= Item.zero * KY;
|
DeltaY -= Item.zero * KY;
|
||||||
MaxValue -= Item.zero;
|
MaxValue -= Item.zero;
|
||||||
AvgValue -= Item.zero;
|
AvgValue -= Item.zero;
|
||||||
}
|
}
|
||||||
MaxValue = Math.floor(MaxValue + 0.5);
|
MaxValue = Math.floor(MaxValue + 0.5);
|
||||||
if (bLine)
|
if(bLine)
|
||||||
ctx.lineWidth = 3;
|
ctx.lineWidth = 3;
|
||||||
else
|
else
|
||||||
if (KX > 1)
|
if(KX > 1)
|
||||||
ctx.lineWidth = KX;
|
ctx.lineWidth = KX;
|
||||||
else
|
else
|
||||||
ctx.lineWidth = 1;
|
ctx.lineWidth = 1;
|
||||||
@ -164,58 +180,69 @@ function DrawDiagram(Item) {
|
|||||||
var mouseValueX = 0;
|
var mouseValueX = 0;
|
||||||
var mouseValue = undefined;
|
var mouseValue = undefined;
|
||||||
var mouseColor = undefined;
|
var mouseColor = undefined;
|
||||||
|
|
||||||
function DrawLines(arr, mode, color) {
|
function DrawLines(arr,mode,color)
|
||||||
|
{
|
||||||
var WasMove0 = 0;
|
var WasMove0 = 0;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(Left, obj.height - Button);
|
ctx.moveTo(Left, obj.height - Button);
|
||||||
ctx.strokeStyle = color;
|
ctx.strokeStyle = color;
|
||||||
var PrevX = undefined;
|
var PrevX = undefined;
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
var Value = arr[i];
|
var Value = arr[i];
|
||||||
if (!Value)
|
if(!Value)
|
||||||
Value = 0;
|
Value = 0;
|
||||||
if (Value) {
|
if(Value)
|
||||||
if (Pow2)
|
{
|
||||||
|
if(Pow2)
|
||||||
Value = Math.pow(2, Value) / 1000000;
|
Value = Math.pow(2, Value) / 1000000;
|
||||||
}
|
}
|
||||||
if (mode === "green") {
|
if(mode === "green")
|
||||||
if (Value > GreenValue)
|
{
|
||||||
|
if(Value > GreenValue)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (mode === "red") {
|
if(mode === "red")
|
||||||
if (Value <= GreenValue)
|
{
|
||||||
|
if(Value <= GreenValue)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var Value1 = Value;
|
var Value1 = Value;
|
||||||
if (Value1 > GreenValue)
|
if(Value1 > GreenValue)
|
||||||
Value1 = GreenValue;
|
Value1 = GreenValue;
|
||||||
var VX1 = Math.floor(Value1 * KY);
|
var VX1 = Math.floor(Value1 * KY);
|
||||||
var VX2 = Math.floor(Value * KY);
|
var VX2 = Math.floor(Value * KY);
|
||||||
if (VX1 === VX2)
|
if(VX1 === VX2)
|
||||||
VX1 -= 2;
|
VX1 -= 2;
|
||||||
var x = StartX + ctx.lineWidth / 2 + (i) * KX;
|
var x = StartX + ctx.lineWidth / 2 + (i) * KX;
|
||||||
if (bLine) {
|
if(bLine)
|
||||||
if (!WasMove0) {
|
{
|
||||||
|
if(!WasMove0)
|
||||||
|
{
|
||||||
WasMove0 = 1;
|
WasMove0 = 1;
|
||||||
ctx.moveTo(x, StartY - VX2);
|
ctx.moveTo(x, StartY - VX2);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ctx.lineTo(x, StartY - VX2);
|
ctx.lineTo(x, StartY - VX2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ctx.moveTo(x, StartY - VX1);
|
ctx.moveTo(x, StartY - VX1);
|
||||||
ctx.lineTo(x, StartY - VX2);
|
ctx.lineTo(x, StartY - VX2);
|
||||||
}
|
}
|
||||||
if (mouseX) {
|
if(mouseX)
|
||||||
|
{
|
||||||
var deltaCur = Math.abs(x - mouseX);
|
var deltaCur = Math.abs(x - mouseX);
|
||||||
var deltaWas = Math.abs(mouseValueX - mouseX);
|
var deltaWas = Math.abs(mouseValueX - mouseX);
|
||||||
if (deltaCur < deltaWas) {
|
if(deltaCur < deltaWas)
|
||||||
|
{
|
||||||
mouseValueX = x;
|
mouseValueX = x;
|
||||||
mouseValue = Value;
|
mouseValue = Value;
|
||||||
if (Item.zero)
|
if(Item.zero)
|
||||||
mouseValue -= Item.zero;
|
mouseValue -= Item.zero;
|
||||||
mouseColor = color;
|
mouseColor = color;
|
||||||
}
|
}
|
||||||
@ -223,14 +250,16 @@ function DrawDiagram(Item) {
|
|||||||
}
|
}
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
};
|
};
|
||||||
if (!Item.red)
|
if(!Item.red)
|
||||||
Item.red = "#A00";
|
Item.red = "#A00";
|
||||||
if (bLine) {
|
if(bLine)
|
||||||
|
{
|
||||||
DrawLines(arr, "line", Item.red);
|
DrawLines(arr, "line", Item.red);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
DrawLines(arr, "red", Item.red);
|
DrawLines(arr, "red", Item.red);
|
||||||
if (GreenValue > 0)
|
if(GreenValue > 0)
|
||||||
DrawLines(arr, "green", "#0A0");
|
DrawLines(arr, "green", "#0A0");
|
||||||
}
|
}
|
||||||
var MaxValueText = GetValueByItemProperty(MaxValue, Item);
|
var MaxValueText = GetValueByItemProperty(MaxValue, Item);
|
||||||
@ -246,18 +275,20 @@ function DrawDiagram(Item) {
|
|||||||
ctx.moveTo(StartX, StartY + DeltaY);
|
ctx.moveTo(StartX, StartY + DeltaY);
|
||||||
ctx.lineTo(obj.width - 10, StartY + DeltaY);
|
ctx.lineTo(obj.width - 10, StartY + DeltaY);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
if (mouseX !== undefined) {
|
if(mouseX !== undefined)
|
||||||
|
{
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.lineWidth = 0.5;
|
ctx.lineWidth = 0.5;
|
||||||
ctx.strokeStyle = "#00F";
|
ctx.strokeStyle = "#00F";
|
||||||
ctx.moveTo(mouseX, Top);
|
ctx.moveTo(mouseX, Top);
|
||||||
ctx.lineTo(mouseX, StartY);
|
ctx.lineTo(mouseX, StartY);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
if (mouseValue !== undefined) {
|
if(mouseValue !== undefined)
|
||||||
|
{
|
||||||
ctx.fillStyle = mouseColor;
|
ctx.fillStyle = mouseColor;
|
||||||
var Val = GetValueByItemProperty(mouseValue, Item);
|
var Val = GetValueByItemProperty(mouseValue, Item);
|
||||||
var mouseTextX = mouseX;
|
var mouseTextX = mouseX;
|
||||||
if (Item.MouseText)
|
if(Item.MouseText)
|
||||||
mouseTextX -= 3 * Item.MouseText.length;
|
mouseTextX -= 3 * Item.MouseText.length;
|
||||||
else
|
else
|
||||||
Item.MouseText = "";
|
Item.MouseText = "";
|
||||||
@ -265,14 +296,16 @@ function DrawDiagram(Item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.fillStyle = "#000";
|
ctx.fillStyle = "#000";
|
||||||
if (!Item.NoTextMax)
|
if(!Item.NoTextMax)
|
||||||
ctx.fillText(Rigth(" " + MaxValueText, 8), 0, Top - 3);
|
ctx.fillText(Rigth(" " + MaxValueText, 8), 0, Top - 3);
|
||||||
if (MaxValue > 0 && AvgValue > 0) {
|
if(MaxValue > 0 && AvgValue > 0)
|
||||||
|
{
|
||||||
var heigh = StartY - Top;
|
var heigh = StartY - Top;
|
||||||
var KKY = AvgValue / MaxValue;
|
var KKY = AvgValue / MaxValue;
|
||||||
var y = (heigh - Math.floor(KKY * heigh));
|
var y = (heigh - Math.floor(KKY * heigh));
|
||||||
var yT = y;
|
var yT = y;
|
||||||
if (yT < 10) {
|
if(yT < 10)
|
||||||
|
{
|
||||||
yT = 10;
|
yT = 10;
|
||||||
}
|
}
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -283,58 +316,67 @@ function DrawDiagram(Item) {
|
|||||||
ctx.fillText(Rigth(" " + AvgValueText, 8), 0, yT + Top);
|
ctx.fillText(Rigth(" " + AvgValueText, 8), 0, yT + Top);
|
||||||
}
|
}
|
||||||
var CountNameX = 10;
|
var CountNameX = 10;
|
||||||
if (arr.length < CountNameX)
|
if(arr.length < CountNameX)
|
||||||
CountNameX = arr.length;
|
CountNameX = arr.length;
|
||||||
var KX3 = (obj.width - Left - Right) / CountNameX;
|
var KX3 = (obj.width - Left - Right) / CountNameX;
|
||||||
var KDelitel = 1;
|
var KDelitel = 1;
|
||||||
var Step = arr.length / CountNameX;
|
var Step = arr.length / CountNameX;
|
||||||
var StartTime, bNumber;
|
var StartTime, bNumber;
|
||||||
if (arrX) {
|
if(arrX)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (StartNumber !== undefined) {
|
if(StartNumber !== undefined)
|
||||||
|
{
|
||||||
bNumber = 1;
|
bNumber = 1;
|
||||||
StartTime = StartNumber;
|
StartTime = StartNumber;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (StartServer) {
|
if(StartServer)
|
||||||
|
{
|
||||||
bNumber = 1;
|
bNumber = 1;
|
||||||
StartTime = Math.floor(((Date.now() - StartServer) - StepTime * arr.length * 1000) / 1000);
|
StartTime = Math.floor(((Date.now() - StartServer) - StepTime * arr.length * 1000) / 1000);
|
||||||
if (StartTime < 0)
|
if(StartTime < 0)
|
||||||
StartTime = 0;
|
StartTime = 0;
|
||||||
var KDelitel = Math.floor(Step / 10) * 10;
|
var KDelitel = Math.floor(Step / 10) * 10;
|
||||||
if (KDelitel == 0)
|
if(KDelitel == 0)
|
||||||
KDelitel = 1;
|
KDelitel = 1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
bNumber = 0;
|
bNumber = 0;
|
||||||
StartTime = Date.now() - StepTime * arr.length * 1000;
|
StartTime = Date.now() - StepTime * arr.length * 1000;
|
||||||
StartX = StartX - 16;
|
StartX = StartX - 16;
|
||||||
}
|
}
|
||||||
for (i = 0; i <= CountNameX; i++) {
|
for(i = 0; i <= CountNameX; i++)
|
||||||
|
{
|
||||||
var Val;
|
var Val;
|
||||||
if (i === CountNameX) {
|
if(i === CountNameX)
|
||||||
|
{
|
||||||
Val = arr.length * StepTime;
|
Val = arr.length * StepTime;
|
||||||
KDelitel = 1;
|
KDelitel = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (i === 0)
|
if(i === 0)
|
||||||
Val = 0;
|
Val = 0;
|
||||||
else
|
else
|
||||||
Val = i * Step * StepTime;
|
Val = i * Step * StepTime;
|
||||||
var Str;
|
var Str;
|
||||||
if (arrX) {
|
if(arrX)
|
||||||
|
{
|
||||||
Val = Math.floor(Val);
|
Val = Math.floor(Val);
|
||||||
Str = arrX[Val];
|
Str = arrX[Val];
|
||||||
if (Str === undefined)
|
if(Str === undefined)
|
||||||
Str = "";
|
Str = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (bNumber) {
|
if(bNumber)
|
||||||
|
{
|
||||||
Val = Math.floor((StartTime + Val) / KDelitel) * KDelitel;
|
Val = Math.floor((StartTime + Val) / KDelitel) * KDelitel;
|
||||||
Str = Val;
|
Str = Val;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var Time = new Date(StartTime + Val * 1000);
|
var Time = new Date(StartTime + Val * 1000);
|
||||||
Str = "" + Time.getHours();
|
Str = "" + Time.getHours();
|
||||||
Str += ":" + Rigth("0" + Time.getMinutes(), 2);
|
Str += ":" + Rigth("0" + Time.getMinutes(), 2);
|
||||||
@ -344,56 +386,68 @@ function DrawDiagram(Item) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetValueByItemProperty(Value, Item) {
|
function GetValueByItemProperty(Value,Item)
|
||||||
if (Item.MathPow && Item.MathDiv) {
|
{
|
||||||
|
if(Item.MathPow && Item.MathDiv)
|
||||||
|
{
|
||||||
Value = Math.pow(Item.MathPow, Value) / Item.MathDiv;
|
Value = Math.pow(Item.MathPow, Value) / Item.MathDiv;
|
||||||
}
|
}
|
||||||
var KPrecision = Item.KPrecision;
|
var KPrecision = Item.KPrecision;
|
||||||
if (!Item.KPrecision)
|
if(!Item.KPrecision)
|
||||||
KPrecision = 1;
|
KPrecision = 1;
|
||||||
Value = Math.floor(Value * KPrecision + 0.5) / KPrecision;
|
Value = Math.floor(Value * KPrecision + 0.5) / KPrecision;
|
||||||
return Value;
|
return Value;
|
||||||
};
|
};
|
||||||
|
|
||||||
function InitDiagramByArr(Arr, width) {
|
function InitDiagramByArr(Arr,width)
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
{
|
||||||
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
Arr[i].num = i + 1;
|
Arr[i].num = i + 1;
|
||||||
SetHTMLDiagramItem(Arr[i], width);
|
SetHTMLDiagramItem(Arr[i], width);
|
||||||
}
|
}
|
||||||
window.addEventListener('mousedown', function(event) {
|
window.addEventListener('mousedown', function (event)
|
||||||
|
{
|
||||||
SetDiagramMouseX(event, "down");
|
SetDiagramMouseX(event, "down");
|
||||||
}, false);
|
}, false);
|
||||||
window.addEventListener('mouseup', function(event) {
|
window.addEventListener('mouseup', function (event)
|
||||||
|
{
|
||||||
SetDiagramMouseX(event, "up");
|
SetDiagramMouseX(event, "up");
|
||||||
}, false);
|
}, false);
|
||||||
window.addEventListener('onmousemove', function(event) {
|
window.addEventListener('onmousemove', function (event)
|
||||||
|
{
|
||||||
SetDiagramMouseX(event, "move");
|
SetDiagramMouseX(event, "move");
|
||||||
}, false);
|
}, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
function getMouse(canvas, e) {
|
function getMouse(canvas,e)
|
||||||
|
{
|
||||||
var x = e.clientX - getTrueOffsetLeft(canvas);
|
var x = e.clientX - getTrueOffsetLeft(canvas);
|
||||||
if (window.pageXOffset)
|
if(window.pageXOffset)
|
||||||
x = x + window.pageXOffset;
|
x = x + window.pageXOffset;
|
||||||
var y = e.clientY - getTrueOffsetTop(canvas);
|
var y = e.clientY - getTrueOffsetTop(canvas);
|
||||||
if (window.pageYOffset)
|
if(window.pageYOffset)
|
||||||
y = y + window.pageYOffset;
|
y = y + window.pageYOffset;
|
||||||
var coord = { x: x, y: y };
|
var coord = {x:x, y:y};
|
||||||
return coord;
|
return coord;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTrueOffsetLeft(ele) {
|
function getTrueOffsetLeft(ele)
|
||||||
|
{
|
||||||
var n = 0;
|
var n = 0;
|
||||||
while (ele) {
|
while(ele)
|
||||||
|
{
|
||||||
n += ele.offsetLeft || 0;
|
n += ele.offsetLeft || 0;
|
||||||
ele = ele.offsetParent;
|
ele = ele.offsetParent;
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTrueOffsetTop(ele) {
|
function getTrueOffsetTop(ele)
|
||||||
|
{
|
||||||
var n = 0;
|
var n = 0;
|
||||||
while (ele) {
|
while(ele)
|
||||||
|
{
|
||||||
n += ele.offsetTop || 0;
|
n += ele.offsetTop || 0;
|
||||||
ele = ele.offsetParent;
|
ele = ele.offsetParent;
|
||||||
}
|
}
|
||||||
|
@ -11,150 +11,180 @@
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
var der = require("./der"), toString = Object.prototype.toString, exports = {}, assert = exports;
|
var der = require("./der"), toString = Object.prototype.toString, exports = {}, assert = exports;
|
||||||
exports.isArray = function(e, s) {
|
exports.isArray = function (e,s)
|
||||||
if (!Array.isArray(e))
|
{
|
||||||
|
if(!Array.isArray(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isBoolean = function(e, s) {
|
}, exports.isBoolean = function (e,s)
|
||||||
if ("[object Boolean]" !== toString.call(e))
|
{
|
||||||
|
if("[object Boolean]" !== toString.call(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isBuffer = function(e, s) {
|
}, exports.isBuffer = function (e,s)
|
||||||
if (!Buffer.isBuffer(e))
|
{
|
||||||
|
if(!Buffer.isBuffer(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isFunction = function(e, s) {
|
}, exports.isFunction = function (e,s)
|
||||||
if ("[object Function]" !== toString.call(e))
|
{
|
||||||
|
if("[object Function]" !== toString.call(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isNumber = function(e, s) {
|
}, exports.isNumber = function (e,s)
|
||||||
if ("[object Number]" !== toString.call(e))
|
{
|
||||||
|
if("[object Number]" !== toString.call(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isObject = function(e, s) {
|
}, exports.isObject = function (e,s)
|
||||||
if ("[object Object]" !== toString.call(e))
|
{
|
||||||
|
if("[object Object]" !== toString.call(e))
|
||||||
throw TypeError(s);
|
throw TypeError(s);
|
||||||
}, exports.isBufferLength = function(e, s, r) {
|
}, exports.isBufferLength = function (e,s,r)
|
||||||
if (e.length !== s)
|
{
|
||||||
|
if(e.length !== s)
|
||||||
throw RangeError(r);
|
throw RangeError(r);
|
||||||
}, exports.isBufferLength2 = function(e, s, r, _) {
|
}, exports.isBufferLength2 = function (e,s,r,_)
|
||||||
if (e.length !== s && e.length !== r)
|
{
|
||||||
|
if(e.length !== s && e.length !== r)
|
||||||
throw RangeError(_);
|
throw RangeError(_);
|
||||||
}, exports.isLengthGTZero = function(e, s) {
|
}, exports.isLengthGTZero = function (e,s)
|
||||||
if (0 === e.length)
|
{
|
||||||
|
if(0 === e.length)
|
||||||
throw RangeError(s);
|
throw RangeError(s);
|
||||||
}, exports.isNumberInInterval = function(e, s, r, _) {
|
}, exports.isNumberInInterval = function (e,s,r,_)
|
||||||
if (e <= s || r <= e)
|
{
|
||||||
|
if(e <= s || r <= e)
|
||||||
throw RangeError(_);
|
throw RangeError(_);
|
||||||
};
|
};
|
||||||
var messages = {
|
var messages = {COMPRESSED_TYPE_INVALID:"compressed should be a boolean", EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",
|
||||||
COMPRESSED_TYPE_INVALID: "compressed should be a boolean", EC_PRIVATE_KEY_TYPE_INVALID: "private key should be a Buffer",
|
EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid", EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",
|
||||||
EC_PRIVATE_KEY_LENGTH_INVALID: "private key length is invalid", EC_PRIVATE_KEY_RANGE_INVALID: "private key range is invalid",
|
EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid", EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",
|
||||||
EC_PRIVATE_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting private key is invalid", EC_PRIVATE_KEY_TWEAK_MUL_FAIL: "tweak out of range",
|
EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format", EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",
|
||||||
EC_PRIVATE_KEY_EXPORT_DER_FAIL: "couldn't export to DER format", EC_PRIVATE_KEY_IMPORT_DER_FAIL: "couldn't import from DER format",
|
EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array", EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",
|
||||||
EC_PUBLIC_KEYS_TYPE_INVALID: "public keys should be an Array", EC_PUBLIC_KEYS_LENGTH_INVALID: "public keys Array should have at least 1 element",
|
EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer", EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid", EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",
|
||||||
EC_PUBLIC_KEY_TYPE_INVALID: "public key should be a Buffer", EC_PUBLIC_KEY_LENGTH_INVALID: "public key length is invalid", EC_PUBLIC_KEY_PARSE_FAIL: "the public key could not be parsed or is invalid",
|
EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again", EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",
|
||||||
EC_PUBLIC_KEY_CREATE_FAIL: "private was invalid, try again", EC_PUBLIC_KEY_TWEAK_ADD_FAIL: "tweak out of range or resulting public key is invalid",
|
EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range", EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid", ECDH_FAIL:"scalar was invalid (zero or overflow)",
|
||||||
EC_PUBLIC_KEY_TWEAK_MUL_FAIL: "tweak out of range", EC_PUBLIC_KEY_COMBINE_FAIL: "the sum of the public keys is not valid", ECDH_FAIL: "scalar was invalid (zero or overflow)",
|
ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer", ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",
|
||||||
ECDSA_SIGNATURE_TYPE_INVALID: "signature should be a Buffer", ECDSA_SIGNATURE_LENGTH_INVALID: "signature length is invalid",
|
ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature", ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature", ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",
|
||||||
ECDSA_SIGNATURE_PARSE_FAIL: "couldn't parse signature", ECDSA_SIGNATURE_PARSE_DER_FAIL: "couldn't parse DER signature", ECDSA_SIGNATURE_SERIALIZE_DER_FAIL: "couldn't serialize signature to DER format",
|
ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid", ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",
|
||||||
ECDSA_SIGN_FAIL: "nonce generation function failed or private key is invalid", ECDSA_RECOVER_FAIL: "couldn't recover public key from signature",
|
MSG32_TYPE_INVALID:"message should be a Buffer", MSG32_LENGTH_INVALID:"message length is invalid", OPTIONS_TYPE_INVALID:"options should be an Object",
|
||||||
MSG32_TYPE_INVALID: "message should be a Buffer", MSG32_LENGTH_INVALID: "message length is invalid", OPTIONS_TYPE_INVALID: "options should be an Object",
|
OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer", OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",
|
||||||
OPTIONS_DATA_TYPE_INVALID: "options.data should be a Buffer", OPTIONS_DATA_LENGTH_INVALID: "options.data length is invalid",
|
OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function", RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",
|
||||||
OPTIONS_NONCEFN_TYPE_INVALID: "options.noncefn should be a Function", RECOVERY_ID_TYPE_INVALID: "recovery should be a Number",
|
RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4", TWEAK_TYPE_INVALID:"tweak should be a Buffer", TWEAK_LENGTH_INVALID:"tweak length is invalid"};
|
||||||
RECOVERY_ID_VALUE_INVALID: "recovery should have value between -1 and 4", TWEAK_TYPE_INVALID: "tweak should be a Buffer", TWEAK_LENGTH_INVALID: "tweak length is invalid"
|
|
||||||
};
|
|
||||||
|
|
||||||
function initCompressedValue(e, s) {
|
function initCompressedValue(e,s)
|
||||||
|
{
|
||||||
return void 0 === e ? s : (assert.isBoolean(e, messages.COMPRESSED_TYPE_INVALID), e);
|
return void 0 === e ? s : (assert.isBoolean(e, messages.COMPRESSED_TYPE_INVALID), e);
|
||||||
};
|
};
|
||||||
module.exports = function(E) {
|
module.exports = function (E)
|
||||||
return {
|
{
|
||||||
privateKeyVerify: function(e) {
|
return {privateKeyVerify:function (e)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), 32 === e.length && E.privateKeyVerify(e);
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), 32 === e.length && E.privateKeyVerify(e);
|
||||||
}, privateKeyExport: function(e, s) {
|
}, privateKeyExport:function (e,s)
|
||||||
|
{
|
||||||
assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
s = initCompressedValue(s, !0);
|
s = initCompressedValue(s, !0);
|
||||||
var r = E.privateKeyExport(e, s);
|
var r = E.privateKeyExport(e, s);
|
||||||
return der.privateKeyExport(e, r, s);
|
return der.privateKeyExport(e, r, s);
|
||||||
}, privateKeyImport: function(e) {
|
}, privateKeyImport:function (e)
|
||||||
if (assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), (e = der.privateKeyImport(e)) && 32 === e.length && E.privateKeyVerify(e))
|
{
|
||||||
|
if(assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), (e = der.privateKeyImport(e)) && 32 === e.length && E.privateKeyVerify(e))
|
||||||
return e;
|
return e;
|
||||||
throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL);
|
throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL);
|
||||||
}, privateKeyNegate: function(e) {
|
}, privateKeyNegate:function (e)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
E.privateKeyNegate(e);
|
E.privateKeyNegate(e);
|
||||||
}, privateKeyModInverse: function(e) {
|
}, privateKeyModInverse:function (e)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
E.privateKeyModInverse(e);
|
E.privateKeyModInverse(e);
|
||||||
}, privateKeyTweakAdd: function(e, s) {
|
}, privateKeyTweakAdd:function (e,s)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakAdd(e,
|
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakAdd(e,
|
||||||
s);
|
s);
|
||||||
}, privateKeyTweakMul: function(e, s) {
|
}, privateKeyTweakMul:function (e,s)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakMul(e,
|
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), E.privateKeyTweakMul(e,
|
||||||
s);
|
s);
|
||||||
}, publicKeyCreate: function(e, s) {
|
}, publicKeyCreate:function (e,s)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(e, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
s = initCompressedValue(s, !0), E.publicKeyCreate(e, s);
|
s = initCompressedValue(s, !0), E.publicKeyCreate(e, s);
|
||||||
}, publicKeyConvert: function(e, s) {
|
}, publicKeyConvert:function (e,s)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
||||||
s = initCompressedValue(s, !0), E.publicKeyConvert(e, s);
|
s = initCompressedValue(s, !0), E.publicKeyConvert(e, s);
|
||||||
}, publicKeyVerify: function(e) {
|
}, publicKeyVerify:function (e)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), E.publicKeyVerify(e);
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), E.publicKeyVerify(e);
|
||||||
}, publicKeyTweakAdd: function(e, s, r) {
|
}, publicKeyTweakAdd:function (e,s,r)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r,
|
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r,
|
||||||
!0), E.publicKeyTweakAdd(e, s, r);
|
!0), E.publicKeyTweakAdd(e, s, r);
|
||||||
}, publicKeyTweakMul: function(e, s, r) {
|
}, publicKeyTweakMul:function (e,s,r)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r,
|
assert.isBuffer(s, messages.TWEAK_TYPE_INVALID), assert.isBufferLength(s, 32, messages.TWEAK_LENGTH_INVALID), r = initCompressedValue(r,
|
||||||
!0), E.publicKeyTweakMul(e, s, r);
|
!0), E.publicKeyTweakMul(e, s, r);
|
||||||
}, publicKeyCombine: function(e, s) {
|
}, publicKeyCombine:function (e,s)
|
||||||
|
{
|
||||||
assert.isArray(e, messages.EC_PUBLIC_KEYS_TYPE_INVALID), assert.isLengthGTZero(e, messages.EC_PUBLIC_KEYS_LENGTH_INVALID);
|
assert.isArray(e, messages.EC_PUBLIC_KEYS_TYPE_INVALID), assert.isLengthGTZero(e, messages.EC_PUBLIC_KEYS_LENGTH_INVALID);
|
||||||
for (var r = 0; r < e.length; ++r)
|
for(var r = 0; r < e.length; ++r)
|
||||||
assert.isBuffer(e[r], messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e[r], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID);
|
assert.isBuffer(e[r], messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e[r], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID);
|
||||||
return s = initCompressedValue(s, !0), E.publicKeyCombine(e, s);
|
return s = initCompressedValue(s, !0), E.publicKeyCombine(e, s);
|
||||||
}, signatureNormalize: function(e) {
|
}, signatureNormalize:function (e)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID),
|
||||||
E.signatureNormalize(e);
|
E.signatureNormalize(e);
|
||||||
}, signatureExport: function(e) {
|
}, signatureExport:function (e)
|
||||||
|
{
|
||||||
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(e, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
||||||
var s = E.signatureExport(e);
|
var s = E.signatureExport(e);
|
||||||
return der.signatureExport(s);
|
return der.signatureExport(s);
|
||||||
}, signatureImport: function(e) {
|
}, signatureImport:function (e)
|
||||||
|
{
|
||||||
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
||||||
var s = der.signatureImport(e);
|
var s = der.signatureImport(e);
|
||||||
if (s)
|
if(s)
|
||||||
return E.signatureImport(s);
|
return E.signatureImport(s);
|
||||||
throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL);
|
throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL);
|
||||||
}, signatureImportLax: function(e) {
|
}, signatureImportLax:function (e)
|
||||||
|
{
|
||||||
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
assert.isBuffer(e, messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isLengthGTZero(e, messages.ECDSA_SIGNATURE_LENGTH_INVALID);
|
||||||
var s = der.signatureImportLax(e);
|
var s = der.signatureImportLax(e);
|
||||||
if (s)
|
if(s)
|
||||||
return E.signatureImport(s);
|
return E.signatureImport(s);
|
||||||
throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL);
|
throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL);
|
||||||
}, sign: function(e, s, r) {
|
}, sign:function (e,s,r)
|
||||||
|
{
|
||||||
assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
||||||
messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID);
|
messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID);
|
||||||
var _ = null, t = null;
|
var _ = null, t = null;
|
||||||
return void 0 !== r && (assert.isObject(r, messages.OPTIONS_TYPE_INVALID), void 0 !== r.data && (assert.isBuffer(r.data, messages.OPTIONS_DATA_TYPE_INVALID),
|
return void 0 !== r && (assert.isObject(r, messages.OPTIONS_TYPE_INVALID), void 0 !== r.data && (assert.isBuffer(r.data, messages.OPTIONS_DATA_TYPE_INVALID),
|
||||||
assert.isBufferLength(r.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID), _ = r.data), void 0 !== r.noncefn && (assert.isFunction(r.noncefn,
|
assert.isBufferLength(r.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID), _ = r.data), void 0 !== r.noncefn && (assert.isFunction(r.noncefn,
|
||||||
messages.OPTIONS_NONCEFN_TYPE_INVALID), t = r.noncefn)), E.sign(e, s, t, _);
|
messages.OPTIONS_NONCEFN_TYPE_INVALID), t = r.noncefn)), E.sign(e, s, t, _);
|
||||||
}, verify: function(e, s, r) {
|
}, verify:function (e,s,r)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
||||||
messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isBuffer(r,
|
messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isBuffer(r,
|
||||||
messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(r, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), E.verify(e,
|
messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(r, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID), E.verify(e,
|
||||||
s, r);
|
s, r);
|
||||||
}, recover: function(e, s, r, _) {
|
}, recover:function (e,s,r,_)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
return assert.isBuffer(e, messages.MSG32_TYPE_INVALID), assert.isBufferLength(e, 32, messages.MSG32_LENGTH_INVALID), assert.isBuffer(s,
|
||||||
messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isNumber(r,
|
messages.ECDSA_SIGNATURE_TYPE_INVALID), assert.isBufferLength(s, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID), assert.isNumber(r,
|
||||||
messages.RECOVERY_ID_TYPE_INVALID), assert.isNumberInInterval(r, - 1, 4, messages.RECOVERY_ID_VALUE_INVALID), _ = initCompressedValue(_,
|
messages.RECOVERY_ID_TYPE_INVALID), assert.isNumberInInterval(r, - 1, 4, messages.RECOVERY_ID_VALUE_INVALID), _ = initCompressedValue(_,
|
||||||
!0), E.recover(e, s, r, _);
|
!0), E.recover(e, s, r, _);
|
||||||
}, ecdh: function(e, s) {
|
}, ecdh:function (e,s)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
E.ecdh(e, s);
|
E.ecdh(e, s);
|
||||||
}, ecdhUnsafe: function(e, s, r) {
|
}, ecdhUnsafe:function (e,s,r)
|
||||||
|
{
|
||||||
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
return assert.isBuffer(e, messages.EC_PUBLIC_KEY_TYPE_INVALID), assert.isBufferLength2(e, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID),
|
||||||
assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
assert.isBuffer(s, messages.EC_PRIVATE_KEY_TYPE_INVALID), assert.isBufferLength(s, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID),
|
||||||
r = initCompressedValue(r, !0), E.ecdhUnsafe(e, s, r);
|
r = initCompressedValue(r, !0), E.ecdhUnsafe(e, s, r);
|
||||||
}
|
}};
|
||||||
};
|
|
||||||
}, global.SIGN_LIB = module.exports;
|
}, global.SIGN_LIB = module.exports;
|
||||||
|
@ -8,14 +8,17 @@
|
|||||||
* Telegram: https://t.me/terafoundation
|
* Telegram: https://t.me/terafoundation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function ()
|
||||||
|
{
|
||||||
'use strict';
|
'use strict';
|
||||||
var root = typeof window === 'object' ? window : {};
|
var root = typeof window === 'object' ? window : {};
|
||||||
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
|
||||||
if (NODE_JS && !root.RUN_NW_CLIENT) {
|
if(NODE_JS && !root.RUN_NW_CLIENT)
|
||||||
|
{
|
||||||
root = global;
|
root = global;
|
||||||
}
|
}
|
||||||
if (root.RUN_CLIENT) {
|
if(root.RUN_CLIENT)
|
||||||
|
{
|
||||||
root = window;
|
root = window;
|
||||||
}
|
}
|
||||||
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;
|
var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;
|
||||||
@ -27,132 +30,157 @@
|
|||||||
var PADDING = [6, 1536, 393216, 100663296];
|
var PADDING = [6, 1536, 393216, 100663296];
|
||||||
var SHIFT = [0, 8, 16, 24];
|
var SHIFT = [0, 8, 16, 24];
|
||||||
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777,
|
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777,
|
||||||
2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648,
|
2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648,
|
||||||
32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649,
|
32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649,
|
||||||
0, 2147516424, 2147483648];
|
0, 2147516424, 2147483648];
|
||||||
var BITS = [224, 256, 384, 512];
|
var BITS = [224, 256, 384, 512];
|
||||||
var SHAKE_BITS = [128, 256];
|
var SHAKE_BITS = [128, 256];
|
||||||
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];
|
||||||
var CSHAKE_BYTEPAD = { '128': 168, '256': 136 };
|
var CSHAKE_BYTEPAD = {'128':168, '256':136};
|
||||||
if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {
|
if(root.JS_SHA3_NO_NODE_JS || !Array.isArray)
|
||||||
Array.isArray = function(obj) {
|
{
|
||||||
|
Array.isArray = function (obj)
|
||||||
|
{
|
||||||
return Object.prototype.toString.call(obj) === '[object Array]';
|
return Object.prototype.toString.call(obj) === '[object Array]';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
var createOutputMethod = function(bits, padding, outputType) {
|
var createOutputMethod = function (bits,padding,outputType)
|
||||||
return function(message) {
|
{
|
||||||
|
return function (message)
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
return new Keccak(bits, padding, bits).update(message)[outputType]();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
var createShakeOutputMethod = function(bits, padding, outputType) {
|
var createShakeOutputMethod = function (bits,padding,outputType)
|
||||||
return function(message, outputBits) {
|
{
|
||||||
|
return function (message,outputBits)
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
return new Keccak(bits, padding, outputBits).update(message)[outputType]();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
var createCshakeOutputMethod = function(bits, padding, outputType) {
|
var createCshakeOutputMethod = function (bits,padding,outputType)
|
||||||
return function(message, outputBits, n, s) {
|
{
|
||||||
|
return function (message,outputBits,n,s)
|
||||||
|
{
|
||||||
return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();
|
return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
var createKmacOutputMethod = function(bits, padding, outputType) {
|
var createKmacOutputMethod = function (bits,padding,outputType)
|
||||||
return function(key, message, outputBits, s) {
|
{
|
||||||
|
return function (key,message,outputBits,s)
|
||||||
|
{
|
||||||
return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();
|
return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
var createOutputMethods = function(method, createMethod, bits, padding) {
|
var createOutputMethods = function (method,createMethod,bits,padding)
|
||||||
for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
|
{
|
||||||
|
for(var i = 0; i < OUTPUT_TYPES.length; ++i)
|
||||||
|
{
|
||||||
var type = OUTPUT_TYPES[i];
|
var type = OUTPUT_TYPES[i];
|
||||||
method[type] = createMethod(bits, padding, type);
|
method[type] = createMethod(bits, padding, type);
|
||||||
}
|
}
|
||||||
return method;
|
return method;
|
||||||
};
|
};
|
||||||
var createMethod = function(bits, padding, outputs) {
|
var createMethod = function (bits,padding,outputs)
|
||||||
|
{
|
||||||
var method = createOutputMethod(bits, padding, outputs);
|
var method = createOutputMethod(bits, padding, outputs);
|
||||||
method.create = function() {
|
method.create = function ()
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, bits);
|
return new Keccak(bits, padding, bits);
|
||||||
};
|
};
|
||||||
method.update = function(message) {
|
method.update = function (message)
|
||||||
|
{
|
||||||
return method.create().update(message);
|
return method.create().update(message);
|
||||||
};
|
};
|
||||||
return createOutputMethods(method, createOutputMethod, bits, padding);
|
return createOutputMethods(method, createOutputMethod, bits, padding);
|
||||||
};
|
};
|
||||||
var createMethodArray = function(bits, padding) {
|
var createMethodArray = function (bits,padding)
|
||||||
|
{
|
||||||
var method = createOutputMethod(bits, padding, 'array');
|
var method = createOutputMethod(bits, padding, 'array');
|
||||||
method.create = function() {
|
method.create = function ()
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, bits);
|
return new Keccak(bits, padding, bits);
|
||||||
};
|
};
|
||||||
method.update = function(message) {
|
method.update = function (message)
|
||||||
|
{
|
||||||
return method.create().update(message);
|
return method.create().update(message);
|
||||||
};
|
};
|
||||||
return createOutputMethods(method, createOutputMethod, bits, padding);
|
return createOutputMethods(method, createOutputMethod, bits, padding);
|
||||||
};
|
};
|
||||||
var createShakeMethod = function(bits, padding) {
|
var createShakeMethod = function (bits,padding)
|
||||||
|
{
|
||||||
var method = createShakeOutputMethod(bits, padding, 'hex');
|
var method = createShakeOutputMethod(bits, padding, 'hex');
|
||||||
method.create = function(outputBits) {
|
method.create = function (outputBits)
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, outputBits);
|
return new Keccak(bits, padding, outputBits);
|
||||||
};
|
};
|
||||||
method.update = function(message, outputBits) {
|
method.update = function (message,outputBits)
|
||||||
|
{
|
||||||
return method.create(outputBits).update(message);
|
return method.create(outputBits).update(message);
|
||||||
};
|
};
|
||||||
return createOutputMethods(method, createShakeOutputMethod, bits, padding);
|
return createOutputMethods(method, createShakeOutputMethod, bits, padding);
|
||||||
};
|
};
|
||||||
var createCshakeMethod = function(bits, padding) {
|
var createCshakeMethod = function (bits,padding)
|
||||||
|
{
|
||||||
var w = CSHAKE_BYTEPAD[bits];
|
var w = CSHAKE_BYTEPAD[bits];
|
||||||
var method = createCshakeOutputMethod(bits, padding, 'hex');
|
var method = createCshakeOutputMethod(bits, padding, 'hex');
|
||||||
method.create = function(outputBits, n, s) {
|
method.create = function (outputBits,n,s)
|
||||||
if (!n && !s) {
|
{
|
||||||
|
if(!n && !s)
|
||||||
|
{
|
||||||
return methods['shake' + bits].create(outputBits);
|
return methods['shake' + bits].create(outputBits);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
return new Keccak(bits, padding, outputBits).bytepad([n, s], w);
|
return new Keccak(bits, padding, outputBits).bytepad([n, s], w);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
method.update = function(message, outputBits, n, s) {
|
method.update = function (message,outputBits,n,s)
|
||||||
|
{
|
||||||
return method.create(outputBits, n, s).update(message);
|
return method.create(outputBits, n, s).update(message);
|
||||||
};
|
};
|
||||||
return createOutputMethods(method, createCshakeOutputMethod, bits, padding);
|
return createOutputMethods(method, createCshakeOutputMethod, bits, padding);
|
||||||
};
|
};
|
||||||
var createKmacMethod = function(bits, padding) {
|
var createKmacMethod = function (bits,padding)
|
||||||
|
{
|
||||||
var w = CSHAKE_BYTEPAD[bits];
|
var w = CSHAKE_BYTEPAD[bits];
|
||||||
var method = createKmacOutputMethod(bits, padding, 'hex');
|
var method = createKmacOutputMethod(bits, padding, 'hex');
|
||||||
method.create = function(key, outputBits, s) {
|
method.create = function (key,outputBits,s)
|
||||||
|
{
|
||||||
return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);
|
return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);
|
||||||
};
|
};
|
||||||
method.update = function(key, message, outputBits, s) {
|
method.update = function (key,message,outputBits,s)
|
||||||
|
{
|
||||||
return method.create(key, outputBits, s).update(message);
|
return method.create(key, outputBits, s).update(message);
|
||||||
};
|
};
|
||||||
return createOutputMethods(method, createKmacOutputMethod, bits, padding);
|
return createOutputMethods(method, createKmacOutputMethod, bits, padding);
|
||||||
};
|
};
|
||||||
var algorithms = [{ name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod }, {
|
var algorithms = [{name:'keccak', padding:KECCAK_PADDING, bits:BITS, createMethod:createMethod}, {name:'sha3', padding:PADDING,
|
||||||
name: 'sha3', padding: PADDING,
|
bits:BITS, createMethod:createMethod, outputs:'hex'}, {name:'sha3_array', padding:PADDING, bits:BITS, createMethod:createMethod,
|
||||||
bits: BITS, createMethod: createMethod, outputs: 'hex'
|
outputs:'array'}, {name:'sha3_buf', padding:PADDING, bits:BITS, createMethod:createMethod, outputs:'buffer'}, {name:'shake',
|
||||||
}, {
|
padding:SHAKE_PADDING, bits:SHAKE_BITS, createMethod:createShakeMethod}, {name:'cshake', padding:CSHAKE_PADDING, bits:SHAKE_BITS,
|
||||||
name: 'sha3_array', padding: PADDING, bits: BITS, createMethod: createMethod,
|
createMethod:createCshakeMethod}, {name:'kmac', padding:CSHAKE_PADDING, bits:SHAKE_BITS, createMethod:createKmacMethod}];
|
||||||
outputs: 'array'
|
|
||||||
}, { name: 'sha3_buf', padding: PADDING, bits: BITS, createMethod: createMethod, outputs: 'buffer' }, {
|
|
||||||
name: 'shake',
|
|
||||||
padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod
|
|
||||||
}, {
|
|
||||||
name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS,
|
|
||||||
createMethod: createCshakeMethod
|
|
||||||
}, { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }];
|
|
||||||
var methods = {}, methodNames = [];
|
var methods = {}, methodNames = [];
|
||||||
for (var i = 0; i < algorithms.length; ++i) {
|
for(var i = 0; i < algorithms.length; ++i)
|
||||||
|
{
|
||||||
var algorithm = algorithms[i];
|
var algorithm = algorithms[i];
|
||||||
var bits = algorithm.bits;
|
var bits = algorithm.bits;
|
||||||
for (var j = 0; j < bits.length; ++j) {
|
for(var j = 0; j < bits.length; ++j)
|
||||||
|
{
|
||||||
var methodName = algorithm.name + '_' + bits[j];
|
var methodName = algorithm.name + '_' + bits[j];
|
||||||
methodNames.push(methodName);
|
methodNames.push(methodName);
|
||||||
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding, algorithm.outputs);
|
methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding, algorithm.outputs);
|
||||||
if (algorithm.name !== 'sha3') {
|
if(algorithm.name !== 'sha3')
|
||||||
|
{
|
||||||
var newMethodName = algorithm.name + bits[j];
|
var newMethodName = algorithm.name + bits[j];
|
||||||
methodNames.push(newMethodName);
|
methodNames.push(newMethodName);
|
||||||
methods[newMethodName] = methods[methodName];
|
methods[newMethodName] = methods[methodName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Keccak(bits, padding, outputBits) {
|
function Keccak(bits,padding,outputBits)
|
||||||
|
{
|
||||||
this.blocks = [];
|
this.blocks = [];
|
||||||
this.s = [];
|
this.s = [];
|
||||||
this.padding = padding;
|
this.padding = padding;
|
||||||
@ -164,55 +192,71 @@
|
|||||||
this.byteCount = this.blockCount << 2;
|
this.byteCount = this.blockCount << 2;
|
||||||
this.outputBlocks = outputBits >> 5;
|
this.outputBlocks = outputBits >> 5;
|
||||||
this.extraBytes = (outputBits & 31) >> 3;
|
this.extraBytes = (outputBits & 31) >> 3;
|
||||||
for (var i = 0; i < 50; ++i) {
|
for(var i = 0; i < 50; ++i)
|
||||||
|
{
|
||||||
this.s[i] = 0;
|
this.s[i] = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Keccak.prototype.update = function(message) {
|
Keccak.prototype.update = function (message)
|
||||||
|
{
|
||||||
var notString = typeof message !== 'string';
|
var notString = typeof message !== 'string';
|
||||||
if (notString && message.constructor === root.ArrayBuffer) {
|
if(notString && message.constructor === root.ArrayBuffer)
|
||||||
|
{
|
||||||
TO_ERROR_LOG("SHA3", 10, 'ERROR: Error type ArrayBuffer, use Uint8Array instead!');
|
TO_ERROR_LOG("SHA3", 10, 'ERROR: Error type ArrayBuffer, use Uint8Array instead!');
|
||||||
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
}
|
}
|
||||||
var length = message.length;
|
var length = message.length;
|
||||||
if (notString) {
|
if(notString)
|
||||||
if (typeof length !== 'number' || !Array.isArray(message) && !(ARRAY_BUFFER && ArrayBuffer.isView(message))) {
|
{
|
||||||
|
if(typeof length !== 'number' || !Array.isArray(message) && !(ARRAY_BUFFER && ArrayBuffer.isView(message)))
|
||||||
|
{
|
||||||
TO_ERROR_LOG("SHA3", 20, 'ERROR: Input is invalid type, message=' + JSON.stringify(message));
|
TO_ERROR_LOG("SHA3", 20, 'ERROR: Input is invalid type, message=' + JSON.stringify(message));
|
||||||
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var blocks = this.blocks, byteCount = this.byteCount, blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
var blocks = this.blocks, byteCount = this.byteCount, blockCount = this.blockCount, index = 0, s = this.s, i, code;
|
||||||
while (index < length) {
|
while(index < length)
|
||||||
if (this.reset) {
|
{
|
||||||
|
if(this.reset)
|
||||||
|
{
|
||||||
this.reset = false;
|
this.reset = false;
|
||||||
blocks[0] = this.block;
|
blocks[0] = this.block;
|
||||||
for (i = 1; i < blockCount + 1; ++i) {
|
for(i = 1; i < blockCount + 1; ++i)
|
||||||
|
{
|
||||||
blocks[i] = 0;
|
blocks[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (notString) {
|
if(notString)
|
||||||
for (i = this.start; index < length && i < byteCount; ++index) {
|
{
|
||||||
|
for(i = this.start; index < length && i < byteCount; ++index)
|
||||||
|
{
|
||||||
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
for (i = this.start; index < length && i < byteCount; ++index) {
|
{
|
||||||
|
for(i = this.start; index < length && i < byteCount; ++index)
|
||||||
|
{
|
||||||
code = message.charCodeAt(index);
|
code = message.charCodeAt(index);
|
||||||
if (code < 0x80) {
|
if(code < 0x80)
|
||||||
|
{
|
||||||
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
blocks[i >> 2] |= code << SHIFT[i++ & 3];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (code < 0x800) {
|
if(code < 0x800)
|
||||||
|
{
|
||||||
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
|
||||||
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (code < 0xd800 || code >= 0xe000) {
|
if(code < 0xd800 || code >= 0xe000)
|
||||||
|
{
|
||||||
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
|
||||||
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
|
||||||
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
|
||||||
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
|
||||||
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
|
||||||
@ -222,73 +266,91 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.lastByteIndex = i;
|
this.lastByteIndex = i;
|
||||||
if (i >= byteCount) {
|
if(i >= byteCount)
|
||||||
|
{
|
||||||
this.start = i - byteCount;
|
this.start = i - byteCount;
|
||||||
this.block = blocks[blockCount];
|
this.block = blocks[blockCount];
|
||||||
for (i = 0; i < blockCount; ++i) {
|
for(i = 0; i < blockCount; ++i)
|
||||||
|
{
|
||||||
s[i] ^= blocks[i];
|
s[i] ^= blocks[i];
|
||||||
}
|
}
|
||||||
f(s);
|
f(s);
|
||||||
this.reset = true;
|
this.reset = true;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
this.start = i;
|
this.start = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
Keccak.prototype.encode = function(x, right) {
|
Keccak.prototype.encode = function (x,right)
|
||||||
|
{
|
||||||
var o = x & 255, n = 1;
|
var o = x & 255, n = 1;
|
||||||
var bytes = [o];
|
var bytes = [o];
|
||||||
x = x >> 8;
|
x = x >> 8;
|
||||||
o = x & 255;
|
o = x & 255;
|
||||||
while (o > 0) {
|
while(o > 0)
|
||||||
|
{
|
||||||
bytes.unshift(o);
|
bytes.unshift(o);
|
||||||
x = x >> 8;
|
x = x >> 8;
|
||||||
o = x & 255;
|
o = x & 255;
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
if (right) {
|
if(right)
|
||||||
|
{
|
||||||
bytes.push(n);
|
bytes.push(n);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
bytes.unshift(n);
|
bytes.unshift(n);
|
||||||
}
|
}
|
||||||
this.update(bytes);
|
this.update(bytes);
|
||||||
return bytes.length;
|
return bytes.length;
|
||||||
};
|
};
|
||||||
Keccak.prototype.encodeString = function(str) {
|
Keccak.prototype.encodeString = function (str)
|
||||||
|
{
|
||||||
str = str || '';
|
str = str || '';
|
||||||
var notString = typeof str !== 'string';
|
var notString = typeof str !== 'string';
|
||||||
if (notString && str.constructor === root.ArrayBuffer) {
|
if(notString && str.constructor === root.ArrayBuffer)
|
||||||
|
{
|
||||||
str = new Uint8Array(str);
|
str = new Uint8Array(str);
|
||||||
}
|
}
|
||||||
var length = str.length;
|
var length = str.length;
|
||||||
if (notString) {
|
if(notString)
|
||||||
if (typeof length !== 'number' || !Array.isArray(str) && !(ARRAY_BUFFER && ArrayBuffer.isView(str))) {
|
{
|
||||||
|
if(typeof length !== 'number' || !Array.isArray(str) && !(ARRAY_BUFFER && ArrayBuffer.isView(str)))
|
||||||
|
{
|
||||||
TO_ERROR_LOG("SHA3", 30, 'ERROR: Input is invalid type, str=' + JSON.stringify(str));
|
TO_ERROR_LOG("SHA3", 30, 'ERROR: Input is invalid type, str=' + JSON.stringify(str));
|
||||||
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var bytes = 0;
|
var bytes = 0;
|
||||||
if (notString) {
|
if(notString)
|
||||||
|
{
|
||||||
bytes = length;
|
bytes = length;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
for (var i = 0; i < str.length; ++i) {
|
{
|
||||||
|
for(var i = 0; i < str.length; ++i)
|
||||||
|
{
|
||||||
var code = str.charCodeAt(i);
|
var code = str.charCodeAt(i);
|
||||||
if (code < 0x80) {
|
if(code < 0x80)
|
||||||
|
{
|
||||||
bytes += 1;
|
bytes += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (code < 0x800) {
|
if(code < 0x800)
|
||||||
|
{
|
||||||
bytes += 2;
|
bytes += 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (code < 0xd800 || code >= 0xe000) {
|
if(code < 0xd800 || code >= 0xe000)
|
||||||
|
{
|
||||||
bytes += 3;
|
bytes += 3;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));
|
code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));
|
||||||
bytes += 4;
|
bytes += 4;
|
||||||
}
|
}
|
||||||
@ -298,9 +360,11 @@
|
|||||||
this.update(str);
|
this.update(str);
|
||||||
return bytes;
|
return bytes;
|
||||||
};
|
};
|
||||||
Keccak.prototype.bytepad = function(strs, w) {
|
Keccak.prototype.bytepad = function (strs,w)
|
||||||
|
{
|
||||||
var bytes = this.encode(w);
|
var bytes = this.encode(w);
|
||||||
for (var i = 0; i < strs.length; ++i) {
|
for(var i = 0; i < strs.length; ++i)
|
||||||
|
{
|
||||||
bytes += this.encodeString(strs[i]);
|
bytes += this.encodeString(strs[i]);
|
||||||
}
|
}
|
||||||
var paddingBytes = w - bytes % w;
|
var paddingBytes = w - bytes % w;
|
||||||
@ -309,82 +373,104 @@
|
|||||||
this.update(zeros);
|
this.update(zeros);
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
Keccak.prototype.finalize = function() {
|
Keccak.prototype.finalize = function ()
|
||||||
|
{
|
||||||
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
|
||||||
blocks[i >> 2] |= this.padding[i & 3];
|
blocks[i >> 2] |= this.padding[i & 3];
|
||||||
if (this.lastByteIndex === this.byteCount) {
|
if(this.lastByteIndex === this.byteCount)
|
||||||
|
{
|
||||||
blocks[0] = blocks[blockCount];
|
blocks[0] = blocks[blockCount];
|
||||||
for (i = 1; i < blockCount + 1; ++i) {
|
for(i = 1; i < blockCount + 1; ++i)
|
||||||
|
{
|
||||||
blocks[i] = 0;
|
blocks[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blocks[blockCount - 1] |= 0x80000000;
|
blocks[blockCount - 1] |= 0x80000000;
|
||||||
for (i = 0; i < blockCount; ++i) {
|
for(i = 0; i < blockCount; ++i)
|
||||||
|
{
|
||||||
s[i] ^= blocks[i];
|
s[i] ^= blocks[i];
|
||||||
}
|
}
|
||||||
f(s);
|
f(s);
|
||||||
};
|
};
|
||||||
Keccak.prototype.toString = Keccak.prototype.hex = function() {
|
Keccak.prototype.toString = Keccak.prototype.hex = function ()
|
||||||
|
{
|
||||||
this.finalize();
|
this.finalize();
|
||||||
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
||||||
var hex = '', block;
|
var hex = '', block;
|
||||||
while (j < outputBlocks) {
|
while(j < outputBlocks)
|
||||||
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
{
|
||||||
|
for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j)
|
||||||
|
{
|
||||||
block = s[i];
|
block = s[i];
|
||||||
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] + HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] + HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] + HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] + HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];
|
||||||
}
|
}
|
||||||
if (j % blockCount === 0) {
|
if(j % blockCount === 0)
|
||||||
|
{
|
||||||
f(s);
|
f(s);
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extraBytes) {
|
if(extraBytes)
|
||||||
|
{
|
||||||
block = s[i];
|
block = s[i];
|
||||||
if (extraBytes > 0) {
|
if(extraBytes > 0)
|
||||||
|
{
|
||||||
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];
|
||||||
}
|
}
|
||||||
if (extraBytes > 1) {
|
if(extraBytes > 1)
|
||||||
|
{
|
||||||
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];
|
||||||
}
|
}
|
||||||
if (extraBytes > 2) {
|
if(extraBytes > 2)
|
||||||
|
{
|
||||||
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return hex;
|
return hex;
|
||||||
};
|
};
|
||||||
Keccak.prototype.arrayBuffer = function() {
|
Keccak.prototype.arrayBuffer = function ()
|
||||||
|
{
|
||||||
this.finalize();
|
this.finalize();
|
||||||
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
||||||
var bytes = this.outputBits >> 3;
|
var bytes = this.outputBits >> 3;
|
||||||
var buffer;
|
var buffer;
|
||||||
if (extraBytes) {
|
if(extraBytes)
|
||||||
|
{
|
||||||
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
buffer = new ArrayBuffer((outputBlocks + 1) << 2);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
buffer = new ArrayBuffer(bytes);
|
buffer = new ArrayBuffer(bytes);
|
||||||
}
|
}
|
||||||
var array = new Uint32Array(buffer);
|
var array = new Uint32Array(buffer);
|
||||||
while (j < outputBlocks) {
|
while(j < outputBlocks)
|
||||||
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
{
|
||||||
|
for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j)
|
||||||
|
{
|
||||||
array[j] = s[i];
|
array[j] = s[i];
|
||||||
}
|
}
|
||||||
if (j % blockCount === 0) {
|
if(j % blockCount === 0)
|
||||||
|
{
|
||||||
f(s);
|
f(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extraBytes) {
|
if(extraBytes)
|
||||||
|
{
|
||||||
array[i] = s[i];
|
array[i] = s[i];
|
||||||
buffer = buffer.slice(0, bytes);
|
buffer = buffer.slice(0, bytes);
|
||||||
}
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
};
|
};
|
||||||
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
|
||||||
Keccak.prototype.digest = Keccak.prototype.array = function() {
|
Keccak.prototype.digest = Keccak.prototype.array = function ()
|
||||||
|
{
|
||||||
this.finalize();
|
this.finalize();
|
||||||
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
|
||||||
var array = [], offset, block;
|
var array = [], offset, block;
|
||||||
while (j < outputBlocks) {
|
while(j < outputBlocks)
|
||||||
for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
|
{
|
||||||
|
for(i = 0; i < blockCount && j < outputBlocks; ++i, ++j)
|
||||||
|
{
|
||||||
offset = j << 2;
|
offset = j << 2;
|
||||||
block = s[i];
|
block = s[i];
|
||||||
array[offset] = block & 0xFF;
|
array[offset] = block & 0xFF;
|
||||||
@ -392,39 +478,48 @@
|
|||||||
array[offset + 2] = (block >> 16) & 0xFF;
|
array[offset + 2] = (block >> 16) & 0xFF;
|
||||||
array[offset + 3] = (block >> 24) & 0xFF;
|
array[offset + 3] = (block >> 24) & 0xFF;
|
||||||
}
|
}
|
||||||
if (j % blockCount === 0) {
|
if(j % blockCount === 0)
|
||||||
|
{
|
||||||
f(s);
|
f(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extraBytes) {
|
if(extraBytes)
|
||||||
|
{
|
||||||
offset = j << 2;
|
offset = j << 2;
|
||||||
block = s[i];
|
block = s[i];
|
||||||
if (extraBytes > 0) {
|
if(extraBytes > 0)
|
||||||
|
{
|
||||||
array[offset] = block & 0xFF;
|
array[offset] = block & 0xFF;
|
||||||
}
|
}
|
||||||
if (extraBytes > 1) {
|
if(extraBytes > 1)
|
||||||
|
{
|
||||||
array[offset + 1] = (block >> 8) & 0xFF;
|
array[offset + 1] = (block >> 8) & 0xFF;
|
||||||
}
|
}
|
||||||
if (extraBytes > 2) {
|
if(extraBytes > 2)
|
||||||
|
{
|
||||||
array[offset + 2] = (block >> 16) & 0xFF;
|
array[offset + 2] = (block >> 16) & 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
};
|
};
|
||||||
|
|
||||||
function Kmac(bits, padding, outputBits) {
|
function Kmac(bits,padding,outputBits)
|
||||||
|
{
|
||||||
Keccak.call(this, bits, padding, outputBits);
|
Keccak.call(this, bits, padding, outputBits);
|
||||||
};
|
};
|
||||||
Kmac.prototype = new Keccak();
|
Kmac.prototype = new Keccak();
|
||||||
Kmac.prototype.finalize = function() {
|
Kmac.prototype.finalize = function ()
|
||||||
|
{
|
||||||
this.encode(this.outputBits, true);
|
this.encode(this.outputBits, true);
|
||||||
return Keccak.prototype.finalize.call(this);
|
return Keccak.prototype.finalize.call(this);
|
||||||
};
|
};
|
||||||
var f = function(s) {
|
var f = function (s)
|
||||||
|
{
|
||||||
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15,
|
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15,
|
||||||
b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40,
|
b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40,
|
||||||
b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
||||||
for (n = 0; n < 48; n += 2) {
|
for(n = 0; n < 48; n += 2)
|
||||||
|
{
|
||||||
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
||||||
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
||||||
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
||||||
@ -602,47 +697,58 @@
|
|||||||
root.sha3_str = methods.sha3_256;
|
root.sha3_str = methods.sha3_256;
|
||||||
root.sha3_array_256 = methods.sha3_array_256;
|
root.sha3_array_256 = methods.sha3_array_256;
|
||||||
root.sha3 = methods.sha3_array_256;
|
root.sha3 = methods.sha3_array_256;
|
||||||
root.sha = function(data) {
|
root.sha = function (data)
|
||||||
|
{
|
||||||
return meshhash(methods.sha3_256(data));
|
return meshhash(methods.sha3_256(data));
|
||||||
};
|
};
|
||||||
root.shaarr = function(data) {
|
root.shaarr = function (data)
|
||||||
|
{
|
||||||
return meshhash(methods.sha3_array_256(data));
|
return meshhash(methods.sha3_array_256(data));
|
||||||
};
|
};
|
||||||
root.shabuf = function(data) {
|
root.shabuf = function (data)
|
||||||
|
{
|
||||||
return Buffer.from(shaarr(data));
|
return Buffer.from(shaarr(data));
|
||||||
};
|
};
|
||||||
root.shabuf = function(data) {
|
root.shabuf = function (data)
|
||||||
|
{
|
||||||
return Buffer.from(shaarr(data));
|
return Buffer.from(shaarr(data));
|
||||||
};
|
};
|
||||||
root.SHA3BUF = function(data, num) {
|
root.SHA3BUF = function (data,num)
|
||||||
|
{
|
||||||
return Buffer.from(SHA3ARR(data, num));
|
return Buffer.from(SHA3ARR(data, num));
|
||||||
};
|
};
|
||||||
root.SHA3ARR = function(data, num) {
|
root.SHA3ARR = function (data,num)
|
||||||
if (!NEW_SIGN_TIME || !num || num >= NEW_SIGN_TIME)
|
{
|
||||||
|
if(!NEW_SIGN_TIME || !num || num >= NEW_SIGN_TIME)
|
||||||
return sha3(data);
|
return sha3(data);
|
||||||
else
|
else
|
||||||
return meshhash(methods.sha3_array_256(data));
|
return meshhash(methods.sha3_array_256(data));
|
||||||
};
|
};
|
||||||
root.shaarrblock = function(data, num) {
|
root.shaarrblock = function (data,num)
|
||||||
|
{
|
||||||
return meshhash(methods.sha3_array_256(data), num);
|
return meshhash(methods.sha3_array_256(data), num);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function meshhash(hash, num) {
|
function meshhash(hash,num)
|
||||||
|
{
|
||||||
var regs = [hash[3], hash[2], hash[1], hash[0]];
|
var regs = [hash[3], hash[2], hash[1], hash[0]];
|
||||||
var mem = [];
|
var mem = [];
|
||||||
for (var i = 0; i < 16; i++) {
|
for(var i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
mem[i] = hash[i * 2] + (hash[i * 2 + 1] << 8);
|
mem[i] = hash[i * 2] + (hash[i * 2 + 1] << 8);
|
||||||
}
|
}
|
||||||
var WasGoto = 0;
|
var WasGoto = 0;
|
||||||
var L = 0;
|
var L = 0;
|
||||||
for (var i = 0; i < 64; i++) {
|
for(var i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
var c = hash[L & 31];
|
var c = hash[L & 31];
|
||||||
L++;
|
L++;
|
||||||
var a = (c >> 4) & 0xF;
|
var a = (c >> 4) & 0xF;
|
||||||
var b = c & 0xF;
|
var b = c & 0xF;
|
||||||
var r = c & 0x3;
|
var r = c & 0x3;
|
||||||
switch (a) {
|
switch(a)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
regs[0] = regs[0] + regs[r];
|
regs[0] = regs[0] + regs[r];
|
||||||
break;
|
break;
|
||||||
@ -662,13 +768,15 @@ function meshhash(hash, num) {
|
|||||||
regs[0] = regs[0] + regs[1] + regs[2] + regs[3];
|
regs[0] = regs[0] + regs[1] + regs[2] + regs[3];
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if ((regs[0] & 0xFFFF) < 32768 && !WasGoto) {
|
if((regs[0] & 0xFFFF) < 32768 && !WasGoto)
|
||||||
|
{
|
||||||
L = 32 + L - b;
|
L = 32 + L - b;
|
||||||
WasGoto = 1;
|
WasGoto = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
if ((regs[0] & 0xFFFF) > 32768 && !WasGoto) {
|
if((regs[0] & 0xFFFF) > 32768 && !WasGoto)
|
||||||
|
{
|
||||||
L += b;
|
L += b;
|
||||||
WasGoto = 1;
|
WasGoto = 1;
|
||||||
}
|
}
|
||||||
@ -678,14 +786,16 @@ function meshhash(hash, num) {
|
|||||||
}
|
}
|
||||||
var index1 = regs[0] & 0xF;
|
var index1 = regs[0] & 0xF;
|
||||||
var index2 = (regs[0] >> 8) & 0xF;
|
var index2 = (regs[0] >> 8) & 0xF;
|
||||||
if (index1 !== index2) {
|
if(index1 !== index2)
|
||||||
|
{
|
||||||
var temp = mem[index1];
|
var temp = mem[index1];
|
||||||
mem[index1] = mem[index2];
|
mem[index1] = mem[index2];
|
||||||
mem[index2] = temp;
|
mem[index2] = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var ret = [];
|
var ret = [];
|
||||||
for (var i = 0; i < 16; i++) {
|
for(var i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
ret[i * 2] = mem[i] & 0xFF;
|
ret[i * 2] = mem[i] & 0xFF;
|
||||||
ret[i * 2 + 1] = mem[i] >> 8;
|
ret[i * 2 + 1] = mem[i] >> 8;
|
||||||
}
|
}
|
||||||
|
3486
src/HTML/JS/sign-lib-min.js
vendored
@ -12,7 +12,8 @@ var DELTA_LONG_MINING = 5000;
|
|||||||
var BLOCKNUM_ALGO2 = 6560000;
|
var BLOCKNUM_ALGO2 = 6560000;
|
||||||
var BLOCKNUM_HASH_NEW = 10195000;
|
var BLOCKNUM_HASH_NEW = 10195000;
|
||||||
var BLOCKNUM_TICKET_ALGO = 16070000;
|
var BLOCKNUM_TICKET_ALGO = 16070000;
|
||||||
if (typeof global === "object") {
|
if(typeof global === "object")
|
||||||
|
{
|
||||||
global.GetHashFromSeqAddr = GetHashFromSeqAddr;
|
global.GetHashFromSeqAddr = GetHashFromSeqAddr;
|
||||||
global.CalcHashBlockFromSeqAddr = CalcHashBlockFromSeqAddr;
|
global.CalcHashBlockFromSeqAddr = CalcHashBlockFromSeqAddr;
|
||||||
global.GetHashFromNum2 = GetHashFromNum2;
|
global.GetHashFromNum2 = GetHashFromNum2;
|
||||||
@ -20,23 +21,28 @@ if (typeof global === "object") {
|
|||||||
global.GetHashFromArrNum2 = GetHashFromArrNum2;
|
global.GetHashFromArrNum2 = GetHashFromArrNum2;
|
||||||
global.XORArr = XORArr;
|
global.XORArr = XORArr;
|
||||||
global.GetHash = GetHash;
|
global.GetHash = GetHash;
|
||||||
if (global.LOCAL_RUN || global.TEST_NETWORK) {
|
if(global.LOCAL_RUN || global.TEST_NETWORK)
|
||||||
|
{
|
||||||
BLOCKNUM_ALGO2 = 0;
|
BLOCKNUM_ALGO2 = 0;
|
||||||
if (global.TEST_NETWORK) {
|
if(global.TEST_NETWORK)
|
||||||
|
{
|
||||||
BLOCKNUM_HASH_NEW = 100;
|
BLOCKNUM_HASH_NEW = 100;
|
||||||
BLOCKNUM_TICKET_ALGO = 0;
|
BLOCKNUM_TICKET_ALGO = 0;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
BLOCKNUM_HASH_NEW = 100;
|
BLOCKNUM_HASH_NEW = 100;
|
||||||
BLOCKNUM_TICKET_ALGO = 0;
|
BLOCKNUM_TICKET_ALGO = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetHashFromSeqAddr(SeqHash, AddrHash, BlockNum, PrevHash, MiningVer) {
|
function GetHashFromSeqAddr(SeqHash,AddrHash,BlockNum,PrevHash,MiningVer)
|
||||||
if (BlockNum < BLOCKNUM_ALGO2) {
|
{
|
||||||
|
if(BlockNum < BLOCKNUM_ALGO2)
|
||||||
|
{
|
||||||
var Hash = shaarrblock2(SeqHash, AddrHash, BlockNum);
|
var Hash = shaarrblock2(SeqHash, AddrHash, BlockNum);
|
||||||
return { Hash: Hash, PowHash: Hash, Hash1: Hash, Hash2: Hash };
|
return {Hash:Hash, PowHash:Hash, Hash1:Hash, Hash2:Hash};
|
||||||
}
|
}
|
||||||
var MinerID = ReadUintFromArr(AddrHash, 0);
|
var MinerID = ReadUintFromArr(AddrHash, 0);
|
||||||
var Nonce0 = ReadUintFromArr(AddrHash, 6);
|
var Nonce0 = ReadUintFromArr(AddrHash, 6);
|
||||||
@ -45,26 +51,31 @@ function GetHashFromSeqAddr(SeqHash, AddrHash, BlockNum, PrevHash, MiningVer) {
|
|||||||
var DeltaNum1 = ReadUint16FromArr(AddrHash, 24);
|
var DeltaNum1 = ReadUint16FromArr(AddrHash, 24);
|
||||||
var DeltaNum2 = ReadUint16FromArr(AddrHash, 26);
|
var DeltaNum2 = ReadUint16FromArr(AddrHash, 26);
|
||||||
var PrevHashNum;
|
var PrevHashNum;
|
||||||
if (PrevHash) {
|
if(PrevHash)
|
||||||
|
{
|
||||||
PrevHashNum = ReadUint32FromArr(PrevHash, 28);
|
PrevHashNum = ReadUint32FromArr(PrevHash, 28);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
PrevHashNum = ReadUint32FromArr(AddrHash, 28);
|
PrevHashNum = ReadUint32FromArr(AddrHash, 28);
|
||||||
}
|
}
|
||||||
var Data = GetHash(SeqHash, PrevHashNum, BlockNum, MinerID, Nonce0, Nonce1, Nonce2, DeltaNum1, DeltaNum2);
|
var Data = GetHash(SeqHash, PrevHashNum, BlockNum, MinerID, Nonce0, Nonce1, Nonce2, DeltaNum1, DeltaNum2);
|
||||||
if (MiningVer) {
|
if(MiningVer)
|
||||||
if (AddrHash[17] !== MiningVer || AddrHash[23] !== MiningVer) {
|
{
|
||||||
|
if(AddrHash[17] !== MiningVer || AddrHash[23] !== MiningVer)
|
||||||
|
{
|
||||||
Data.PowHash = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
Data.PowHash = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255];
|
255, 255, 255, 255, 255, 255, 255, 255, 255, 255];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Data;
|
return Data;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2, DeltaNum1, DeltaNum2) {
|
function GetHash(BlockHash,PrevHashNum,BlockNum,Miner,Nonce0,Nonce1,Nonce2,DeltaNum1,DeltaNum2)
|
||||||
if (DeltaNum1 > DELTA_LONG_MINING)
|
{
|
||||||
|
if(DeltaNum1 > DELTA_LONG_MINING)
|
||||||
DeltaNum1 = 0;
|
DeltaNum1 = 0;
|
||||||
if (DeltaNum2 > DELTA_LONG_MINING)
|
if(DeltaNum2 > DELTA_LONG_MINING)
|
||||||
DeltaNum2 = 0;
|
DeltaNum2 = 0;
|
||||||
var HashBase = GetHashFromNum2(BlockNum, PrevHashNum);
|
var HashBase = GetHashFromNum2(BlockNum, PrevHashNum);
|
||||||
var HashCurrent = GetHashFromArrNum2(BlockHash, Miner, Nonce0);
|
var HashCurrent = GetHashFromArrNum2(BlockHash, Miner, Nonce0);
|
||||||
@ -72,15 +83,18 @@ function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2
|
|||||||
var HashNonce2 = GetHashFromNum3(BlockNum - DeltaNum2, Miner, Nonce2);
|
var HashNonce2 = GetHashFromNum3(BlockNum - DeltaNum2, Miner, Nonce2);
|
||||||
var Hash1 = XORArr(HashBase, HashNonce1);
|
var Hash1 = XORArr(HashBase, HashNonce1);
|
||||||
var Hash2 = XORArr(HashCurrent, HashNonce2);
|
var Hash2 = XORArr(HashCurrent, HashNonce2);
|
||||||
var Ret = { Hash: Hash2, Hash1: Hash1, Hash2: Hash2 };
|
var Ret = {Hash:Hash2, Hash1:Hash1, Hash2:Hash2};
|
||||||
if (CompareArr(Hash1, Hash2) > 0) {
|
if(CompareArr(Hash1, Hash2) > 0)
|
||||||
|
{
|
||||||
Ret.PowHash = Hash1;
|
Ret.PowHash = Hash1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Ret.PowHash = Hash2;
|
Ret.PowHash = Hash2;
|
||||||
}
|
}
|
||||||
if (BlockNum >= BLOCKNUM_HASH_NEW) {
|
if(BlockNum >= BLOCKNUM_HASH_NEW)
|
||||||
if (BlockNum >= BLOCKNUM_TICKET_ALGO)
|
{
|
||||||
|
if(BlockNum >= BLOCKNUM_TICKET_ALGO)
|
||||||
Ret.Hash = sha3arr2(Hash1, Hash2);
|
Ret.Hash = sha3arr2(Hash1, Hash2);
|
||||||
else
|
else
|
||||||
Ret.Hash = shaarr2(Hash1, Hash2);
|
Ret.Hash = shaarr2(Hash1, Hash2);
|
||||||
@ -88,37 +102,43 @@ function GetHash(BlockHash, PrevHashNum, BlockNum, Miner, Nonce0, Nonce1, Nonce2
|
|||||||
return Ret;
|
return Ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
function CalcHashBlockFromSeqAddr(Block, PrevHash, MiningVer) {
|
function CalcHashBlockFromSeqAddr(Block,PrevHash,MiningVer)
|
||||||
|
{
|
||||||
var Value = GetHashFromSeqAddr(Block.SeqHash, Block.AddrHash, Block.BlockNum, PrevHash, MiningVer);
|
var Value = GetHashFromSeqAddr(Block.SeqHash, Block.AddrHash, Block.BlockNum, PrevHash, MiningVer);
|
||||||
Block.Hash = Value.Hash;
|
Block.Hash = Value.Hash;
|
||||||
Block.PowHash = Value.PowHash;
|
Block.PowHash = Value.PowHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
function XORArr(Arr1, Arr2) {
|
function XORArr(Arr1,Arr2)
|
||||||
|
{
|
||||||
var Ret = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
var Ret = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
for (var i = 0; i < 32; i++) {
|
for(var i = 0; i < 32; i++)
|
||||||
|
{
|
||||||
Ret[i] = Arr1[i] ^ Arr2[i];
|
Ret[i] = Arr1[i] ^ Arr2[i];
|
||||||
}
|
}
|
||||||
return Ret;
|
return Ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetHashFromNum2(Value1, Value2) {
|
function GetHashFromNum2(Value1,Value2)
|
||||||
|
{
|
||||||
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
WriteUintToArrOnPos(MeshArr, Value1, 0);
|
WriteUintToArrOnPos(MeshArr, Value1, 0);
|
||||||
WriteUintToArrOnPos(MeshArr, Value2, 6);
|
WriteUintToArrOnPos(MeshArr, Value2, 6);
|
||||||
return sha3(MeshArr);
|
return sha3(MeshArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetHashFromArrNum2(Arr, Value1, Value2) {
|
function GetHashFromArrNum2(Arr,Value1,Value2)
|
||||||
|
{
|
||||||
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0];
|
0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
WriteArrToArrOnPos(MeshArr, Arr, 0, 32);
|
WriteArrToArrOnPos(MeshArr, Arr, 0, 32);
|
||||||
WriteUintToArrOnPos(MeshArr, Value1, 32);
|
WriteUintToArrOnPos(MeshArr, Value1, 32);
|
||||||
WriteUintToArrOnPos(MeshArr, Value2, 38);
|
WriteUintToArrOnPos(MeshArr, Value2, 38);
|
||||||
return sha3(MeshArr);
|
return sha3(MeshArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetHashFromNum3(Value1, Value2, Value3) {
|
function GetHashFromNum3(Value1,Value2,Value3)
|
||||||
|
{
|
||||||
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
var MeshArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
WriteUintToArrOnPos(MeshArr, Value1, 0);
|
WriteUintToArrOnPos(MeshArr, Value1, 0);
|
||||||
WriteUintToArrOnPos(MeshArr, Value2, 6);
|
WriteUintToArrOnPos(MeshArr, Value2, 6);
|
||||||
@ -126,8 +146,10 @@ function GetHashFromNum3(Value1, Value2, Value3) {
|
|||||||
return sha3(MeshArr);
|
return sha3(MeshArr);
|
||||||
};
|
};
|
||||||
|
|
||||||
function ReadUintFromArr(arr, len) {
|
function ReadUintFromArr(arr,len)
|
||||||
if (len === undefined) {
|
{
|
||||||
|
if(len === undefined)
|
||||||
|
{
|
||||||
len = arr.len;
|
len = arr.len;
|
||||||
arr.len += 6;
|
arr.len += 6;
|
||||||
}
|
}
|
||||||
@ -137,8 +159,10 @@ function ReadUintFromArr(arr, len) {
|
|||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
function ReadUint32FromArr(arr, len) {
|
function ReadUint32FromArr(arr,len)
|
||||||
if (len === undefined) {
|
{
|
||||||
|
if(len === undefined)
|
||||||
|
{
|
||||||
len = arr.len;
|
len = arr.len;
|
||||||
arr.len += 4;
|
arr.len += 4;
|
||||||
}
|
}
|
||||||
@ -146,8 +170,10 @@ function ReadUint32FromArr(arr, len) {
|
|||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
function ReadUint16FromArr(arr, len) {
|
function ReadUint16FromArr(arr,len)
|
||||||
if (len === undefined) {
|
{
|
||||||
|
if(len === undefined)
|
||||||
|
{
|
||||||
len = arr.len;
|
len = arr.len;
|
||||||
arr.len += 2;
|
arr.len += 2;
|
||||||
}
|
}
|
||||||
@ -155,17 +181,20 @@ function ReadUint16FromArr(arr, len) {
|
|||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
function ReadArrFromArr(arr, length) {
|
function ReadArrFromArr(arr,length)
|
||||||
|
{
|
||||||
var Ret = [];
|
var Ret = [];
|
||||||
var len = arr.len;
|
var len = arr.len;
|
||||||
for (var i = 0; i < length; i++) {
|
for(var i = 0; i < length; i++)
|
||||||
|
{
|
||||||
Ret[i] = arr[len + i];
|
Ret[i] = arr[len + i];
|
||||||
}
|
}
|
||||||
arr.len += length;
|
arr.len += length;
|
||||||
return Ret;
|
return Ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteUintToArr(arr, Num) {
|
function WriteUintToArr(arr,Num)
|
||||||
|
{
|
||||||
var len = arr.length;
|
var len = arr.length;
|
||||||
arr[len] = Num & 0xFF;
|
arr[len] = Num & 0xFF;
|
||||||
arr[len + 1] = (Num >>> 8) & 0xFF;
|
arr[len + 1] = (Num >>> 8) & 0xFF;
|
||||||
@ -176,7 +205,8 @@ function WriteUintToArr(arr, Num) {
|
|||||||
arr[len + 5] = (NumH >>> 8) & 0xFF;
|
arr[len + 5] = (NumH >>> 8) & 0xFF;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteUintToArrOnPos(arr, Num, Pos) {
|
function WriteUintToArrOnPos(arr,Num,Pos)
|
||||||
|
{
|
||||||
arr[Pos] = Num & 0xFF;
|
arr[Pos] = Num & 0xFF;
|
||||||
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
||||||
arr[Pos + 2] = (Num >>> 16) & 0xFF;
|
arr[Pos + 2] = (Num >>> 16) & 0xFF;
|
||||||
@ -186,7 +216,8 @@ function WriteUintToArrOnPos(arr, Num, Pos) {
|
|||||||
arr[Pos + 5] = (NumH >>> 8) & 0xFF;
|
arr[Pos + 5] = (NumH >>> 8) & 0xFF;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteUint32ToArr(arr, Num) {
|
function WriteUint32ToArr(arr,Num)
|
||||||
|
{
|
||||||
var len = arr.length;
|
var len = arr.length;
|
||||||
arr[len] = Num & 0xFF;
|
arr[len] = Num & 0xFF;
|
||||||
arr[len + 1] = (Num >>> 8) & 0xFF;
|
arr[len + 1] = (Num >>> 8) & 0xFF;
|
||||||
@ -194,124 +225,148 @@ function WriteUint32ToArr(arr, Num) {
|
|||||||
arr[len + 3] = (Num >>> 24) & 0xFF;
|
arr[len + 3] = (Num >>> 24) & 0xFF;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteUint32ToArrOnPos(arr, Num, Pos) {
|
function WriteUint32ToArrOnPos(arr,Num,Pos)
|
||||||
|
{
|
||||||
arr[Pos] = Num & 0xFF;
|
arr[Pos] = Num & 0xFF;
|
||||||
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
||||||
arr[Pos + 2] = (Num >>> 16) & 0xFF;
|
arr[Pos + 2] = (Num >>> 16) & 0xFF;
|
||||||
arr[Pos + 3] = (Num >>> 24) & 0xFF;
|
arr[Pos + 3] = (Num >>> 24) & 0xFF;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteUint16ToArrOnPos(arr, Num, Pos) {
|
function WriteUint16ToArrOnPos(arr,Num,Pos)
|
||||||
|
{
|
||||||
arr[Pos] = Num & 0xFF;
|
arr[Pos] = Num & 0xFF;
|
||||||
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
arr[Pos + 1] = (Num >>> 8) & 0xFF;
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteArrToArr(arr, arr2, ConstLength) {
|
function WriteArrToArr(arr,arr2,ConstLength)
|
||||||
|
{
|
||||||
var len = arr.length;
|
var len = arr.length;
|
||||||
for (var i = 0; i < ConstLength; i++) {
|
for(var i = 0; i < ConstLength; i++)
|
||||||
|
{
|
||||||
arr[len + i] = arr2[i];
|
arr[len + i] = arr2[i];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteArrToArrOnPos(arr, arr2, Pos, ConstLength) {
|
function WriteArrToArrOnPos(arr,arr2,Pos,ConstLength)
|
||||||
for (var i = 0; i < ConstLength; i++) {
|
{
|
||||||
|
for(var i = 0; i < ConstLength; i++)
|
||||||
|
{
|
||||||
arr[Pos + i] = arr2[i];
|
arr[Pos + i] = arr2[i];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function WriteArrToArrHOnPos(arr, arr2, Pos, ConstLength) {
|
function WriteArrToArrHOnPos(arr,arr2,Pos,ConstLength)
|
||||||
for (var i = 0; i < ConstLength; i++) {
|
{
|
||||||
|
for(var i = 0; i < ConstLength; i++)
|
||||||
|
{
|
||||||
arr[Pos + i] |= (arr2[i] << 8);
|
arr[Pos + i] |= (arr2[i] << 8);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function ConvertBufferToStr(Data) {
|
function ConvertBufferToStr(Data)
|
||||||
for (var key in Data) {
|
{
|
||||||
|
for(var key in Data)
|
||||||
|
{
|
||||||
var item = Data[key];
|
var item = Data[key];
|
||||||
if (item instanceof Buffer) {
|
if(item instanceof Buffer)
|
||||||
|
{
|
||||||
Data[key] = GetHexFromArr(item);
|
Data[key] = GetHexFromArr(item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (typeof item === "object")
|
if(typeof item === "object")
|
||||||
ConvertBufferToStr(item);
|
ConvertBufferToStr(item);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function CopyObjValue(obj, num) {
|
function CopyObjValue(obj,num)
|
||||||
if (num && num > 5)
|
{
|
||||||
|
if(num && num > 5)
|
||||||
return obj;
|
return obj;
|
||||||
var ret = {};
|
var ret = {};
|
||||||
for (var key in obj) {
|
for(var key in obj)
|
||||||
|
{
|
||||||
var val = obj[key];
|
var val = obj[key];
|
||||||
if ((typeof val === "object") && !(val instanceof Buffer) && !(val instanceof ArrayBuffer) && !(val instanceof Array))
|
if((typeof val === "object") && !(val instanceof Buffer) && !(val instanceof ArrayBuffer) && !(val instanceof Array))
|
||||||
val = CopyObjValue(val, num + 1);
|
val = CopyObjValue(val, num + 1);
|
||||||
ret[key] = val;
|
ret[key] = val;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
function CopyArr(arr1) {
|
function CopyArr(arr1)
|
||||||
|
{
|
||||||
var arr2 = [];
|
var arr2 = [];
|
||||||
if (arr1)
|
if(arr1)
|
||||||
for (var i = 0; i < arr1.length; i++)
|
for(var i = 0; i < arr1.length; i++)
|
||||||
arr2[i] = arr1[i];
|
arr2[i] = arr1[i];
|
||||||
return arr2;
|
return arr2;
|
||||||
};
|
};
|
||||||
|
|
||||||
function ParseNum(a) {
|
function ParseNum(a)
|
||||||
|
{
|
||||||
var Num = parseInt(a);
|
var Num = parseInt(a);
|
||||||
if (!Num)
|
if(!Num)
|
||||||
Num = 0;
|
Num = 0;
|
||||||
if (isNaN(Num))
|
if(isNaN(Num))
|
||||||
Num = 0;
|
Num = 0;
|
||||||
if (Num < 0)
|
if(Num < 0)
|
||||||
Num = 0;
|
Num = 0;
|
||||||
return Num;
|
return Num;
|
||||||
};
|
};
|
||||||
|
|
||||||
function CompareArr(a, b) {
|
function CompareArr(a,b)
|
||||||
for (var i = 0; i < a.length; i++) {
|
{
|
||||||
if (a[i] !== b[i])
|
for(var i = 0; i < a.length; i++)
|
||||||
|
{
|
||||||
|
if(a[i] !== b[i])
|
||||||
return a[i] - b[i];
|
return a[i] - b[i];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
function CompareArrL(a, b) {
|
function CompareArrL(a,b)
|
||||||
if (a.length !== b.length)
|
{
|
||||||
|
if(a.length !== b.length)
|
||||||
return a.length - b.length;
|
return a.length - b.length;
|
||||||
for (var i = 0; i < a.length; i++) {
|
for(var i = 0; i < a.length; i++)
|
||||||
if (a[i] !== b[i])
|
{
|
||||||
|
if(a[i] !== b[i])
|
||||||
return a[i] - b[i];
|
return a[i] - b[i];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetSeqHash(BlockNum, PrevHash, TreeHash) {
|
function GetSeqHash(BlockNum,PrevHash,TreeHash)
|
||||||
|
{
|
||||||
var arr = [GetArrFromValue(BlockNum), PrevHash, TreeHash];
|
var arr = [GetArrFromValue(BlockNum), PrevHash, TreeHash];
|
||||||
var SeqHash = CalcHashFromArray(arr, true);
|
var SeqHash = CalcHashFromArray(arr, true);
|
||||||
return SeqHash;
|
return SeqHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
function arr2(Value1, Value2) {
|
function arr2(Value1,Value2)
|
||||||
|
{
|
||||||
var Buf = [];
|
var Buf = [];
|
||||||
for (var n = 0; n < Value1.length; n++)
|
for(var n = 0; n < Value1.length; n++)
|
||||||
Buf.push(Value1[n]);
|
Buf.push(Value1[n]);
|
||||||
for (var n = 0; n < Value2.length; n++)
|
for(var n = 0; n < Value2.length; n++)
|
||||||
Buf.push(Value2[n]);
|
Buf.push(Value2[n]);
|
||||||
return Buf;
|
return Buf;
|
||||||
};
|
};
|
||||||
|
|
||||||
function shaarr2(Value1, Value2) {
|
function shaarr2(Value1,Value2)
|
||||||
|
{
|
||||||
return shaarr(arr2(Value1, Value2));
|
return shaarr(arr2(Value1, Value2));
|
||||||
};
|
};
|
||||||
|
|
||||||
function sha3arr2(Value1, Value2) {
|
function sha3arr2(Value1,Value2)
|
||||||
|
{
|
||||||
return sha3(arr2(Value1, Value2));
|
return sha3(arr2(Value1, Value2));
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetBlockArrFromBuffer(BufRead, Info) {
|
function GetBlockArrFromBuffer(BufRead,Info)
|
||||||
if (!BufRead || BufRead.length < 10)
|
{
|
||||||
|
if(!BufRead || BufRead.length < 10)
|
||||||
return [];
|
return [];
|
||||||
var BLOCK_PROCESSING_LENGTH = 8;
|
var BLOCK_PROCESSING_LENGTH = 8;
|
||||||
var BLOCK_PROCESSING_LENGTH2 = BLOCK_PROCESSING_LENGTH * 2;
|
var BLOCK_PROCESSING_LENGTH2 = BLOCK_PROCESSING_LENGTH * 2;
|
||||||
@ -319,19 +374,24 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
var StartNum = ReadUintFromArr(BufRead);
|
var StartNum = ReadUintFromArr(BufRead);
|
||||||
var CountLoad = ReadUint32FromArr(BufRead);
|
var CountLoad = ReadUint32FromArr(BufRead);
|
||||||
var BufSize = 6 + 4 + BLOCK_PROCESSING_LENGTH2 * 32 + 32 + 6 + CountLoad * 64;
|
var BufSize = 6 + 4 + BLOCK_PROCESSING_LENGTH2 * 32 + 32 + 6 + CountLoad * 64;
|
||||||
if (CountLoad <= 0 || BufSize !== BufRead.length) {
|
if(CountLoad <= 0 || BufSize !== BufRead.length)
|
||||||
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
var PrevBlock;
|
var PrevBlock;
|
||||||
var BlockArr = [];
|
var BlockArr = [];
|
||||||
for (var i = 0; i < CountLoad + BLOCK_PROCESSING_LENGTH2; i++) {
|
for(var i = 0; i < CountLoad + BLOCK_PROCESSING_LENGTH2; i++)
|
||||||
|
{
|
||||||
var Block = {};
|
var Block = {};
|
||||||
Block.BlockNum = StartNum + i;
|
Block.BlockNum = StartNum + i;
|
||||||
if (i < BLOCK_PROCESSING_LENGTH2) {
|
if(i < BLOCK_PROCESSING_LENGTH2)
|
||||||
|
{
|
||||||
Block.Hash = ReadArrFromArr(BufRead, 32);
|
Block.Hash = ReadArrFromArr(BufRead, 32);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (i === BLOCK_PROCESSING_LENGTH2) {
|
{
|
||||||
|
if(i === BLOCK_PROCESSING_LENGTH2)
|
||||||
|
{
|
||||||
Block.SumHash = ReadArrFromArr(BufRead, 32);
|
Block.SumHash = ReadArrFromArr(BufRead, 32);
|
||||||
Block.SumPow = ReadUintFromArr(BufRead);
|
Block.SumPow = ReadUintFromArr(BufRead);
|
||||||
}
|
}
|
||||||
@ -339,7 +399,8 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
Block.AddrHash = ReadArrFromArr(BufRead, 32);
|
Block.AddrHash = ReadArrFromArr(BufRead, 32);
|
||||||
var arr = [];
|
var arr = [];
|
||||||
var start = i - BLOCK_PROCESSING_LENGTH2;
|
var start = i - BLOCK_PROCESSING_LENGTH2;
|
||||||
for (var n = 0; n < BLOCK_PROCESSING_LENGTH; n++) {
|
for(var n = 0; n < BLOCK_PROCESSING_LENGTH; n++)
|
||||||
|
{
|
||||||
var Prev = BlockArr[start + n];
|
var Prev = BlockArr[start + n];
|
||||||
arr.push(Prev.Hash);
|
arr.push(Prev.Hash);
|
||||||
}
|
}
|
||||||
@ -347,10 +408,12 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
Block.SeqHash = GetSeqHash(Block.BlockNum, Block.PrevHash, Block.TreeHash);
|
Block.SeqHash = GetSeqHash(Block.BlockNum, Block.PrevHash, Block.TreeHash);
|
||||||
var PrevHashNum = ReadUint32FromArr(Block.PrevHash, 28);
|
var PrevHashNum = ReadUint32FromArr(Block.PrevHash, 28);
|
||||||
var PrevAddrNum = ReadUint32FromArr(Block.AddrHash, 28);
|
var PrevAddrNum = ReadUint32FromArr(Block.AddrHash, 28);
|
||||||
if (PrevHashNum !== PrevAddrNum && Block.BlockNum > 20000000) {
|
if(PrevHashNum !== PrevAddrNum && Block.BlockNum > 20000000)
|
||||||
if (global.WATCHDOG_DEV) {
|
{
|
||||||
|
if(global.WATCHDOG_DEV)
|
||||||
|
{
|
||||||
var Str = "";
|
var Str = "";
|
||||||
if (Info && Info.Node)
|
if(Info && Info.Node)
|
||||||
Str = " from " + NodeName(Info.Node);
|
Str = " from " + NodeName(Info.Node);
|
||||||
ToError("Error on block load: " + Block.BlockNum + Str);
|
ToError("Error on block load: " + Block.BlockNum + Str);
|
||||||
}
|
}
|
||||||
@ -358,7 +421,8 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
}
|
}
|
||||||
CalcHashBlockFromSeqAddr(Block, Block.PrevHash);
|
CalcHashBlockFromSeqAddr(Block, Block.PrevHash);
|
||||||
Block.Power = GetPowPower(Block.PowHash);
|
Block.Power = GetPowPower(Block.PowHash);
|
||||||
if (PrevBlock) {
|
if(PrevBlock)
|
||||||
|
{
|
||||||
Block.SumHash = shaarr2(PrevBlock.SumHash, Block.Hash);
|
Block.SumHash = shaarr2(PrevBlock.SumHash, Block.Hash);
|
||||||
}
|
}
|
||||||
PrevBlock = Block;
|
PrevBlock = Block;
|
||||||
@ -368,9 +432,11 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
Block.TrDataLen = 0;
|
Block.TrDataLen = 0;
|
||||||
BlockArr.push(Block);
|
BlockArr.push(Block);
|
||||||
}
|
}
|
||||||
for (var i = BlockArr.length - 1; i >= 0; i--) {
|
for(var i = BlockArr.length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
var Block = BlockArr[i];
|
var Block = BlockArr[i];
|
||||||
if (!Block.SumHash) {
|
if(!Block.SumHash)
|
||||||
|
{
|
||||||
BlockArr = BlockArr.slice(i + 1);
|
BlockArr = BlockArr.slice(i + 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -378,10 +444,12 @@ function GetBlockArrFromBuffer(BufRead, Info) {
|
|||||||
return BlockArr;
|
return BlockArr;
|
||||||
};
|
};
|
||||||
|
|
||||||
function shaarrblock2(Value1, Value2, BlockNum) {
|
function shaarrblock2(Value1,Value2,BlockNum)
|
||||||
|
{
|
||||||
return shaarrblock(arr2(Value1, Value2), BlockNum);
|
return shaarrblock(arr2(Value1, Value2), BlockNum);
|
||||||
};
|
};
|
||||||
if (typeof global === "object") {
|
if(typeof global === "object")
|
||||||
|
{
|
||||||
global.ReadUint32FromArr = ReadUint32FromArr;
|
global.ReadUint32FromArr = ReadUint32FromArr;
|
||||||
global.ReadUintFromArr = ReadUintFromArr;
|
global.ReadUintFromArr = ReadUintFromArr;
|
||||||
global.ReadUint16FromArr = ReadUint16FromArr;
|
global.ReadUint16FromArr = ReadUint16FromArr;
|
||||||
@ -406,6 +474,7 @@ if (typeof global === "object") {
|
|||||||
global.shaarrblock2 = shaarrblock2;
|
global.shaarrblock2 = shaarrblock2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (typeof window === "object") {
|
if(typeof window === "object")
|
||||||
|
{
|
||||||
global = window;
|
global = window;
|
||||||
}
|
}
|
||||||
|
@ -19,56 +19,65 @@ var MaxBlockNum = 0;
|
|||||||
var DelList = {};
|
var DelList = {};
|
||||||
var WasAccountsDataStr;
|
var WasAccountsDataStr;
|
||||||
|
|
||||||
function SetAccountsData(Data, AccountsDataStr) {
|
function SetAccountsData(Data,AccountsDataStr)
|
||||||
if (!Data || !Data.result)
|
{
|
||||||
return;
|
if(!Data || !Data.result)
|
||||||
if ($("idBtRun"))
|
return ;
|
||||||
|
if($("idBtRun"))
|
||||||
$("idBtRun").style.display = (Data.arr.length ? '' : 'none');
|
$("idBtRun").style.display = (Data.arr.length ? '' : 'none');
|
||||||
if (AccountsDataStr === WasAccountsDataStr)
|
if(AccountsDataStr === WasAccountsDataStr)
|
||||||
return;
|
return ;
|
||||||
WasAccountsDataStr = AccountsDataStr;
|
WasAccountsDataStr = AccountsDataStr;
|
||||||
var arr = Data.arr;
|
var arr = Data.arr;
|
||||||
var Select = $("idAccount");
|
var Select = $("idAccount");
|
||||||
if (arr.length !== Select.options.length) {
|
if(arr.length !== Select.options.length)
|
||||||
|
{
|
||||||
var options = Select.options;
|
var options = Select.options;
|
||||||
options.length = arr.length;
|
options.length = arr.length;
|
||||||
}
|
}
|
||||||
MaxBlockNum = GetCurrentBlockNumByTime();
|
MaxBlockNum = GetCurrentBlockNumByTime();
|
||||||
SetGridData(arr, "grid_accounts", "idMyTotalSum");
|
SetGridData(arr, "grid_accounts", "idMyTotalSum");
|
||||||
for (var i = 0; arr && i < arr.length; i++) {
|
for(var i = 0; arr && i < arr.length; i++)
|
||||||
|
{
|
||||||
var Item = arr[i];
|
var Item = arr[i];
|
||||||
Item.MyAccount = true;
|
Item.MyAccount = true;
|
||||||
var Num = ParseNum(Item.Num);
|
var Num = ParseNum(Item.Num);
|
||||||
if (!MapAccounts[Num])
|
if(!MapAccounts[Num])
|
||||||
MapAccounts[Num] = {};
|
MapAccounts[Num] = {};
|
||||||
CopyObjKeys(MapAccounts[Num], Item);
|
CopyObjKeys(MapAccounts[Num], Item);
|
||||||
var option = Select.options[i];
|
var option = Select.options[i];
|
||||||
var StrText = GetAccountText(Item, Num, 1);
|
var StrText = GetAccountText(Item, Num, 1);
|
||||||
if (option.text !== StrText)
|
if(option.text !== StrText)
|
||||||
CheckNameAccTo();
|
CheckNameAccTo();
|
||||||
option.value = Num;
|
option.value = Num;
|
||||||
option.text = StrText;
|
option.text = StrText;
|
||||||
}
|
}
|
||||||
var CurentValue = LoadMapAfter["idAccount"];
|
var CurentValue = LoadMapAfter["idAccount"];
|
||||||
if (CurentValue) {
|
if(CurentValue)
|
||||||
|
{
|
||||||
Select.value = CurentValue;
|
Select.value = CurentValue;
|
||||||
delete LoadMapAfter["idAccount"];
|
delete LoadMapAfter["idAccount"];
|
||||||
}
|
}
|
||||||
SetCurCurencyName();
|
SetCurCurencyName();
|
||||||
};
|
};
|
||||||
|
|
||||||
function CurTransactionToForm(bForce) {
|
function CurTransactionToForm(bForce)
|
||||||
|
{
|
||||||
var Item = $("idTransaction");
|
var Item = $("idTransaction");
|
||||||
if (Item && (Item.className === "" || bForce))
|
if(Item && (Item.className === "" || bForce))
|
||||||
Item.value = GetJSONFromTransaction(CurrentTR);
|
Item.value = GetJSONFromTransaction(CurrentTR);
|
||||||
};
|
};
|
||||||
|
|
||||||
function CheckNameAccTo() {
|
function CheckNameAccTo()
|
||||||
|
{
|
||||||
MaxBlockNum = GetCurrentBlockNumByTime();
|
MaxBlockNum = GetCurrentBlockNumByTime();
|
||||||
var ToID = ParseNum($("idTo").value);
|
var ToID = ParseNum($("idTo").value);
|
||||||
if (!MapAccounts[ToID] || (MapAccounts[ToID].MustUpdate && MapAccounts[ToID].MustUpdate >= MaxBlockNum)) {
|
if(!MapAccounts[ToID] || (MapAccounts[ToID].MustUpdate && MapAccounts[ToID].MustUpdate >= MaxBlockNum))
|
||||||
GetData("GetAccountList", { StartNum: ToID }, function(Data) {
|
{
|
||||||
if (Data && Data.result === 1 && Data.arr.length) {
|
GetData("GetAccountList", {StartNum:ToID}, function (Data)
|
||||||
|
{
|
||||||
|
if(Data && Data.result === 1 && Data.arr.length)
|
||||||
|
{
|
||||||
var Item = Data.arr[0];
|
var Item = Data.arr[0];
|
||||||
Item.UpdateData = Date.now();
|
Item.UpdateData = Date.now();
|
||||||
MapAccounts[Item.Num] = Item;
|
MapAccounts[Item.Num] = Item;
|
||||||
@ -79,173 +88,215 @@ function CheckNameAccTo() {
|
|||||||
SetNameAccTo();
|
SetNameAccTo();
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetNameAccTo() {
|
function SetNameAccTo()
|
||||||
|
{
|
||||||
var Str = "";
|
var Str = "";
|
||||||
var ToID = ParseNum($("idTo").value);
|
var ToID = $("idTo").value.trim();
|
||||||
var Item = MapAccounts[ToID];
|
var Item = MapAccounts[ToID];
|
||||||
var element = $("idNameTo");
|
|
||||||
var StrTo = GetAccountText(Item, ToID, 1);
|
var StrTo = GetAccountText(Item, ToID, 1);
|
||||||
if (!element) {
|
var element = $("idNameTo");
|
||||||
|
if(!element)
|
||||||
|
{
|
||||||
element = $("idNameTo2");
|
element = $("idNameTo2");
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
StrTo = "To: " + StrTo;
|
StrTo = "To: " + StrTo;
|
||||||
}
|
}
|
||||||
if (element.innerText !== StrTo) {
|
if(!ToID || ToID === "0")
|
||||||
|
{
|
||||||
|
element.innerText = "";
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if(element && element.innerText !== StrTo)
|
||||||
|
{
|
||||||
element.innerText = StrTo;
|
element.innerText = StrTo;
|
||||||
if (Item && Item.MyAccount)
|
if(Item && Item.MyAccount)
|
||||||
element.className = "smallbold";
|
element.className = "smallbold";
|
||||||
else
|
else
|
||||||
element.className = "";
|
element.className = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetAccountText(Item, Num, bGetSum) {
|
function GetAccountText(Item,Num,bGetSum)
|
||||||
if (Item) {
|
{
|
||||||
|
if(Item)
|
||||||
|
{
|
||||||
var text = Item.Name;
|
var text = Item.Name;
|
||||||
if (!text || text.length === 0)
|
if(!text || text.length === 0)
|
||||||
text = Num;
|
text = Num;
|
||||||
else
|
else
|
||||||
text = "" + Num + ". " + text;
|
text = "" + Num + ". " + text;
|
||||||
if (bGetSum) {
|
if(bGetSum)
|
||||||
|
{
|
||||||
var StrSum = SUM_TO_STRING(Item.Value, Item.Currency);
|
var StrSum = SUM_TO_STRING(Item.Value, Item.Currency);
|
||||||
text += " (" + StrSum + ")";
|
text += " (" + StrSum + ")";
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
return Num;
|
{
|
||||||
|
if(IsPublicAddr(Num))
|
||||||
|
return Num;
|
||||||
|
else
|
||||||
|
return "<Error addres>";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function OnEditIdTo() {
|
function OnEditIdTo()
|
||||||
|
{
|
||||||
CheckNameAccTo();
|
CheckNameAccTo();
|
||||||
OnEditTransactionFields();
|
OnEditTransactionFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
function OnEditTransactionFields() {
|
function OnEditTransactionFields()
|
||||||
if (IsVisibleBlock("edit_transaction"))
|
{
|
||||||
|
if(IsVisibleBlock("edit_transaction"))
|
||||||
CreateTransaction();
|
CreateTransaction();
|
||||||
SetCurCurencyName();
|
SetCurCurencyName();
|
||||||
SaveValues();
|
SaveValues();
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetCurCurencyName() {
|
function SetCurCurencyName()
|
||||||
|
{
|
||||||
var idCoin = $("idCoinName");
|
var idCoin = $("idCoinName");
|
||||||
if (!idCoin)
|
if(!idCoin)
|
||||||
return;
|
return ;
|
||||||
var Num = ParseNum($("idAccount").value);
|
var Num = ParseNum($("idAccount").value);
|
||||||
var Item = MapAccounts[Num];
|
var Item = MapAccounts[Num];
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
idCoin.innerText = CurrencyName(Item.Currency);
|
idCoin.innerText = CurrencyName(Item.Currency);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function CreateTransaction(F, CheckErr, Run) {
|
function IsPublicAddr(StrTo)
|
||||||
|
{
|
||||||
|
if(StrTo.length === 66 && (StrTo.substr(0, 2) === "02" || StrTo.substr(0, 2) === "03") && IsHexStr(StrTo))
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
function CreateTransaction(F,CheckErr,Run)
|
||||||
|
{
|
||||||
CheckNameAccTo();
|
CheckNameAccTo();
|
||||||
CheckSending();
|
CheckSending();
|
||||||
var FromID = ParseNum($("idAccount").value);
|
var FromID = ParseNum($("idAccount").value);
|
||||||
if (CheckErr && FromID === 0) {
|
if(CheckErr && FromID === 0)
|
||||||
|
{
|
||||||
SetError("Select valid 'From account'");
|
SetError("Select valid 'From account'");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var StrTo = $("idTo").value.trim();
|
var StrTo = $("idTo").value.trim();
|
||||||
var bFindAcc = 0;
|
var bFindAcc = 0;
|
||||||
var ToPubKey = "";
|
var ToPubKey = "";
|
||||||
var ToID = ParseNum(StrTo);
|
var ToID = ParseNum(StrTo);
|
||||||
if (StrTo !== "" + ToID) {
|
if(StrTo !== "" + ToID)
|
||||||
if (StrTo.length === 66 && (StrTo.substr(0, 2) === "02" || StrTo.substr(0, 2) === "03") && IsHexStr(StrTo)) {
|
{
|
||||||
|
if(IsPublicAddr(StrTo))
|
||||||
|
{
|
||||||
ToID = 0;
|
ToID = 0;
|
||||||
ToPubKey = StrTo;
|
ToPubKey = StrTo;
|
||||||
if (ToPubKey === PubKeyStr)
|
if(ToPubKey === window.PubKeyStr)
|
||||||
bFindAcc = 1;
|
bFindAcc = 1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (CheckErr)
|
{
|
||||||
|
if(CheckErr)
|
||||||
SetError("Valid 'Pay to' - required!");
|
SetError("Valid 'Pay to' - required!");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CheckErr && ToID <= 0 && ToPubKey === "" && !AttachItem) {
|
if(CheckErr && ToID <= 0 && ToPubKey === "" && !AttachItem)
|
||||||
|
{
|
||||||
SetError("Valid 'Pay to' - required!");
|
SetError("Valid 'Pay to' - required!");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var Description = $("idDescription").value.substr(0, 200);
|
var Description = $("idDescription").value.substr(0, 200);
|
||||||
var StrSum = $("idSumSend").value;
|
var StrSum = $("idSumSend").value;
|
||||||
var indDot = StrSum.indexOf(".");
|
var indDot = StrSum.indexOf(".");
|
||||||
if (indDot >= 0) {
|
if(indDot >= 0)
|
||||||
|
{
|
||||||
var StrTER = StrSum.substr(0, indDot);
|
var StrTER = StrSum.substr(0, indDot);
|
||||||
var StrCENT = StrSum.substr(indDot + 1);
|
var StrCENT = StrSum.substr(indDot + 1);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var StrTER = StrSum;
|
var StrTER = StrSum;
|
||||||
var StrCENT = "0";
|
var StrCENT = "0";
|
||||||
}
|
}
|
||||||
StrCENT = StrCENT + "000000000";
|
StrCENT = StrCENT + "000000000";
|
||||||
var Coin = { SumCOIN: ParseNum(StrTER), SumCENT: ParseNum(StrCENT.substr(0, 9)) };
|
var Coin = {SumCOIN:ParseNum(StrTER), SumCENT:ParseNum(StrCENT.substr(0, 9))};
|
||||||
var OperationID = 0;
|
var OperationID = 0;
|
||||||
var Item = MapAccounts[FromID];
|
var Item = MapAccounts[FromID];
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
OperationID = Item.Value.OperationID;
|
OperationID = Item.Value.OperationID;
|
||||||
}
|
}
|
||||||
var AttachBody = [];
|
var AttachBody = [];
|
||||||
if (AttachItem) {
|
if(AttachItem)
|
||||||
|
{
|
||||||
AttachBody = AttachItem.Data.Body;
|
AttachBody = AttachItem.Data.Body;
|
||||||
if (!AttachBody)
|
if(!AttachBody)
|
||||||
AttachBody = [];
|
AttachBody = [];
|
||||||
}
|
}
|
||||||
var ToPubKeyArr = [];
|
var ToPubKeyArr = [];
|
||||||
if (ToPubKey)
|
if(ToPubKey)
|
||||||
ToPubKeyArr = GetArrFromHex(ToPubKey);
|
ToPubKeyArr = GetArrFromHex(ToPubKey);
|
||||||
var TR = {
|
var TR = {Type:111, Version:3, Reserve:0, FromID:FromID, OperationID:OperationID, To:[{PubKey:ToPubKeyArr, ID:ToID, SumCOIN:Coin.SumCOIN,
|
||||||
Type: 111, Version: 3, Reserve: 0, FromID: FromID, OperationID: OperationID, To: [{
|
SumCENT:Coin.SumCENT}], Description:Description, Body:AttachBody, Sign:CurrentTR.Sign, };
|
||||||
PubKey: ToPubKeyArr, ID: ToID, SumCOIN: Coin.SumCOIN,
|
Object.defineProperties(TR, {bFindAcc:{configurable:true, writable:true, enumerable:false, value:bFindAcc}});
|
||||||
SumCENT: Coin.SumCENT
|
Object.defineProperties(TR, {Run:{configurable:true, writable:true, enumerable:false, value:Run}});
|
||||||
}], Description: Description, Body: AttachBody, Sign: CurrentTR.Sign,
|
if(JSON.stringify(TR) === JSON.stringify(CurrentTR))
|
||||||
};
|
{
|
||||||
Object.defineProperties(TR, { bFindAcc: { configurable: true, writable: true, enumerable: false, value: bFindAcc } });
|
if(F)
|
||||||
Object.defineProperties(TR, { Run: { configurable: true, writable: true, enumerable: false, value: Run } });
|
|
||||||
if (JSON.stringify(TR) === JSON.stringify(CurrentTR)) {
|
|
||||||
if (F)
|
|
||||||
F(CurrentTR);
|
F(CurrentTR);
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
CurrentTR = TR;
|
CurrentTR = TR;
|
||||||
GetSignTransaction(TR, "", function(TR) {
|
GetSignTransaction(TR, "", function (TR)
|
||||||
|
{
|
||||||
CurTransactionToForm(true);
|
CurTransactionToForm(true);
|
||||||
if (F)
|
if(F)
|
||||||
F(TR);
|
F(TR);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SignJSON(F) {
|
function SignJSON(F)
|
||||||
if ($("idSignJSON").disabled)
|
{
|
||||||
return;
|
if($("idSignJSON").disabled)
|
||||||
|
return ;
|
||||||
var TR = GetTransactionFromJSON();
|
var TR = GetTransactionFromJSON();
|
||||||
if (!TR)
|
if(!TR)
|
||||||
return;
|
return ;
|
||||||
CurrentTR = TR;
|
CurrentTR = TR;
|
||||||
GetSignTransaction(TR, "", function(TR) {
|
GetSignTransaction(TR, "", function (TR)
|
||||||
|
{
|
||||||
CurTransactionToForm(true);
|
CurTransactionToForm(true);
|
||||||
if (F)
|
if(F)
|
||||||
F();
|
F();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function CheckSending(bToStatus) {
|
function CheckSending(bToStatus)
|
||||||
|
{
|
||||||
MaxBlockNum = GetCurrentBlockNumByTime();
|
MaxBlockNum = GetCurrentBlockNumByTime();
|
||||||
var CanSend = IsPrivateMode();
|
var CanSend = IsPrivateMode();
|
||||||
var StrButton = "Send";
|
var StrButton = "Send";
|
||||||
var StrButtonSign = "Sign JSON";
|
var StrButtonSign = "Sign JSON";
|
||||||
if (!CanSend) {
|
if(!CanSend)
|
||||||
|
{
|
||||||
StrButton = " ";
|
StrButton = " ";
|
||||||
StrButtonSign = " ";
|
StrButtonSign = " ";
|
||||||
}
|
}
|
||||||
if (CanSend) {
|
if(CanSend)
|
||||||
|
{
|
||||||
var FromID = ParseNum($("idAccount").value);
|
var FromID = ParseNum($("idAccount").value);
|
||||||
var Item = MapAccounts[FromID];
|
var Item = MapAccounts[FromID];
|
||||||
if (Item && Item.NextSendTime && Item.NextSendTime > MaxBlockNum) {
|
if(Item && Item.NextSendTime && Item.NextSendTime > MaxBlockNum)
|
||||||
if (bToStatus)
|
{
|
||||||
|
if(bToStatus)
|
||||||
SetStatus("Transaction was sending. Wait... (" + Item.LastTransactionText + ")");
|
SetStatus("Transaction was sending. Wait... (" + Item.LastTransactionText + ")");
|
||||||
CanSend = false;
|
CanSend = false;
|
||||||
StrButton = "Wait...";
|
StrButton = "Wait...";
|
||||||
@ -258,26 +309,31 @@ function CheckSending(bToStatus) {
|
|||||||
return CanSend;
|
return CanSend;
|
||||||
};
|
};
|
||||||
|
|
||||||
function AddWhiteList() {
|
function AddWhiteList()
|
||||||
|
{
|
||||||
var ToID = ParseNum($("idTo").value);
|
var ToID = ParseNum($("idTo").value);
|
||||||
if (ToID && $("idWhiteOnSend").checked)
|
if(ToID && $("idWhiteOnSend").checked)
|
||||||
Storage.setItem("White:" + ToID, 1);
|
Storage.setItem("White:" + ToID, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendMoneyBefore() {
|
function SendMoneyBefore()
|
||||||
if ($("idSendButton").disabled)
|
{
|
||||||
return;
|
if($("idSendButton").disabled)
|
||||||
|
return ;
|
||||||
var ToID = ParseNum($("idTo").value);
|
var ToID = ParseNum($("idTo").value);
|
||||||
var Item = MapAccounts[ToID];
|
var Item = MapAccounts[ToID];
|
||||||
if (Storage.getItem("White:" + ToID) || !$("idSumSend").value || Item && Item.MyAccount) {
|
if(Storage.getItem("White:" + ToID) || !$("idSumSend").value || Item && Item.MyAccount)
|
||||||
|
{
|
||||||
SendMoney();
|
SendMoney();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var CoinAmount = COIN_FROM_FLOAT($("idSumSend").value);
|
var CoinAmount = COIN_FROM_FLOAT($("idSumSend").value);
|
||||||
var StrTo = " to " + GetAccountText(Item, ToID);
|
var StrTo = " to " + GetAccountText(Item, ToID);
|
||||||
$("idWhiteOnSend").checked = 0;
|
$("idWhiteOnSend").checked = 0;
|
||||||
$("idOnSendText").innerHTML = "<B style='color:#ff4534'>" + STRING_FROM_COIN(CoinAmount) + "</B> " + $("idCoinName").innerText + StrTo;
|
$("idOnSendText").innerHTML = "<B style='color:#ff4534'>" + STRING_FROM_COIN(CoinAmount) + "</B> " + $("idCoinName").innerText + StrTo;
|
||||||
if ($("idSumSend").value >= 100000) {
|
if($("idSumSend").value >= 100000)
|
||||||
|
{
|
||||||
$("idOnSendText").innerHTML += "<BR><DIV style='color: yellow;'>WARNING: You are about to send a very large amount!</DIV>";
|
$("idOnSendText").innerHTML += "<BR><DIV style='color: yellow;'>WARNING: You are about to send a very large amount!</DIV>";
|
||||||
}
|
}
|
||||||
SetVisibleBlock("idBlockOnSend", 1);
|
SetVisibleBlock("idBlockOnSend", 1);
|
||||||
@ -285,26 +341,31 @@ function SendMoneyBefore() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendMoney2() {
|
function SendMoney2()
|
||||||
|
{
|
||||||
AddWhiteList();
|
AddWhiteList();
|
||||||
SendMoney();
|
SendMoney();
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendMoney() {
|
function SendMoney()
|
||||||
if (!CanSendTransaction) {
|
{
|
||||||
|
if(!CanSendTransaction)
|
||||||
|
{
|
||||||
SetError("Can't Send transaction");
|
SetError("Can't Send transaction");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
CheckSending(true);
|
CheckSending(true);
|
||||||
if ($("idSendButton").disabled)
|
if($("idSendButton").disabled)
|
||||||
return;
|
return ;
|
||||||
SetVisibleBlock("idBlockOnSend", 0);
|
SetVisibleBlock("idBlockOnSend", 0);
|
||||||
CreateTransaction(SendMoneyTR, true, ClearAttach);
|
CreateTransaction(SendMoneyTR, true, ClearAttach);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetJSONFromTransaction(TR) {
|
function GetJSONFromTransaction(TR)
|
||||||
|
{
|
||||||
var TR2 = JSON.parse(JSON.stringify(TR));
|
var TR2 = JSON.parse(JSON.stringify(TR));
|
||||||
for (var i = 0; i < TR2.To.length; i++) {
|
for(var i = 0; i < TR2.To.length; i++)
|
||||||
|
{
|
||||||
var Item = TR2.To[i];
|
var Item = TR2.To[i];
|
||||||
Item.PubKey = GetHexFromArr(Item.PubKey);
|
Item.PubKey = GetHexFromArr(Item.PubKey);
|
||||||
}
|
}
|
||||||
@ -314,19 +375,24 @@ function GetJSONFromTransaction(TR) {
|
|||||||
return Str;
|
return Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetTransactionFromJSON() {
|
function GetTransactionFromJSON()
|
||||||
|
{
|
||||||
var Str = $("idTransaction").value;
|
var Str = $("idTransaction").value;
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
var TR = JSON.parse(Str);
|
var TR = JSON.parse(Str);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
SetError(e);
|
SetError(e);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
for (var i = 0; i < TR.To.length; i++) {
|
for(var i = 0; i < TR.To.length; i++)
|
||||||
|
{
|
||||||
var Item = TR.To[i];
|
var Item = TR.To[i];
|
||||||
Item.PubKey = GetArrFromHex(Item.PubKey);
|
Item.PubKey = GetArrFromHex(Item.PubKey);
|
||||||
if (Item.SumTER && Item.SumCOIN === undefined) {
|
if(Item.SumTER && Item.SumCOIN === undefined)
|
||||||
|
{
|
||||||
Item.SumCOIN = Item.SumTER;
|
Item.SumCOIN = Item.SumTER;
|
||||||
delete Item.SumTER;
|
delete Item.SumTER;
|
||||||
}
|
}
|
||||||
@ -336,58 +402,68 @@ function GetTransactionFromJSON() {
|
|||||||
return TR;
|
return TR;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendMoneyJSON() {
|
function SendMoneyJSON()
|
||||||
if (!CanSendTransaction) {
|
{
|
||||||
|
if(!CanSendTransaction)
|
||||||
|
{
|
||||||
SetError("Can't Send transaction");
|
SetError("Can't Send transaction");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var TR = GetTransactionFromJSON();
|
var TR = GetTransactionFromJSON();
|
||||||
if (!TR)
|
if(!TR)
|
||||||
return;
|
return ;
|
||||||
SendMoneyTR(TR);
|
SendMoneyTR(TR);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SignAndSendFromJSON() {
|
function SignAndSendFromJSON()
|
||||||
|
{
|
||||||
SignJSON(SendMoneyJSON);
|
SignJSON(SendMoneyJSON);
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetTransactionText(TR, key) {
|
function GetTransactionText(TR,key)
|
||||||
|
{
|
||||||
var Str;
|
var Str;
|
||||||
if (TR) {
|
if(TR)
|
||||||
if (TR.Type === TYPE_TRANSACTION_CREATE) {
|
{
|
||||||
|
if(TR.Type === TYPE_TRANSACTION_CREATE)
|
||||||
|
{
|
||||||
Str = "New account " + TR.Name.substr(0, 20);
|
Str = "New account " + TR.Name.substr(0, 20);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (TR.Type === 111) {
|
if(TR.Type === 111)
|
||||||
|
{
|
||||||
var MapItem = {};
|
var MapItem = {};
|
||||||
var ValueTotal = { SumCOIN: 0, SumCENT: 0 };
|
var ValueTotal = {SumCOIN:0, SumCENT:0};
|
||||||
Str = "" + TR.FromID + "/" + TR.OperationID + " to ";
|
Str = "" + TR.FromID + "/" + TR.OperationID + " to ";
|
||||||
for (var i = 0; i < TR.To.length; i++) {
|
for(var i = 0; i < TR.To.length; i++)
|
||||||
|
{
|
||||||
var Item = TR.To[i];
|
var Item = TR.To[i];
|
||||||
if (Item.ID === TR.FromID || MapItem[Item.ID])
|
if(Item.ID === TR.FromID || MapItem[Item.ID])
|
||||||
continue;
|
continue;
|
||||||
MapItem[Item.ID] = 1;
|
MapItem[Item.ID] = 1;
|
||||||
ADD(ValueTotal, Item);
|
ADD(ValueTotal, Item);
|
||||||
if (i === 0)
|
if(i === 0)
|
||||||
Str += "[";
|
Str += "[";
|
||||||
if (Str.length < 16) {
|
if(Str.length < 16)
|
||||||
if (i > 0)
|
{
|
||||||
|
if(i > 0)
|
||||||
Str += ",";
|
Str += ",";
|
||||||
if (Item.ID || (Item.PubKey && Item.PubKey.length !== 66))
|
if(Item.ID || (Item.PubKey && Item.PubKey.length !== 66))
|
||||||
Str += Item.ID;
|
Str += Item.ID;
|
||||||
else
|
else
|
||||||
Str += GetHexFromArr(Item.PubKey).substr(0, 8);
|
Str += GetHexFromArr(Item.PubKey).substr(0, 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (Str.substr(Str.length - 1) !== ".")
|
if(Str.substr(Str.length - 1) !== ".")
|
||||||
Str += "...";
|
Str += "...";
|
||||||
}
|
}
|
||||||
Str += "] " + SUM_TO_STRING(ValueTotal);
|
Str += "] " + SUM_TO_STRING(ValueTotal);
|
||||||
Str += " " + (TR.Description.substr(0, 20)).replace(/\n/g, "");
|
Str += " " + (TR.Description.substr(0, 20)).replace(/\n/g, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (key)
|
{
|
||||||
|
if(key)
|
||||||
Str = key;
|
Str = key;
|
||||||
else
|
else
|
||||||
Str = "";
|
Str = "";
|
||||||
@ -395,15 +471,18 @@ function GetTransactionText(TR, key) {
|
|||||||
return Str;
|
return Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendMoneyTR(TR) {
|
function SendMoneyTR(TR)
|
||||||
|
{
|
||||||
var Body = GetArrFromTR(TR);
|
var Body = GetArrFromTR(TR);
|
||||||
WriteArr(Body, TR.Sign, 64);
|
WriteArr(Body, TR.Sign, 64);
|
||||||
Body.length += 12;
|
Body.length += 12;
|
||||||
SendTransaction(Body, TR, undefined, function(Err, TR, Body) {
|
SendTransaction(Body, TR, undefined, function (Err,TR,Body)
|
||||||
if (Err)
|
{
|
||||||
return;
|
if(Err)
|
||||||
|
return ;
|
||||||
var Item = MapAccounts[TR.FromID];
|
var Item = MapAccounts[TR.FromID];
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
var key = GetHexFromArr(sha3(Body));
|
var key = GetHexFromArr(sha3(Body));
|
||||||
var BlockNum = GetCurrentBlockNumByTime();
|
var BlockNum = GetCurrentBlockNumByTime();
|
||||||
Item.LastTransactionText = GetTransactionText(TR);
|
Item.LastTransactionText = GetTransactionText(TR);
|
||||||
@ -414,31 +493,37 @@ function SendMoneyTR(TR) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClearTransaction() {
|
function ClearTransaction()
|
||||||
|
{
|
||||||
PayList = [];
|
PayList = [];
|
||||||
ClearAttach();
|
ClearAttach();
|
||||||
CheckSendList(1);
|
CheckSendList(1);
|
||||||
var arr = ["idAccount", "idTo", "idSumSend", "idDescription"];
|
var arr = ["idAccount", "idTo", "idSumSend", "idDescription"];
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
$(arr[i]).value = "";
|
$(arr[i]).value = "";
|
||||||
}
|
}
|
||||||
SaveValues();
|
SaveValues();
|
||||||
CreateTransaction();
|
CreateTransaction();
|
||||||
};
|
};
|
||||||
|
|
||||||
function StartEditTransactionJSON() {
|
function StartEditTransactionJSON()
|
||||||
|
{
|
||||||
var Item = $("idTransaction");
|
var Item = $("idTransaction");
|
||||||
Item.className = "smallbold";
|
Item.className = "smallbold";
|
||||||
};
|
};
|
||||||
|
|
||||||
function EditJSONTransaction() {
|
function EditJSONTransaction()
|
||||||
|
{
|
||||||
var name = "edit_transaction";
|
var name = "edit_transaction";
|
||||||
var Item = $("idTransaction");
|
var Item = $("idTransaction");
|
||||||
if (IsVisibleBlock(name)) {
|
if(IsVisibleBlock(name))
|
||||||
|
{
|
||||||
SetVisibleBlock(name, false);
|
SetVisibleBlock(name, false);
|
||||||
Item.className = "";
|
Item.className = "";
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
CreateTransaction();
|
CreateTransaction();
|
||||||
SetVisibleBlock(name, true);
|
SetVisibleBlock(name, true);
|
||||||
Item.className = "";
|
Item.className = "";
|
||||||
@ -446,14 +531,16 @@ function EditJSONTransaction() {
|
|||||||
};
|
};
|
||||||
var glNumPayCount = 0;
|
var glNumPayCount = 0;
|
||||||
|
|
||||||
function GetInvoiceHTML(item, onclick, classstr) {
|
function GetInvoiceHTML(item,onclick,classstr)
|
||||||
if (!item.num) {
|
{
|
||||||
|
if(!item.num)
|
||||||
|
{
|
||||||
glNumPayCount++;
|
glNumPayCount++;
|
||||||
item.num = glNumPayCount;
|
item.num = glNumPayCount;
|
||||||
}
|
}
|
||||||
var idname = "idSendInvoice" + item.num;
|
var idname = "idSendInvoice" + item.num;
|
||||||
var value = "";
|
var value = "";
|
||||||
if (item.Data.Amount)
|
if(item.Data.Amount)
|
||||||
value += "<B>" + item.Data.Amount + "</B> Tera";
|
value += "<B>" + item.Data.Amount + "</B> Tera";
|
||||||
else
|
else
|
||||||
value += "<B style='color:green'>No pay</B>";
|
value += "<B style='color:green'>No pay</B>";
|
||||||
@ -461,46 +548,55 @@ function GetInvoiceHTML(item, onclick, classstr) {
|
|||||||
return "<button id='" + idname + "' onclick='" + onclick + "' class='" + classstr + "'>" + value + "</button>";
|
return "<button id='" + idname + "' onclick='" + onclick + "' class='" + classstr + "'>" + value + "</button>";
|
||||||
};
|
};
|
||||||
|
|
||||||
function AddSendList(item) {
|
function AddSendList(item)
|
||||||
PayList.push({ Data: item });
|
{
|
||||||
|
PayList.push({Data:item});
|
||||||
};
|
};
|
||||||
|
|
||||||
function CheckSendList(bRedraw) {
|
function CheckSendList(bRedraw)
|
||||||
|
{
|
||||||
TitleWarning = PayList.length;
|
TitleWarning = PayList.length;
|
||||||
if (AttachItem)
|
if(AttachItem)
|
||||||
TitleWarning++;
|
TitleWarning++;
|
||||||
var Str = Storage.getItem("InvoiceList");
|
var Str = Storage.getItem("InvoiceList");
|
||||||
if (!Str && !bRedraw)
|
if(!Str && !bRedraw)
|
||||||
return;
|
return ;
|
||||||
if (!bRedraw) {
|
if(!bRedraw)
|
||||||
|
{
|
||||||
SelectTab("TabSend");
|
SelectTab("TabSend");
|
||||||
}
|
}
|
||||||
if (Str) {
|
if(Str)
|
||||||
|
{
|
||||||
var arr = JSON.parse(Str);
|
var arr = JSON.parse(Str);
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
AddSendList(arr[i]);
|
AddSendList(arr[i]);
|
||||||
}
|
}
|
||||||
Storage.setItem("InvoiceList", "");
|
Storage.setItem("InvoiceList", "");
|
||||||
}
|
}
|
||||||
var idList = $("idSendList");
|
var idList = $("idSendList");
|
||||||
if (PayList.length) {
|
if(PayList.length)
|
||||||
|
{
|
||||||
idList.innerHTML = "<DIV id='PaiListInfo'>Select the item you want to sign (pay) and send to blockchain:</DIV>";
|
idList.innerHTML = "<DIV id='PaiListInfo'>Select the item you want to sign (pay) and send to blockchain:</DIV>";
|
||||||
for (var i = 0; i < PayList.length; i++) {
|
for(var i = 0; i < PayList.length; i++)
|
||||||
|
{
|
||||||
var item = PayList[i];
|
var item = PayList[i];
|
||||||
idList.innerHTML += GetInvoiceHTML(item, "UseInvoice(" + i + ")", "btinvoice");
|
idList.innerHTML += GetInvoiceHTML(item, "UseInvoice(" + i + ")", "btinvoice");
|
||||||
}
|
}
|
||||||
if (AttachItem === undefined)
|
if(AttachItem === undefined)
|
||||||
UseInvoice(0);
|
UseInvoice(0);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
idList.innerHTML = "";
|
idList.innerHTML = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
setInterval(CheckSendList, 200);
|
setInterval(CheckSendList, 200);
|
||||||
|
|
||||||
function UseInvoice(Num) {
|
function UseInvoice(Num)
|
||||||
|
{
|
||||||
var item = PayList[Num];
|
var item = PayList[Num];
|
||||||
if (item.Data.From)
|
if(item.Data.From)
|
||||||
$("idAccount").value = item.Data.From;
|
$("idAccount").value = item.Data.From;
|
||||||
$("idTo").value = item.Data.To;
|
$("idTo").value = item.Data.To;
|
||||||
$("idSumSend").value = item.Data.Amount;
|
$("idSumSend").value = item.Data.Amount;
|
||||||
@ -511,16 +607,19 @@ function UseInvoice(Num) {
|
|||||||
CheckSendList(1);
|
CheckSendList(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClearAttach() {
|
function ClearAttach()
|
||||||
|
{
|
||||||
AttachItem = undefined;
|
AttachItem = undefined;
|
||||||
if ($("idAttach"))
|
if($("idAttach"))
|
||||||
$("idAttach").innerHTML = "";
|
$("idAttach").innerHTML = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
function OpenAttach() {
|
function OpenAttach()
|
||||||
if (AttachItem) {
|
{
|
||||||
|
if(AttachItem)
|
||||||
|
{
|
||||||
var Data2 = JSON.parse(JSON.stringify(AttachItem.Data));
|
var Data2 = JSON.parse(JSON.stringify(AttachItem.Data));
|
||||||
if (Data2.Body)
|
if(Data2.Body)
|
||||||
Data2.Body = GetHexFromArr(Data2.Body);
|
Data2.Body = GetHexFromArr(Data2.Body);
|
||||||
delete Data2.TransferSecret;
|
delete Data2.TransferSecret;
|
||||||
alert("DATA:\n" + JSON.stringify(Data2, "", 4));
|
alert("DATA:\n" + JSON.stringify(Data2, "", 4));
|
||||||
@ -528,65 +627,79 @@ function OpenAttach() {
|
|||||||
};
|
};
|
||||||
var CURRENCY, PUBKEY, NAME, SMART;
|
var CURRENCY, PUBKEY, NAME, SMART;
|
||||||
|
|
||||||
function SendTrCreateAccWait(Currency, PubKey, Name, Smart) {
|
function SendTrCreateAccWait(Currency,PubKey,Name,Smart)
|
||||||
|
{
|
||||||
CURRENCY = Currency;
|
CURRENCY = Currency;
|
||||||
PUBKEY = PubKey;
|
PUBKEY = PubKey;
|
||||||
NAME = Name;
|
NAME = Name;
|
||||||
SMART = Smart;
|
SMART = Smart;
|
||||||
setTimeout(function() {
|
setTimeout(function ()
|
||||||
|
{
|
||||||
SendTrCreateAcc(CURRENCY, PUBKEY, NAME, 0, SMART, 0, 0);
|
SendTrCreateAcc(CURRENCY, PUBKEY, NAME, 0, SMART, 0, 0);
|
||||||
}, 50);
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SendTrCreateAcc(Currency, PubKey, Description, Adviser, Smart, bFindAcc, bAddToPay) {
|
function SendTrCreateAcc(Currency,PubKey,Description,Adviser,Smart,bFindAcc,bAddToPay)
|
||||||
|
{
|
||||||
var TR = GetTrCreateAcc(Currency, PubKey, Description, Adviser, Smart);
|
var TR = GetTrCreateAcc(Currency, PubKey, Description, Adviser, Smart);
|
||||||
var Body = GetBodyCreateAcc(TR);
|
var Body = GetBodyCreateAcc(TR);
|
||||||
TR.bFindAcc = 1;
|
TR.bFindAcc = 1;
|
||||||
if (bAddToPay) {
|
if(bAddToPay)
|
||||||
var Item = {
|
{
|
||||||
name: Description, To: 0, Amount: CONFIG_DATA.PRICE_DAO.NewAccount, Description: "Create acc: " + Description, Body: Body,
|
var Item = {name:Description, To:0, Amount:CONFIG_DATA.PRICE_DAO.NewAccount, Description:"Create acc: " + Description, Body:Body,
|
||||||
};
|
};
|
||||||
AddToInvoiceList(Item);
|
AddToInvoiceList(Item);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SendTransaction(Body, TR);
|
SendTransaction(Body, TR);
|
||||||
}
|
}
|
||||||
$("idAccountName").value = "";
|
$("idAccountName").value = "";
|
||||||
CancelCreateAccount();
|
CancelCreateAccount();
|
||||||
};
|
};
|
||||||
|
|
||||||
function ChangeSmart(NumAccount, WasSmart) {
|
function ChangeSmart(NumAccount,WasSmart)
|
||||||
if (!IsPrivateMode()) {
|
{
|
||||||
|
if(!IsPrivateMode())
|
||||||
|
{
|
||||||
SetError("Pls, open wallet");
|
SetError("Pls, open wallet");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
var Result = prompt("Enter smart number:", WasSmart);
|
var Result = prompt("Enter smart number:", WasSmart);
|
||||||
if (Result !== null && Result != WasSmart) {
|
if(Result !== null && Result != WasSmart)
|
||||||
|
{
|
||||||
var Smart = parseInt(Result);
|
var Smart = parseInt(Result);
|
||||||
if (Smart) {
|
if(Smart)
|
||||||
GetData("GetDappList", { StartNum: Smart, CountNum: 1 }, function(Data) {
|
{
|
||||||
if (Data && Data.result && Data.arr.length === 1) {
|
GetData("GetDappList", {StartNum:Smart, CountNum:1}, function (Data)
|
||||||
|
{
|
||||||
|
if(Data && Data.result && Data.arr.length === 1)
|
||||||
|
{
|
||||||
SetSmartToAccount(NumAccount, Smart);
|
SetSmartToAccount(NumAccount, Smart);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetError("Error smart number");
|
SetError("Error smart number");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetSmartToAccount(NumAccount, Smart);
|
SetSmartToAccount(NumAccount, Smart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetSmartToAccount(NumAccount, Smart) {
|
function SetSmartToAccount(NumAccount,Smart)
|
||||||
|
{
|
||||||
var OperationID = 0;
|
var OperationID = 0;
|
||||||
var Item = MapAccounts[NumAccount];
|
var Item = MapAccounts[NumAccount];
|
||||||
if (Item) {
|
if(Item)
|
||||||
|
{
|
||||||
OperationID = Item.Value.OperationID;
|
OperationID = Item.Value.OperationID;
|
||||||
}
|
}
|
||||||
OperationID++;
|
OperationID++;
|
||||||
var TR = { Type: 140, Account: NumAccount, Smart: Smart, FromNum: NumAccount, Reserve: [], OperationID: OperationID, Sign: "", };
|
var TR = {Type:140, Account:NumAccount, Smart:Smart, FromNum:NumAccount, Reserve:[], OperationID:OperationID, Sign:"", };
|
||||||
var Body = [];
|
var Body = [];
|
||||||
WriteByte(Body, TR.Type);
|
WriteByte(Body, TR.Type);
|
||||||
WriteUint(Body, TR.Account);
|
WriteUint(Body, TR.Account);
|
||||||
@ -597,11 +710,12 @@ function SetSmartToAccount(NumAccount, Smart) {
|
|||||||
SendTrArrayWithSign(Body, TR.Account, TR);
|
SendTrArrayWithSign(Body, TR.Account, TR);
|
||||||
};
|
};
|
||||||
|
|
||||||
function CheckLengthAccDesription(name, Length) {
|
function CheckLengthAccDesription(name,Length)
|
||||||
|
{
|
||||||
var Str = $(name).value.substr(0, Length + 1);
|
var Str = $(name).value.substr(0, Length + 1);
|
||||||
var arr = toUTF8Array(Str);
|
var arr = toUTF8Array(Str);
|
||||||
var Len = Length - arr.length;
|
var Len = Length - arr.length;
|
||||||
if (Len < 0)
|
if(Len < 0)
|
||||||
SetError("Bad length");
|
SetError("Bad length");
|
||||||
else
|
else
|
||||||
SetStatus("Lost: " + Len + " bytes");
|
SetStatus("Lost: " + Len + " bytes");
|
||||||
|
@ -9,34 +9,40 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function SavePrivateKey() {
|
function SavePrivateKey()
|
||||||
|
{
|
||||||
var Select = document.getElementById("idTypeKey");
|
var Select = document.getElementById("idTypeKey");
|
||||||
if (Select.value === "brain") {
|
if(Select.value === "brain")
|
||||||
|
{
|
||||||
ConvertToPrivateKey();
|
ConvertToPrivateKey();
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var Str = document.getElementById("idKeyNew").value;
|
var Str = document.getElementById("idKeyNew").value;
|
||||||
Str = Str.trim();
|
Str = Str.trim();
|
||||||
if (Select.value === "private" && (Str.length !== 64 || !IsHexStr(Str))) {
|
if(Select.value === "private" && (Str.length !== 64 || !IsHexStr(Str)))
|
||||||
|
{
|
||||||
SetError("Error: Length must 64 HEX chars. (Length=" + Str.length + ")");
|
SetError("Error: Length must 64 HEX chars. (Length=" + Str.length + ")");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (Select.value !== "private" && (Str.length !== 66 || Str.substr(0, 1) !== "0" || !IsHexStr(Str))) {
|
if(Select.value !== "private" && (Str.length !== 66 || Str.substr(0, 1) !== "0" || !IsHexStr(Str)))
|
||||||
|
{
|
||||||
SetError("Error: Length must 66 HEX chars. (Length=" + Str.length + ")");
|
SetError("Error: Length must 66 HEX chars. (Length=" + Str.length + ")");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
if (Select.value === "private" && PrivKeyStr !== Str)
|
if(Select.value === "private" && PrivKeyStr !== Str)
|
||||||
SetStatus("Changed privat key");
|
SetStatus("Changed privat key");
|
||||||
else
|
else
|
||||||
if (Select.value === "public" && PubKeyStr !== Str)
|
if(Select.value === "public" && PubKeyStr !== Str)
|
||||||
SetStatus("Changed public key");
|
SetStatus("Changed public key");
|
||||||
GetData("SetWalletKey", Str, function(Data) {
|
GetData("SetWalletKey", Str, function (Data)
|
||||||
if (Data && Data.result === 1) {
|
{
|
||||||
if (Select.value === "private")
|
if(Data && Data.result === 1)
|
||||||
|
{
|
||||||
|
if(Select.value === "private")
|
||||||
SelectStyle("styleContrast1");
|
SelectStyle("styleContrast1");
|
||||||
else
|
else
|
||||||
if (Select.value === "public")
|
if(Select.value === "public")
|
||||||
SelectStyle("styleContrast2");
|
SelectStyle("styleContrast2");
|
||||||
SetVisibleEditKeys(0);
|
SetVisibleEditKeys(0);
|
||||||
UpdatesData();
|
UpdatesData();
|
||||||
@ -44,36 +50,46 @@ function SavePrivateKey() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function CreateCheckPoint() {
|
function CreateCheckPoint()
|
||||||
if (!ServerBlockNumDB || ServerBlockNumDB < 16) {
|
{
|
||||||
|
if(!ServerBlockNumDB || ServerBlockNumDB < 16)
|
||||||
|
{
|
||||||
SetError("Not set ServerBlockNumDB");
|
SetError("Not set ServerBlockNumDB");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var BlockNum = ServerBlockNumDB - 10;
|
var BlockNum = ServerBlockNumDB - 10;
|
||||||
SetCheckPoint(BlockNum);
|
SetCheckPoint(BlockNum);
|
||||||
};
|
};
|
||||||
|
|
||||||
function UseAutoCheckPoint() {
|
function UseAutoCheckPoint()
|
||||||
|
{
|
||||||
var Set = $("idUseAutoCheckPoint").checked;
|
var Set = $("idUseAutoCheckPoint").checked;
|
||||||
var Period = ParseNum($("idPeriodAutoCheckPoint").value);
|
var Period = ParseNum($("idPeriodAutoCheckPoint").value);
|
||||||
GetData("SetAutoCheckPoint", { Set: Set, Period: Period }, function(Data) {
|
GetData("SetAutoCheckPoint", {Set:Set, Period:Period}, function (Data)
|
||||||
if (Data) {
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus(Data.text, !Data.result);
|
SetStatus(Data.text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function UseAutoCorrTime() {
|
function UseAutoCorrTime()
|
||||||
GetData("SetAutoCorrTime", document.getElementById("idUseAutoCorrTime").checked, function(Data) {
|
{
|
||||||
if (Data) {
|
GetData("SetAutoCorrTime", document.getElementById("idUseAutoCorrTime").checked, function (Data)
|
||||||
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus(Data.text, !Data.result);
|
SetStatus(Data.text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetCodeVersionJSON() {
|
function SetCodeVersionJSON()
|
||||||
|
{
|
||||||
var Data = JSON.parse(JSON.stringify(CONFIG_DATA.CODE_VERSION));
|
var Data = JSON.parse(JSON.stringify(CONFIG_DATA.CODE_VERSION));
|
||||||
if (!Data.BlockNum) {
|
if(!Data.BlockNum)
|
||||||
|
{
|
||||||
Data.LevelUpdate = 160;
|
Data.LevelUpdate = 160;
|
||||||
}
|
}
|
||||||
Data.BlockNum = CONFIG_DATA.CurBlockNum;
|
Data.BlockNum = CONFIG_DATA.CurBlockNum;
|
||||||
@ -87,11 +103,13 @@ function SetCodeVersionJSON() {
|
|||||||
document.getElementById("idDevService").value = Str;
|
document.getElementById("idDevService").value = Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetCorrTimeJSON() {
|
function SetCorrTimeJSON()
|
||||||
|
{
|
||||||
var AutoDelta = parseInt(document.getElementById("idDevValue").value);
|
var AutoDelta = parseInt(document.getElementById("idDevValue").value);
|
||||||
var Data = { Num: CONFIG_DATA.CurBlockNum, bUse: 1, bAddTime: 1 };
|
var Data = {Num:CONFIG_DATA.CurBlockNum, bUse:1, bAddTime:1};
|
||||||
if (AutoDelta < 0) {
|
if(AutoDelta < 0)
|
||||||
AutoDelta = - AutoDelta;
|
{
|
||||||
|
AutoDelta = - AutoDelta;
|
||||||
Data.bAddTime = 0;
|
Data.bAddTime = 0;
|
||||||
}
|
}
|
||||||
Data.DeltaTime = 40;
|
Data.DeltaTime = 40;
|
||||||
@ -101,140 +119,180 @@ function SetCorrTimeJSON() {
|
|||||||
document.getElementById("idDevService").value = Str;
|
document.getElementById("idDevService").value = Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetNetConstJSON() {
|
function SetNetConstJSON()
|
||||||
|
{
|
||||||
var Str = JSON.stringify(Data, "", 2);
|
var Str = JSON.stringify(Data, "", 2);
|
||||||
document.getElementById("idDevService").value = Str;
|
document.getElementById("idDevService").value = Str;
|
||||||
var Data = { MaxTrasactionLimit: CONFIG_DATA.MAX_TRANSACTION_LIMIT };
|
var Data = {MaxTrasactionLimit:CONFIG_DATA.MAX_TRANSACTION_LIMIT};
|
||||||
var Str = JSON.stringify(Data, "", 2);
|
var Str = JSON.stringify(Data, "", 2);
|
||||||
document.getElementById("idDevService").value = Str;
|
document.getElementById("idDevService").value = Str;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetNewCodeVersion() {
|
function SetNewCodeVersion()
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var Data = JSON.parse(document.getElementById("idDevService").value);
|
var Data = JSON.parse(document.getElementById("idDevService").value);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
SetError("Error format setting data");
|
SetError("Error format setting data");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
Data.addrArr = GetArrFromHex(Data.addrArr);
|
Data.addrArr = GetArrFromHex(Data.addrArr);
|
||||||
GetData("SetNewCodeVersion", Data, function(Data) {
|
GetData("SetNewCodeVersion", Data, function (Data)
|
||||||
if (Data) {
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus(Data.text, !Data.result);
|
SetStatus(Data.text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function StartTimeCorrect() {
|
function StartTimeCorrect()
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var Data = JSON.parse(document.getElementById("idDevService").value);
|
var Data = JSON.parse(document.getElementById("idDevService").value);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
SetError("Error format setting data");
|
SetError("Error format setting data");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
GetData("SetCheckDeltaTime", Data, function(Data) {
|
GetData("SetCheckDeltaTime", Data, function (Data)
|
||||||
if (Data) {
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus(Data.text, !Data.result);
|
SetStatus(Data.text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function StartNetConst() {
|
function StartNetConst()
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var Data = JSON.parse(document.getElementById("idDevService").value);
|
var Data = JSON.parse(document.getElementById("idDevService").value);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
SetError("Error format setting data");
|
SetError("Error format setting data");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
GetData("SetCheckNetConstant", Data, function(Data) {
|
GetData("SetCheckNetConstant", Data, function (Data)
|
||||||
if (Data) {
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus(Data.text, !Data.result);
|
SetStatus(Data.text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function RestartNode() {
|
function RestartNode()
|
||||||
|
{
|
||||||
GetData("RestartNode", {});
|
GetData("RestartNode", {});
|
||||||
DoRestartWallet();
|
DoRestartWallet();
|
||||||
};
|
};
|
||||||
|
|
||||||
function UseAutoUpdate() {
|
function UseAutoUpdate()
|
||||||
var Data = { USE_AUTO_UPDATE: document.getElementById("idAutoUpdate").checked, DoMining: 1 };
|
{
|
||||||
GetData("SaveConstant", Data, function(Data) {
|
var Data = {USE_AUTO_UPDATE:document.getElementById("idAutoUpdate").checked, DoMining:1};
|
||||||
if (Data && Data.result) {
|
GetData("SaveConstant", Data, function (Data)
|
||||||
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
SetStatus("Save AutoUpdate: " + document.getElementById("idAutoUpdate").checked);
|
SetStatus("Save AutoUpdate: " + document.getElementById("idAutoUpdate").checked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function UseMining() {
|
function UseMining()
|
||||||
if (!MiningAccount) {
|
{
|
||||||
|
if(!MiningAccount)
|
||||||
|
{
|
||||||
SetError("Not set mining account");
|
SetError("Not set mining account");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
var Data = { USE_MINING: document.getElementById("idUseMining").checked, DoMining: 1 };
|
var Data = {USE_MINING:document.getElementById("idUseMining").checked, DoMining:1};
|
||||||
GetData("SaveConstant", Data, function(Data) {
|
GetData("SaveConstant", Data, function (Data)
|
||||||
if (Data && Data.result) {
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
SetStatus("Save Mining: " + document.getElementById("idUseMining").checked);
|
SetStatus("Save Mining: " + document.getElementById("idUseMining").checked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetPercentMining() {
|
function SetPercentMining()
|
||||||
var Data = { POW_MAX_PERCENT: document.getElementById("idPercentMining").value };
|
{
|
||||||
GetData("SaveConstant", Data, function(Data) {
|
var Data = {POW_MAX_PERCENT:document.getElementById("idPercentMining").value};
|
||||||
if (Data && Data.result) {
|
GetData("SaveConstant", Data, function (Data)
|
||||||
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
SetStatus("Save Mining percent: " + document.getElementById("idPercentMining").value + " %");
|
SetStatus("Save Mining percent: " + document.getElementById("idPercentMining").value + " %");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function MiningSets() {
|
function MiningSets()
|
||||||
|
{
|
||||||
var name = "edit_mining_set";
|
var name = "edit_mining_set";
|
||||||
if (IsVisibleBlock(name)) {
|
if(IsVisibleBlock(name))
|
||||||
|
{
|
||||||
SetVisibleBlock(name, false);
|
SetVisibleBlock(name, false);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetVisibleBlock(name, true);
|
SetVisibleBlock(name, true);
|
||||||
document.getElementById("idMiningAccount").value = MiningAccount;
|
document.getElementById("idMiningAccount").value = MiningAccount;
|
||||||
document.getElementById("idMiningAccount").focus();
|
document.getElementById("idMiningAccount").focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SaveMiningSet(Value) {
|
function SaveMiningSet(Value)
|
||||||
|
{
|
||||||
SetVisibleBlock("edit_mining_set", false);
|
SetVisibleBlock("edit_mining_set", false);
|
||||||
if (Value) {
|
if(Value)
|
||||||
|
{
|
||||||
MiningAccount = Value;
|
MiningAccount = Value;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
MiningAccount = ParseNum(document.getElementById("idMiningAccount").value);
|
MiningAccount = ParseNum(document.getElementById("idMiningAccount").value);
|
||||||
}
|
}
|
||||||
GetData("SetMining", MiningAccount, function(Data) {
|
GetData("SetMining", MiningAccount, function (Data)
|
||||||
|
{
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function CancalMiningSet() {
|
function CancalMiningSet()
|
||||||
|
{
|
||||||
var name = "edit_mining_set";
|
var name = "edit_mining_set";
|
||||||
SetVisibleBlock(name, false);
|
SetVisibleBlock(name, false);
|
||||||
};
|
};
|
||||||
var WasHistoryMaxNum;
|
var WasHistoryMaxNum;
|
||||||
var WasLastNumSound = 0;
|
var WasLastNumSound = 0;
|
||||||
|
|
||||||
function CheckNewMoney() {
|
function CheckNewMoney()
|
||||||
return;
|
{
|
||||||
if (!$("idUseSoundHistory").checked)
|
return ;
|
||||||
return;
|
if(!$("idUseSoundHistory").checked)
|
||||||
if (WasHistoryMaxNum === HistoryMaxNum || !ServerBlockNumDB)
|
return ;
|
||||||
return;
|
if(WasHistoryMaxNum === HistoryMaxNum || !ServerBlockNumDB)
|
||||||
|
return ;
|
||||||
WasHistoryMaxNum = HistoryMaxNum;
|
WasHistoryMaxNum = HistoryMaxNum;
|
||||||
GetData("GetHistoryAct", { StartNum: HistoryMaxNum - 40, CountNum: 40 }, function(Data) {
|
GetData("GetHistoryAct", {StartNum:HistoryMaxNum - 40, CountNum:40}, function (Data)
|
||||||
if (Data && Data.result) {
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
var arr = Data.arr;
|
var arr = Data.arr;
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
var Item = arr[i];
|
var Item = arr[i];
|
||||||
if (Item.Direct === "+" && Item.BlockNum > ServerBlockNumDB - 60 && Item.BlockNum < ServerBlockNumDB - 20 && Item.BlockNum > WasLastNumSound) {
|
if(Item.Direct === "+" && Item.BlockNum > ServerBlockNumDB - 60 && Item.BlockNum < ServerBlockNumDB - 20 && Item.BlockNum > WasLastNumSound)
|
||||||
|
{
|
||||||
WasLastNumSound = Item.BlockNum;
|
WasLastNumSound = Item.BlockNum;
|
||||||
$("sound_coin").play();
|
$("sound_coin").play();
|
||||||
}
|
}
|
||||||
@ -243,41 +301,52 @@ function CheckNewMoney() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function DoRestartWallet() {
|
function DoRestartWallet()
|
||||||
|
{
|
||||||
SetStatus("<H1 align='center' style='color:blue'>Restarting program...</H1>");
|
SetStatus("<H1 align='center' style='color:blue'>Restarting program...</H1>");
|
||||||
if (!WasSetRestart) {
|
if(!WasSetRestart)
|
||||||
|
{
|
||||||
WasSetRestart = 1;
|
WasSetRestart = 1;
|
||||||
setTimeout(function() {
|
setTimeout(function ()
|
||||||
|
{
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 10 * 1000);
|
}, 10 * 1000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetArrLog(arr) {
|
function SetArrLog(arr)
|
||||||
|
{
|
||||||
var Str = "";
|
var Str = "";
|
||||||
var bFindAccount = 0;
|
var bFindAccount = 0;
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
var Item = arr[i];
|
var Item = arr[i];
|
||||||
var tr_text = GetTransactionText(MapSendTransaction[Item.key], Item.key.substr(0, 16));
|
var tr_text = GetTransactionText(MapSendTransaction[Item.key], Item.key.substr(0, 16));
|
||||||
var info = Item.text;
|
var info = Item.text;
|
||||||
if (tr_text)
|
if(tr_text)
|
||||||
info += " (" + tr_text + ")";
|
info += " (" + tr_text + ")";
|
||||||
if (Item.final) {
|
if(Item.final)
|
||||||
|
{
|
||||||
var TR = MapSendTransaction[Item.key];
|
var TR = MapSendTransaction[Item.key];
|
||||||
if (TR) {
|
if(TR)
|
||||||
if (Item.text.indexOf("Add to blockchain") >= 0) {
|
{
|
||||||
if (TR.bFindAcc) {
|
if(Item.text.indexOf("Add to blockchain") >= 0)
|
||||||
|
{
|
||||||
|
if(TR.bFindAcc)
|
||||||
|
{
|
||||||
bFindAccount = 1;
|
bFindAccount = 1;
|
||||||
TR.bFindAcc = 0;
|
TR.bFindAcc = 0;
|
||||||
}
|
}
|
||||||
if (TR.Run) {
|
if(TR.Run)
|
||||||
|
{
|
||||||
TR.Run(TR);
|
TR.Run(TR);
|
||||||
TR.Run = undefined;
|
TR.Run = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var Account = MapCheckTransaction[Item.key];
|
var Account = MapCheckTransaction[Item.key];
|
||||||
if (Account) {
|
if(Account)
|
||||||
|
{
|
||||||
delete MapCheckTransaction[Item.key];
|
delete MapCheckTransaction[Item.key];
|
||||||
Account.NextSendTime = 0;
|
Account.NextSendTime = 0;
|
||||||
}
|
}
|
||||||
@ -286,31 +355,39 @@ function SetArrLog(arr) {
|
|||||||
}
|
}
|
||||||
SetStatusFromServer(Str);
|
SetStatusFromServer(Str);
|
||||||
CheckSending();
|
CheckSending();
|
||||||
if (bFindAccount) {
|
if(bFindAccount)
|
||||||
|
{
|
||||||
FindMyAccounts();
|
FindMyAccounts();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetAutoMining() {
|
function SetAutoMining()
|
||||||
setTimeout(function() {
|
{
|
||||||
|
setTimeout(function ()
|
||||||
|
{
|
||||||
var Select = $("idAccount");
|
var Select = $("idAccount");
|
||||||
if (Select.options.length) {
|
if(Select.options.length)
|
||||||
|
{
|
||||||
SaveMiningSet(Select.options[Select.options.length - 1].value);
|
SaveMiningSet(Select.options[Select.options.length - 1].value);
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
function ViewNetworkMode() {
|
function ViewNetworkMode()
|
||||||
if (IsVisibleBlock('idNetworkView')) {
|
{
|
||||||
|
if(IsVisibleBlock('idNetworkView'))
|
||||||
|
{
|
||||||
SetVisibleBlock('idNetworkView', false);
|
SetVisibleBlock('idNetworkView', false);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetVisibleBlock('idNetworkView', true);
|
SetVisibleBlock('idNetworkView', true);
|
||||||
var Mode = CONFIG_DATA.CONSTANTS.NET_WORK_MODE;
|
var Mode = CONFIG_DATA.CONSTANTS.NET_WORK_MODE;
|
||||||
if (!Mode) {
|
if(!Mode)
|
||||||
|
{
|
||||||
Mode = {};
|
Mode = {};
|
||||||
Mode.UseDirectIP = true;
|
Mode.UseDirectIP = true;
|
||||||
if (INTERNET_IP_FROM_STUN)
|
if(INTERNET_IP_FROM_STUN)
|
||||||
Mode.ip = INTERNET_IP_FROM_STUN;
|
Mode.ip = INTERNET_IP_FROM_STUN;
|
||||||
else
|
else
|
||||||
Mode.ip = SERVER_IP;
|
Mode.ip = SERVER_IP;
|
||||||
@ -319,120 +396,146 @@ function ViewNetworkMode() {
|
|||||||
document.getElementById("idUseDirectIP").checked = Mode.UseDirectIP;
|
document.getElementById("idUseDirectIP").checked = Mode.UseDirectIP;
|
||||||
document.getElementById("idIP").value = Mode.ip;
|
document.getElementById("idIP").value = Mode.ip;
|
||||||
document.getElementById("idPort").value = Mode.port;
|
document.getElementById("idPort").value = Mode.port;
|
||||||
if (!Mode.NodeWhiteList)
|
if(!Mode.NodeWhiteList)
|
||||||
Mode.NodeWhiteList = "";
|
Mode.NodeWhiteList = "";
|
||||||
document.getElementById("idNodeWhiteList").value = Mode.NodeWhiteList;
|
document.getElementById("idNodeWhiteList").value = Mode.NodeWhiteList;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetNetworkParams(bRestart) {
|
function SetNetworkParams(bRestart)
|
||||||
|
{
|
||||||
var Mode = {};
|
var Mode = {};
|
||||||
Mode.UseDirectIP = document.getElementById("idUseDirectIP").checked;
|
Mode.UseDirectIP = document.getElementById("idUseDirectIP").checked;
|
||||||
Mode.ip = document.getElementById("idIP").value;
|
Mode.ip = document.getElementById("idIP").value;
|
||||||
Mode.port = ParseNum(document.getElementById("idPort").value);
|
Mode.port = ParseNum(document.getElementById("idPort").value);
|
||||||
Mode.NodeWhiteList = document.getElementById("idNodeWhiteList").value;
|
Mode.NodeWhiteList = document.getElementById("idNodeWhiteList").value;
|
||||||
Mode.DoRestartNode = bRestart;
|
Mode.DoRestartNode = bRestart;
|
||||||
GetData("SetNetMode", Mode, function(Data) {
|
GetData("SetNetMode", Mode, function (Data)
|
||||||
if (Data && Data.result) {
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
SetStatus("Set net work params OK");
|
SetStatus("Set net work params OK");
|
||||||
SetVisibleBlock('idNetworkView', false);
|
SetVisibleBlock('idNetworkView', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (bRestart)
|
if(bRestart)
|
||||||
DoRestartWallet();
|
DoRestartWallet();
|
||||||
};
|
};
|
||||||
|
|
||||||
function ViewConstant() {
|
function ViewConstant()
|
||||||
if (IsVisibleBlock('idConstantView')) {
|
{
|
||||||
|
if(IsVisibleBlock('idConstantView'))
|
||||||
|
{
|
||||||
SetVisibleBlock('idConstantView', false);
|
SetVisibleBlock('idConstantView', false);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetVisibleBlock('idConstantView', true);
|
SetVisibleBlock('idConstantView', true);
|
||||||
document.getElementById("idConstant").value = JSON.stringify(CONFIG_DATA.CONSTANTS, "", 2);
|
document.getElementById("idConstant").value = JSON.stringify(CONFIG_DATA.CONSTANTS, "", 2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SaveConstant(bRestart) {
|
function SaveConstant(bRestart)
|
||||||
try {
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var Data = JSON.parse(document.getElementById("idConstant").value);
|
var Data = JSON.parse(document.getElementById("idConstant").value);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch(e)
|
||||||
|
{
|
||||||
SetError("Error JSON format setting constant");
|
SetError("Error JSON format setting constant");
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
Data.DoRestartNode = bRestart;
|
Data.DoRestartNode = bRestart;
|
||||||
GetData("SaveConstant", Data, function(Data) {
|
GetData("SaveConstant", Data, function (Data)
|
||||||
if (Data && Data.result) {
|
{
|
||||||
|
if(Data && Data.result)
|
||||||
|
{
|
||||||
SetStatus("Save Constant OK");
|
SetStatus("Save Constant OK");
|
||||||
SetVisibleBlock('idConstantView', false);
|
SetVisibleBlock('idConstantView', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (bRestart)
|
if(bRestart)
|
||||||
DoRestartWallet();
|
DoRestartWallet();
|
||||||
};
|
};
|
||||||
|
|
||||||
function ViewRemoteParams() {
|
function ViewRemoteParams()
|
||||||
if (IsVisibleBlock('idRemoteView')) {
|
{
|
||||||
|
if(IsVisibleBlock('idRemoteView'))
|
||||||
|
{
|
||||||
SetVisibleBlock('idRemoteView', false);
|
SetVisibleBlock('idRemoteView', false);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetVisibleBlock('idRemoteView', true);
|
SetVisibleBlock('idRemoteView', true);
|
||||||
if (CONFIG_DATA.HTTPPort)
|
if(CONFIG_DATA.HTTPPort)
|
||||||
document.getElementById("idHTTPPort").value = CONFIG_DATA.HTTPPort;
|
document.getElementById("idHTTPPort").value = CONFIG_DATA.HTTPPort;
|
||||||
document.getElementById("idHTTPPassword").value = CONFIG_DATA.HTTPPassword;
|
document.getElementById("idHTTPPassword").value = CONFIG_DATA.HTTPPassword;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetRemoteParams(bRestart) {
|
function SetRemoteParams(bRestart)
|
||||||
|
{
|
||||||
var PrevHTTPPassword = HTTPPassword;
|
var PrevHTTPPassword = HTTPPassword;
|
||||||
var HTTPPort = ParseNum(document.getElementById("idHTTPPort").value);
|
var HTTPPort = ParseNum(document.getElementById("idHTTPPort").value);
|
||||||
var HTTPPassword = document.getElementById("idHTTPPassword").value;
|
var HTTPPassword = document.getElementById("idHTTPPassword").value;
|
||||||
GetData("SetHTTPParams", { HTTPPort: HTTPPort, HTTPPassword: HTTPPassword, DoRestartNode: bRestart }, function(Data) {
|
GetData("SetHTTPParams", {HTTPPort:HTTPPort, HTTPPassword:HTTPPassword, DoRestartNode:bRestart}, function (Data)
|
||||||
if (!PrevHTTPPassword && HTTPPassword)
|
{
|
||||||
|
if(!PrevHTTPPassword && HTTPPassword)
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
SetVisibleBlock('idRemoteView', false);
|
SetVisibleBlock('idRemoteView', false);
|
||||||
SetStatus("Set HTTP params OK");
|
SetStatus("Set HTTP params OK");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (bRestart)
|
if(bRestart)
|
||||||
DoRestartWallet();
|
DoRestartWallet();
|
||||||
};
|
};
|
||||||
|
|
||||||
function RewriteAllTransactions() {
|
function RewriteAllTransactions()
|
||||||
|
{
|
||||||
DoBlockChainProcess("RewriteAllTransactions", "Rewrite all transactions", 0);
|
DoBlockChainProcess("RewriteAllTransactions", "Rewrite all transactions", 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
function RewriteTransactions() {
|
function RewriteTransactions()
|
||||||
|
{
|
||||||
DoBlockChainProcess("RewriteTransactions", "Rewrite transactions on last %1 blocks", 1);
|
DoBlockChainProcess("RewriteTransactions", "Rewrite transactions on last %1 blocks", 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function TruncateBlockChain() {
|
function TruncateBlockChain()
|
||||||
|
{
|
||||||
DoBlockChainProcess("TruncateBlockChain", "Truncate last %1 blocks", 1);
|
DoBlockChainProcess("TruncateBlockChain", "Truncate last %1 blocks", 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClearDataBase() {
|
function ClearDataBase()
|
||||||
|
{
|
||||||
DoBlockChainProcess("ClearDataBase", "Clear DataBase", 0);
|
DoBlockChainProcess("ClearDataBase", "Clear DataBase", 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
function CleanChain() {
|
function CleanChain()
|
||||||
|
{
|
||||||
DoBlockChainProcess("CleanChain", "Clean chain on last %1 blocks", 1);
|
DoBlockChainProcess("CleanChain", "Clean chain on last %1 blocks", 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
function DoBlockChainProcess(FuncName, Text, LastBlock) {
|
function DoBlockChainProcess(FuncName,Text,LastBlock)
|
||||||
|
{
|
||||||
SaveValues();
|
SaveValues();
|
||||||
var Params = {};
|
var Params = {};
|
||||||
if (LastBlock) {
|
if(LastBlock)
|
||||||
|
{
|
||||||
Params.BlockCount = ParseNum(document.getElementById("idBlockCount").value);
|
Params.BlockCount = ParseNum(document.getElementById("idBlockCount").value);
|
||||||
Text = Text.replace("%1", Params.BlockCount);
|
Text = Text.replace("%1", Params.BlockCount);
|
||||||
}
|
}
|
||||||
var result = confirm(Text + "?");
|
var result = confirm(Text + "?");
|
||||||
if (!result)
|
if(!result)
|
||||||
return;
|
return ;
|
||||||
SetVisibleBlock("idServerBlock", 1);
|
SetVisibleBlock("idServerBlock", 1);
|
||||||
SetStatus("START: " + Text);
|
SetStatus("START: " + Text);
|
||||||
GetData(FuncName, Params, function(Data) {
|
GetData(FuncName, Params, function (Data)
|
||||||
if (Data) {
|
{
|
||||||
|
if(Data)
|
||||||
|
{
|
||||||
SetStatus("FINISH: " + Text, !Data.result);
|
SetStatus("FINISH: " + Text, !Data.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -18,37 +18,23 @@ var StartTimeConnecting = 0;
|
|||||||
var ConnectedCount = 0;
|
var ConnectedCount = 0;
|
||||||
var NETWORK = "TERA-MAIN";
|
var NETWORK = "TERA-MAIN";
|
||||||
var ServerMap = {};
|
var ServerMap = {};
|
||||||
var ServerMainMap = {
|
var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "t2.teraexplorer.com":{"ip":"t2.teraexplorer.com",
|
||||||
"127.0.0.1": { "ip": "127.0.0.1", "port": 80, "Name": "LOCAL" }, "terafoundation.org": {
|
"port":443, "Name":"t2.teraexplorer.com", "System":1}, "t3.teraexplorer.com":{"ip":"t3.teraexplorer.com", "port":443, "Name":"t3.teraexplorer.com",
|
||||||
"ip": "terafoundation.org",
|
"System":1}, "t4.teraexplorer.com":{"ip":"t4.teraexplorer.com", "port":443, "Name":"t4.teraexplorer.com", "System":1}, "t5.teraexplorer.com":{"ip":"t5.teraexplorer.com",
|
||||||
"port": 443, "Name": "TERA", "System": 1
|
"port":443, "Name":"t5.teraexplorer.com", "System":1}, "dappsgate.com":{"ip":"dappsgate.com", "port":80, "Name":"SUPPORT2",
|
||||||
}, "dappsgate.com": { "ip": "dappsgate.com", "port": 80, "Name": "SUPPORT2", "System": 1 }, "t1.teraexplorer.com": {
|
"System":1}, "t1.teraexplorer.com":{"ip":"t1.teraexplorer.com", "port":80, "Name":"t1.teraexplorer.com", "System":1}, };
|
||||||
"ip": "t1.teraexplorer.com",
|
var ServerTestMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "dappsgate.com":{"ip":"dappsgate.com", "port":88,
|
||||||
"port": 80, "Name": "t1.teraexplorer.com", "System": 1
|
"Name":"SUPPORT2", "System":1}, };
|
||||||
}, "t2.teraexplorer.com": {
|
|
||||||
"ip": "t2.teraexplorer.com", "port": 80, "Name": "t2.teraexplorer.com",
|
|
||||||
"System": 1
|
|
||||||
}, "t3.teraexplorer.com": { "ip": "t3.teraexplorer.com", "port": 80, "Name": "t3.teraexplorer.com", "System": 1 }, "t4.teraexplorer.com": {
|
|
||||||
"ip": "t4.teraexplorer.com",
|
|
||||||
"port": 80, "Name": "t4.teraexplorer.com", "System": 1
|
|
||||||
}, "t5.teraexplorer.com": {
|
|
||||||
"ip": "t5.teraexplorer.com", "port": 80, "Name": "t5.teraexplorer.com",
|
|
||||||
"System": 1
|
|
||||||
},
|
|
||||||
};
|
|
||||||
var ServerTestMap = {
|
|
||||||
"127.0.0.1": { "ip": "127.0.0.1", "port": 80, "Name": "LOCAL" }, "dappsgate.com": {
|
|
||||||
"ip": "dappsgate.com", "port": 88,
|
|
||||||
"Name": "SUPPORT2", "System": 1
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
function StartWebWallet() {
|
function StartWebWallet()
|
||||||
if (NETWORK === "TERA-TEST2") {
|
{
|
||||||
|
if(NETWORK === "TERA-TEST2")
|
||||||
|
{
|
||||||
MIN_SUM_POWER = 0;
|
MIN_SUM_POWER = 0;
|
||||||
ServerMap = ServerTestMap;
|
ServerMap = ServerTestMap;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
MIN_SUM_POWER = COUNT_BLOCK_PROOF * 35;
|
MIN_SUM_POWER = COUNT_BLOCK_PROOF * 35;
|
||||||
ServerMap = ServerMainMap;
|
ServerMap = ServerMainMap;
|
||||||
}
|
}
|
||||||
@ -57,53 +43,64 @@ function StartWebWallet() {
|
|||||||
ConnectWebWallet();
|
ConnectWebWallet();
|
||||||
};
|
};
|
||||||
|
|
||||||
function OnInitWebWallet() {
|
function OnInitWebWallet()
|
||||||
|
{
|
||||||
var str = Storage.getItem(NETWORK + "NodesArrayList");
|
var str = Storage.getItem(NETWORK + "NodesArrayList");
|
||||||
if (str) {
|
if(str)
|
||||||
|
{
|
||||||
var arr = JSON.parse(str);
|
var arr = JSON.parse(str);
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for(var i = 0; i < arr.length; i++)
|
||||||
|
{
|
||||||
var Item = ServerMap[arr[i].ip];
|
var Item = ServerMap[arr[i].ip];
|
||||||
if (Item && Item.System)
|
if(Item && Item.System)
|
||||||
continue;
|
continue;
|
||||||
ServerMap[arr[i].ip] = arr[i];
|
ServerMap[arr[i].ip] = arr[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function SaveServerMap() {
|
function SaveServerMap()
|
||||||
|
{
|
||||||
var arr = [];
|
var arr = [];
|
||||||
for (var key in ServerMap) {
|
for(var key in ServerMap)
|
||||||
|
{
|
||||||
var Item = ServerMap[key];
|
var Item = ServerMap[key];
|
||||||
if (Item.SumPower >= MIN_SUM_POWER) {
|
if(Item.SumPower >= MIN_SUM_POWER)
|
||||||
arr.push({ ip: Item.ip, port: Item.port });
|
{
|
||||||
|
arr.push({ip:Item.ip, port:Item.port});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(arr));
|
Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(arr));
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetStatus(Str) {
|
function SetStatus(Str)
|
||||||
|
{
|
||||||
var id = $("idStatus");
|
var id = $("idStatus");
|
||||||
id.innerHTML = Str;
|
id.innerHTML = Str;
|
||||||
if (Str)
|
if(Str)
|
||||||
console.log(id.innerText);
|
console.log(id.innerText);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetError(Str, bNoSound) {
|
function SetError(Str,bNoSound)
|
||||||
|
{
|
||||||
SetStatus("<DIV align='left' style='color:red'><B>" + Str + "</B></DIV>");
|
SetStatus("<DIV align='left' style='color:red'><B>" + Str + "</B></DIV>");
|
||||||
};
|
};
|
||||||
var CountConnect = 0;
|
var CountConnect = 0;
|
||||||
var CountWallet = 0;
|
var CountWallet = 0;
|
||||||
|
|
||||||
function ConnectWebWallet() {
|
function ConnectWebWallet()
|
||||||
|
{
|
||||||
StartTimeConnecting = Date.now();
|
StartTimeConnecting = Date.now();
|
||||||
ConnectedCount = 0;
|
ConnectedCount = 0;
|
||||||
for (var key in ServerMap) {
|
for(var key in ServerMap)
|
||||||
|
{
|
||||||
var Item = ServerMap[key];
|
var Item = ServerMap[key];
|
||||||
Item.SendHandShake = 0;
|
Item.SendHandShake = 0;
|
||||||
}
|
}
|
||||||
if (window.BrowserIE && !IsLocalClient()) {
|
if(window.BrowserIE && !IsLocalClient())
|
||||||
|
{
|
||||||
MainServer = undefined;
|
MainServer = undefined;
|
||||||
return;
|
return ;
|
||||||
}
|
}
|
||||||
CountConnect = 0;
|
CountConnect = 0;
|
||||||
CountWallet = 0;
|
CountWallet = 0;
|
||||||
@ -113,57 +110,68 @@ function ConnectWebWallet() {
|
|||||||
};
|
};
|
||||||
var Stage = 0;
|
var Stage = 0;
|
||||||
|
|
||||||
function LoopHandShake() {
|
function LoopHandShake()
|
||||||
|
{
|
||||||
Stage++;
|
Stage++;
|
||||||
SetStatus("Connecting: " + Stage + "...");
|
SetStatus("Connecting: " + Stage + "...");
|
||||||
for (var key in ServerMap) {
|
for(var key in ServerMap)
|
||||||
|
{
|
||||||
var Item = ServerMap[key];
|
var Item = ServerMap[key];
|
||||||
if (Item.SendHandShake || !Item.port)
|
if(Item.SendHandShake || !Item.port)
|
||||||
continue;
|
continue;
|
||||||
CountConnect++;
|
CountConnect++;
|
||||||
if (window.BrowserIE && CountConnect > 4)
|
if(window.BrowserIE && CountConnect > 4)
|
||||||
break;
|
break;
|
||||||
DoNodeList(Item);
|
DoNodeList(Item);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function DoNodeList(Item) {
|
function DoNodeList(Item)
|
||||||
|
{
|
||||||
console.log(GetProtocolServerPath(Item) + "/GetNodeList");
|
console.log(GetProtocolServerPath(Item) + "/GetNodeList");
|
||||||
if (window.location.protocol === "https:" && Item.port !== 443)
|
if(window.location.protocol === "https:" && Item.port !== 443)
|
||||||
return;
|
return ;
|
||||||
if (Item.port === 443 && IsIPAddres(Item.ip))
|
if(Item.port === 443 && IsIPAddres(Item.ip))
|
||||||
return;
|
return ;
|
||||||
SetStatus("Try: " + Item.ip + ":" + Item.port);
|
SetStatus("Try: " + Item.ip + ":" + Item.port);
|
||||||
Item.SendHandShake = 1;
|
Item.SendHandShake = 1;
|
||||||
GetData(GetProtocolServerPath(Item) + "/GetNodeList", {}, function(Data) {
|
GetData(GetProtocolServerPath(Item) + "/GetNodeList", {}, function (Data)
|
||||||
if (Data && Data.result && Data.NETWORK === NETWORK && Data.VersionNum >= MIN_VERSION) {
|
{
|
||||||
|
if(Data && Data.result && Data.NETWORK === NETWORK && Data.VersionNum >= MIN_VERSION)
|
||||||
|
{
|
||||||
ConnectedCount++;
|
ConnectedCount++;
|
||||||
Item.GetHandShake = 1;
|
Item.GetHandShake = 1;
|
||||||
Item.BlockChain = Data.BlockChain;
|
Item.BlockChain = Data.BlockChain;
|
||||||
SetStatus("Get: " + Item.ip + ":" + Item.port);
|
SetStatus("Get: " + Item.ip + ":" + Item.port);
|
||||||
var bWas = 0;
|
var bWas = 0;
|
||||||
for (var i = 0; i < Data.arr.length; i++) {
|
for(var i = 0; i < Data.arr.length; i++)
|
||||||
|
{
|
||||||
var Node = Data.arr[i];
|
var Node = Data.arr[i];
|
||||||
if (!ServerMap[Node.ip] && Node.port) {
|
if(!ServerMap[Node.ip] && Node.port)
|
||||||
|
{
|
||||||
ServerMap[Node.ip] = Node;
|
ServerMap[Node.ip] = Node;
|
||||||
console.log("New: " + Node.ip + ":" + Node.port);
|
console.log("New: " + Node.ip + ":" + Node.port);
|
||||||
bWas = 1;
|
bWas = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bWas && ConnectedCount < MaxConnectedCount && new Date() - StartTimeConnecting < MaxTimeConnecting) {
|
if(bWas && ConnectedCount < MaxConnectedCount && new Date() - StartTimeConnecting < MaxTimeConnecting)
|
||||||
|
{
|
||||||
setTimeout(LoopHandShake, 100);
|
setTimeout(LoopHandShake, 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function LoopWalletInfo() {
|
function LoopWalletInfo()
|
||||||
|
{
|
||||||
SetStatus("Get wallets info...");
|
SetStatus("Get wallets info...");
|
||||||
for (var key in ServerMap) {
|
for(var key in ServerMap)
|
||||||
|
{
|
||||||
var Item = ServerMap[key];
|
var Item = ServerMap[key];
|
||||||
if (Item.port) {
|
if(Item.port)
|
||||||
|
{
|
||||||
CountWallet++;
|
CountWallet++;
|
||||||
if (window.BrowserIE && CountWallet > 4)
|
if(window.BrowserIE && CountWallet > 4)
|
||||||
break;
|
break;
|
||||||
DoWalletInfo(Item);
|
DoWalletInfo(Item);
|
||||||
}
|
}
|
||||||
@ -171,15 +179,18 @@ function LoopWalletInfo() {
|
|||||||
setTimeout(FindLider, 500);
|
setTimeout(FindLider, 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
function DoWalletInfo(Item) {
|
function DoWalletInfo(Item)
|
||||||
if (window.location.protocol === "https:" && Item.port !== 443)
|
{
|
||||||
return;
|
if(window.location.protocol === "https:" && Item.port !== 443)
|
||||||
if (Item.port === 443 && IsIPAddres(Item.ip))
|
return ;
|
||||||
return;
|
if(Item.port === 443 && IsIPAddres(Item.ip))
|
||||||
|
return ;
|
||||||
Item.StartTime = Date.now();
|
Item.StartTime = Date.now();
|
||||||
Item.SendWalletInfo = 1;
|
Item.SendWalletInfo = 1;
|
||||||
GetData(GetProtocolServerPath(Item) + "/GetCurrentInfo", { BlockChain: 1 }, function(Data) {
|
GetData(GetProtocolServerPath(Item) + "/GetCurrentInfo", {BlockChain:1}, function (Data)
|
||||||
if (Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK) {
|
{
|
||||||
|
if(Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK)
|
||||||
|
{
|
||||||
Item.Name = Data.NODES_NAME;
|
Item.Name = Data.NODES_NAME;
|
||||||
Item.GetWalletInfo = 1;
|
Item.GetWalletInfo = 1;
|
||||||
Item.DeltaTime = new Date() - Item.StartTime;
|
Item.DeltaTime = new Date() - Item.StartTime;
|
||||||
@ -190,40 +201,49 @@ function DoWalletInfo(Item) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function FindLider() {
|
function FindLider()
|
||||||
|
{
|
||||||
MainServer = undefined;
|
MainServer = undefined;
|
||||||
var Arr = [];
|
var Arr = [];
|
||||||
var MapSumPower = {};
|
var MapSumPower = {};
|
||||||
for (var key in ServerMap) {
|
for(var key in ServerMap)
|
||||||
|
{
|
||||||
var Item = ServerMap[key];
|
var Item = ServerMap[key];
|
||||||
if (Item.GetWalletInfo && Item.BlockChain) {
|
if(Item.GetWalletInfo && Item.BlockChain)
|
||||||
|
{
|
||||||
var arr = Item.BlockChain;
|
var arr = Item.BlockChain;
|
||||||
if (arr.data)
|
if(arr.data)
|
||||||
arr = arr.data;
|
arr = arr.data;
|
||||||
Item.SumPower = CalcPowFromBlockChain(arr);
|
Item.SumPower = CalcPowFromBlockChain(arr);
|
||||||
if (Item.SumPower < MIN_SUM_POWER) {
|
if(Item.SumPower < MIN_SUM_POWER)
|
||||||
|
{
|
||||||
console.log("Skip: " + Item.ip + ":" + Item.port + " SumPower(" + Item.SumPower + ") < MIN_SUM_POWER(" + MIN_SUM_POWER + ")");
|
console.log("Skip: " + Item.ip + ":" + Item.port + " SumPower(" + Item.SumPower + ") < MIN_SUM_POWER(" + MIN_SUM_POWER + ")");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!MapSumPower[Item.SumPower])
|
if(!MapSumPower[Item.SumPower])
|
||||||
MapSumPower[Item.SumPower] = 0;
|
MapSumPower[Item.SumPower] = 0;
|
||||||
MapSumPower[Item.SumPower]++;
|
MapSumPower[Item.SumPower]++;
|
||||||
Arr.push(Item);
|
Arr.push(Item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var Max = 0, MaxKey;
|
var Max = 0, MaxKey;
|
||||||
for (var key in MapSumPower) {
|
for(var key in MapSumPower)
|
||||||
if (MapSumPower[key] >= Max) {
|
{
|
||||||
|
if(MapSumPower[key] >= Max)
|
||||||
|
{
|
||||||
Max = MapSumPower[key];
|
Max = MapSumPower[key];
|
||||||
MaxKey = parseInt(key);
|
MaxKey = parseInt(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Arr.sort(function(a, b) {
|
Arr.sort(function (a,b)
|
||||||
|
{
|
||||||
return a.DeltaTime - b.DeltaTime;
|
return a.DeltaTime - b.DeltaTime;
|
||||||
});
|
});
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
var Item = Arr[i];
|
var Item = Arr[i];
|
||||||
if (Item.SumPower === MaxKey) {
|
if(Item.SumPower === MaxKey)
|
||||||
|
{
|
||||||
SetStatus("Find " + Item.ip + ":" + Item.port + " with pow=" + Item.SumPower + "/" + MaxKey + " ping=" + Item.DeltaTime);
|
SetStatus("Find " + Item.ip + ":" + Item.port + " with pow=" + Item.SumPower + "/" + MaxKey + " ping=" + Item.DeltaTime);
|
||||||
MainServer = Item;
|
MainServer = Item;
|
||||||
SaveServerMap();
|
SaveServerMap();
|
||||||
@ -233,19 +253,23 @@ function FindLider() {
|
|||||||
OnFindServer();
|
OnFindServer();
|
||||||
};
|
};
|
||||||
|
|
||||||
function CalcPowFromBlockChain(BufRead) {
|
function CalcPowFromBlockChain(BufRead)
|
||||||
|
{
|
||||||
var Sum = 0;
|
var Sum = 0;
|
||||||
var Arr = GetBlockArrFromBuffer(BufRead);
|
var Arr = GetBlockArrFromBuffer(BufRead);
|
||||||
if (Arr.length === COUNT_BLOCK_PROOF) {
|
if(Arr.length === COUNT_BLOCK_PROOF)
|
||||||
for (var i = 0; i < Arr.length; i++) {
|
{
|
||||||
|
for(var i = 0; i < Arr.length; i++)
|
||||||
|
{
|
||||||
Sum += Arr[i].Power;
|
Sum += Arr[i].Power;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Sum;
|
return Sum;
|
||||||
};
|
};
|
||||||
|
|
||||||
function SetAllSum() {
|
function SetAllSum()
|
||||||
|
{
|
||||||
var Item = MapAccounts[$("idAccount").value];
|
var Item = MapAccounts[$("idAccount").value];
|
||||||
if (Item)
|
if(Item)
|
||||||
$("idSumSend").value = FLOAT_FROM_COIN(Item.Value).toStringF();
|
$("idSumSend").value = FLOAT_FROM_COIN(Item.Value).toStringF();
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<circle cx="12" cy="12" r="12" fill="none"/>
|
<circle cx="12" cy="12" r="12" fill="none"/>
|
||||||
<path d="M16.37 11.6869C16.7553 11.143 16.9852 10.4622 16.9852 9.72248C16.9852 7.94269 15.6576 6.4998 14.0206 6.4998C13.8896 6.4998 13.7302 6.4998 13.548 6.4998V4.00765C13.548 3.86574 13.4319 3.75 13.2904 3.75H12.4304C12.2885 3.75 12.1727 3.86616 12.1727 4.00765V6.4998H10.7978V4.00765C10.7978 3.86574 10.6816 3.75 10.5402 3.75H9.68095C9.53904 3.75 9.4233 3.86616 9.4233 4.00765V6.4998H6.58724C6.4449 6.4998 6.32959 6.61511 6.32959 6.75744V7.62538C6.32959 7.75813 6.42873 7.87308 6.56106 7.8851C7.52942 7.97387 8.04837 8.62357 8.04837 9.42176V14.75C8.04837 15.4681 7.67786 16.0381 6.86807 16.1161C6.75312 16.1273 6.6577 16.209 6.63617 16.3228L6.47187 17.1989C6.4424 17.3553 6.56271 17.5002 6.72207 17.5002H9.42245V19.9924C9.42245 20.1342 9.53861 20.25 9.68009 20.25H10.5393C10.6812 20.25 10.7969 20.1338 10.7969 19.9924V17.5002H12.1719V19.9924C12.1719 20.1342 12.288 20.25 12.4295 20.25H13.2887C13.4306 20.25 13.5463 20.1338 13.5463 19.9924V17.5002C14.0334 17.5002 14.4379 17.5002 14.7064 17.5002C16.3439 17.5002 17.671 16.0768 17.671 14.3207C17.6726 13.2244 17.1562 12.2586 16.37 11.6869ZM10.7974 8.56207C10.7974 8.56207 12.1196 8.56207 12.9028 8.56207C13.6862 8.56207 14.3208 9.19682 14.3208 9.98013C14.3208 10.7634 13.6862 11.3981 12.9028 11.3981C12.1196 11.3981 10.7974 11.3981 10.7974 11.3981V8.56207ZM13.5903 15.5232C12.8071 15.5232 10.7974 15.5232 10.7974 15.5232V12.6872C10.7974 12.6872 12.8071 12.6872 13.5903 12.6872C14.3737 12.6872 15.0083 13.3219 15.0083 14.1052C15.0083 14.8884 14.3737 15.5232 13.5903 15.5232Z" fill="#445368"/>
|
<path d="M16.37 11.6869C16.7553 11.143 16.9852 10.4622 16.9852 9.72248C16.9852 7.94269 15.6576 6.4998 14.0206 6.4998C13.8896 6.4998 13.7302 6.4998 13.548 6.4998V4.00765C13.548 3.86574 13.4319 3.75 13.2904 3.75H12.4304C12.2885 3.75 12.1727 3.86616 12.1727 4.00765V6.4998H10.7978V4.00765C10.7978 3.86574 10.6816 3.75 10.5402 3.75H9.68095C9.53904 3.75 9.4233 3.86616 9.4233 4.00765V6.4998H6.58724C6.4449 6.4998 6.32959 6.61511 6.32959 6.75744V7.62538C6.32959 7.75813 6.42873 7.87308 6.56106 7.8851C7.52942 7.97387 8.04837 8.62357 8.04837 9.42176V14.75C8.04837 15.4681 7.67786 16.0381 6.86807 16.1161C6.75312 16.1273 6.6577 16.209 6.63617 16.3228L6.47187 17.1989C6.4424 17.3553 6.56271 17.5002 6.72207 17.5002H9.42245V19.9924C9.42245 20.1342 9.53861 20.25 9.68009 20.25H10.5393C10.6812 20.25 10.7969 20.1338 10.7969 19.9924V17.5002H12.1719V19.9924C12.1719 20.1342 12.288 20.25 12.4295 20.25H13.2887C13.4306 20.25 13.5463 20.1338 13.5463 19.9924V17.5002C14.0334 17.5002 14.4379 17.5002 14.7064 17.5002C16.3439 17.5002 17.671 16.0768 17.671 14.3207C17.6726 13.2244 17.1562 12.2586 16.37 11.6869ZM10.7974 8.56207C10.7974 8.56207 12.1196 8.56207 12.9028 8.56207C13.6862 8.56207 14.3208 9.19682 14.3208 9.98013C14.3208 10.7634 13.6862 11.3981 12.9028 11.3981C12.1196 11.3981 10.7974 11.3981 10.7974 11.3981V8.56207ZM13.5903 15.5232C12.8071 15.5232 10.7974 15.5232 10.7974 15.5232V12.6872C10.7974 12.6872 12.8071 12.6872 13.5903 12.6872C14.3737 12.6872 15.0083 13.3219 15.0083 14.1052C15.0083 14.8884 14.3737 15.5232 13.5903 15.5232Z" fill="#445368"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<svg width="104" height="25" viewBox="0 0 105 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="104" height="25" viewBox="0 0 105 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M29.9728 24.4597C29.9728 24.4587 29.9723 24.4577 29.9718 24.4566C29.9707 24.4535 29.9697 24.4504 29.9681 24.4479C29.9661 24.4427 29.9635 24.4375 29.9604 24.4323C29.9594 24.4292 29.9579 24.4261 29.9563 24.423C29.9522 24.4153 29.9481 24.408 29.9435 24.4008L15.3327 0.205778C15.3317 0.204227 15.3306 0.202158 15.3296 0.200607L15.3137 0.173722C15.2453 0.0687645 15.1275 0 14.9944 0C14.8622 0 14.746 0.0672141 14.6776 0.169586C14.6704 0.179927 14.6637 0.190783 14.6576 0.202158C13.6755 1.83184 12.6878 3.45843 11.6939 5.08191C11.5946 5.22357 11.5417 5.39264 11.5417 5.56533C11.5417 5.73854 11.5946 5.90709 11.6939 6.04875C13.0045 8.20012 14.3079 10.3567 15.6186 12.508C15.7255 12.6616 15.7826 12.8441 15.7826 13.0318C15.7826 13.219 15.7255 13.4015 15.6186 13.555C13.4652 17.1107 11.1807 20.8545 9.01708 24.4303C8.98777 24.4846 8.97131 24.5471 8.97131 24.6133C8.97131 24.8258 9.14202 24.9975 9.35334 24.9975H15.3846L15.3841 24.998H15.6746C15.7476 24.998 15.8155 24.9773 15.8736 24.9416C15.9317 24.9059 15.979 24.8553 16.0114 24.7953L16.0124 24.7948L16.2299 24.4298L19.1437 19.594C19.1443 19.5934 19.1437 19.5934 19.1437 19.5934C19.209 19.4735 19.335 19.3928 19.48 19.3928C19.6116 19.3928 19.7279 19.46 19.7968 19.5619C19.7993 19.566 19.8019 19.5702 19.8045 19.5743L19.807 19.5784L22.708 24.3424L22.9738 24.7844C23.0386 24.9039 23.1646 24.985 23.3101 24.985H23.487C23.5163 24.9866 23.5456 24.9871 23.5749 24.9856H29.618C29.8288 24.9856 30 24.8139 30 24.6014C30 24.5513 29.9908 24.5032 29.9728 24.4597Z" fill="white" />
|
<path d="M29.9728 24.4597C29.9728 24.4587 29.9723 24.4577 29.9718 24.4566C29.9707 24.4535 29.9697 24.4504 29.9681 24.4479C29.9661 24.4427 29.9635 24.4375 29.9604 24.4323C29.9594 24.4292 29.9579 24.4261 29.9563 24.423C29.9522 24.4153 29.9481 24.408 29.9435 24.4008L15.3327 0.205778C15.3317 0.204227 15.3306 0.202158 15.3296 0.200607L15.3137 0.173722C15.2453 0.0687645 15.1275 0 14.9944 0C14.8622 0 14.746 0.0672141 14.6776 0.169586C14.6704 0.179927 14.6637 0.190783 14.6576 0.202158C13.6755 1.83184 12.6878 3.45843 11.6939 5.08191C11.5946 5.22357 11.5417 5.39264 11.5417 5.56533C11.5417 5.73854 11.5946 5.90709 11.6939 6.04875C13.0045 8.20012 14.3079 10.3567 15.6186 12.508C15.7255 12.6616 15.7826 12.8441 15.7826 13.0318C15.7826 13.219 15.7255 13.4015 15.6186 13.555C13.4652 17.1107 11.1807 20.8545 9.01708 24.4303C8.98777 24.4846 8.97131 24.5471 8.97131 24.6133C8.97131 24.8258 9.14202 24.9975 9.35334 24.9975H15.3846L15.3841 24.998H15.6746C15.7476 24.998 15.8155 24.9773 15.8736 24.9416C15.9317 24.9059 15.979 24.8553 16.0114 24.7953L16.0124 24.7948L16.2299 24.4298L19.1437 19.594C19.1443 19.5934 19.1437 19.5934 19.1437 19.5934C19.209 19.4735 19.335 19.3928 19.48 19.3928C19.6116 19.3928 19.7279 19.46 19.7968 19.5619C19.7993 19.566 19.8019 19.5702 19.8045 19.5743L19.807 19.5784L22.708 24.3424L22.9738 24.7844C23.0386 24.9039 23.1646 24.985 23.3101 24.985H23.487C23.5163 24.9866 23.5456 24.9871 23.5749 24.9856H29.618C29.8288 24.9856 30 24.8139 30 24.6014C30 24.5513 29.9908 24.5032 29.9728 24.4597Z" fill="white" />
|
||||||
<path d="M13.1433 13.7884C13.2133 13.6721 13.2832 13.5563 13.3536 13.4394C13.4405 13.3133 13.4873 13.1639 13.4873 13.0108C13.4873 12.8578 13.4405 12.7073 13.3536 12.5822L12.0553 10.467L10.5704 8.0468C10.503 7.93719 10.3822 7.86377 10.2449 7.86377C10.0994 7.86377 9.97242 7.94443 9.90763 8.06438L0.0457623 24.4321C0.0164543 24.4863 0 24.5489 0 24.6151C0 24.8276 0.170703 24.9992 0.382028 24.9992H3.19971V24.9987H5.77983L5.77778 24.9998H5.93872L6.17318 24.9992H6.17421C6.31869 24.9992 6.44467 24.9181 6.50894 24.7986C6.50894 24.7986 6.50945 24.7986 6.50945 24.7981L6.73106 24.429C6.74134 24.415 6.7506 24.4005 6.75883 24.3855C6.75883 24.3855 6.75934 24.3855 6.75934 24.3845L6.99998 23.9848C9.07005 20.5466 11.0429 17.2644 13.1104 13.8422C13.1223 13.8246 13.1331 13.8065 13.1433 13.7884Z" fill="white" />
|
<path d="M13.1433 13.7884C13.2133 13.6721 13.2832 13.5563 13.3536 13.4394C13.4405 13.3133 13.4873 13.1639 13.4873 13.0108C13.4873 12.8578 13.4405 12.7073 13.3536 12.5822L12.0553 10.467L10.5704 8.0468C10.503 7.93719 10.3822 7.86377 10.2449 7.86377C10.0994 7.86377 9.97242 7.94443 9.90763 8.06438L0.0457623 24.4321C0.0164543 24.4863 0 24.5489 0 24.6151C0 24.8276 0.170703 24.9992 0.382028 24.9992H3.19971V24.9987H5.77983L5.77778 24.9998H5.93872L6.17318 24.9992H6.17421C6.31869 24.9992 6.44467 24.9181 6.50894 24.7986C6.50894 24.7986 6.50945 24.7986 6.50945 24.7981L6.73106 24.429C6.74134 24.415 6.7506 24.4005 6.75883 24.3855C6.75883 24.3855 6.75934 24.3855 6.75934 24.3845L6.99998 23.9848C9.07005 20.5466 11.0429 17.2644 13.1104 13.8422C13.1223 13.8246 13.1331 13.8065 13.1433 13.7884Z" fill="white" />
|
||||||
<path d="M84.9771 18.1896L84.7356 17.7922L84.7372 17.7906L82.9705 14.8915C82.705 14.4544 82.7506 13.7969 83.1545 13.4891C84.4869 12.4746 85.3338 10.7451 85.3338 9.1756C85.3338 6.7668 83.1385 4.17139 80.4577 4.17139H80.0162H73.738C73.7332 4.17139 73.7292 4.1722 73.7244 4.1722H72.8967C72.5624 4.1722 72.2897 4.44845 72.2897 4.7853V6.5075C72.2897 6.84515 72.5624 7.1206 72.8967 7.1206H75.344H80.0162C80.0226 7.1206 80.029 7.1206 80.0354 7.12141C80.3049 7.12302 80.5632 7.17149 80.8032 7.25712C81.6013 7.56085 82.1692 8.33954 82.1692 9.25234C82.1692 10.2144 81.5373 11.0278 80.6688 11.292C80.4617 11.3469 80.2425 11.376 80.0162 11.376H79.901H73.7412H73.7085C73.6589 11.3768 73.6093 11.38 73.5613 11.3857H72.8967C72.8831 11.3857 72.8703 11.3865 72.8567 11.3881C72.54 11.4083 72.2897 11.6733 72.2897 11.998C72.2897 11.9988 72.2897 11.9988 72.2897 11.9996V13.6709C72.2897 13.6911 72.2905 13.7105 72.2929 13.7291V16.8544C72.2905 16.8729 72.2897 16.8923 72.2897 16.9125V19.3843C72.2897 19.7212 72.5624 19.9975 72.8967 19.9975H73.6685C73.6877 19.9983 73.7069 19.9999 73.7268 19.9999C73.746 19.9999 73.7652 19.9983 73.7844 19.9975H74.5514C74.8849 19.9975 75.1584 19.7212 75.1584 19.3843V18.6113C75.1592 18.5919 75.1616 18.5717 75.1616 18.5515C75.1616 18.537 75.16 18.5241 75.1592 18.5103L75.1608 16.6613C75.1552 16.629 75.152 16.5959 75.152 16.562V14.8907C75.152 14.553 75.4247 14.2775 75.759 14.2775H78.2063C78.2279 14.2775 78.2495 14.2792 78.2711 14.2808H78.615V14.2816C79.0181 14.2816 79.3684 14.5005 79.5611 14.826H79.5627L81.2454 17.5911C81.2478 17.5951 81.2494 17.5991 81.2518 17.6024L82.2811 19.2939L82.5147 19.6768C82.5195 19.6857 82.525 19.6945 82.5298 19.7026C82.637 19.8811 82.8306 19.9999 83.0529 19.9999H83.508C83.5104 19.9999 83.512 19.9999 83.5144 19.9999C83.5152 19.9999 83.5167 19.9999 83.5175 19.9999H84.9851C85.3226 19.9999 85.5961 19.7236 85.5961 19.3827C85.5961 19.2551 85.5578 19.1364 85.4922 19.0378L84.9771 18.1896Z" fill="white" />
|
<path d="M84.9771 18.1896L84.7356 17.7922L84.7372 17.7906L82.9705 14.8915C82.705 14.4544 82.7506 13.7969 83.1545 13.4891C84.4869 12.4746 85.3338 10.7451 85.3338 9.1756C85.3338 6.7668 83.1385 4.17139 80.4577 4.17139H80.0162H73.738C73.7332 4.17139 73.7292 4.1722 73.7244 4.1722H72.8967C72.5624 4.1722 72.2897 4.44845 72.2897 4.7853V6.5075C72.2897 6.84515 72.5624 7.1206 72.8967 7.1206H75.344H80.0162C80.0226 7.1206 80.029 7.1206 80.0354 7.12141C80.3049 7.12302 80.5632 7.17149 80.8032 7.25712C81.6013 7.56085 82.1692 8.33954 82.1692 9.25234C82.1692 10.2144 81.5373 11.0278 80.6688 11.292C80.4617 11.3469 80.2425 11.376 80.0162 11.376H79.901H73.7412H73.7085C73.6589 11.3768 73.6093 11.38 73.5613 11.3857H72.8967C72.8831 11.3857 72.8703 11.3865 72.8567 11.3881C72.54 11.4083 72.2897 11.6733 72.2897 11.998C72.2897 11.9988 72.2897 11.9988 72.2897 11.9996V13.6709C72.2897 13.6911 72.2905 13.7105 72.2929 13.7291V16.8544C72.2905 16.8729 72.2897 16.8923 72.2897 16.9125V19.3843C72.2897 19.7212 72.5624 19.9975 72.8967 19.9975H73.6685C73.6877 19.9983 73.7069 19.9999 73.7268 19.9999C73.746 19.9999 73.7652 19.9983 73.7844 19.9975H74.5514C74.8849 19.9975 75.1584 19.7212 75.1584 19.3843V18.6113C75.1592 18.5919 75.1616 18.5717 75.1616 18.5515C75.1616 18.537 75.16 18.5241 75.1592 18.5103L75.1608 16.6613C75.1552 16.629 75.152 16.5959 75.152 16.562V14.8907C75.152 14.553 75.4247 14.2775 75.759 14.2775H78.2063C78.2279 14.2775 78.2495 14.2792 78.2711 14.2808H78.615V14.2816C79.0181 14.2816 79.3684 14.5005 79.5611 14.826H79.5627L81.2454 17.5911C81.2478 17.5951 81.2494 17.5991 81.2518 17.6024L82.2811 19.2939L82.5147 19.6768C82.5195 19.6857 82.525 19.6945 82.5298 19.7026C82.637 19.8811 82.8306 19.9999 83.0529 19.9999H83.508C83.5104 19.9999 83.512 19.9999 83.5144 19.9999C83.5152 19.9999 83.5167 19.9999 83.5175 19.9999H84.9851C85.3226 19.9999 85.5961 19.7236 85.5961 19.3827C85.5961 19.2551 85.5578 19.1364 85.4922 19.0378L84.9771 18.1896Z" fill="white" />
|
||||||
<path d="M67.2056 17.1015H66.4338C66.4154 17.1007 66.397 17.0991 66.3786 17.0991H57.2429C57.2238 17.0991 57.2062 17.1007 57.1878 17.1015H56.4152C56.0817 17.1015 55.8082 17.3778 55.8082 17.7147V19.3859C55.8082 19.7236 56.0817 19.9991 56.4152 19.9991H58.8625C58.8809 19.9991 58.8993 19.9983 58.9176 19.9966H64.7031C64.7215 19.9983 64.7399 19.9991 64.7583 19.9991H67.2056C67.5399 19.9991 67.8126 19.7236 67.8126 19.3859V18.5475V17.7147C67.8126 17.3778 67.5399 17.1015 67.2056 17.1015Z" fill="white" />
|
<path d="M67.2056 17.1015H66.4338C66.4154 17.1007 66.397 17.0991 66.3786 17.0991H57.2429C57.2238 17.0991 57.2062 17.1007 57.1878 17.1015H56.4152C56.0817 17.1015 55.8082 17.3778 55.8082 17.7147V19.3859C55.8082 19.7236 56.0817 19.9991 56.4152 19.9991H58.8625C58.8809 19.9991 58.8993 19.9983 58.9176 19.9966H64.7031C64.7215 19.9983 64.7399 19.9991 64.7583 19.9991H67.2056C67.5399 19.9991 67.8126 19.7236 67.8126 19.3859V18.5475V17.7147C67.8126 17.3778 67.5399 17.1015 67.2056 17.1015Z" fill="white" />
|
||||||
<path d="M67.2056 10.6369H66.4058C66.3962 10.6369 66.3874 10.6353 66.3786 10.6353H57.2429C57.2334 10.6353 57.2246 10.6369 57.2158 10.6369H56.4152C56.0817 10.6369 55.8082 10.9123 55.8082 11.25V12.0844V12.9213C55.8082 13.2581 56.0817 13.5344 56.4152 13.5344H58.8625C58.8721 13.5344 58.8809 13.5336 58.8897 13.5328H64.7311C64.7399 13.5336 64.7495 13.5344 64.7583 13.5344H67.2056C67.5399 13.5344 67.8126 13.2581 67.8126 12.9213V12.0844V11.25C67.8126 10.9123 67.5399 10.6369 67.2056 10.6369Z" fill="white" />
|
<path d="M67.2056 10.6369H66.4058C66.3962 10.6369 66.3874 10.6353 66.3786 10.6353H57.2429C57.2334 10.6353 57.2246 10.6369 57.2158 10.6369H56.4152C56.0817 10.6369 55.8082 10.9123 55.8082 11.25V12.0844V12.9213C55.8082 13.2581 56.0817 13.5344 56.4152 13.5344H58.8625C58.8721 13.5344 58.8809 13.5336 58.8897 13.5328H64.7311C64.7399 13.5336 64.7495 13.5344 64.7583 13.5344H67.2056C67.5399 13.5344 67.8126 13.2581 67.8126 12.9213V12.0844V11.25C67.8126 10.9123 67.5399 10.6369 67.2056 10.6369Z" fill="white" />
|
||||||
<path d="M67.2056 4.17188H66.3882C66.385 4.17188 66.3818 4.17188 66.3786 4.17188H57.2429C57.2389 4.17188 57.2357 4.17188 57.2326 4.17188H56.4152C56.0817 4.17188 55.8082 4.44813 55.8082 4.78498V6.45628C55.8082 6.79394 56.0817 7.06939 56.4152 7.06939H58.8625C58.8665 7.06939 58.8697 7.06939 58.8729 7.06939H64.7479C64.7519 7.06939 64.7551 7.06939 64.7583 7.06939H67.2056C67.5399 7.06939 67.8126 6.79394 67.8126 6.45628V5.62023V4.78498C67.8126 4.44813 67.5399 4.17188 67.2056 4.17188Z" fill="white" />
|
<path d="M67.2056 4.17188H66.3882C66.385 4.17188 66.3818 4.17188 66.3786 4.17188H57.2429C57.2389 4.17188 57.2357 4.17188 57.2326 4.17188H56.4152C56.0817 4.17188 55.8082 4.44813 55.8082 4.78498V6.45628C55.8082 6.79394 56.0817 7.06939 56.4152 7.06939H58.8625C58.8665 7.06939 58.8697 7.06939 58.8729 7.06939H64.7479C64.7519 7.06939 64.7551 7.06939 64.7583 7.06939H67.2056C67.5399 7.06939 67.8126 6.79394 67.8126 6.45628V5.62023V4.78498C67.8126 4.44813 67.5399 4.17188 67.2056 4.17188Z" fill="white" />
|
||||||
<path d="M50.7665 4.17215H49.9515C49.9467 4.17215 49.9427 4.17135 49.9387 4.17135H44.9514C44.9186 4.16892 44.8866 4.1665 44.853 4.1665C44.8162 4.1665 44.7811 4.16973 44.7451 4.17215H44.0261C43.6918 4.17215 43.4191 4.44841 43.4191 4.78526V6.45656V9.32257V14.8421V16.9141V19.3867C43.4191 19.7236 43.6918 19.999 44.0261 19.999H44.8522H44.853H45.6808C46.0143 19.999 46.2878 19.7236 46.2878 19.3867V18.5515C46.2878 18.5515 46.2878 18.5515 46.2878 18.5507V14.8421V9.32338V8.51802V8.1836C46.2878 8.17795 46.2886 8.17229 46.2886 8.16663V7.68277C46.2886 7.34593 46.5613 7.06967 46.8956 7.06967H47.3915V7.06886H47.7218H48.3064C48.3104 7.06967 48.3144 7.06967 48.3192 7.06967H50.7665C51.1 7.06967 51.3735 6.79422 51.3735 6.45656V5.62132C51.3735 5.62132 51.3735 5.62132 51.3735 5.62051V4.78526C51.3735 4.44841 51.1 4.17215 50.7665 4.17215Z" fill="white" />
|
<path d="M50.7665 4.17215H49.9515C49.9467 4.17215 49.9427 4.17135 49.9387 4.17135H44.9514C44.9186 4.16892 44.8866 4.1665 44.853 4.1665C44.8162 4.1665 44.7811 4.16973 44.7451 4.17215H44.0261C43.6918 4.17215 43.4191 4.44841 43.4191 4.78526V6.45656V9.32257V14.8421V16.9141V19.3867C43.4191 19.7236 43.6918 19.999 44.0261 19.999H44.8522H44.853H45.6808C46.0143 19.999 46.2878 19.7236 46.2878 19.3867V18.5515C46.2878 18.5515 46.2878 18.5515 46.2878 18.5507V14.8421V9.32338V8.51802V8.1836C46.2878 8.17795 46.2886 8.17229 46.2886 8.16663V7.68277C46.2886 7.34593 46.5613 7.06967 46.8956 7.06967H47.3915V7.06886H47.7218H48.3064C48.3104 7.06967 48.3144 7.06967 48.3192 7.06967H50.7665C51.1 7.06967 51.3735 6.79422 51.3735 6.45656V5.62132C51.3735 5.62132 51.3735 5.62132 51.3735 5.62051V4.78526C51.3735 4.44841 51.1 4.17215 50.7665 4.17215Z" fill="white" />
|
||||||
<path d="M41.3876 4.17188H40.5599H40.164H39.7673H38.9403C38.606 4.17188 38.3333 4.44813 38.3333 4.78498V6.45628C38.3333 6.79394 38.606 7.06939 38.9403 7.06939H39.7673H40.164H40.5599H41.3876C41.7211 7.06939 41.9946 6.79394 41.9946 6.45628V4.78498C41.9946 4.44813 41.7211 4.17188 41.3876 4.17188Z" fill="white" />
|
<path d="M41.3876 4.17188H40.5599H40.164H39.7673H38.9403C38.606 4.17188 38.3333 4.44813 38.3333 4.78498V6.45628C38.3333 6.79394 38.606 7.06939 38.9403 7.06939H39.7673H40.164H40.5599H41.3876C41.7211 7.06939 41.9946 6.79394 41.9946 6.45628V4.78498C41.9946 4.44813 41.7211 4.17188 41.3876 4.17188Z" fill="white" />
|
||||||
<path d="M104.124 19.1776C104.124 19.1759 104.123 19.1743 104.123 19.1727L104.105 19.1347C104.103 19.1299 104.101 19.1251 104.099 19.1202L97.9053 5.06883L97.6854 4.54539C97.6838 4.54054 97.6822 4.53569 97.6798 4.53165C97.5878 4.31921 97.3783 4.17139 97.1351 4.17139H96.0363C95.7955 4.17139 95.5876 4.31679 95.4948 4.5252C95.4916 4.53166 95.4884 4.53812 95.486 4.54458L95.2525 5.06883L91.8727 12.7387L91.1097 14.4504L90.957 14.7929C90.9546 14.7978 90.9522 14.8034 90.9498 14.8091C90.9194 14.8818 90.9034 14.9609 90.9034 15.0449C90.9034 15.3858 91.1769 15.6629 91.5152 15.6629H93.3203C93.5738 15.6629 93.7905 15.507 93.8833 15.2857L93.9233 15.1968L94.0609 14.8882C94.0696 14.8721 94.0785 14.8559 94.0865 14.839L94.108 14.7913L94.116 14.7719L94.4159 14.0918L94.7303 13.3866C94.7391 13.3672 94.747 13.347 94.7534 13.326L95.5612 11.4939L96.2658 9.89533C96.317 9.77174 96.4385 9.68531 96.5793 9.68531C96.7113 9.68531 96.8264 9.76123 96.8824 9.87271C96.8864 9.87998 96.8896 9.88725 96.8928 9.89533L97.5974 11.4939L99.3873 15.5538L99.8591 16.6242H99.8583C99.8759 16.6645 99.8855 16.7098 99.8855 16.7574C99.8855 16.9481 99.7328 17.1016 99.5448 17.1016H98.3964C98.394 17.1016 98.3916 17.1016 98.3892 17.1016H98.3468C98.3444 17.1016 98.342 17.1016 98.3396 17.1016H90.8794C90.8786 17.1016 90.8778 17.1016 90.8778 17.1016H90.7442C90.7402 17.1016 90.7354 17.1024 90.7314 17.1024H90.3244C90.0892 17.1024 89.8869 17.2397 89.7909 17.4384L89.7733 17.478L89.1895 18.7866L89.0367 19.1291C89.0343 19.1339 89.0319 19.1396 89.0295 19.1452C88.9992 19.2179 88.9832 19.2971 88.9832 19.3811C88.9832 19.722 89.2567 19.9991 89.595 19.9991H90.7434H90.7442H93.1915C93.1923 19.9991 93.1931 19.9991 93.1931 19.9991H103.572C103.9 19.9991 104.167 19.7309 104.167 19.3989C104.167 19.3205 104.152 19.2454 104.124 19.1776Z" fill="white" />
|
<path d="M104.124 19.1776C104.124 19.1759 104.123 19.1743 104.123 19.1727L104.105 19.1347C104.103 19.1299 104.101 19.1251 104.099 19.1202L97.9053 5.06883L97.6854 4.54539C97.6838 4.54054 97.6822 4.53569 97.6798 4.53165C97.5878 4.31921 97.3783 4.17139 97.1351 4.17139H96.0363C95.7955 4.17139 95.5876 4.31679 95.4948 4.5252C95.4916 4.53166 95.4884 4.53812 95.486 4.54458L95.2525 5.06883L91.8727 12.7387L91.1097 14.4504L90.957 14.7929C90.9546 14.7978 90.9522 14.8034 90.9498 14.8091C90.9194 14.8818 90.9034 14.9609 90.9034 15.0449C90.9034 15.3858 91.1769 15.6629 91.5152 15.6629H93.3203C93.5738 15.6629 93.7905 15.507 93.8833 15.2857L93.9233 15.1968L94.0609 14.8882C94.0696 14.8721 94.0785 14.8559 94.0865 14.839L94.108 14.7913L94.116 14.7719L94.4159 14.0918L94.7303 13.3866C94.7391 13.3672 94.747 13.347 94.7534 13.326L95.5612 11.4939L96.2658 9.89533C96.317 9.77174 96.4385 9.68531 96.5793 9.68531C96.7113 9.68531 96.8264 9.76123 96.8824 9.87271C96.8864 9.87998 96.8896 9.88725 96.8928 9.89533L97.5974 11.4939L99.3873 15.5538L99.8591 16.6242H99.8583C99.8759 16.6645 99.8855 16.7098 99.8855 16.7574C99.8855 16.9481 99.7328 17.1016 99.5448 17.1016H98.3964C98.394 17.1016 98.3916 17.1016 98.3892 17.1016H98.3468C98.3444 17.1016 98.342 17.1016 98.3396 17.1016H90.8794C90.8786 17.1016 90.8778 17.1016 90.8778 17.1016H90.7442C90.7402 17.1016 90.7354 17.1024 90.7314 17.1024H90.3244C90.0892 17.1024 89.8869 17.2397 89.7909 17.4384L89.7733 17.478L89.1895 18.7866L89.0367 19.1291C89.0343 19.1339 89.0319 19.1396 89.0295 19.1452C88.9992 19.2179 88.9832 19.2971 88.9832 19.3811C88.9832 19.722 89.2567 19.9991 89.595 19.9991H90.7434H90.7442H93.1915C93.1923 19.9991 93.1931 19.9991 93.1931 19.9991H103.572C103.9 19.9991 104.167 19.7309 104.167 19.3989C104.167 19.3205 104.152 19.2454 104.124 19.1776Z" fill="white" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13" width="150" height="150">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13" width="150" height="150">
|
||||||
<title>Logo2</title>
|
<title>Logo2</title>
|
||||||
<path d="M894.31,812.41a0.18,0.18,0,0,0,0-.08,1.11,1.11,0,0,0-.09-0.23,2.58,2.58,0,0,0-.21-0.41,1.51,1.51,0,0,0-.11-0.25c-0.11-.21-0.22-0.4-0.34-0.59l-388.62-640-0.08-.14L504.4,170a10.15,10.15,0,0,0-16.92-.11,9.33,9.33,0,0,0-.54.86q-39.18,64.66-78.83,129.08a22.21,22.21,0,0,0,0,25.57q52.29,85.36,104.39,170.85a24.15,24.15,0,0,1,0,27.69C455.24,618,394.48,717,336.93,811.63a10.18,10.18,0,0,0,8.94,15H514a10.12,10.12,0,0,0,5.29-1.49,10.25,10.25,0,0,0,3.66-3.87h0l5.79-9.66,77.5-127.91s0,0,0,0a10.18,10.18,0,0,1,17.37-.84l0.21,0.33,0.07,0.11,77.16,126L708.15,821a10.17,10.17,0,0,0,8.95,5.3h4.71a21.71,21.71,0,0,0,2.34,0H884.87A10.16,10.16,0,0,0,895,816.15,9.73,9.73,0,0,0,894.31,812.41Z" />
|
<path d="M894.31,812.41a0.18,0.18,0,0,0,0-.08,1.11,1.11,0,0,0-.09-0.23,2.58,2.58,0,0,0-.21-0.41,1.51,1.51,0,0,0-.11-0.25c-0.11-.21-0.22-0.4-0.34-0.59l-388.62-640-0.08-.14L504.4,170a10.15,10.15,0,0,0-16.92-.11,9.33,9.33,0,0,0-.54.86q-39.18,64.66-78.83,129.08a22.21,22.21,0,0,0,0,25.57q52.29,85.36,104.39,170.85a24.15,24.15,0,0,1,0,27.69C455.24,618,394.48,717,336.93,811.63a10.18,10.18,0,0,0,8.94,15H514a10.12,10.12,0,0,0,5.29-1.49,10.25,10.25,0,0,0,3.66-3.87h0l5.79-9.66,77.5-127.91s0,0,0,0a10.18,10.18,0,0,1,17.37-.84l0.21,0.33,0.07,0.11,77.16,126L708.15,821a10.17,10.17,0,0,0,8.95,5.3h4.71a21.71,21.71,0,0,0,2.34,0H884.87A10.16,10.16,0,0,0,895,816.15,9.73,9.73,0,0,0,894.31,812.41Z" />
|
||||||
<path d="M446.68,530.15l5.59-9.23a19.86,19.86,0,0,0,0-22.68L417.74,442.3l-39.5-64a10.2,10.2,0,0,0-17.63.46L98.31,811.68a10.17,10.17,0,0,0,8.95,15H250.82l-0.05,0h4.28l6.23,0h0a10.12,10.12,0,0,0,8.9-5.3,0,0,0,0,0,0,0l5.89-9.77a9.82,9.82,0,0,0,.74-1.15s0,0,0,0l6.4-10.57c55.06-90.94,107.53-177.76,162.52-268.28C446.12,531.11,446.41,530.63,446.68,530.15Z" />
|
<path d="M446.68,530.15l5.59-9.23a19.86,19.86,0,0,0,0-22.68L417.74,442.3l-39.5-64a10.2,10.2,0,0,0-17.63.46L98.31,811.68a10.17,10.17,0,0,0,8.95,15H250.82l-0.05,0h4.28l6.23,0h0a10.12,10.12,0,0,0,8.9-5.3,0,0,0,0,0,0,0l5.89-9.77a9.82,9.82,0,0,0,.74-1.15s0,0,0,0l6.4-10.57c55.06-90.94,107.53-177.76,162.52-268.28C446.12,531.11,446.41,530.63,446.68,530.15Z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13" width="150" height="150">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13" width="150" height="150">
|
||||||
<title>Logo2</title>
|
<title>Logo2</title>
|
||||||
<path d="M894.31,812.41a0.18,0.18,0,0,0,0-.08,1.11,1.11,0,0,0-.09-0.23,2.58,2.58,0,0,0-.21-0.41,1.51,1.51,0,0,0-.11-0.25c-0.11-.21-0.22-0.4-0.34-0.59l-388.62-640-0.08-.14L504.4,170a10.15,10.15,0,0,0-16.92-.11,9.33,9.33,0,0,0-.54.86q-39.18,64.66-78.83,129.08a22.21,22.21,0,0,0,0,25.57q52.29,85.36,104.39,170.85a24.15,24.15,0,0,1,0,27.69C455.24,618,394.48,717,336.93,811.63a10.18,10.18,0,0,0,8.94,15H514a10.12,10.12,0,0,0,5.29-1.49,10.25,10.25,0,0,0,3.66-3.87h0l5.79-9.66,77.5-127.91s0,0,0,0a10.18,10.18,0,0,1,17.37-.84l0.21,0.33,0.07,0.11,77.16,126L708.15,821a10.17,10.17,0,0,0,8.95,5.3h4.71a21.71,21.71,0,0,0,2.34,0H884.87A10.16,10.16,0,0,0,895,816.15,9.73,9.73,0,0,0,894.31,812.41Z" fill="rgb(250,250,250)"/>
|
<path d="M894.31,812.41a0.18,0.18,0,0,0,0-.08,1.11,1.11,0,0,0-.09-0.23,2.58,2.58,0,0,0-.21-0.41,1.51,1.51,0,0,0-.11-0.25c-0.11-.21-0.22-0.4-0.34-0.59l-388.62-640-0.08-.14L504.4,170a10.15,10.15,0,0,0-16.92-.11,9.33,9.33,0,0,0-.54.86q-39.18,64.66-78.83,129.08a22.21,22.21,0,0,0,0,25.57q52.29,85.36,104.39,170.85a24.15,24.15,0,0,1,0,27.69C455.24,618,394.48,717,336.93,811.63a10.18,10.18,0,0,0,8.94,15H514a10.12,10.12,0,0,0,5.29-1.49,10.25,10.25,0,0,0,3.66-3.87h0l5.79-9.66,77.5-127.91s0,0,0,0a10.18,10.18,0,0,1,17.37-.84l0.21,0.33,0.07,0.11,77.16,126L708.15,821a10.17,10.17,0,0,0,8.95,5.3h4.71a21.71,21.71,0,0,0,2.34,0H884.87A10.16,10.16,0,0,0,895,816.15,9.73,9.73,0,0,0,894.31,812.41Z" fill="rgb(250,250,250)"/>
|
||||||
<path d="M446.68,530.15l5.59-9.23a19.86,19.86,0,0,0,0-22.68L417.74,442.3l-39.5-64a10.2,10.2,0,0,0-17.63.46L98.31,811.68a10.17,10.17,0,0,0,8.95,15H250.82l-0.05,0h4.28l6.23,0h0a10.12,10.12,0,0,0,8.9-5.3,0,0,0,0,0,0,0l5.89-9.77a9.82,9.82,0,0,0,.74-1.15s0,0,0,0l6.4-10.57c55.06-90.94,107.53-177.76,162.52-268.28C446.12,531.11,446.41,530.63,446.68,530.15Z" fill="rgb(250,250,250)"/>
|
<path d="M446.68,530.15l5.59-9.23a19.86,19.86,0,0,0,0-22.68L417.74,442.3l-39.5-64a10.2,10.2,0,0,0-17.63.46L98.31,811.68a10.17,10.17,0,0,0,8.95,15H250.82l-0.05,0h4.28l6.23,0h0a10.12,10.12,0,0,0,8.9-5.3,0,0,0,0,0,0,0l5.89-9.77a9.82,9.82,0,0,0,.74-1.15s0,0,0,0l6.4-10.57c55.06-90.94,107.53-177.76,162.52-268.28C446.12,531.11,446.41,530.63,446.68,530.15Z" fill="rgb(250,250,250)"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -1,4 +1,4 @@
|
|||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<circle cx="12" cy="12" r="12" fill="none"/>
|
<circle cx="12" cy="12" r="12" fill="none"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 153 B |
@ -1,3 +1,3 @@
|
|||||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8.5C16 12.6421 12.6421 16 8.5 16C4.35786 16 1 12.6421 1 8.5C1 4.35786 4.35786 1 8.5 1C12.6421 1 16 4.35786 16 8.5ZM14.1464 14.8537C12.6451 16.1889 10.6673 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0C13.1944 0 17 3.80558 17 8.5C17 10.6673 16.1888 12.6452 14.8536 14.1466L17.8535 17.1465C18.0487 17.3417 18.0487 17.6583 17.8535 17.8536C17.6582 18.0488 17.3416 18.0488 17.1464 17.8536L14.1464 14.8537Z" fill="#445368"/>
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8.5C16 12.6421 12.6421 16 8.5 16C4.35786 16 1 12.6421 1 8.5C1 4.35786 4.35786 1 8.5 1C12.6421 1 16 4.35786 16 8.5ZM14.1464 14.8537C12.6451 16.1889 10.6673 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0C13.1944 0 17 3.80558 17 8.5C17 10.6673 16.1888 12.6452 14.8536 14.1466L17.8535 17.1465C18.0487 17.3417 18.0487 17.6583 17.8535 17.8536C17.6582 18.0488 17.3416 18.0488 17.1464 17.8536L14.1464 14.8537Z" fill="#445368"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 596 B |
@ -1,131 +1,174 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Block</title>
|
<title>Block</title>
|
||||||
<link rel="shortcut icon" href="./PIC/viewer.png" type="image/png">
|
<link rel="shortcut icon" href="./PIC/viewer.png" type="image/png">
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!--<link rel="stylesheet" href="./CSS/blockviewer.css">-->
|
<!--<link rel="stylesheet" href="./CSS/blockviewer.css">-->
|
||||||
<link rel="stylesheet" href="./CSS/mobile-wallet.css">
|
<link rel="stylesheet" href="./CSS/mobile-wallet.css">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.RUN_CLIENT=1;
|
window.RUN_CLIENT=1;
|
||||||
window.RUN_SERVER=0;
|
window.RUN_SERVER=0;
|
||||||
if(typeof global === 'object')
|
if(typeof global === 'object')
|
||||||
{
|
{
|
||||||
global.RUN_CLIENT=1;
|
global.RUN_CLIENT=1;
|
||||||
global.RUN_SERVER=0;
|
global.RUN_SERVER=0;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="./JS/coinlib.js"></script>
|
<script type="text/javascript" src="./JS/coinlib.js"></script>
|
||||||
<script type="text/javascript" src="./JS/client.js"></script>
|
<script type="text/javascript" src="./JS/client.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var DefTr={NumName:"idViewTrNum", TabName:"grid_transaction_all",APIName:"GetTransactionAll",Param3:undefined};
|
var DefTr={NumName:"idViewTrNum", TabName:"grid_transaction_all",APIName:"GetTransactionAll",Param3:undefined};
|
||||||
var CountViewRows=10;//global
|
var CountViewRows=10;//global
|
||||||
window.onload=function()
|
window.onload=function()
|
||||||
{
|
{
|
||||||
InitMainServer();
|
InitMainServer();
|
||||||
|
|
||||||
document.body.className="univers "+localStorage["idSelStyle"];
|
document.body.className="univers "+localStorage["idSelStyle"];
|
||||||
var i=document.URL.indexOf("#");
|
var i=document.URL.indexOf("#");
|
||||||
if(i>0)
|
if(i>0)
|
||||||
{
|
{
|
||||||
var BlockNum=ParseNum(document.URL.substr(i+1));
|
var BlockNum=ParseNum(document.URL.substr(i+1));
|
||||||
ViewBlock(BlockNum);
|
ViewBlock(BlockNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onkeydown = function (e)
|
window.onkeydown = function (e)
|
||||||
{
|
{
|
||||||
if(e.keyCode===27)
|
if(e.keyCode===27)
|
||||||
{
|
{
|
||||||
window.close();
|
ClosePage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("popstate", function(event)
|
window.addEventListener("popstate", function(event)
|
||||||
{
|
{
|
||||||
var BlockNum=ParseNum(window.location.hash.substr(1));
|
var BlockNum=ParseNum(window.location.hash.substr(1));
|
||||||
ViewBlock(BlockNum);
|
ViewBlock(BlockNum);
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
}
|
if (window.addEventListener)
|
||||||
function ViewBlock(BlockNum)
|
{
|
||||||
{
|
window.addEventListener("message", OnMessage);
|
||||||
if(BlockNum!==undefined)
|
} else
|
||||||
document.getElementById("idViewBlockNum").value=BlockNum;
|
{
|
||||||
else
|
// IE8
|
||||||
{
|
window.attachEvent("onmessage", OnMessage);
|
||||||
BlockNum=ParseNum(document.getElementById("idViewBlockNum").value);
|
}
|
||||||
history.pushState(null,null,"#"+BlockNum);
|
|
||||||
}
|
}
|
||||||
|
function ViewBlock(BlockNum)
|
||||||
document.title="Block: "+BlockNum;
|
{
|
||||||
DefTr.Param3=BlockNum;
|
if(BlockNum!==undefined)
|
||||||
ViewCurrent(DefTr);
|
document.getElementById("idViewBlockNum").value=BlockNum;
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
BlockNum=ParseNum(document.getElementById("idViewBlockNum").value);
|
||||||
function SaveValues()
|
history.pushState(null,null,"#"+BlockNum);
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
document.title="Block: "+BlockNum;
|
||||||
</script>
|
DefTr.Param3=BlockNum;
|
||||||
</head>
|
ViewCurrent(DefTr);
|
||||||
<body>
|
}
|
||||||
<header class="header">
|
|
||||||
<div class="header__wrapper">
|
|
||||||
<div class="header__logo header__logo--history">
|
function SaveValues()
|
||||||
<a onclick="" class="header__logo-link" id="MTabWelcome">
|
{
|
||||||
<img class="main-logo" src="/PIC/TeraLogo.svg" alt="TERA Foundation">
|
}
|
||||||
<p class="header__logo-name">Blockviewer</p>
|
|
||||||
</a>
|
|
||||||
</div>
|
var FrameData;
|
||||||
<div class="header__right">
|
function ClosePage()
|
||||||
<select size="1" id="idLang" onchange="ChangeLang()" class="bigs" >
|
{
|
||||||
<option value="ENG">ENG</option>
|
if(FrameData && window.parent)
|
||||||
</select>
|
{
|
||||||
</div>
|
FrameData.cmd="Close";
|
||||||
</div>
|
window.parent.postMessage(FrameData, "*");
|
||||||
</header>
|
}
|
||||||
<main>
|
else
|
||||||
<section class="history-page" id="idTransactionBlock" style="display: block">
|
window.close();
|
||||||
<div class="history__text-block">
|
}
|
||||||
<div class="history-page__id" >
|
|
||||||
<!--<a class="back-link back-link--history" onclick="SelectTab('TabKeySet')"><span>Accounts</span></a>-->
|
function OnMessage(event)
|
||||||
Transactions on block: <INPUT class="history-page__id-count" type="number" id="idViewBlockNum" style="text-align: center" value="0" min=0 max=1000000000 onchange="ViewBlock()">
|
{
|
||||||
</div>
|
var Data=event.data;
|
||||||
<BR>
|
if(!Data || typeof Data!=="object")
|
||||||
</div>
|
return;
|
||||||
<div class="history-page__table">
|
|
||||||
<div class="page-pagination">
|
FrameData=Data;
|
||||||
<button onclick="ViewPrev(DefTr)" class="btnav btn"><</button>
|
if(Data.BlockNum)
|
||||||
<INPUT type="number" class="page-pagination__num" id="idViewTrNum" style="text-align: center" value="0" min=0 max=1000000000 onchange="ViewCurrent(DefTr)">
|
{
|
||||||
<button onclick="ViewNext(DefTr,5000)" class="btnav btn">></button>
|
document.getElementById("idViewBlockNum").value=Data.BlockNum;
|
||||||
</div>
|
ViewBlock();
|
||||||
<div class="history-page__table-wrap">
|
|
||||||
<table id="grid_transaction_all" class="grid">
|
$("MTabWelcome").className+=" back-link";
|
||||||
<tr>
|
}
|
||||||
<th id="Item.Num" class="num">TrNum</th>
|
}
|
||||||
<th id="Item.Type" class="num">Type</th>
|
function DoBackPage()
|
||||||
<th id="GetHexFromArr(Item.Body)" class="code">Body</th>
|
{
|
||||||
<th id="(escapeHtml(Item.Script))" class="code">JSON</th>
|
if(FrameData)
|
||||||
<th id="Item.TxID" class="hash">TxID</th>
|
ClosePage()
|
||||||
<th id="Item.Length" class="num">Bytes</th>
|
|
||||||
<th id="Item.power" class="num">Power</th>
|
}
|
||||||
<th id="(Item.VerifyHTML)" class="verify">Verify</th>
|
|
||||||
</tr>
|
</script>
|
||||||
</table>
|
</head>
|
||||||
</div>
|
<body>
|
||||||
</div>
|
<header class="header">
|
||||||
</section>
|
<div class="header__wrapper">
|
||||||
</main>
|
<div class="header__logo header__logo--history">
|
||||||
|
<a onclick="DoBackPage()" class="header__logo-link" id="MTabWelcome">
|
||||||
|
<img class="main-logo" src="./PIC/TeraLogo.svg" alt="TERA Foundation">
|
||||||
</body>
|
<p class="header__logo-name">Blockviewer</p>
|
||||||
</html>
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="header__right">
|
||||||
|
<select size="1" id="idLang" onchange="ChangeLang()" class="bigs" >
|
||||||
|
<option value="ENG">ENG</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<section class="history-page" id="idTransactionBlock" style="display: block">
|
||||||
|
<div class="history__text-block">
|
||||||
|
<div class="history-page__id" >
|
||||||
|
Transactions on block: <INPUT class="history-page__id-count" type="number" id="idViewBlockNum" style="text-align: center" value="0" min=0 max=1000000000 onchange="ViewBlock()">
|
||||||
|
</div>
|
||||||
|
<BR>
|
||||||
|
</div>
|
||||||
|
<div class="history-page__table">
|
||||||
|
<div class="page-pagination">
|
||||||
|
<button onclick="ViewPrev(DefTr)" class="btnav btn"><</button>
|
||||||
|
<INPUT type="number" class="page-pagination__num" id="idViewTrNum" style="text-align: center" value="0" min=0 max=1000000000 onchange="ViewCurrent(DefTr)">
|
||||||
|
<button onclick="ViewNext(DefTr,5000)" class="btnav btn">></button>
|
||||||
|
</div>
|
||||||
|
<div class="history-page__table-wrap">
|
||||||
|
<table id="grid_transaction_all" class="grid">
|
||||||
|
<tr>
|
||||||
|
<th id="Item.Num" class="num">TrNum</th>
|
||||||
|
<th id="Item.Type" class="num">Type</th>
|
||||||
|
<th id="GetHexFromArr(Item.Body)" class="code">Body</th>
|
||||||
|
<th id="(escapeHtml(Item.Script))" class="code">JSON</th>
|
||||||
|
<th id="Item.TxID" class="hash">TxID</th>
|
||||||
|
<th id="Item.Length" class="num">Bytes</th>
|
||||||
|
<th id="Item.power" class="num">Power</th>
|
||||||
|
<th id="(Item.VerifyHTML)" class="verify">Verify</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
2914
src/HTML/chains.html
@ -1,253 +1,308 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>History account</title>
|
<title>History account</title>
|
||||||
<link rel="shortcut icon" href="./PIC/viewer.png" type="image/png">
|
<link rel="shortcut icon" href="./PIC/viewer.png" type="image/png">
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<!--<link rel="stylesheet" type="text/css" href="./CSS/history.css">-->
|
<!--<link rel="stylesheet" type="text/css" href="./CSS/history.css">-->
|
||||||
<link rel="stylesheet" href="./CSS/mobile-wallet.css">
|
<link rel="stylesheet" href="./CSS/mobile-wallet.css">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.RUN_CLIENT=1;
|
window.RUN_CLIENT=1;
|
||||||
window.RUN_SERVER=0;
|
window.RUN_SERVER=0;
|
||||||
if(typeof global === 'object')
|
if(typeof global === 'object')
|
||||||
{
|
{
|
||||||
global.RUN_CLIENT=1;
|
global.RUN_CLIENT=1;
|
||||||
global.RUN_SERVER=0;
|
global.RUN_SERVER=0;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="./JS/coinlib.js"></script>
|
<script type="text/javascript" src="./JS/coinlib.js"></script>
|
||||||
<script type="text/javascript" src="./JS/client.js"></script>
|
<script type="text/javascript" src="./JS/client.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var AccountID;
|
var AccountID;
|
||||||
var CountViewRows=20;
|
var CountViewRows=20;
|
||||||
|
|
||||||
function SetStatus(Str)
|
function SetStatus(Str)
|
||||||
{
|
{
|
||||||
var id = $("idStatus");
|
var id = $("idStatus");
|
||||||
id.innerHTML=Str;
|
id.innerHTML=Str;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload=function()
|
window.onload=function()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OnLoad();
|
OnLoad();
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
SetStatus("Error: "+e);
|
SetStatus("Error: "+e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
function OnLoad()
|
function OnLoad()
|
||||||
{
|
{
|
||||||
InitMainServer();
|
InitMainServer();
|
||||||
|
|
||||||
document.body.className="univers "+localStorage["idSelStyle"];
|
document.body.className="univers "+localStorage["idSelStyle"];
|
||||||
var i=document.URL.indexOf("#");
|
var i=document.URL.indexOf("#");
|
||||||
if(i>0)
|
if(i>0)
|
||||||
{
|
{
|
||||||
AccountID=ParseNum(document.URL.substr(i+1));
|
AccountID=ParseNum(document.URL.substr(i+1));
|
||||||
document.getElementById("idViewAccountID").value=AccountID;
|
document.getElementById("idViewAccountID").value=AccountID;
|
||||||
ViewHistory(1);
|
ViewHistory(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onkeydown = function (e)
|
window.onkeydown = function (e)
|
||||||
{
|
{
|
||||||
if(e.keyCode===27)
|
if(e.keyCode===27)
|
||||||
{
|
{
|
||||||
window.close();
|
ClosePage();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener("popstate", function(event)
|
window.addEventListener("popstate", function(event)
|
||||||
{
|
{
|
||||||
document.getElementById("idViewAccountID").value=ParseNum(window.location.hash.substr(1));
|
document.getElementById("idViewAccountID").value=ParseNum(window.location.hash.substr(1));
|
||||||
ViewHistory(1);
|
ViewHistory(1);
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
}
|
if (window.addEventListener)
|
||||||
function OnChangeAccount()
|
{
|
||||||
{
|
window.addEventListener("message", OnMessage);
|
||||||
AccountID=ParseNum(document.getElementById("idViewAccountID").value);
|
} else
|
||||||
history.pushState(null,null,"#"+AccountID);
|
{
|
||||||
ViewHistory(1)
|
// IE8
|
||||||
}
|
window.attachEvent("onmessage", OnMessage);
|
||||||
|
}
|
||||||
var CurPage=0;
|
|
||||||
var ArrPos=[];
|
}
|
||||||
function ViewHistory(bReset,NextPos)
|
function OnChangeAccount()
|
||||||
{
|
{
|
||||||
var Params={AccountID:AccountID,Count:CountViewRows,GetDescription:1}
|
AccountID=ParseNum(document.getElementById("idViewAccountID").value);
|
||||||
if(bReset)
|
history.pushState(null,null,"#"+AccountID);
|
||||||
{
|
ViewHistory(1)
|
||||||
CurPage=0;
|
}
|
||||||
ArrPos=[];
|
|
||||||
AccountID=ParseNum(document.getElementById("idViewAccountID").value);
|
var CurPage=0;
|
||||||
Params.AccountID=AccountID;
|
var ArrPos=[];
|
||||||
}
|
function ViewHistory(bReset,NextPos)
|
||||||
else
|
{
|
||||||
{
|
var Params={AccountID:AccountID,Count:CountViewRows,GetDescription:1}
|
||||||
Params.NextPos=NextPos;
|
if(bReset)
|
||||||
}
|
{
|
||||||
|
CurPage=0;
|
||||||
document.title="Account: "+AccountID;
|
ArrPos=[];
|
||||||
GetData("GetHistoryTransactions", Params, function (Data)
|
AccountID=ParseNum(document.getElementById("idViewAccountID").value);
|
||||||
{
|
Params.AccountID=AccountID;
|
||||||
if(!Data || !Data.History)
|
}
|
||||||
return;
|
else
|
||||||
$("idName").innerText=Data.Name;
|
{
|
||||||
$("idBalanceSum").innerText="Balance: "+STRING_FROM_COIN(Data.Value)+" "+CurrencyName(Data.Currency);
|
Params.NextPos=NextPos;
|
||||||
MaxBlockNum=Data.MaxBlockNum;
|
}
|
||||||
window.FIRST_TIME_BLOCK=Data.FIRST_TIME_BLOCK;
|
|
||||||
var Item;
|
document.title="Account: "+AccountID;
|
||||||
var arr=Data.History;
|
GetData("GetHistoryTransactions", Params, function (Data)
|
||||||
for(var i=0;i<arr.length;i++)
|
{
|
||||||
{
|
if(!Data || !Data.History)
|
||||||
Item=arr[i];
|
return;
|
||||||
Item.Num=Item.Pos;
|
$("idName").innerText=Data.Name;
|
||||||
Item.Currency=Data.Currency;
|
$("idBalanceSum").innerText="Balance: "+STRING_FROM_COIN(Data.Value)+" "+CurrencyName(Data.Currency);
|
||||||
Item.Value={SumCOIN:Item.SumCOIN,SumCENT:Item.SumCENT};
|
MaxBlockNum=Data.MaxBlockNum;
|
||||||
|
window.FIRST_TIME_BLOCK=Data.FIRST_TIME_BLOCK;
|
||||||
}
|
var Item;
|
||||||
if(Item)
|
var arr=Data.History;
|
||||||
{
|
for(var i=0;i<arr.length;i++)
|
||||||
ArrPos[CurPage]={First:arr[0].Pos,NextPos:Item.NextPos};
|
{
|
||||||
}
|
Item=arr[i];
|
||||||
SetGridData(Data.History,"grid_history","idTotalSumH",1);
|
Item.Num=Item.Pos;
|
||||||
});
|
Item.Currency=Data.Currency;
|
||||||
|
Item.Value={SumCOIN:Item.SumCOIN,SumCENT:Item.SumCENT};
|
||||||
}
|
|
||||||
|
}
|
||||||
function ViewBegin()
|
if(Item)
|
||||||
{
|
{
|
||||||
ViewHistory(1);
|
ArrPos[CurPage]={First:arr[0].Pos,NextPos:Item.NextPos};
|
||||||
// CurPage=0;
|
}
|
||||||
// var Item=ArrPos[CurPage];
|
SetGridData(Data.History,"grid_history","idTotalSumH",1);
|
||||||
// if(Item)
|
});
|
||||||
// {
|
|
||||||
// ViewHistory(0,Item.First);
|
}
|
||||||
// }
|
|
||||||
}
|
function ViewBegin()
|
||||||
function ViewPrev()
|
{
|
||||||
{
|
ViewHistory(1);
|
||||||
if(CurPage<=0)
|
}
|
||||||
return;
|
function ViewPrev()
|
||||||
CurPage--;
|
{
|
||||||
var Item=ArrPos[CurPage];
|
if(CurPage<=0)
|
||||||
if(Item)
|
return;
|
||||||
{
|
CurPage--;
|
||||||
ViewHistory(0,Item.First);
|
var Item=ArrPos[CurPage];
|
||||||
}
|
if(Item)
|
||||||
}
|
{
|
||||||
function ViewNext()
|
ViewHistory(0,Item.First);
|
||||||
{
|
}
|
||||||
var Item=ArrPos[CurPage];
|
}
|
||||||
if(Item && Item.NextPos)
|
function ViewNext()
|
||||||
{
|
{
|
||||||
CurPage++;
|
var Item=ArrPos[CurPage];
|
||||||
ViewHistory(0,Item.NextPos);
|
if(Item && Item.NextPos)
|
||||||
}
|
{
|
||||||
}
|
CurPage++;
|
||||||
|
ViewHistory(0,Item.NextPos);
|
||||||
function SaveValues()
|
}
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
function SaveValues()
|
||||||
var MaxBlockNum=0;
|
{
|
||||||
function ConfirmationFromBlock(BlockNum)
|
}
|
||||||
{
|
|
||||||
var Length=MaxBlockNum-8-BlockNum;
|
var MaxBlockNum=0;
|
||||||
if(Length>0)
|
function ConfirmationFromBlock(BlockNum)
|
||||||
{
|
{
|
||||||
if(Length<=100)
|
var Length=MaxBlockNum-8-BlockNum;
|
||||||
return Length;
|
if(Length>0)
|
||||||
else
|
{
|
||||||
{
|
if(Length<=100)
|
||||||
return ">"+Math.floor(Length/100)*100;
|
return Length;
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
else
|
return ">"+Math.floor(Length/100)*100;
|
||||||
return "";
|
}
|
||||||
}
|
}
|
||||||
function GetCorrID(Item,Direct)
|
else
|
||||||
{
|
return "";
|
||||||
var Str;
|
}
|
||||||
if(Item.Direct===Direct)
|
function GetCorrID(Item,Direct)
|
||||||
Str=RetHistoryAccount(Item,"CorrID");
|
{
|
||||||
else
|
var Str;
|
||||||
Str=AccountID;
|
if(Item.Direct===Direct)
|
||||||
|
Str=RetHistoryAccount(Item,"CorrID");
|
||||||
return Str;
|
else
|
||||||
}
|
Str=AccountID;
|
||||||
function GetStr(Str)
|
|
||||||
{
|
return Str;
|
||||||
if(Str===undefined)
|
}
|
||||||
return "";
|
function GetStr(Str)
|
||||||
return Str;
|
{
|
||||||
}
|
if(Str===undefined)
|
||||||
</script>
|
return "";
|
||||||
</head>
|
return Str;
|
||||||
<body>
|
}
|
||||||
<header class="header">
|
|
||||||
<div class="header__wrapper">
|
|
||||||
<div class="header__logo header__logo--history">
|
var FrameData;
|
||||||
<a onclick="" class="header__logo-link" id="MTabWelcome">
|
function ClosePage()
|
||||||
<img class="main-logo" src="/PIC/TeraLogo.svg" alt="TERA Foundation">
|
{
|
||||||
<p class="header__logo-name">History</p>
|
if(FrameData && window.parent)
|
||||||
</a>
|
{
|
||||||
</div>
|
FrameData.cmd="Close";
|
||||||
<div class="header__right">
|
window.parent.postMessage(FrameData, "*");
|
||||||
<select size="1" id="idLang" onchange="ChangeLang()" class="bigs" >
|
}
|
||||||
<option value="ENG">ENG</option>
|
else
|
||||||
</select>
|
window.close();
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
</header>
|
function OnMessage(event)
|
||||||
<main>
|
{
|
||||||
<section class="history-page" id="idTransactionBlock" style="display: block">
|
var Data=event.data;
|
||||||
<div class="history__text-block">
|
if(!Data || typeof Data!=="object")
|
||||||
<div class="history-page__id" >
|
return;
|
||||||
<!--<a class="back-link back-link--history" onclick="SelectTab('TabKeySet')"><span>Accounts</span></a>-->
|
|
||||||
History of <input class="history-page__id-count" type="number" id="idViewAccountID" style="text-align: center" value="0" min=0 max=1000000000 onchange="OnChangeAccount()">
|
FrameData=Data;
|
||||||
</div>
|
if(Data.Account)
|
||||||
<div id="idName" class="history-page__description"></div>
|
{
|
||||||
<div class="history-page__balance" id="idBalanceSum">Balance: 000<img class="history-page__tera-icon" src="./PIC/T.svg" width="10" height="14" alt=""></div>
|
AccountID=Data.Account;
|
||||||
</div>
|
document.getElementById("idViewAccountID").value=AccountID;
|
||||||
<div class="history-page__table">
|
ViewHistory(1)
|
||||||
<div class="page-pagination">
|
|
||||||
<button onclick="ViewBegin()" class="btnav btn">|<</button>
|
$("MTabWelcome").className+=" back-link";
|
||||||
<button onclick="ViewPrev()" class="btnav btn"><</button>
|
}
|
||||||
<input type="number" class="page-pagination__num" id="idViewAccountNum" style="text-align: center" value="0" min="0" onchange="ViewCurrent(DefAccounts)">
|
}
|
||||||
<button onclick="ViewNext()" class="btnav btn">></button>
|
function DoBackPage()
|
||||||
</div>
|
{
|
||||||
|
if(FrameData)
|
||||||
<div class="history-page__table-wrap">
|
ClosePage()
|
||||||
<table id="grid_history" class="grid">
|
|
||||||
<tr>
|
}
|
||||||
<th id="(RetDirect(Item.Direct))" class="direct">...</th>
|
|
||||||
<th id="(GetCorrID(Item,'+'))" class="num">From</th>
|
function OpenBlockViewerPage(Num)
|
||||||
<th id="(GetCorrID(Item,'-'))" class="num">To</th>
|
{
|
||||||
<th id="(escapeHtml(DateFromBlock(Item.BlockNum,1)))" class="date">Date</th>
|
if(FrameData && window.parent)
|
||||||
<th id="SUM_TO_STRING(Item)" class="sum smallbold">Amount</th>
|
{
|
||||||
<th id="CurrencyName(Item.Currency)" class="cur">Cur</th>
|
FrameData.cmd="OpenBlockViewerPage";
|
||||||
<th id="GetStr(Item.Description)" class="desc">Description</th>
|
FrameData.BlockNum=Num;
|
||||||
<th id="ConfirmationFromBlock(Item.BlockNum)" class="num">Confirm</th>
|
window.parent.postMessage(FrameData, "*");
|
||||||
<th id="(RetOpenBlock(Item.BlockNum,1))" class="num">Block</th>
|
}
|
||||||
<th id="Item.TrNum" class="num">Tx</th>
|
else
|
||||||
</tr>
|
{
|
||||||
</table>
|
window.open("./blockviewer.html#"+Num);
|
||||||
</div>
|
return;
|
||||||
<br><DIV id="idTotalSumH"></DIV>
|
}
|
||||||
</div>
|
}
|
||||||
</section>
|
|
||||||
</main>
|
</script>
|
||||||
|
</head>
|
||||||
</body>
|
<body>
|
||||||
|
<header class="header">
|
||||||
|
<div class="header__wrapper">
|
||||||
|
<div class="header__logo header__logo--history">
|
||||||
|
<a onclick="DoBackPage()" class="header__logo-link" id="MTabWelcome">
|
||||||
|
<img class="main-logo" src="./PIC/TeraLogo.svg" alt="TERA Foundation">
|
||||||
|
<p class="header__logo-name">History</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="header__right">
|
||||||
|
<select size="1" id="idLang" onchange="ChangeLang()" class="bigs" >
|
||||||
|
<option value="ENG">ENG</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<section class="history-page" id="idTransactionBlock" style="display: block">
|
||||||
|
<div class="history__text-block">
|
||||||
|
<div class="history-page__id" >
|
||||||
|
<!--<a class="back-link back-link--history" onclick="SelectTab('TabKeySet')"><span>Accounts</span></a>-->
|
||||||
|
History of <input class="history-page__id-count" type="number" id="idViewAccountID" style="text-align: center" value="0" min=0 max=1000000000 onchange="OnChangeAccount()">
|
||||||
|
</div>
|
||||||
|
<div id="idName" class="history-page__description"></div>
|
||||||
|
<div class="history-page__balance" id="idBalanceSum">Balance: 000<img class="history-page__tera-icon" src="./PIC/T.svg" width="10" height="14" alt=""></div>
|
||||||
|
</div>
|
||||||
|
<div class="history-page__table">
|
||||||
|
<div class="page-pagination">
|
||||||
|
<button onclick="ViewBegin()" class="btnav btn">|<</button>
|
||||||
|
<button onclick="ViewPrev()" class="btnav btn"><</button>
|
||||||
|
<input type="number" class="page-pagination__num" id="idViewAccountNum" style="text-align: center" value="0" min="0" onchange="ViewCurrent(DefAccounts)">
|
||||||
|
<button onclick="ViewNext()" class="btnav btn">></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="history-page__table-wrap">
|
||||||
|
<table id="grid_history" class="grid">
|
||||||
|
<tr>
|
||||||
|
<th id="(RetDirect(Item.Direct))" class="direct">...</th>
|
||||||
|
<th id="(GetCorrID(Item,'+'))" class="num">From</th>
|
||||||
|
<th id="(GetCorrID(Item,'-'))" class="num">To</th>
|
||||||
|
<th id="(escapeHtml(DateFromBlock(Item.BlockNum,1)))" class="date">Date</th>
|
||||||
|
<th id="SUM_TO_STRING(Item)" class="sum smallbold">Amount</th>
|
||||||
|
<th id="CurrencyName(Item.Currency)" class="cur">Cur</th>
|
||||||
|
<th id="GetStr(Item.Description)" class="desc">Description</th>
|
||||||
|
<th id="ConfirmationFromBlock(Item.BlockNum)" class="num">Confirm</th>
|
||||||
|
<th id="(RetOpenBlock(Item.BlockNum,1))" class="num">Block</th>
|
||||||
|
<th id="Item.TrNum" class="num">Tx</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<br><DIV id="idTotalSumH"></DIV>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,339 +1,339 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Password</title>
|
<title>Password</title>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,
|
||||||
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,
|
||||||
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,
|
||||||
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,
|
||||||
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
|
||||||
|
|
||||||
function Mesh(s,Count)
|
function Mesh(s,Count)
|
||||||
{
|
{
|
||||||
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,
|
||||||
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,
|
||||||
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,
|
||||||
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
||||||
for (n = 0; n < Count; n += 2)//48
|
for (n = 0; n < Count; n += 2)//48
|
||||||
{
|
{
|
||||||
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
|
||||||
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
|
||||||
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
|
||||||
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
|
||||||
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
|
||||||
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
|
||||||
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
|
||||||
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
|
||||||
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
|
||||||
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
|
||||||
|
|
||||||
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
h = c8 ^ ((c2 << 1) | (c3 >>> 31));
|
||||||
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
l = c9 ^ ((c3 << 1) | (c2 >>> 31));
|
||||||
s[0] ^= h;
|
s[0] ^= h;
|
||||||
s[1] ^= l;
|
s[1] ^= l;
|
||||||
s[10] ^= h;
|
s[10] ^= h;
|
||||||
s[11] ^= l;
|
s[11] ^= l;
|
||||||
s[20] ^= h;
|
s[20] ^= h;
|
||||||
s[21] ^= l;
|
s[21] ^= l;
|
||||||
s[30] ^= h;
|
s[30] ^= h;
|
||||||
s[31] ^= l;
|
s[31] ^= l;
|
||||||
s[40] ^= h;
|
s[40] ^= h;
|
||||||
s[41] ^= l;
|
s[41] ^= l;
|
||||||
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
h = c0 ^ ((c4 << 1) | (c5 >>> 31));
|
||||||
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
l = c1 ^ ((c5 << 1) | (c4 >>> 31));
|
||||||
s[2] ^= h;
|
s[2] ^= h;
|
||||||
s[3] ^= l;
|
s[3] ^= l;
|
||||||
s[12] ^= h;
|
s[12] ^= h;
|
||||||
s[13] ^= l;
|
s[13] ^= l;
|
||||||
s[22] ^= h;
|
s[22] ^= h;
|
||||||
s[23] ^= l;
|
s[23] ^= l;
|
||||||
s[32] ^= h;
|
s[32] ^= h;
|
||||||
s[33] ^= l;
|
s[33] ^= l;
|
||||||
s[42] ^= h;
|
s[42] ^= h;
|
||||||
s[43] ^= l;
|
s[43] ^= l;
|
||||||
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
h = c2 ^ ((c6 << 1) | (c7 >>> 31));
|
||||||
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
l = c3 ^ ((c7 << 1) | (c6 >>> 31));
|
||||||
s[4] ^= h;
|
s[4] ^= h;
|
||||||
s[5] ^= l;
|
s[5] ^= l;
|
||||||
s[14] ^= h;
|
s[14] ^= h;
|
||||||
s[15] ^= l;
|
s[15] ^= l;
|
||||||
s[24] ^= h;
|
s[24] ^= h;
|
||||||
s[25] ^= l;
|
s[25] ^= l;
|
||||||
s[34] ^= h;
|
s[34] ^= h;
|
||||||
s[35] ^= l;
|
s[35] ^= l;
|
||||||
s[44] ^= h;
|
s[44] ^= h;
|
||||||
s[45] ^= l;
|
s[45] ^= l;
|
||||||
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
h = c4 ^ ((c8 << 1) | (c9 >>> 31));
|
||||||
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
l = c5 ^ ((c9 << 1) | (c8 >>> 31));
|
||||||
s[6] ^= h;
|
s[6] ^= h;
|
||||||
s[7] ^= l;
|
s[7] ^= l;
|
||||||
s[16] ^= h;
|
s[16] ^= h;
|
||||||
s[17] ^= l;
|
s[17] ^= l;
|
||||||
s[26] ^= h;
|
s[26] ^= h;
|
||||||
s[27] ^= l;
|
s[27] ^= l;
|
||||||
s[36] ^= h;
|
s[36] ^= h;
|
||||||
s[37] ^= l;
|
s[37] ^= l;
|
||||||
s[46] ^= h;
|
s[46] ^= h;
|
||||||
s[47] ^= l;
|
s[47] ^= l;
|
||||||
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
h = c6 ^ ((c0 << 1) | (c1 >>> 31));
|
||||||
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
l = c7 ^ ((c1 << 1) | (c0 >>> 31));
|
||||||
s[8] ^= h;
|
s[8] ^= h;
|
||||||
s[9] ^= l;
|
s[9] ^= l;
|
||||||
s[18] ^= h;
|
s[18] ^= h;
|
||||||
s[19] ^= l;
|
s[19] ^= l;
|
||||||
s[28] ^= h;
|
s[28] ^= h;
|
||||||
s[29] ^= l;
|
s[29] ^= l;
|
||||||
s[38] ^= h;
|
s[38] ^= h;
|
||||||
s[39] ^= l;
|
s[39] ^= l;
|
||||||
s[48] ^= h;
|
s[48] ^= h;
|
||||||
s[49] ^= l;
|
s[49] ^= l;
|
||||||
|
|
||||||
b0 = s[0];
|
b0 = s[0];
|
||||||
b1 = s[1];
|
b1 = s[1];
|
||||||
b32 = (s[11] << 4) | (s[10] >>> 28);
|
b32 = (s[11] << 4) | (s[10] >>> 28);
|
||||||
b33 = (s[10] << 4) | (s[11] >>> 28);
|
b33 = (s[10] << 4) | (s[11] >>> 28);
|
||||||
b14 = (s[20] << 3) | (s[21] >>> 29);
|
b14 = (s[20] << 3) | (s[21] >>> 29);
|
||||||
b15 = (s[21] << 3) | (s[20] >>> 29);
|
b15 = (s[21] << 3) | (s[20] >>> 29);
|
||||||
b46 = (s[31] << 9) | (s[30] >>> 23);
|
b46 = (s[31] << 9) | (s[30] >>> 23);
|
||||||
b47 = (s[30] << 9) | (s[31] >>> 23);
|
b47 = (s[30] << 9) | (s[31] >>> 23);
|
||||||
b28 = (s[40] << 18) | (s[41] >>> 14);
|
b28 = (s[40] << 18) | (s[41] >>> 14);
|
||||||
b29 = (s[41] << 18) | (s[40] >>> 14);
|
b29 = (s[41] << 18) | (s[40] >>> 14);
|
||||||
b20 = (s[2] << 1) | (s[3] >>> 31);
|
b20 = (s[2] << 1) | (s[3] >>> 31);
|
||||||
b21 = (s[3] << 1) | (s[2] >>> 31);
|
b21 = (s[3] << 1) | (s[2] >>> 31);
|
||||||
b2 = (s[13] << 12) | (s[12] >>> 20);
|
b2 = (s[13] << 12) | (s[12] >>> 20);
|
||||||
b3 = (s[12] << 12) | (s[13] >>> 20);
|
b3 = (s[12] << 12) | (s[13] >>> 20);
|
||||||
b34 = (s[22] << 10) | (s[23] >>> 22);
|
b34 = (s[22] << 10) | (s[23] >>> 22);
|
||||||
b35 = (s[23] << 10) | (s[22] >>> 22);
|
b35 = (s[23] << 10) | (s[22] >>> 22);
|
||||||
b16 = (s[33] << 13) | (s[32] >>> 19);
|
b16 = (s[33] << 13) | (s[32] >>> 19);
|
||||||
b17 = (s[32] << 13) | (s[33] >>> 19);
|
b17 = (s[32] << 13) | (s[33] >>> 19);
|
||||||
b48 = (s[42] << 2) | (s[43] >>> 30);
|
b48 = (s[42] << 2) | (s[43] >>> 30);
|
||||||
b49 = (s[43] << 2) | (s[42] >>> 30);
|
b49 = (s[43] << 2) | (s[42] >>> 30);
|
||||||
b40 = (s[5] << 30) | (s[4] >>> 2);
|
b40 = (s[5] << 30) | (s[4] >>> 2);
|
||||||
b41 = (s[4] << 30) | (s[5] >>> 2);
|
b41 = (s[4] << 30) | (s[5] >>> 2);
|
||||||
b22 = (s[14] << 6) | (s[15] >>> 26);
|
b22 = (s[14] << 6) | (s[15] >>> 26);
|
||||||
b23 = (s[15] << 6) | (s[14] >>> 26);
|
b23 = (s[15] << 6) | (s[14] >>> 26);
|
||||||
b4 = (s[25] << 11) | (s[24] >>> 21);
|
b4 = (s[25] << 11) | (s[24] >>> 21);
|
||||||
b5 = (s[24] << 11) | (s[25] >>> 21);
|
b5 = (s[24] << 11) | (s[25] >>> 21);
|
||||||
b36 = (s[34] << 15) | (s[35] >>> 17);
|
b36 = (s[34] << 15) | (s[35] >>> 17);
|
||||||
b37 = (s[35] << 15) | (s[34] >>> 17);
|
b37 = (s[35] << 15) | (s[34] >>> 17);
|
||||||
b18 = (s[45] << 29) | (s[44] >>> 3);
|
b18 = (s[45] << 29) | (s[44] >>> 3);
|
||||||
b19 = (s[44] << 29) | (s[45] >>> 3);
|
b19 = (s[44] << 29) | (s[45] >>> 3);
|
||||||
b10 = (s[6] << 28) | (s[7] >>> 4);
|
b10 = (s[6] << 28) | (s[7] >>> 4);
|
||||||
b11 = (s[7] << 28) | (s[6] >>> 4);
|
b11 = (s[7] << 28) | (s[6] >>> 4);
|
||||||
b42 = (s[17] << 23) | (s[16] >>> 9);
|
b42 = (s[17] << 23) | (s[16] >>> 9);
|
||||||
b43 = (s[16] << 23) | (s[17] >>> 9);
|
b43 = (s[16] << 23) | (s[17] >>> 9);
|
||||||
b24 = (s[26] << 25) | (s[27] >>> 7);
|
b24 = (s[26] << 25) | (s[27] >>> 7);
|
||||||
b25 = (s[27] << 25) | (s[26] >>> 7);
|
b25 = (s[27] << 25) | (s[26] >>> 7);
|
||||||
b6 = (s[36] << 21) | (s[37] >>> 11);
|
b6 = (s[36] << 21) | (s[37] >>> 11);
|
||||||
b7 = (s[37] << 21) | (s[36] >>> 11);
|
b7 = (s[37] << 21) | (s[36] >>> 11);
|
||||||
b38 = (s[47] << 24) | (s[46] >>> 8);
|
b38 = (s[47] << 24) | (s[46] >>> 8);
|
||||||
b39 = (s[46] << 24) | (s[47] >>> 8);
|
b39 = (s[46] << 24) | (s[47] >>> 8);
|
||||||
b30 = (s[8] << 27) | (s[9] >>> 5);
|
b30 = (s[8] << 27) | (s[9] >>> 5);
|
||||||
b31 = (s[9] << 27) | (s[8] >>> 5);
|
b31 = (s[9] << 27) | (s[8] >>> 5);
|
||||||
b12 = (s[18] << 20) | (s[19] >>> 12);
|
b12 = (s[18] << 20) | (s[19] >>> 12);
|
||||||
b13 = (s[19] << 20) | (s[18] >>> 12);
|
b13 = (s[19] << 20) | (s[18] >>> 12);
|
||||||
b44 = (s[29] << 7) | (s[28] >>> 25);
|
b44 = (s[29] << 7) | (s[28] >>> 25);
|
||||||
b45 = (s[28] << 7) | (s[29] >>> 25);
|
b45 = (s[28] << 7) | (s[29] >>> 25);
|
||||||
b26 = (s[38] << 8) | (s[39] >>> 24);
|
b26 = (s[38] << 8) | (s[39] >>> 24);
|
||||||
b27 = (s[39] << 8) | (s[38] >>> 24);
|
b27 = (s[39] << 8) | (s[38] >>> 24);
|
||||||
b8 = (s[48] << 14) | (s[49] >>> 18);
|
b8 = (s[48] << 14) | (s[49] >>> 18);
|
||||||
b9 = (s[49] << 14) | (s[48] >>> 18);
|
b9 = (s[49] << 14) | (s[48] >>> 18);
|
||||||
|
|
||||||
s[0] = b0 ^ (~b2 & b4);
|
s[0] = b0 ^ (~b2 & b4);
|
||||||
s[1] = b1 ^ (~b3 & b5);
|
s[1] = b1 ^ (~b3 & b5);
|
||||||
s[10] = b10 ^ (~b12 & b14);
|
s[10] = b10 ^ (~b12 & b14);
|
||||||
s[11] = b11 ^ (~b13 & b15);
|
s[11] = b11 ^ (~b13 & b15);
|
||||||
s[20] = b20 ^ (~b22 & b24);
|
s[20] = b20 ^ (~b22 & b24);
|
||||||
s[21] = b21 ^ (~b23 & b25);
|
s[21] = b21 ^ (~b23 & b25);
|
||||||
s[30] = b30 ^ (~b32 & b34);
|
s[30] = b30 ^ (~b32 & b34);
|
||||||
s[31] = b31 ^ (~b33 & b35);
|
s[31] = b31 ^ (~b33 & b35);
|
||||||
s[40] = b40 ^ (~b42 & b44);
|
s[40] = b40 ^ (~b42 & b44);
|
||||||
s[41] = b41 ^ (~b43 & b45);
|
s[41] = b41 ^ (~b43 & b45);
|
||||||
s[2] = b2 ^ (~b4 & b6);
|
s[2] = b2 ^ (~b4 & b6);
|
||||||
s[3] = b3 ^ (~b5 & b7);
|
s[3] = b3 ^ (~b5 & b7);
|
||||||
s[12] = b12 ^ (~b14 & b16);
|
s[12] = b12 ^ (~b14 & b16);
|
||||||
s[13] = b13 ^ (~b15 & b17);
|
s[13] = b13 ^ (~b15 & b17);
|
||||||
s[22] = b22 ^ (~b24 & b26);
|
s[22] = b22 ^ (~b24 & b26);
|
||||||
s[23] = b23 ^ (~b25 & b27);
|
s[23] = b23 ^ (~b25 & b27);
|
||||||
s[32] = b32 ^ (~b34 & b36);
|
s[32] = b32 ^ (~b34 & b36);
|
||||||
s[33] = b33 ^ (~b35 & b37);
|
s[33] = b33 ^ (~b35 & b37);
|
||||||
s[42] = b42 ^ (~b44 & b46);
|
s[42] = b42 ^ (~b44 & b46);
|
||||||
s[43] = b43 ^ (~b45 & b47);
|
s[43] = b43 ^ (~b45 & b47);
|
||||||
s[4] = b4 ^ (~b6 & b8);
|
s[4] = b4 ^ (~b6 & b8);
|
||||||
s[5] = b5 ^ (~b7 & b9);
|
s[5] = b5 ^ (~b7 & b9);
|
||||||
s[14] = b14 ^ (~b16 & b18);
|
s[14] = b14 ^ (~b16 & b18);
|
||||||
s[15] = b15 ^ (~b17 & b19);
|
s[15] = b15 ^ (~b17 & b19);
|
||||||
s[24] = b24 ^ (~b26 & b28);
|
s[24] = b24 ^ (~b26 & b28);
|
||||||
s[25] = b25 ^ (~b27 & b29);
|
s[25] = b25 ^ (~b27 & b29);
|
||||||
s[34] = b34 ^ (~b36 & b38);
|
s[34] = b34 ^ (~b36 & b38);
|
||||||
s[35] = b35 ^ (~b37 & b39);
|
s[35] = b35 ^ (~b37 & b39);
|
||||||
s[44] = b44 ^ (~b46 & b48);
|
s[44] = b44 ^ (~b46 & b48);
|
||||||
s[45] = b45 ^ (~b47 & b49);
|
s[45] = b45 ^ (~b47 & b49);
|
||||||
s[6] = b6 ^ (~b8 & b0);
|
s[6] = b6 ^ (~b8 & b0);
|
||||||
s[7] = b7 ^ (~b9 & b1);
|
s[7] = b7 ^ (~b9 & b1);
|
||||||
s[16] = b16 ^ (~b18 & b10);
|
s[16] = b16 ^ (~b18 & b10);
|
||||||
s[17] = b17 ^ (~b19 & b11);
|
s[17] = b17 ^ (~b19 & b11);
|
||||||
s[26] = b26 ^ (~b28 & b20);
|
s[26] = b26 ^ (~b28 & b20);
|
||||||
s[27] = b27 ^ (~b29 & b21);
|
s[27] = b27 ^ (~b29 & b21);
|
||||||
s[36] = b36 ^ (~b38 & b30);
|
s[36] = b36 ^ (~b38 & b30);
|
||||||
s[37] = b37 ^ (~b39 & b31);
|
s[37] = b37 ^ (~b39 & b31);
|
||||||
s[46] = b46 ^ (~b48 & b40);
|
s[46] = b46 ^ (~b48 & b40);
|
||||||
s[47] = b47 ^ (~b49 & b41);
|
s[47] = b47 ^ (~b49 & b41);
|
||||||
s[8] = b8 ^ (~b0 & b2);
|
s[8] = b8 ^ (~b0 & b2);
|
||||||
s[9] = b9 ^ (~b1 & b3);
|
s[9] = b9 ^ (~b1 & b3);
|
||||||
s[18] = b18 ^ (~b10 & b12);
|
s[18] = b18 ^ (~b10 & b12);
|
||||||
s[19] = b19 ^ (~b11 & b13);
|
s[19] = b19 ^ (~b11 & b13);
|
||||||
s[28] = b28 ^ (~b20 & b22);
|
s[28] = b28 ^ (~b20 & b22);
|
||||||
s[29] = b29 ^ (~b21 & b23);
|
s[29] = b29 ^ (~b21 & b23);
|
||||||
s[38] = b38 ^ (~b30 & b32);
|
s[38] = b38 ^ (~b30 & b32);
|
||||||
s[39] = b39 ^ (~b31 & b33);
|
s[39] = b39 ^ (~b31 & b33);
|
||||||
s[48] = b48 ^ (~b40 & b42);
|
s[48] = b48 ^ (~b40 & b42);
|
||||||
s[49] = b49 ^ (~b41 & b43);
|
s[49] = b49 ^ (~b41 & b43);
|
||||||
|
|
||||||
s[0] ^= RC[n];
|
s[0] ^= RC[n];
|
||||||
s[1] ^= RC[n + 1];
|
s[1] ^= RC[n + 1];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function GetHexFromArr(arr)
|
function GetHexFromArr(arr)
|
||||||
{
|
{
|
||||||
var Str="";
|
var Str="";
|
||||||
|
|
||||||
for(var i=0;arr && i<arr.length;i++)
|
for(var i=0;arr && i<arr.length;i++)
|
||||||
{
|
{
|
||||||
if(!arr[i])
|
if(!arr[i])
|
||||||
Str+="00";
|
Str+="00";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var Val=arr[i]&255;
|
var Val=arr[i]&255;
|
||||||
var A=Val.toString(16);
|
var A=Val.toString(16);
|
||||||
if(A.length===1)
|
if(A.length===1)
|
||||||
A="0"+A;
|
A="0"+A;
|
||||||
Str=Str+A;
|
Str=Str+A;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Str.toUpperCase();
|
return Str.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
function WriteNumToArr0(body,Num)
|
function WriteNumToArr0(body,Num)
|
||||||
{
|
{
|
||||||
body[0] ^=Num&0xFF;
|
body[0] ^=Num&0xFF;
|
||||||
body[1] ^=(Num>>>8) & 0xFF;
|
body[1] ^=(Num>>>8) & 0xFF;
|
||||||
body[2] ^=(Num>>>16) & 0xFF;
|
body[2] ^=(Num>>>16) & 0xFF;
|
||||||
body[3] ^=(Num>>>24) & 0xFF;
|
body[3] ^=(Num>>>24) & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ClientHex(Str)
|
function ClientHex(Str)
|
||||||
{
|
{
|
||||||
var arr0=[0,0,0,0];
|
var arr0=[0,0,0,0];
|
||||||
for(var i=0;i<Str.length;i++)
|
for(var i=0;i<Str.length;i++)
|
||||||
arr0[4+i]=Str.charCodeAt(i);
|
arr0[4+i]=Str.charCodeAt(i);
|
||||||
for(var nonce=0;nonce<1000000;nonce++)
|
for(var nonce=0;nonce<1000000;nonce++)
|
||||||
{
|
{
|
||||||
var arr=[];
|
var arr=[];
|
||||||
for(var i=0;i<arr0.length;i++)
|
for(var i=0;i<arr0.length;i++)
|
||||||
arr[i]=arr0[i];
|
arr[i]=arr0[i];
|
||||||
WriteNumToArr0(arr,nonce);
|
WriteNumToArr0(arr,nonce);
|
||||||
Mesh(arr,60);
|
Mesh(arr,60);
|
||||||
if((arr[0]&255)===0 && (arr[1]&255)===0)
|
if((arr[0]&255)===0 && (arr[1]&255)===0)
|
||||||
return GetHexFromArr(arr)+"-"+nonce;
|
return GetHexFromArr(arr)+"-"+nonce;
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function parseCookies (rc)
|
function parseCookies (rc)
|
||||||
{
|
{
|
||||||
var list = {};
|
var list = {};
|
||||||
|
|
||||||
rc && rc.split(';').forEach(function( cookie )
|
rc && rc.split(';').forEach(function( cookie )
|
||||||
{
|
{
|
||||||
var parts = cookie.split('=');
|
var parts = cookie.split('=');
|
||||||
list[parts.shift().trim()] = decodeURI(parts.join('='));
|
list[parts.shift().trim()] = decodeURI(parts.join('='));
|
||||||
});
|
});
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
function random(max)
|
function random(max)
|
||||||
{
|
{
|
||||||
ret=Math.floor(Math.random()*max);
|
ret=Math.floor(Math.random()*max);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload=function()
|
window.onload=function()
|
||||||
{
|
{
|
||||||
window.onkeydown = function (e)
|
window.onkeydown = function (e)
|
||||||
{
|
{
|
||||||
if(e.keyCode===13)
|
if(e.keyCode===13)
|
||||||
{
|
{
|
||||||
SendPassword();
|
SendPassword();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// document.getElementById("idPassword").focus();
|
// document.getElementById("idPassword").focus();
|
||||||
// setTimeout(function ()
|
// setTimeout(function ()
|
||||||
// {
|
// {
|
||||||
// var password = document.getElementById("idPassword").value;
|
// var password = document.getElementById("idPassword").value;
|
||||||
// if(password)
|
// if(password)
|
||||||
// SendPassword();
|
// SendPassword();
|
||||||
// },1000);
|
// },1000);
|
||||||
//
|
//
|
||||||
// SetStatus("Port="+window.location.port);
|
// SetStatus("Port="+window.location.port);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendPassword()
|
function SendPassword()
|
||||||
{
|
{
|
||||||
var port=window.location.port;
|
var port=window.location.port;
|
||||||
if(!port)
|
if(!port)
|
||||||
port="";
|
port="";
|
||||||
|
|
||||||
var list=parseCookies(document.cookie);
|
var list=parseCookies(document.cookie);
|
||||||
var id=list["token"+port];
|
var id=list["token"+port];
|
||||||
var password = document.getElementById("idPassword").value;
|
var password = document.getElementById("idPassword").value;
|
||||||
var hash=ClientHex(id+"-"+password);
|
var hash=ClientHex(id+"-"+password);
|
||||||
if(!hash)
|
if(!hash)
|
||||||
{
|
{
|
||||||
console.log("Error find Hash")
|
console.log("Error find Hash")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.cookie = "hash"+port+"="+hash+";path=/";
|
document.cookie = "hash"+port+"="+hash+";path=/";
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#idBlockPassword
|
#idBlockPassword
|
||||||
{
|
{
|
||||||
z-index:1000;
|
z-index:1000;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
top:20%;
|
top:20%;
|
||||||
left:40%;
|
left:40%;
|
||||||
height:50px;
|
height:50px;
|
||||||
width:320px;
|
width:320px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 0 0 0 1px;
|
box-shadow: 0 0 0 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<DIV id="idBlockPassword">
|
<DIV id="idBlockPassword">
|
||||||
ENTER PASSWORD
|
ENTER PASSWORD
|
||||||
<BR>
|
<BR>
|
||||||
<INPUT type="password" id="idPassword" autocomplete="password" autofocus > <INPUT type="button" onclick="SendPassword()" value="OK">
|
<INPUT type="password" id="idPassword" autocomplete="password" autofocus > <INPUT type="button" onclick="SendPassword()" value="OK">
|
||||||
<DIV id="idStatus">
|
<DIV id="idStatus">
|
||||||
</DIV>
|
</DIV>
|
||||||
</DIV>
|
</DIV>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,382 +1,382 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Counters</title>
|
<title>Counters</title>
|
||||||
<meta charset='utf-8' />
|
<meta charset='utf-8' />
|
||||||
<link rel="shortcut icon" href="/HTML/PIC/counters.png" type="image/png">
|
<link rel="shortcut icon" href="/HTML/PIC/counters.png" type="image/png">
|
||||||
<link rel="stylesheet" type="text/css" href="/HTML/CSS/style.css">
|
<link rel="stylesheet" type="text/css" href="/HTML/CSS/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.RUN_CLIENT=1;
|
window.RUN_CLIENT=1;
|
||||||
window.RUN_SERVER=0;
|
window.RUN_SERVER=0;
|
||||||
if(typeof global === 'object')
|
if(typeof global === 'object')
|
||||||
{
|
{
|
||||||
global.RUN_CLIENT=1;
|
global.RUN_CLIENT=1;
|
||||||
global.RUN_SERVER=0;
|
global.RUN_SERVER=0;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="/HTML/JS/coinlib.js"></script>
|
<script type="text/javascript" src="/HTML/JS/coinlib.js"></script>
|
||||||
<script type="text/javascript" src="../HTML/JS/client.js"></script>
|
<script type="text/javascript" src="../HTML/JS/client.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var TabbleStat,TableError;
|
var TabbleStat,TableError;
|
||||||
var PrevData;
|
var PrevData;
|
||||||
function SetResult(Data)
|
function SetResult(Data)
|
||||||
{
|
{
|
||||||
if(!Data)
|
if(!Data)
|
||||||
Data=PrevData;
|
Data=PrevData;
|
||||||
if(!Data || !Data.result)
|
if(!Data || !Data.result)
|
||||||
return;
|
return;
|
||||||
PrevData=Data;
|
PrevData=Data;
|
||||||
|
|
||||||
|
|
||||||
var arrnames=["10s","10m","total, avg"];
|
var arrnames=["10s","10m","total, avg"];
|
||||||
var arrmult=[10,10*60,Data.period*10];
|
var arrmult=[10,10*60,Data.period*10];
|
||||||
for(var i=0;i<arrmult.length;i++)
|
for(var i=0;i<arrmult.length;i++)
|
||||||
{
|
{
|
||||||
if(arrmult[i]>Data.period)
|
if(arrmult[i]>Data.period)
|
||||||
arrmult[i]=Data.period;
|
arrmult[i]=Data.period;
|
||||||
|
|
||||||
arrmult[i]=arrmult[i]/10;
|
arrmult[i]=arrmult[i]/10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var arrdata=[Data.stats.Counter10S,Data.stats.Counter10M,Data.stats.Counter];
|
var arrdata=[Data.stats.Counter10S,Data.stats.Counter10M,Data.stats.Counter];
|
||||||
var arrerr=[Data.errors.Counter10S,Data.errors.Counter10M,Data.errors.Counter];
|
var arrerr=[Data.errors.Counter10S,Data.errors.Counter10M,Data.errors.Counter];
|
||||||
//drawChart(arrdata,arrnames,arrmult);
|
//drawChart(arrdata,arrnames,arrmult);
|
||||||
|
|
||||||
|
|
||||||
SetStat(TabbleStat,arrdata);
|
SetStat(TabbleStat,arrdata);
|
||||||
SetStat(TableError,arrerr);
|
SetStat(TableError,arrerr);
|
||||||
}
|
}
|
||||||
function ClearTableStat(htmlTable)
|
function ClearTableStat(htmlTable)
|
||||||
{
|
{
|
||||||
for(var i=htmlTable.rows.length-1;i>0;i--)
|
for(var i=htmlTable.rows.length-1;i>0;i--)
|
||||||
htmlTable.deleteRow(i);
|
htmlTable.deleteRow(i);
|
||||||
htmlTable.StatItem={};
|
htmlTable.StatItem={};
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetStat(htmlTable,arr)
|
function SetStat(htmlTable,arr)
|
||||||
{
|
{
|
||||||
var StrFilter = document.getElementById("idFilter").value;
|
var StrFilter = document.getElementById("idFilter").value;
|
||||||
|
|
||||||
var rows=htmlTable.rows;
|
var rows=htmlTable.rows;
|
||||||
if(!htmlTable.StatItem)
|
if(!htmlTable.StatItem)
|
||||||
{
|
{
|
||||||
htmlTable.StatItem={};
|
htmlTable.StatItem={};
|
||||||
htmlTable.StatItem["Total"]=rows[1];
|
htmlTable.StatItem["Total"]=rows[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(0)
|
if(0)
|
||||||
for(var i=1;i<rows.length;i++)
|
for(var i=1;i<rows.length;i++)
|
||||||
rows[i].Do=1;
|
rows[i].Do=1;
|
||||||
|
|
||||||
for(var m=0;m<arr.length;m++)
|
for(var m=0;m<arr.length;m++)
|
||||||
{
|
{
|
||||||
var Data=arr[m];
|
var Data=arr[m];
|
||||||
var Sum=0;
|
var Sum=0;
|
||||||
for(var name in Data)
|
for(var name in Data)
|
||||||
{
|
{
|
||||||
if(name.indexOf("MAX:")!==-1)
|
if(name.indexOf("MAX:")!==-1)
|
||||||
continue;
|
continue;
|
||||||
var Count=Data[name];
|
var Count=Data[name];
|
||||||
if(Count)
|
if(Count)
|
||||||
{
|
{
|
||||||
Sum+=parseInt(Count);
|
Sum+=parseInt(Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Data["Total"]=Sum;
|
Data["Total"]=Sum;
|
||||||
|
|
||||||
for(var name in Data)
|
for(var name in Data)
|
||||||
{
|
{
|
||||||
|
|
||||||
var item=htmlTable.StatItem[name];
|
var item=htmlTable.StatItem[name];
|
||||||
if(!item)
|
if(!item)
|
||||||
{
|
{
|
||||||
//index=htmlTable.rows.length;
|
//index=htmlTable.rows.length;
|
||||||
|
|
||||||
var item=htmlTable.insertRow(1);
|
var item=htmlTable.insertRow(1);
|
||||||
htmlTable.StatItem[name]=item;
|
htmlTable.StatItem[name]=item;
|
||||||
item.insertCell(0);
|
item.insertCell(0);
|
||||||
for(var n=0;n<arr.length;n++)
|
for(var n=0;n<arr.length;n++)
|
||||||
{
|
{
|
||||||
item.insertCell(n+1);
|
item.insertCell(n+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.cells[0].innerText=name;
|
item.cells[0].innerText=name;
|
||||||
item.insertCell(arr.length);
|
item.insertCell(arr.length);
|
||||||
item.cells[arr.length+1].innerHTML='<INPUT type="button" class="add" onclick="AddDiagram(\''+name+'\')" value="Add">';
|
item.cells[arr.length+1].innerHTML='<INPUT type="button" class="add" onclick="AddDiagram(\''+name+'\')" value="Add">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var Count=Math.floor(Data[name]);
|
var Count=Math.floor(Data[name]);
|
||||||
item.cells[m+1].innerText=Count;
|
item.cells[m+1].innerText=Count;
|
||||||
//item.visibility="visible";
|
//item.visibility="visible";
|
||||||
|
|
||||||
if(StrFilter.length>0 && name.indexOf(StrFilter)==-1)
|
if(StrFilter.length>0 && name.indexOf(StrFilter)==-1)
|
||||||
item.style="display:none";
|
item.style="display:none";
|
||||||
else
|
else
|
||||||
item.style="";
|
item.style="";
|
||||||
item.Do=0;
|
item.Do=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(0)
|
if(0)
|
||||||
for(var i=1;i<rows.length;i++)
|
for(var i=1;i<rows.length;i++)
|
||||||
if(rows[i].Do===1)
|
if(rows[i].Do===1)
|
||||||
for(var j=1;j<rows[i].cells.length-1;j++)
|
for(var j=1;j<rows[i].cells.length-1;j++)
|
||||||
rows[i].cells[j].innerText="";
|
rows[i].cells[j].innerText="";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddDiagram(Name)
|
function AddDiagram(Name)
|
||||||
{
|
{
|
||||||
var Str=localStorage["DiagramArr"];
|
var Str=localStorage["DiagramArr"];
|
||||||
if(!Str|| Str==="undefined")
|
if(!Str|| Str==="undefined")
|
||||||
Str="[]";
|
Str="[]";
|
||||||
var DiagramArr=JSON.parse(Str);
|
var DiagramArr=JSON.parse(Str);
|
||||||
|
|
||||||
var Item={name:Name,text:Name,value:0,red:"#1c6bb6"};
|
var Item={name:Name,text:Name,value:0,red:"#1c6bb6"};
|
||||||
|
|
||||||
AddDiagramToArr(DiagramArr,Item);
|
AddDiagramToArr(DiagramArr,Item);
|
||||||
|
|
||||||
localStorage["DiagramArr"]=JSON.stringify(DiagramArr)
|
localStorage["DiagramArr"]=JSON.stringify(DiagramArr)
|
||||||
localStorage["ExternSetDiagramArr"]=1;
|
localStorage["ExternSetDiagramArr"]=1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var bPause;
|
var bPause;
|
||||||
var StatMode;
|
var StatMode;
|
||||||
function SetPause(SetMode)
|
function SetPause(SetMode)
|
||||||
{
|
{
|
||||||
if(SetMode===undefined)
|
if(SetMode===undefined)
|
||||||
{
|
{
|
||||||
bPause=!bPause;
|
bPause=!bPause;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bPause=SetMode;
|
bPause=SetMode;
|
||||||
}
|
}
|
||||||
var item = document.getElementById("idRun");
|
var item = document.getElementById("idRun");
|
||||||
if(bPause)
|
if(bPause)
|
||||||
item.value="Continue view";
|
item.value="Continue view";
|
||||||
else
|
else
|
||||||
item.value="Pause view";
|
item.value="Pause view";
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetStatMode()
|
function SetStatMode()
|
||||||
{
|
{
|
||||||
if(!StatMode)
|
if(!StatMode)
|
||||||
StatMode=0;
|
StatMode=0;
|
||||||
StatMode=(StatMode+1)%3;
|
StatMode=(StatMode+1)%3;
|
||||||
GetData("SetStatMode",StatMode,function (Data)
|
GetData("SetStatMode",StatMode,function (Data)
|
||||||
{
|
{
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function ClearStat()
|
function ClearStat()
|
||||||
{
|
{
|
||||||
GetData("ClearStat",{},function (Data)
|
GetData("ClearStat",{},function (Data)
|
||||||
{
|
{
|
||||||
ClearTableStat(TabbleStat);
|
ClearTableStat(TabbleStat);
|
||||||
ClearTableStat(TableError);
|
ClearTableStat(TableError);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function SetStatInfo(Data)
|
function SetStatInfo(Data)
|
||||||
{
|
{
|
||||||
var item = document.getElementById("idStatInfo");
|
var item = document.getElementById("idStatInfo");
|
||||||
var button = document.getElementById("idStatButton");
|
var button = document.getElementById("idStatButton");
|
||||||
StatMode=Data.STAT_MODE;
|
StatMode=Data.STAT_MODE;
|
||||||
if(StatMode===1)
|
if(StatMode===1)
|
||||||
{
|
{
|
||||||
item.innerText=" =Stat ON=";
|
item.innerText=" =Stat ON=";
|
||||||
button.value="Start detail stat"
|
button.value="Start detail stat"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(StatMode===2)
|
if(StatMode===2)
|
||||||
{
|
{
|
||||||
item.innerText=" =Stat detail ON=";
|
item.innerText=" =Stat detail ON=";
|
||||||
button.value="Stop stat"
|
button.value="Stop stat"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.innerText=" =Stat OFF=";
|
item.innerText=" =Stat OFF=";
|
||||||
button.value="Start stat"
|
button.value="Start stat"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//LIB
|
//LIB
|
||||||
function GetStat()
|
function GetStat()
|
||||||
{
|
{
|
||||||
if(bPause)
|
if(bPause)
|
||||||
return;
|
return;
|
||||||
GetData("GetAllCounters",{},function (Data)
|
GetData("GetAllCounters",{},function (Data)
|
||||||
{
|
{
|
||||||
SetResult(Data);
|
SetResult(Data);
|
||||||
SetStatInfo(Data);
|
SetStatInfo(Data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function OnSetFilter()
|
function OnSetFilter()
|
||||||
{
|
{
|
||||||
SetResult();
|
SetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.onload=function()
|
window.onload=function()
|
||||||
{
|
{
|
||||||
TabbleStat=document.getElementById("grid_stat");
|
TabbleStat=document.getElementById("grid_stat");
|
||||||
TableError=document.getElementById("grid_error");
|
TableError=document.getElementById("grid_error");
|
||||||
|
|
||||||
SetPause(0);
|
SetPause(0);
|
||||||
GetStat();
|
GetStat();
|
||||||
setInterval(GetStat,1000);
|
setInterval(GetStat,1000);
|
||||||
|
|
||||||
window.onkeydown = function (e)
|
window.onkeydown = function (e)
|
||||||
{
|
{
|
||||||
if(e.keyCode===27)
|
if(e.keyCode===27)
|
||||||
{
|
{
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//document.body.className="univers "+localStorage["idSelStyle"];
|
//document.body.className="univers "+localStorage["idSelStyle"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
table
|
table
|
||||||
{
|
{
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
.stat th, .stat td
|
.stat th, .stat td
|
||||||
{
|
{
|
||||||
border: 1px solid #000;
|
border: 1px solid #000;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
.stat td
|
.stat td
|
||||||
{
|
{
|
||||||
width: 122px;
|
width: 122px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.stat td:nth-child(1)
|
.stat td:nth-child(1)
|
||||||
{
|
{
|
||||||
width: 220px;
|
width: 220px;
|
||||||
}
|
}
|
||||||
.stat td:nth-child(5)
|
.stat td:nth-child(5)
|
||||||
{
|
{
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
.total
|
.total
|
||||||
{
|
{
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#topframeFind
|
#topframeFind
|
||||||
{
|
{
|
||||||
z-index:1000;
|
z-index:1000;
|
||||||
position:fixed;
|
position:fixed;
|
||||||
top:80px;
|
top:80px;
|
||||||
left:10px;
|
left:10px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width:1200px;
|
width:1200px;
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
color: blue;
|
color: blue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#topframe
|
#topframe
|
||||||
{
|
{
|
||||||
z-index:1000;
|
z-index:1000;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top:0px;
|
top:0px;
|
||||||
left:0px;
|
left:0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width:600px;
|
width:600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#idRun, #idStatButton
|
#idRun, #idStatButton
|
||||||
{
|
{
|
||||||
width:100px;
|
width:100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<BR>
|
<BR>
|
||||||
|
|
||||||
<div id="confirm_div" style="height: 0px;"></div>
|
<div id="confirm_div" style="height: 0px;"></div>
|
||||||
|
|
||||||
<h2 align='center' >Performance counters</h2>
|
<h2 align='center' >Performance counters</h2>
|
||||||
|
|
||||||
<DIV id="topframeFind">
|
<DIV id="topframeFind">
|
||||||
Filter: <INPUT type="search" style="width: 292px" id="idFilter" autofocus onkeyup="OnSetFilter()" value="">
|
Filter: <INPUT type="search" style="width: 292px" id="idFilter" autofocus onkeyup="OnSetFilter()" value="">
|
||||||
</DIV>
|
</DIV>
|
||||||
|
|
||||||
<BR>
|
<BR>
|
||||||
|
|
||||||
<table id="grid_stat" class="stat">
|
<table id="grid_stat" class="stat">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Counters</th>
|
<th>Counters</th>
|
||||||
<th>10 sec</th>
|
<th>10 sec</th>
|
||||||
<th>10 min</th>
|
<th>10 min</th>
|
||||||
<th>total</th>
|
<th>total</th>
|
||||||
<th>Diagr</th>
|
<th>Diagr</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="total">
|
<tr class="total">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<BR>
|
<BR>
|
||||||
|
|
||||||
<table id="grid_error" class="stat">
|
<table id="grid_error" class="stat">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Errors</th>
|
<th>Errors</th>
|
||||||
<th>10 sec</th>
|
<th>10 sec</th>
|
||||||
<th>10 min</th>
|
<th>10 min</th>
|
||||||
<th>total</th>
|
<th>total</th>
|
||||||
<th>Diagr</th>
|
<th>Diagr</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="total">
|
<tr class="total">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="chart_div" style="width: 900px; height: 500px;"></div>
|
<div id="chart_div" style="width: 900px; height: 500px;"></div>
|
||||||
|
|
||||||
|
|
||||||
<DIV id="topframe">
|
<DIV id="topframe">
|
||||||
<INPUT type="button" style="float:left" onclick="SetPause()" id="idRun">
|
<INPUT type="button" style="float:left" onclick="SetPause()" id="idRun">
|
||||||
<INPUT type="button" style="float:left" onclick="ClearStat()" id="idClearStat" value="Clear stat">
|
<INPUT type="button" style="float:left" onclick="ClearStat()" id="idClearStat" value="Clear stat">
|
||||||
<INPUT type="button" style="float:left" onclick="SetStatMode()" id="idStatButton">
|
<INPUT type="button" style="float:left" onclick="SetStatMode()" id="idStatButton">
|
||||||
<DIV align='left'><B id="idStatInfo"></B></DIV>
|
<DIV align='left'><B id="idStatInfo"></B></DIV>
|
||||||
</DIV>
|
</DIV>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|