From df9688f267568d4cafcf1895d21d5eb2cd0274dc Mon Sep 17 00:00:00 2001 From: Mayel de Borniol Date: Mon, 30 Apr 2018 11:35:13 +0300 Subject: [PATCH] switch to https --- extension/extension.js | 33 +++++++++++++++------------------ index.js | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/extension/extension.js b/extension/extension.js index 434ab42..f0b30fe 100644 --- a/extension/extension.js +++ b/extension/extension.js @@ -1,25 +1,8 @@ $(function() { - var heads = 'Official RateOfficial ValueMarket Value'; - - $("thead tr").append(heads); - - - ajax = function(options, callback) { - var xhr; - xhr = new XMLHttpRequest(); - xhr.open(options.type, options.url, options.async || true); - xhr.onreadystatechange = function() { - if (xhr.readyState === 4) { - return callback(xhr.responseText); - } - }; - return xhr.send(); - }; - ajax({ type: "GET", - url: "http://api.fairplayground.info/rawdata/faircoin_prices.csv", + url: "https://api.fairplayground.info/rawdata/faircoin_prices.csv", }, processData); @@ -30,6 +13,9 @@ $(function() { if (priceData) { + var heads = 'Official RateOfficial ValueMarket Value'; + $("thead tr").append(heads); + $('tbody > tr').each(function() { @@ -81,6 +67,17 @@ $(function() { $(el).append('€ ' + (Math.round(market * 100) / 100) + ''); } + function ajax (options, callback) { + var xhr; + xhr = new XMLHttpRequest(); + xhr.open(options.type, options.url, options.async || true); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + return callback(xhr.responseText); + } + }; + return xhr.send(); + }; function csvToArray(csv) { var a1 = csv.split("\n"); diff --git a/index.js b/index.js index d528df1..61ec2bc 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ $(document).ready(function() { $.ajax({ type: "GET", - url: "http://api.fairplayground.info/rawdata/faircoin_prices.csv", + url: "https://api.fairplayground.info/rawdata/faircoin_prices.csv", dataType: "text", success: processData });