Skip to content

Commit 098acb6

Browse files
committed
historical data
1 parent 76b06cb commit 098acb6

File tree

3 files changed

+36
-41
lines changed

3 files changed

+36
-41
lines changed

assets_js_bitrequest_core.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,6 +3589,7 @@ function animate_confbar(confbox, index) {
35893589
// Shows transaction metadata on double click
35903590
function show_transaction_meta() {
35913591
$(document).on("dblclick", ".requestlist li .transactionlist li", function() {
3592+
if (!glob_supportsTouch) return;
35923593
const thisli = $(this),
35933594
txmeta = thisli.children(".historic_meta");
35943595
if (txmeta.is(":visible")) {
@@ -4365,7 +4366,7 @@ function appendrequest(rd) {
43654366
amount_rounded = trimdecimals(amount, Math.min(deter, 8)),
43664367
receivedamount_rounded = trimdecimals(receivedamount, 6),
43674368
fiatvalue_rounded = trimdecimals(fiatvalue, 2),
4368-
requestlist = archive === true ? $("#archivelist") : $("#requestlist"),
4369+
requestlist = archive ? $("#archivelist") : $("#requestlist"),
43694370
utc = timestamp - glob_timezone,
43704371
localtime = requestdate ? requestdate - glob_timezone : utc,
43714372
incoming = requesttype === "incoming",
@@ -4421,7 +4422,7 @@ function appendrequest(rd) {
44214422
src_html = source ? "<span class='src_txt'>" + translate("source") + ": " + source + "</span><span class='icon-wifi-off'></span><span class='icon-connection'></span>" : "",
44224423
iscryptoclass = iscrypto ? "" : " isfiat",
44234424
archivebutton = showarchive || isexpired ? "<div class='icon-folder-open' title='archive request'></div>" : "",
4424-
render_archive = txhistory && (pending == "no" || archive === true),
4425+
render_archive = txhistory && (pending === "no" || archive),
44254426
tl_text = render_archive ? translate("transactions") : "",
44264427
edit_request = local ? "<div class='editrequest icon-pencil' title='edit request' data-requestid='" + requestid + "'></div>" : "",
44274428
pid_li = payment_id ? "<li><strong>" + translate("paymentid") + ":</strong> <span class='select' data-type='payment ID'>" + payment_id + "</span></li>" : "",
@@ -4482,7 +4483,7 @@ function appendrequest(rd) {
44824483
<div class='expired_panel'><h2>" + translate("expired") + "</h2></div>\
44834484
</li>");
44844485
new_requestli.data(rd).prependTo(requestlist);
4485-
if (render_archive === true) {
4486+
if (render_archive) {
44864487
const transactionlist = requestlist.find("#" + requestid).find(".transactionlist");
44874488
add_historical_data(transactionlist, txhistory);
44884489
}
@@ -4492,7 +4493,7 @@ function appendrequest(rd) {
44924493
function add_historical_data(transactionlist, txhistory) {
44934494
let tx_listitem = false;
44944495
$.each(txhistory, function(data, value) {
4495-
tx_listitem = append_tx_li(value, false);
4496+
tx_listitem = append_tx_li(value);
44964497
if (tx_listitem) {
44974498
const h_string = data_title(value);
44984499
if (h_string) {

assets_js_bitrequest_monitors.js

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ function tx_api_scan_fail(rd, api_data, rdo, error_data, all_proxys, l2) {
424424
tx_api_fail(thislist, rdo.statuspanel);
425425
}
426426
}
427-
if (src === "addr_polling" && rdo.socket === true) {
427+
if (src === "addr_polling" && rdo.socket) {
428428
handle_socket_fails(api_data, rd.address);
429429
return
430430
}
@@ -607,8 +607,7 @@ function get_api_error_data(error) {
607607

608608
// Sets the API source for a given request
609609
function set_api_src(rdo, api_data) {
610-
const src = rdo.source;
611-
if (src === "list") {
610+
if (rdo.source === "list") {
612611
api_src(rdo.thislist, api_data);
613612
}
614613
}
@@ -846,40 +845,35 @@ function get_next_rpc(this_payment, api_data, requestid) {
846845

847846
// Appends a transaction list item with given transaction data
848847
function append_tx_li(txd, rqtype) {
849-
const txhash = txd.txhash,
848+
const txhash = txd.txhash;
849+
if (!txhash) return null;
850+
const ccval = txd.ccval,
851+
ccval_rounded = trimdecimals(ccval, 6),
852+
transactiontime = txd.transactiontime,
853+
conf = txd.confirmations,
854+
setconfirmations = txd.setconfirmations,
855+
ccsymbol = txd.ccsymbol,
856+
set_ccsymbol = ccsymbol ? ccsymbol.toUpperCase() : "",
850857
ln = txhash && txhash.slice(0, 9) === "lightning";
851-
if (txhash) {
852-
const ccval = txd.ccval,
853-
ccval_rounded = trimdecimals(ccval, 6),
854-
transactiontime = txd.transactiontime,
855-
conf = txd.confirmations,
856-
setconfirmations = txd.setconfirmations,
857-
ccsymbol = txd.ccsymbol,
858-
set_ccsymbol = ccsymbol ? ccsymbol.toUpperCase() : "",
859-
lnstr = ln ? " <span class='icon-power'></span>" : "",
860-
valstr = (ln && !conf) ? "" : ccval_rounded + " " + set_ccsymbol + lnstr,
861-
date_format = transactiontime ? short_date(transactiontime) : "",
862-
no_conf = setconfirmations === false,
863-
instant_lock = txd.instant_lock,
864-
confirmed = instant_lock || no_conf || (conf && conf >= setconfirmations),
865-
conf_count = no_conf ? "" : conf + " / " + setconfirmations + " " + translate("confirmations"),
866-
instant_lock_text = instant_lock ? " (instant_lock)" : "",
867-
conf_title = instant_lock ? "instant_lock" : conf_count,
868-
unconf_text = translate("unconfirmedtx"),
869-
checked_span = "<span class='icon-checkmark' title='" + conf_title + "'></span>",
870-
confspan = confirmed ? checked_span : conf ? "<div class='txli_conf' title='" + conf_title + "'><div class='confbar'></div><span>" + conf_title + "</span></div>" :
871-
"<div class='txli_conf' title='" + unconf_text + "'><div class='confbar'></div><span>" + unconf_text + "</span></div>",
872-
tx_listitem = $("<li><div class='txli_content'>" + date_format + confspan + "<div class='txli_conf txl_canceled'><span class='icon-blocked'></span>Canceled</div><span class='tx_val'> + " + valstr + " <span class='icon-eye show_tx' title='view on blockexplorer'></span></span></div></li>");
873-
if (rqtype === false) {
874-
return tx_listitem;
875-
}
876-
if (glob_tx_list.includes(txhash)) { // check for indexed transaction id's
877-
return rqtype === "outgoing" ? null : tx_listitem;
878-
}
879-
glob_tx_list.push(txhash);
880-
return tx_listitem;
881-
}
882-
return null;
858+
lnstr = ln ? " <span class='icon-power'></span>" : "",
859+
valstr = (ln && !conf) ? "" : ccval_rounded + " " + set_ccsymbol + lnstr,
860+
date_format = transactiontime ? short_date(transactiontime) : "",
861+
no_conf = setconfirmations === false,
862+
instant_lock = txd.instant_lock,
863+
confirmed = instant_lock || no_conf || (conf && conf >= setconfirmations),
864+
conf_count = no_conf ? "" : conf + " / " + setconfirmations + " " + translate("confirmations"),
865+
instant_lock_text = instant_lock ? " (instant_lock)" : "",
866+
conf_title = instant_lock ? "instant_lock" : conf_count,
867+
unconf_text = translate("unconfirmedtx"),
868+
checked_span = "<span class='icon-checkmark' title='" + conf_title + "'></span>",
869+
confspan = confirmed ? checked_span : conf ? "<div class='txli_conf' title='" + conf_title + "'><div class='confbar'></div><span>" + conf_title + "</span></div>" :
870+
"<div class='txli_conf' title='" + unconf_text + "'><div class='confbar'></div><span>" + unconf_text + "</span></div>",
871+
tx_listitem = $("<li><div class='txli_content'>" + date_format + confspan + "<div class='txli_conf txl_canceled'><span class='icon-blocked'></span>Canceled</div><span class='tx_val'> + " + valstr + " <span class='icon-eye show_tx' title='view on blockexplorer'></span></span></div></li>");
872+
if (glob_tx_list.includes(txhash)) { // check for indexed transaction id's
873+
return rqtype === "outgoing" ? null : tx_listitem;
874+
}
875+
glob_tx_list.push(txhash);
876+
return tx_listitem;
883877
}
884878

885879
// Creates HTML for historic data

assets_styles_styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ html.dragmode .currentpage .applist li.dragging {
14011401
margin: 10px 0 0 0;
14021402
border-radius: 5px;
14031403
padding: 10px;
1404-
font-size: 12px;
1404+
font-size: 70%;
14051405
line-height: 1.4em;
14061406
font-family: monospace;
14071407
display: none;

0 commit comments

Comments
 (0)