added market cap data on network page

This commit is contained in:
Lee Wong 2017-03-29 00:08:41 +07:00 committed by Chuck Williams
parent 2880b77cf2
commit acfc0700e1
3 changed files with 25 additions and 4 deletions

View file

@ -786,9 +786,10 @@ pages:
hero-blockchain-btn: Blockchain hero-blockchain-btn: Blockchain
hero-mining-btn: Mining hero-mining-btn: Mining
markets-desc-text: site about Lorem Ipsum, giving information on its origins, as well as a random Lipsum generator.
masternode-desc-text: Reference site about Lorem Ipsum, giving information on its origins, as well as a random Lipsum generator. masternode-desc-text: Reference site about Lorem Ipsum, giving information on its origins, as well as a random Lipsum generator.
markets-heading: Markets markets-heading: Market Cap (USD)
governance-heading: Treasury governance-heading: Treasury
network-heading: Masternodes network-heading: Masternodes
blockchain-heading: Blockchain blockchain-heading: Blockchain

View file

@ -12,9 +12,10 @@ description: pages.currency.description
<div class="section__content"> <div class="section__content">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h2 class="">{% t pages.currency.markets-heading %}</h2> <h2 class="bottom-space">{% t pages.currency.markets-heading %}</h2>
<p class="section__lead"> <span id="marketcap_count" class="big-accent bottom-space"></span>
Compare Sites <p class="bottom-space">
{% t pages.currency.markets-desc-text %}
</p> </p>
<div class="hero__buttons"> <div class="hero__buttons">
<a href="http://coinmarketcap.com/currencies/dash/#markets" target="_blank" class="btn-blue-solid">CoinMarketCap</a> <a href="http://coinmarketcap.com/currencies/dash/#markets" target="_blank" class="btn-blue-solid">CoinMarketCap</a>

View file

@ -3,6 +3,25 @@
$(document).ready(function () { $(document).ready(function () {
var siteApi = window.globals.siteApi || '/api/v1'; var siteApi = window.globals.siteApi || '/api/v1';
var marketCapApi = 'https://www.coincap.io/front/'
if ($('#marketcap_count').length) {
function results(json){
var $dash="DASH",
result = json.filter(function(itm){
return $dash.indexOf(itm.short) > -1;
});
var num = result[0].mktcap.toFixed(0).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
$('#marketcap_count').text(num);
}
$.ajax({
url: "https://www.coincap.io/front/",
dataType: "jsonp",
jsonpCallback: "results"
});
}
if ($('#blocks').length) { if ($('#blocks').length) {