|
|
|
@ -294,7 +294,7 @@ namespace xmreg
|
|
|
|
|
string mainnet_url;
|
|
|
|
|
|
|
|
|
|
string js_html_files;
|
|
|
|
|
|
|
|
|
|
string js_html_files_all_in_one;
|
|
|
|
|
|
|
|
|
|
// instead of constatnly reading template files
|
|
|
|
|
// from hard drive for each request, we can read
|
|
|
|
@ -391,8 +391,7 @@ namespace xmreg
|
|
|
|
|
template_file["tx_table_header"] = xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_header.html");
|
|
|
|
|
template_file["tx_table_row"] = xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_row.html");
|
|
|
|
|
|
|
|
|
|
if (enable_js)
|
|
|
|
|
{
|
|
|
|
|
if (enable_js) {
|
|
|
|
|
// JavaScript files
|
|
|
|
|
template_file["jquery.min.js"] = xmreg::read(JS_JQUERY);
|
|
|
|
|
template_file["crc32.js"] = xmreg::read(JS_CRC32);
|
|
|
|
@ -409,10 +408,12 @@ namespace xmreg
|
|
|
|
|
// if we are running testnet or mainnet explorer
|
|
|
|
|
|
|
|
|
|
if (testnet)
|
|
|
|
|
{
|
|
|
|
|
template_file["config.js"] = std::regex_replace(
|
|
|
|
|
template_file["config.js"],
|
|
|
|
|
std::regex("testnet: false"),
|
|
|
|
|
"testnet: true");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
js_html_files += "<script src=\"/js/jquery.min.js\"></script>";
|
|
|
|
|
js_html_files += "<script src=\"/js/crc32.js\"></script>";
|
|
|
|
@ -423,6 +424,8 @@ namespace xmreg
|
|
|
|
|
js_html_files += "<script src=\"/js/base58.js\"></script>";
|
|
|
|
|
js_html_files += "<script src=\"/js/cn_util.js\"></script>";
|
|
|
|
|
js_html_files += "<script src=\"/js/sha3.js\"></script>";
|
|
|
|
|
|
|
|
|
|
js_html_files_all_in_one = "<script src=\"/js/all_in_one.js\"></script>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -6210,7 +6213,8 @@ namespace xmreg
|
|
|
|
|
add_js_files(mstch::map& context)
|
|
|
|
|
{
|
|
|
|
|
context["js_files"] = mstch::lambda{[&](const std::string& text) -> mstch::node {
|
|
|
|
|
return this->js_html_files;
|
|
|
|
|
//return this->js_html_files;
|
|
|
|
|
return this->js_html_files_all_in_one;
|
|
|
|
|
}};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|