Browse Source

blocks by longest chain blocks number fix & chrome app files added

chrome app files are good enough for basic setup.
JS and html code still needs fixing to support chrome app. It’s buggy
to this commit height.
master
Satinder Grewal 8 years ago
parent
commit
b6e7699f4d
  1. 8
      assets/scripts/dashboard.js
  2. 4
      assets/scripts/login.js
  3. 11
      background.js
  4. BIN
      icon_128.png
  5. 19
      manifest.json

8
assets/scripts/dashboard.js

@ -604,18 +604,22 @@ function ShowCoinProgressBar(coin) {
//console.log(coin+' is undefined');
} else {
if ( parseInt(CoinInfoData.RTheight) != 0 ) {
var coin_blocks = parseInt(CoinInfoData.blocks);
var coin_blocks_plus1 = coin_blocks + 1;
//console.log(coin+' is less than 99.98% complete.');
$('div[data-currency="'+coin+'"][id="currency-progressbars"]').show();
$('div[data-currency="'+coin+'"][id="currency-bundles"]').width(parseFloat(CoinInfoData.bundles).toFixed(2)+'%');
$('span[data-currency="'+coin+'"][id="currency-bundles-percent"]').text(parseFloat(CoinInfoData.bundles).toFixed(2)+'% - ( '+parseInt(CoinInfoData.blocks)+1+' / '+CoinInfoData.longestchain+' ) ==>> RT'+CoinInfoData.RTheight);
$('span[data-currency="'+coin+'"][id="currency-bundles-percent"]').text(parseFloat(CoinInfoData.bundles).toFixed(2)+'% - ( '+coin_blocks_plus1+' / '+CoinInfoData.longestchain+' ) ==>> RT'+CoinInfoData.RTheight);
$('div[data-currency="'+coin+'"][id="additional-progress-bars"]').hide();
$('div[data-currency="'+coin+'"][id="currency-bundles"]').removeClass( "progress-bar-info" ).addClass( "progress-bar-indicating progress-bar-success" );
}
if ( parseInt(CoinInfoData.RTheight) == 0 ) {
console.log(coin+': '+CoinInfoData.bundles);
var coin_blocks = parseInt(CoinInfoData.blocks);
var coin_blocks_plus1 = coin_blocks + 1;
$('div[data-currency="'+coin+'"][id="currency-progressbars"]').show();
$('div[data-currency="'+coin+'"][id="currency-bundles"]').width(parseFloat(CoinInfoData.bundles).toFixed(2)+'%');
$('span[data-currency="'+coin+'"][id="currency-bundles-percent"]').text(parseFloat(CoinInfoData.bundles).toFixed(2)+'% - ( '+parseInt(CoinInfoData.blocks)+1+' / '+CoinInfoData.longestchain+' )');
$('span[data-currency="'+coin+'"][id="currency-bundles-percent"]').text(parseFloat(CoinInfoData.bundles).toFixed(2)+'% - ( '+coin_blocks_plus1+' / '+CoinInfoData.longestchain+' )');
$('div[data-currency="'+coin+'"][id="currency-utxo"]').width(parseFloat(CoinInfoData.utxo).toFixed(2)+'%');
$('span[data-currency="'+coin+'"][id="currency-utxo-percent"]').text(parseFloat(CoinInfoData.utxo).toFixed(2)+'%');
$('div[data-currency="'+coin+'"][id="currency-balances"]').width(parseFloat(CoinInfoData.balances).toFixed(2)+'%');

4
assets/scripts/login.js

@ -88,7 +88,7 @@ var Login = function() {
else {
// If something goes wrong, alert the error message that our service returned
//swal("Oops...", "Something went wrong!", "error");
if (LoginOutput.error === 'bitcoinrpc needs coin') {
if (LoginOutput.error === 'bitcoinrpc needs coin that is active') {
toastr.info("Seems like there's no coin running. Activating BTC.", "Coin Notification");
var logincoinnames = []; $('#logincoinslist input[type=checkbox]:checked').each(function() { logincoinnames.push(this.value); }); console.log(logincoinnames);
$.each(logincoinnames, function( index, value ) {
@ -260,7 +260,7 @@ var Login = function() {
//swal("Oops...", "Something went wrong!", "error");
toastr.warning("Opps... Something went wrong!", "Account Notification")
console.log(CreateWalletOutput)
if (CreateWalletOutput.error === 'bitcoinrpc needs coin') {
if (CreateWalletOutput.error === 'bitcoinrpc needs coin that is active') {
toastr.info("Seems like there's no coin running. Activating BTC.", "Coin Notification");
var logincoinnames = []; $('#logincoinslist input[type=checkbox]:checked').each(function() { logincoinnames.push(this.value); }); console.log(logincoinnames);
$.each(logincoinnames, function( index, value ) {

11
background.js

@ -0,0 +1,11 @@
/**
* Listens for the app launching then creates the window
*
* @see http://developer.chrome.com/apps/app.window.html
*/
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
id: 'main',
bounds: { width: 1200, height: 800 }
});
});

BIN
icon_128.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

19
manifest.json

@ -0,0 +1,19 @@
{
"name": "EasyDEX App",
"short_name": "EasyDEX",
"description": "EasyDEX - Decentralized Crypto Currency Exchange App",
"version": "0.0.2",
"manifest_version": 2,
"icons": {
"128": "icon_128.png"
},
"author": "jl777, Satinder Grewal",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"permissions": [
"storage"
]
}
Loading…
Cancel
Save