-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathhistory.js
36 lines (26 loc) · 979 Bytes
/
history.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function trStr(url, desc, amount, time) {
var trStr = '<tr><td>'+url+'</td><td>'+desc+'</td><td>'+amount+'</td><td>'+time+'</td></tr>';
console.log('trStr: ', trStr);
return trStr;
}
$(document).ready(function () {
var str = trStr('url', 'desc', 13);
// console.log('last tr: ', $('#ht tr:last'))
// console.log('str: ', str);
chrome.storage.sync.get(['txHistory', 'address'], function(data) {
// console.log('data: ', data);
console.log('txHistory data: ', data.txHistory);
// console.log('txHistory data [0]: ', data.txHistory[0]);
$('#title').text('History for ' + data.address);
data = data.txHistory;
for (var d in data) {
//console.log('d: ', d)
var host = data[d].host;
var msg = data[d].message;
var amount = data[d].amount;
// console.log(data[d].host, data[d].message, data[d].amount);
var str = trStr(host, msg, amount, 'Aug 3 2014');
$('#ht tr:last').after(str);
}
});
});