|
|
|
@ -3,6 +3,7 @@ |
|
|
|
|
var $ = require('jquery') |
|
|
|
|
|
|
|
|
|
var utils = require('./utils') |
|
|
|
|
var helper = require('../lib/helper.js') |
|
|
|
|
|
|
|
|
|
// -------------- styling ----------------------
|
|
|
|
|
var csjs = require('csjs-inject') |
|
|
|
@ -61,7 +62,7 @@ function Renderer (appAPI, compilerEvent) { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
setInterval(() => { updateAccountBalances(appAPI) }, 1000) |
|
|
|
|
setInterval(() => { updateAccountBalances(self, appAPI) }, 1000) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Renderer.prototype.clear = function () { |
|
|
|
@ -345,13 +346,13 @@ Renderer.prototype.contracts = function (data, source) { |
|
|
|
|
$('.' + css.col2 + ' input,textarea').click(function () { this.select() }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateAccountBalances (appAPI) { |
|
|
|
|
function updateAccountBalances (self, appAPI) { |
|
|
|
|
var accounts = $('#txorigin').children('option') |
|
|
|
|
accounts.each(function (index, value) { |
|
|
|
|
(function (acc) { |
|
|
|
|
appAPI.getBalance(accounts[acc].value, function (err, res) { |
|
|
|
|
if (!err) { |
|
|
|
|
accounts[acc].innerText = accounts[acc].value.substring(0, 8) + '... (' + res.toString() + ' ether)' |
|
|
|
|
accounts[acc].innerText = helper.shortenAddress(accounts[acc].value, res) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
})(index) |
|
|
|
|