diff --git a/index.html b/index.html
index 3e4a477..07cf6fd 100644
--- a/index.html
+++ b/index.html
@@ -69,6 +69,14 @@
Choose Your Base Currency
+
+
+
+
+
Tip Jar
- BTC: 17iENfaJkEpxGXW7mgdFh9hGMZV65R2zVL
diff --git a/js/app_common.js b/js/app_common.js
index 3efbc7c..190a192 100644
--- a/js/app_common.js
+++ b/js/app_common.js
@@ -52,6 +52,7 @@ var url =
base +
"&extraParams=crypto-price-widget";
var pinCheck = document.getElementById("pin-to-top");
+var alwaysShowUsd = document.getElementById("always-show-usd");
function clearData() {
ul.innerHTML = "";
@@ -134,6 +135,13 @@ function initData() {
remote.getCurrentWindow().setAlwaysOnTop(false);
}
+ //Always show USD - settings check - immediately set checkbox and window to saved state
+ if (settings.get("user.alwaysShowUsd") == "yes") {
+ alwaysShowUsd.checked = true;
+ } else {
+ alwaysShowUsd.checked = false;
+ }
+
sortChildren(document.getElementById("prices"), function (li) {
return +li.getAttribute("sortorder");
});
@@ -167,7 +175,8 @@ function updateData() {
settings.get("user.coins") +
"&tsyms=" +
base +
- "&extraParams=crypto-price-widget";
+ ",USD&extraParams=crypto-price-widget";
+
/*
** What data needs to be grabbed/changed?
** Base currency
@@ -194,7 +203,11 @@ function updateData() {
let coinSymbol = coinRAW[base].FROMSYMBOL;
let coinRate = coinDISPLAY[base].PRICE.replace(/ /g, ""); //.replace(/ /g,'') removes space after $
-
+
+ if (base != "USD" && settings.get("user.alwaysShowUsd") == "yes") { // display also prices in USD
+ coinRate = coinRate + " ($" + coinRAW["USD"].PRICE.toFixed(4) + ")"
+ }
+
//replace currencies that have no symbols with easier to read formats
if (coinRate.includes("AUD")) {
coinRate = coinRate.replace("AUD", "A$");
@@ -474,6 +487,18 @@ pinCheck.onclick = function (event) {
}
};
+/***********
+ * ALWAYS SHOW USD
+ *************/
+alwaysShowUsd.onclick = function (event) {
+ var checkbox = event.target;
+ if (checkbox.checked) {
+ settings.set("user.alwaysShowUsd", "yes")
+ } else {
+ settings.set("user.alwaysShowUsd", "no")
+ }
+}
+
/*******
* APP UI
********/