-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathtaint_grouping.min.js
1 lines (1 loc) · 1.94 KB
/
taint_grouping.min.js
1
function removeGrouping(){$("#active-addresses").trigger("show")}function buildTable(b){var a=$("#active-addresses");var n=a.find("table");n.find("tbody").remove();for(var e in b){var l=b[e];if(e==0){n.append('<tbody><tr><th colspan="2">Group #'+e+'</th><th colspan="2"><a onclick="removeGrouping();">Hide Grouping</a></th></tr></tbody>')}else{n.append('<tbody><tr><th colspan="4">Group #'+e+"</th></tr></tbody>")}var f=$("<tbody></tbody>").appendTo(n);for(var m in l){var k=l[m];var g=addresses[k];if(!g){continue}var j="";if(g.tag==1){j=' <font color="red" title="Not Synced">(Not Synced)</font>'}else{if(g.priv==null){j=' <font color="red" title="Watch Only">(Watch Only)</font>'}}var c="";var h=g.addr;if(g.label!=null){h=g.label;c='<span class="hidden-phone"> - '+g.addr+"</span>"}var d='<tr style="background-color:#FFFFFF;"><td style="width:20px;background-color:#FFFFFF;"><img id="qr'+g.addr+'" onclick="showAddressModal(\''+g.addr+'\')" src="'+resource+'info.png" /></td><td style="background-color:#FFFFFF;"><div class="short-addr"><a href="'+root+"address/"+g.addr+'" target="new">'+h+"</a>"+c+" "+j+'<div></td><td style="background-color:#FFFFFF;" colspan="2"><span style="color:green">'+formatBTC(g.balance)+'<span class="hidden-phone"> BTC</span></span></td></tr>';f.append(d)}n.append(f)}}function loadTaintData(){setLoadingText("Loading Taint Data");$.get(root+"taint/"+getAllAddresses().join("|")+"?format=json").success(function(h){var e=[];var k=h.filteredTaints;for(var m in k){var c=k[m];var n=-1;for(var f in c){var d=c[f];for(var g in e){if(g!=n&&$.inArray(f,e[g])){if(n>=0){var l=e.splice(n,1);var j=e.splice(g,1);e.push(l.concat(j))}else{e[g].push(m)}n=g}if(n>=0){break}}}if(n==-1){e.push([m])}}buildTable(e);apiGetBalances(getAllAddresses(),function(b){for(var a in b){addresses[a].balance=b[a].final_balance}buildTable(e)},function(a){makeNotice("error","misc-error",a)})}).error(function(){makeNotice("error","misc-error","Error Downloading Taint Data")})};