Difference between revisions of "Widget:CurrentPrice"

From CryptoWiki

(Created page with "<script type="text/javascript"> baseUrl = "https://widgets.cryptocompare.com/"; var scripts = document.getElementsByTagName("script"); var embedder = scripts[ scripts.length - 1 ]; var cccTheme = {"General":{}}; (function (){ var appName = encodeURIComponent(window.location.hostname); if(appName==""){appName="local";} var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; var theUrl = baseUrl+'serve/v3/coin/header?fsyms=BTC,ETH,XRP,BCH,EOS,...")
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<script type="text/javascript">
<script async src="https://static.coinstats.app/widgets/coin-price-marquee-widget.js"></script>
baseUrl = "https://widgets.cryptocompare.com/";
<coin-stats-marquee-widget locale="en" currency="USD" background="#FFFFFF" status-up-color="#4F8A5B" status-down-color="#FE4747" text-color="#1C1B1B" buttons-color="#1C1B1B" border-color="rgba(28,27,27,0.15)" position="static" font="Roboto, Arial, Helvetica" width="4000px" coins-count="100"></coin-stats-marquee-widget>
var scripts = document.getElementsByTagName("script");
var embedder = scripts[ scripts.length - 1 ];
var cccTheme = {"General":{}};
(function (){
var appName = encodeURIComponent(window.location.hostname);
if(appName==""){appName="local";}
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
var theUrl = baseUrl+'serve/v3/coin/header?fsyms=BTC,ETH,XRP,BCH,EOS,XLM,LTC,ADA,XMR,ETC&tsyms=USD';
s.src = theUrl + ( theUrl.indexOf("?") >= 0 ? "&" : "?") + "app=" + appName;
embedder.parentNode.appendChild(s);
})();
</script>
<script type="text/javascript">
(function () {
  var currentPricesInterval = setInterval(function () {
    var $prices;
    if (typeof jQuery === 'undefined' || ($prices = jQuery('#marquee-container .ccc-header-v3-ccc-price-container')).length === 0) {
      return;
    }
    clearInterval(currentPricesInterval);
    $prices.each(function () {
      var $this = jQuery(this);
      var $link = $this.find('> a');
      var $childs = $link.children();
      $childs.detach();
      $link.remove();
      $this.append($childs);
    });
 
    var links = {
      "BTC": "Bitcoin",
      "XRP": "Ripple",
      "EOS": "EOS",
      "LTC": "Litecoin",
      "XMR": "Monero",
      "ETH": "Ethereum",
      "BCH": "Bitcoin_Cash",
      "XLM": "Stellar",
      "ADA": "Cardano",
      "ETC": "Ethereum_Classic"
    };
    $('#marquee-container .ccc-header-v3-ccc-price-container').each(function () {
      var $this = $(this);
      var $name = $this.find('.ccc-header-v3-price-name');
      var $logo = $this.find('.ccc-header-v3-price-logo');
 
      var text = $name.text();
      var currency = text.match(/^([A-Z]{3})/)[1];
      var $link = $('<a>', {"href": '/wiki/' + links[currency]});
 
      $name.empty();
      $name.append($link.clone().text(text));
 
      $logo.wrap($link.clone());
    });
  }, 100);
})();
</script>

Latest revision as of 14:46, 5 April 2022

<script async src="https://static.coinstats.app/widgets/coin-price-marquee-widget.js"></script> <coin-stats-marquee-widget locale="en" currency="USD" background="#FFFFFF" status-up-color="#4F8A5B" status-down-color="#FE4747" text-color="#1C1B1B" buttons-color="#1C1B1B" border-color="rgba(28,27,27,0.15)" position="static" font="Roboto, Arial, Helvetica" width="4000px" coins-count="100"></coin-stats-marquee-widget>