From c3641eddf8e6e1f70ea50ff6bdf53b06b430e887 Mon Sep 17 00:00:00 2001 From: Cody Neiman Date: Thu, 4 Jan 2018 22:39:55 -0500 Subject: [PATCH] More descriptive comments and readme --- README.md | 6 ++++++ content.js | 18 +++++++++++------- popup.js | 13 ++++++++++--- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1217dc5..2491624 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,15 @@ This adds the value of each wallet in Binance (under deposits and withdraws) aft Please use the [issues tracker on this github repository](https://github.com/Matrix-Guy/binance-valuations/issues)! +## Current Features +WIP + ## Upcoming Features * Only request values above 0 * Dropdown for links to different resources when hovering over value +* Removal of nasty global variables +* Migration to ES6+ features +* More customization options of formatting and features in the GUI ## Prerequisites diff --git a/content.js b/content.js index 6115fc5..a1f4dab 100644 --- a/content.js +++ b/content.js @@ -1,4 +1,5 @@ /*jshint esversion: 6 */ + // Asynchronous HTTP Requestor var HttpClient = function() { this.get = function(aUrl, aCallback) { @@ -13,6 +14,7 @@ var HttpClient = function() { }; }; +// Key of currencies function getCurrency(currency) { const symbols = { USD: '$', @@ -31,10 +33,14 @@ return symbols[currency]; var names = document.getElementsByClassName('coin ng-binding'); var amounts = document.getElementsByClassName('total f-right ng-binding'); var btcs = document.getElementsByClassName('equalValue f-right ng-binding'); + +// Global variables var namesIndex = []; var index; var currency = 'USD'; -var prefix = `
`; @@ -42,7 +48,7 @@ var suffix2 = ``; // Test if prices have already been added if (amounts[1].innerHTML.includes('