pass tx_json from c++ into js variable.

This commit is contained in:
moneroexamples 2018-01-17 16:17:34 +08:00
parent d3481a0d26
commit 1459b30dd4
2 changed files with 9 additions and 2 deletions

View File

@ -5528,6 +5528,10 @@ namespace xmreg
{"construction_time" , string {}},
};
context["tx_json_raw"] = mstch::lambda{[=](const std::string& text) -> mstch::node {
return tx_json;
}};
string server_time_str = xmreg::timestamp_to_str_gm(server_timestamp, "%F");
mstch::array inputs = mstch::array{};
@ -6186,7 +6190,6 @@ namespace xmreg
add_js_files(mstch::map& context)
{
context["js_files"] = mstch::lambda{[&](const std::string& text) -> mstch::node {
return this->js_html_files;
}};
}

View File

@ -172,7 +172,11 @@
// we need output pubplic keys, their indexes and amounts.
// all this is already avaliable on the html, but we can use
// musch frramework to produce js array for this
// musch framework to produce js array for this
var tx_json = {{#tx_json_raw}}{{/tx_json_raw}};
console.log(tx_json);
var is_rct = ($("#is_ringct").val() === "yes");
var rct_type = parseInt($("#ringct_type").val());