From 704ac6d18682bee1d4c4b5f10bb1b946dc373b7b Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Wed, 8 Mar 2017 18:23:42 +0100 Subject: [PATCH] jumblr placeholders to multilang --- assets/scripts/jumblr.js | 130 +++++++++++++++++++------------------- assets/scripts/lang/en.js | 34 ++++++++-- index.html | 45 ++++++++----- 3 files changed, 122 insertions(+), 87 deletions(-) diff --git a/assets/scripts/jumblr.js b/assets/scripts/jumblr.js index 01d2508..696d850 100644 --- a/assets/scripts/jumblr.js +++ b/assets/scripts/jumblr.js @@ -1,40 +1,38 @@ var Jumblr = function() { - var handleJumblr = function() { - - $( ".jumblr_show_hide_addr_btc_btn" ).click(function() { - $( "#jumblr_BTCjumblr" ).toggle(); - $( "#jumblr_BTCjumblr_showhide" ).toggle(); + $( '.jumblr_show_hide_addr_btc_btn' ).click(function() { + $( '#jumblr_BTCjumblr' ).toggle(); + $( '#jumblr_BTCjumblr_showhide' ).toggle(); }); - $( ".jumblr_show_hide_addr_kmd_btn" ).click(function() { - $( "#jumblr_KMDjumblr" ).toggle(); - $( "#jumblr_KMDjumblr_showhide" ).toggle(); + $( '.jumblr_show_hide_addr_kmd_btn' ).click(function() { + $( '#jumblr_KMDjumblr' ).toggle(); + $( '#jumblr_KMDjumblr_showhide' ).toggle(); }); if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { - //clearInterval(CheckIfIguanaRunning); - //console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.'); + // clearInterval(CheckIfIguanaRunning); + // console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.'); } else { - Jumblr_CheckIfConnected().then(function(result){ - console.log(result) + Jumblr_CheckIfConnected().then(function(result) { + console.log(result); if (result == 'connected') { Jumblr_DisplayAddresses(); Jumblr_DisplayStatus(); Jumblr_ShowHideAlert(); } - }) + }); } - $('#jumblr_actions_header').click(function(){ - Jumblr_CheckIfConnected().then(function(result){ - console.log(result) + $('#jumblr_actions_header').click(function() { + Jumblr_CheckIfConnected().then(function(result) { + console.log(result); if (result == 'connected') { Jumblr_DisplayAddresses(); Jumblr_DisplayStatus(); Jumblr_ShowHideAlert(); } - }) + }); }) }; @@ -47,44 +45,48 @@ var Jumblr = function() { }(); function Jumblr_ShowHideAlert() { - Jumblr_LookforNativeKomodo().then(function(result){ - //console.log(result) + Jumblr_LookforNativeKomodo().then(function(result) { + // console.log(result) if (result === 'isnative') { - $('#jumblr_no_native_kmd_alert').hide() + $('#jumblr_no_native_kmd_alert').hide(); } else { - $('#jumblr_no_native_kmd_alert').show() + $('#jumblr_no_native_kmd_alert').show(); } - }) + }); } function Jumblr_DisplayAddresses() { var jumblr_session_data = JSON.parse(JSON.parse(sessionStorage.getItem('IguanaActiveAccount'))); - //console.log(jumblr_session_data); - $('#jumblr_BTCdeposit').text(jumblr_session_data.BTCdeposit) - $('#jumblr_BTCjumblr').text(jumblr_session_data.BTCjumblr) - $('#jumblr_KMDdeposit').text(jumblr_session_data.KMDdeposit) - $('#jumblr_KMDjumblr').text(jumblr_session_data.KMDjumblr) + // console.log(jumblr_session_data); + $('#jumblr_BTCdeposit').text(jumblr_session_data.BTCdeposit); + $('#jumblr_BTCjumblr').text(jumblr_session_data.BTCjumblr); + $('#jumblr_KMDdeposit').text(jumblr_session_data.KMDdeposit); + $('#jumblr_KMDjumblr').text(jumblr_session_data.KMDjumblr); } function Jumblr_DisplayStatus() { - Iguana_Jumblr_Status().then(function(result){ + Iguana_Jumblr_Status().then(function(result) { //console.log(result) /*$('#jumblr_status_BTCdeposit').text(result.BTCdeposit) $('#jumblr_status_BTCjumblr').text(result.BTCjumblr) $('#jumblr_status_KMDdeposit').text(result.KMDdeposit) $('#jumblr_status_KMDjumblr').text(result.KMDjumblr)*/ if (result.result == 'success') { - $('#jumblr_status_result').addClass('label-success').removeClass('label-danger') + $('#jumblr_status_result') + .addClass('label-success') + .removeClass('label-danger'); } else { - $('#jumblr_status_result').addClass('label-danger').removeClass('label-success') + $('#jumblr_status_result') + .addClass('label-danger') + .removeClass('label-success'); } - $('#jumblr_status_result').text(result.result) - $('#jumblr_status_deposited').text(result.deposited) - $('#jumblr_status_t_to_z').text(result.t_to_z) - $('#jumblr_status_z_to_z').text(result.z_to_z) - $('#jumblr_status_z_to_t').text(result.z_to_t) - $('#jumblr_status_finished').text(result.finished) - $('#jumblr_status_pending').text(result.pending) + $('#jumblr_status_result').text(result.result); + $('#jumblr_status_deposited').text(result.deposited); + $('#jumblr_status_t_to_z').text(result.t_to_z); + $('#jumblr_status_z_to_z').text(result.z_to_z); + $('#jumblr_status_z_to_t').text(result.z_to_t); + $('#jumblr_status_finished').text(result.finished); + $('#jumblr_status_pending').text(result.pending); }) } @@ -102,49 +104,48 @@ function Jumblr_LookforNativeKomodo() { $.each(AjaxOutputData.native, function( index, value ) { //console.log(index) //console.log(value) - if (value !== 'KMD') { - console.log('Native KMD not found') - resolve('notfound'); - } else { - console.log('Native KMD found') - resolve('isnative'); - } + if (value !== 'KMD') { + console.log('Native KMD not found') + resolve('notfound'); + } else { + console.log('Native KMD found') + resolve('isnative'); + } }); } else { resolve('notnative'); } }).fail(function(xhr, textStatus, error) { - // handle request failures - console.log(xhr.statusText); - if ( xhr.readyState == 0 ) { - } - console.log(textStatus); - console.log(error); + // handle request failures + console.log(xhr.statusText); + if ( xhr.readyState == 0 ) { + } + console.log(textStatus); + console.log(error); }) }); } - function Jumblr_CheckIfConnected() { return new Promise((resolve) => { var extcoin = $('[data-extcoin]').attr('data-extcoin'), - passthru_agent = getPassthruAgent(), - tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), - ajax_data = { - 'userpass': tmpIguanaRPCAuth, - 'agent': passthru_agent, - 'method': 'passthru', - 'function': 'getinfo', - 'hex': '' - }; + passthru_agent = getPassthruAgent(), + tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), + ajax_data = { + 'userpass': tmpIguanaRPCAuth, + 'agent': passthru_agent, + 'method': 'passthru', + 'function': 'getinfo', + 'hex': '' + }; - //console.log(ajax_data); + // console.log(ajax_data); $.ajax({ type: 'POST', data: JSON.stringify(ajax_data), url: 'http://127.0.0.1:' + config.iguanaPort }).done(function(data){ - data = JSON.parse(data) + data = JSON.parse(data); if ( data.errors != undefined ) { resolve('connected'); } else if (data.errors == '' ) { @@ -154,11 +155,10 @@ function Jumblr_CheckIfConnected() { } else { resolve(data.errors); } - }) - }) + }); + }); } - jQuery(document).ready(function() { Jumblr.init(); }); \ No newline at end of file diff --git a/assets/scripts/lang/en.js b/assets/scripts/lang/en.js index d009593..89fab3f 100644 --- a/assets/scripts/lang/en.js +++ b/assets/scripts/lang/en.js @@ -9,11 +9,15 @@ const _lang = { 'SELECT_SEED_TYPE': 'Please select compatible wallet seed type', 'SELECT': '-Select-', 'FULL_MODE': 'Full mode', - 'FULL_MODE_DESC': 'Adding a coin in Full mode will download its complete blockchain to your local machine. This is the most optimum mode for performance, but will require higher system requirements to have one or multiple coins running in Full mode on your local machine.', + 'FULL_MODE_DESC': 'Adding a coin in Full mode will download its complete blockchain to your local machine. ' + + 'This is the most optimum mode for performance, but will require higher system requirements to have one or multiple coins running in Full mode on your local machine.', 'BASILISK_MODE': 'Basilisk Mode', - 'BASILISK_MODE_DESC': 'In Basilisk Mode, a coin will not download its Full blockchain to the local machine. This mode is best if you have less disk space on your machine, or your system has slower performance. It will be fully functional, but a bit slower to perform as compared to Full mode.', + 'BASILISK_MODE_DESC': 'In Basilisk Mode, a coin will not download its Full blockchain to the local machine. ' + + 'This mode is best if you have less disk space on your machine, or your system has slower performance. ' + + 'It will be fully functional, but a bit slower to perform as compared to Full mode.', 'NATIVE_MODE': 'Native Mode', - 'NATIVE_MODE_DESC1': 'This mode is ONLY available for KOMODO Coin, PAX FIAT Chains, Assetchains, and Geckochains. This mode uses the', + 'NATIVE_MODE_DESC1': 'This mode is ONLY available for KOMODO Coin, PAX FIAT Chains, Assetchains, and Geckochains. ' + + 'This mode uses the', 'NATIVE_MODE_DESC2': 'instead of the', 'NATIVE_MODE_DESC3': 'to query blockchain data', 'NATIVE_MODE_DESC4': 'is the so far mode which will allow you to do', @@ -58,8 +62,11 @@ const _lang = { 'MY': 'My', 'COPY': 'copy', 'ACTIVATING_WALLET_RT': 'Activating wallet once Real Time blocks starts syncing...', - 'IGUANA_FULL_MODE_SYNC_P1': 'An Iguana Full Mode coin synchronizes the blockchain using an entirely different format than traditional blockchain software. Iguana\'s Full Mode uses Memory Mapped Files and stores data in bundles. That\'s why you see four different colored synchronizing progress bars.', - 'IGUANA_FULL_MODE_SYNC_P2': 'Once all these progress bars reach 100%, the Real Time blocks start synchronizing. Only after the Real Time sync mode activates will you be able to see current data in your wallet and make any transactions.', + 'IGUANA_FULL_MODE_SYNC_P1': 'An Iguana Full Mode coin synchronizes the blockchain using an entirely different format than traditional blockchain software. ' + + 'Iguana\'s Full Mode uses Memory Mapped Files and stores data in bundles. ' + + 'That\'s why you see four different colored synchronizing progress bars.', + 'IGUANA_FULL_MODE_SYNC_P2': 'Once all these progress bars reach 100%, the Real Time blocks start synchronizing. ' + + 'Only after the Real Time sync mode activates will you be able to see current data in your wallet and make any transactions.', 'IGUANA_FULL_MODE_SYNC_P3': 'Please wait for all other progress bars to disappear and the first blue bar turns to green.
' + 'That would mean the wallet is in Real Time Sync mode.', 'FETCHING_COIN_DATA': 'Fetching coin data from network. Please wait...', @@ -74,6 +81,7 @@ const _lang = { 'GET_NOTARY_NODES_LIST': 'Get Notary Nodes List', 'REFRESH_BASILISK_CONNECTIONS': 'Refresh Basilisk Connections', 'FETCH_WALLET_DATA': 'Fetch Wallet Data', + 'REFETCH_WALLET_DATA': 'Clear cache and fetch Wallet Data', 'TRANSACTION_HISTORY': 'Transactions History', 'DIRECTION': 'Direction', 'CONFIRMATIONS': 'Confirmations', @@ -156,14 +164,26 @@ const _lang = { 'IMPORT_KEYS': 'Import Keys', 'IMPORT_KEYS_DESC_P1': 'This section allows you to import private key of all iguana supported coins, Assetchain, Geckochain, or PAXchain by the wallet.', 'IMPORT_KEYS_DESC_P2': 'It is not mandatory to have that coin active in the wallet for which you are executing import private key process.', - 'IMPORT_KEYS_DESC_P3': 'You\'ll also notice the private key you imported for one coin or chain will also be showing a new address in all other coin wallets\' receiving address section. It is normal.', + 'IMPORT_KEYS_DESC_P3': 'You\'ll also notice the private key you imported for one coin or chain will also be showing a new address in all other coin wallets\' receiving address section. ' + + 'It is normal.', 'INPUT_PRIV_KEY': 'Input Private Key', 'IMPORT_PRIV_KEY': 'Import Private Key', 'DEBUG_LOG': 'Debug Log', 'DEBUG_LOG_DESC': 'This section allows you to read last N lines from debug log file.', 'DEBUG_LOG_LINES': 'Input number of lines to read', 'TARGET': 'Target', - 'LOAD_DEBUG_LOG': 'Load debug log' + 'LOAD_DEBUG_LOG': 'Load debug log', + 'REFRESH_FUNDS': 'Refresh Funds' + }, + 'JUMBLR': { + 'NOTICE': 'EXPERIMENTAL TEST VERSION ONLY', + 'DESCRIPTION': 'Jumblr feature is very experimental and for now, is Only enabled for testing and debugging.' + + 'Please use the current version of Jumblr only with small amounts if you are participating in testing this feature.', + 'NEED_NATIVE': 'Need Native Mode Komodo', + 'TO_USE_JUMBLR': 'To use Jumblr feature, you need to activate Komodo in Native Mode.', + 'IF_YOU_ALREADY_RUNNING': 'If you are already running Komodo in either Basilisk Mode or Full Mode, close the wallet and restart again to start Komodo In Native Mode.', + 'THIS_SCREEN_DOESNT_REFRESH': 'This screen does not auto refresh. ' + + 'You will need to hit the Refresh button on the top right corner of the screen to get latest Jumblr data.' }, 'DASHBOARD': { 'SELECT_ADDRESS': '- Select Address -', diff --git a/index.html b/index.html index 2b63e4e..d6c8718 100755 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@ if (typeof module === 'object') { window.module = module; module = undefined; - } + } @@ -977,6 +977,11 @@ +
  • + + + +
  • @@ -1058,7 +1063,7 @@
    @@ -1109,24 +1114,34 @@
    -

    This screen does not auto refresh. You will need to hit the Refresh button on the top right corner of the screen to get latest Jumblr data.

    +