Compare commits
2 Commits
c1b05851a4
...
8cd9a2ddeb
Author | SHA1 | Date | |
---|---|---|---|
8cd9a2ddeb | |||
702ca8c4d3 |
740
package-lock.json
generated
740
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,7 @@
|
|||||||
"webpack-cli": "^4.7.2"
|
"webpack-cli": "^4.7.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cash-dom": "^8.1.5",
|
"chart.js": "^4.4.0",
|
||||||
"chart.js": "^4.3.0",
|
|
||||||
"chartjs-adapter-dayjs-3": "^1.2.3",
|
"chartjs-adapter-dayjs-3": "^1.2.3",
|
||||||
"css-minimizer-webpack-plugin": "^5.0.0",
|
"css-minimizer-webpack-plugin": "^5.0.0",
|
||||||
"dayjs": "^1.11.7"
|
"dayjs": "^1.11.7"
|
||||||
|
31
src/index.js
31
src/index.js
@ -9,7 +9,6 @@ import {
|
|||||||
Title,
|
Title,
|
||||||
Tooltip
|
Tooltip
|
||||||
} from 'chart.js';
|
} from 'chart.js';
|
||||||
import $ from 'cash-dom';
|
|
||||||
import 'chartjs-adapter-dayjs-3';
|
import 'chartjs-adapter-dayjs-3';
|
||||||
import "./style.css"
|
import "./style.css"
|
||||||
|
|
||||||
@ -195,7 +194,7 @@ async function pullChartData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatToken() {
|
function formatToken() {
|
||||||
$("#token").html(currentPriceHash[currentRegionSelection].toLocaleString());
|
document.getElementById("token").innerText = currentPriceHash[currentRegionSelection].toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: These maybe able to be collapsed into a single function with params or a lambda
|
// TODO: These maybe able to be collapsed into a single function with params or a lambda
|
||||||
@ -293,7 +292,21 @@ function toolTipMouseOut() {
|
|||||||
tooltip.innerHTML = "Copy to clipboard";
|
tooltip.innerHTML = "Copy to clipboard";
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
function registerEventHandles() {
|
||||||
|
registerCopyHandlers();
|
||||||
|
registerOptionHandlers();
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerCopyHandlers() {
|
||||||
|
document.getElementById('copyURLButton').addEventListener('click', function (event) {
|
||||||
|
copyURL();
|
||||||
|
})
|
||||||
|
document.getElementById('copyURLButton').addEventListener('mouseout', function (event) {
|
||||||
|
toolTipMouseOut();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerOptionHandlers() {
|
||||||
document.getElementById('region').addEventListener('change', function() {
|
document.getElementById('region').addEventListener('change', function() {
|
||||||
updateRegionPreference(this.value);
|
updateRegionPreference(this.value);
|
||||||
});
|
});
|
||||||
@ -305,15 +318,13 @@ $(document).ready(function() {
|
|||||||
document.getElementById('aggregate').addEventListener('change', function () {
|
document.getElementById('aggregate').addEventListener('change', function () {
|
||||||
updateAggregatePreference(this.value);
|
updateAggregatePreference(this.value);
|
||||||
})
|
})
|
||||||
document.getElementById('copyURLButton').addEventListener('click', function (event) {
|
|
||||||
copyURL();
|
|
||||||
})
|
|
||||||
document.getElementById('copyURLButton').addEventListener('mouseout', function (event) {
|
|
||||||
toolTipMouseOut();
|
|
||||||
})
|
|
||||||
currentAggregateSelection = document.getElementById('aggregate').value;
|
currentAggregateSelection = document.getElementById('aggregate').value;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
registerEventHandles();
|
||||||
detectURLQuery();
|
detectURLQuery();
|
||||||
Promise.all([callUpdateURL(), pullChartData()]).then(populateChart)
|
Promise.all([callUpdateURL(), pullChartData()]).then(populateChart)
|
||||||
setInterval(callUpdateURL, 60*1000);
|
setInterval(callUpdateURL, 60*1000);
|
||||||
});
|
}, false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user