mirror of
https://github.com/seigler/Dash-price-widget
synced 2025-07-26 23:56:10 +00:00
set up inlining and minifying
This commit is contained in:
parent
4dd6e2020b
commit
8cf456f7aa
4 changed files with 61 additions and 121 deletions
|
@ -1,6 +1,4 @@
|
|||
<style>
|
||||
@import 'styles/styles.css';
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="styles/styles.css" />
|
||||
<form class="dash-ticker">
|
||||
<div class="dash-ticker--title">Dash Price</div>
|
||||
<div id="dash-ticker--price-container" title="Click to change currency">
|
||||
|
@ -11,4 +9,4 @@
|
|||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<script src="scripts/app.js"></script>
|
||||
<script type="application/javascript" src="scripts/app.js"></script>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
(function () {
|
||||
"use strict";
|
||||
|
||||
/*jshint ignore:start*/
|
||||
window.JSON || document.write('<scr' + 'ipt src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js"><\/scr' + 'ipt>');
|
||||
/*jshint ignore:end*/
|
||||
|
||||
function fetchJSONFile(path, callback) {
|
||||
var httpRequest = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
|
||||
|
@ -25,7 +28,7 @@
|
|||
var nextCurrency = keys[(i < keys.length - 1 ? i + 1 : 0)];
|
||||
var currencyValue = data[keys[i]];
|
||||
var currencyString = (currencyValue.toPrecision(3).length > currencyValue.toFixed(2) ? currencyValue.toPrecision(3) : currencyValue.toFixed(2));
|
||||
currencyListHTML += '<input type="radio" name="currency" id="dash-ticker-currencies-' + thisCurrency + '"' + (i == 0 ? ' checked' : '') + ' /><label for="dash-ticker-currencies-' + nextCurrency + '"><span class="dash-ticker--price">' + currencyString + '</span> <span class="dash-ticker--currency">' + thisCurrency.toUpperCase() + '</span></label>';
|
||||
currencyListHTML += '<input type="radio" name="currency" id="dash-ticker-currencies-' + thisCurrency + '"' + (i === 0 ? ' checked' : '') + ' /><label for="dash-ticker-currencies-' + nextCurrency + '"><span class="dash-ticker--price">' + currencyString + '</span> <span class="dash-ticker--currency">' + thisCurrency.toUpperCase() + '</span></label>';
|
||||
}
|
||||
document.getElementById('dash-ticker--price-container').innerHTML = currencyListHTML;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue