SteemMe V0.0.5 (Commit)
What feature(s) did you add?
SteemMe V0.0.5 brings a new big update and code refactoring with it. First of all does SteemMe now fully uses jQuery for DOM manipulation. The new big update SteemMe brings with it, is the display of STEEM / SBD Prices according to your selected currency in the options page. The prices are always displayed at the bottom of the extension.
You can change the currency in the extension option panel (Chrome Settings -> More Tools -> Extensions -> Extension Options).
Current available currencies are:
- EUR
- USD
- AUD
- CAD
- GBP
If you are missing one, please comment !
How did you implement them?
Layout is all done with bootstrap. To get the latest price feed the CoinMarketCap's API is used. For that the Utils.js file got 2 new methods added:
function getSteemPrice(coinName, currency) {
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://api.coinmarketcap.com/v1/ticker/"+ coinName +"/?convert="+ currency, false);
xhr.send();
var result = JSON.parse(xhr.responseText);
return result[0]["price_" + currency];
}
function getCurrencySymbol(currency) {
switch (currency) {
case 'eur':
return '\u20AC';
case 'cad':
return 'CAD';
case 'gbp':
return '£';
case 'aud':
return 'AUD';
default:
return '$'
}
}
To save the selected currency the options.js got a new method which is automatically called when the selected value changes:
function selectCurrency() {
const currency = selectCur.val();
chrome.storage.sync.set({
currency: currency,
}, function() {
var status = document.getElementById('status');
status.textContent = 'Options saved.';
setTimeout(function() {
status.textContent = '';
}, 750);
});
}
Roadmap
- V.0.0.5:
- SBD / STEEM Price
- Next: V.0.0.6:
- Wallet Details page
- V.0.1:
- UI
- More...
Contribute
Feel free to contribute by forking the GitHub Repo and creating Pull Requests. You can check the Roadmaps to find ideas, or you can implement your own stuff.
How to install it?
Please visit the Google Chrome Webstore and download the extension!
Go to your Extensions Tab and click options to set your Steemit Username
Proof for GitHub
benediktveith is my main GitHub account.
Check here for another proof
Posted on Utopian.io - Rewarding Open Source Contributors