Skip to content

Commit

Permalink
GMT hint under the tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemKo7v committed Sep 28, 2016
1 parent 70be067 commit 0015ae7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
7 changes: 7 additions & 0 deletions css/ethplorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ td.list-field {
text-overflow: ellipsis
}

small {
margin-top: -10px;
display: block;
padding-left: 16px;
color: white;
}

/* Timer*/
.timer{
width: 47px;
Expand Down
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,24 +285,28 @@ <h3 id="error-reason" class="text-danger"></h3>
<div class="block-header"><h3>Token <span class="address-token-name"></span> Issuances</h3></div>
<table class="table"></table>
</div>
<small>* all dates are displayed for <span class="local-time-offset"></span> timezone</small>
</div>
<div class="col-xs-12" id="address-token-transfers" style="display:none;">
<div class="block">
<div class="block-header"><h3>Token <span class="address-token-name"></span> Last 10 Transfers</h3></div>
<table class="table"></table>
</div>
<small>* all dates are displayed for <span class="local-time-offset"></span> timezone</small>
</div>
<div class="col-xs-12" id="address-transfers" style="display:none;">
<div class="block">
<div class="block-header"><h3>Last 10 Transfers</h3></div>
<table class="table"></table>
</div>
<small>* all dates are displayed for <span class="local-time-offset"></span> timezone</small>
</div>
<div class="col-xs-12" id="address-chainy-tx" style="display:none;">
<div class="block">
<div class="block-header"><h3>Last 10 Chainy Transactions</h3></div>
<table class="table"></table>
</div>
<small>* all dates are displayed for <span class="local-time-offset"></span> timezone</small>
</div>
</div>
</div>
Expand Down
28 changes: 22 additions & 6 deletions js/ethplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,33 @@ Ethplorer = {
$('#address-chainy-tx').show();
for(var i=0; i<data.chainy.length; i++){
var tx = data.chainy[i];
var type = '';
var link = '';
if(tx.link){
var obj = Ethplorer.Utils.parseJData(tx.input);
if(false !== obj){
var chainyTypes = {
'R': 'Redirect',
'T': 'Text',
'H': 'Hash',
'L': 'File Hash',
'E': 'Encrypted'
};
type = chainyTypes[obj.type];
}
link = Ethplorer.Utils.hex2ascii(tx.link);
link = '<a href="' + link + '" target="_blank" class="external-link"><i class="fa fa-external-link"></i>&nbsp;' + link + '</a>';
}
var row = $('<tr>');
var tdDate = $('<td>');
var tdHash = $('<td>').addClass('list-field table-hash-field');
// var tdOpType = $('<td>').addClass('text-center table-type-field');
var tdOpType = $('<td>').addClass('text-center table-type-field');
var tdLink = $('<td>');
tdDate.html(Ethplorer.Utils.getEthplorerLink(tx.hash, Ethplorer.Utils.ts2date(tx.timestamp, false), false));
tdHash.html(Ethplorer.Utils.getEthplorerLink(tx.hash));
// tdOpType.html('');
tdOpType.html(type);
tdLink.html(link);
row.append(tdDate, tdHash, /*tdOpType,*/ tdLink);
row.append(tdDate, tdHash, tdOpType, tdLink);
$('#address-chainy-tx .table').append(row);
}
}
Expand Down Expand Up @@ -361,7 +373,7 @@ Ethplorer = {
}
}
}

$('.local-time-offset').text(Ethplorer.Utils.getTZOffset());
Ethplorer.Utils.hideEmptyFields();
Ethplorer.hideLoader();
$('#disqus_thread').show();
Expand Down Expand Up @@ -628,18 +640,22 @@ Ethplorer = {
function padZero(s){
return (s < 10) ? '0' + s : s.toString();
}
var offset = -Math.round(new Date().getTimezoneOffset() / 60);
var res = '';
var dt = new Date(ts);
res += (dt.getFullYear() + '-' + padZero((dt.getMonth() + 1)) + '-' + padZero(dt.getDate()));
res += ' ';
res += (padZero(dt.getHours()) + ':' + padZero(dt.getMinutes()) + ':' + padZero(dt.getSeconds()));
if(withGMT){
res += (' (GMT' + (offset > 0 ? '+' : '-') + offset + ')');
res += (' (' + Ethplorer.Utils.getTZOffset() + ')');
}
return res;
},

getTZOffset: function(){
var offset = -Math.round(new Date().getTimezoneOffset() / 60);
return 'GMT' + (offset > 0 ? '+' : '-') + offset;
},

hideEmptyFields: function(){
$('.list-field').parents('TR').show();
$('.list-field:empty').parents('TR').hide();
Expand Down
4 changes: 2 additions & 2 deletions service/lib/etherscan.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ public function getAddressDetails($address){
if((strlen($link) % 2) !== 0){
$link = $link + '0';
}
if($tx['hasReceipt'] && !empty($tx['receipt']['logs'])){
//if($tx['hasReceipt'] && !empty($tx['receipt']['logs'])){
$result['chainy'][] = array(
'hash' => $tx['hash'],
'timestamp' => $tx['timestamp'],
'input' => $tx['input'],
'link' => $link,
);
}
//}
$fetches++;
}
}
Expand Down

0 comments on commit 0015ae7

Please sign in to comment.