From a918791bb04a9f2033c95e65b1096952e2c4ac9c Mon Sep 17 00:00:00 2001 From: pbca26 Date: Mon, 13 Mar 2017 21:43:37 +0300 Subject: [PATCH] reduced sidebar assets gfx code --- assets/scripts/sidebar.js | 206 ++++++++++---------------------------- 1 file changed, 55 insertions(+), 151 deletions(-) diff --git a/assets/scripts/sidebar.js b/assets/scripts/sidebar.js index b6282f7..43eff82 100644 --- a/assets/scripts/sidebar.js +++ b/assets/scripts/sidebar.js @@ -209,10 +209,7 @@ $('#nav-komodo-wallet').on('click', function() { $('#nav-zcash-wallet').on('click', function() { NProgress.done(true); NProgress.configure({ - template: '
' + - '
' + - '
' + - '
' + template: templates.nprogressBar }); NProgress.start(); $( @@ -433,249 +430,156 @@ function assetchain_pax_menu_actions(coin) { CommonSidebarActionsSet02(); removeDashboardStyle(); + function renderAssetGFX(imgSrcName, imgBgName, _coin) { + $('.header-easydex-section') + .html(' ' + _coin + ''); + $('#easydex-header-div').css('background-image', 'url("assets/images/bg/' + imgBgName + '_transparent_header_bg.png")'); + } + switch (coin) { case 'SUPERNET': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'REVS': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); - $('#easydex-header-div').css(); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'WIRELESS': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/wireless_transparent_header_bg.png")'); + renderAssetGFX('wireless', 'wireless', coin); break; case 'PANGEA': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'DEX': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'JUMBLR': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); - $('#easydex-header-div').css(); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'BET': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/wireless_transparent_header_bg.png")'); + renderAssetGFX('wireless', 'wireless', coin); break; case 'CRYPTO': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'HODL': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); - $('#easydex-header-div').css(); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'SHARK': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/wireless_transparent_header_bg.png")'); + renderAssetGFX('wireless', 'wireless', coin); break; case 'BOTS': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'MGW': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); - $('#easydex-header-div').css(); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'MVP': - $('.header-easydex-section').html(''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/mvp_transparent_header_bg.png")'); + renderAssetGFX('mpv', 'mpv', coin); break; case 'KV': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jumblr_transparent_header_bg.png")'); + renderAssetGFX('supernet', 'jumblr', coin); break; case 'CEAL': - $('.header-easydex-section') - .html(' ' + coin + ''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/ceal_transparent_header_bg.png")'); - $('#easydex-header-div').css(); + renderAssetGFX('ceal', 'ceal', coin); break; case 'MESH': - $('.header-easydex-section').html(''); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/mesh_transparent_header_bg.png")'); + renderAssetGFX('mesh', 'mesh', coin); break; case 'USD': - $('.header-easydex-section') - .html(' US Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/usd_transparent_header_bg.png")'); + renderAssetGFX('usd', 'usd', 'US Dollar'); break; case 'RON': - $('.header-easydex-section') - .html(' Romanian Leu'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/ron_transparent_header_bg.png")'); + renderAssetGFX('ron', 'ron', 'Romanian Leu'); break; case 'EUR': - $('.header-easydex-section') - .html(' Euro'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/eur_transparent_header_bg.png")'); + renderAssetGFX('eur', 'eur', 'Euro'); break; case 'JPY': - $('.header-easydex-section') - .html(' Japanese Yen'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/jpy_transparent_header_bg.png")'); + renderAssetGFX('jpy', 'jpy', 'Japanese Yen'); break; case 'GBP': - $('.header-easydex-section') - .html(' British Pound'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/gbp_transparent_header_bg.png")'); + renderAssetGFX('gbp', 'gbp', 'British Pound'); break; case 'AUD': - $('.header-easydex-section') - .html(' Australian Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/aud_transparent_header_bg.png")'); + renderAssetGFX('aud', 'aud', 'Australian Dollar'); break; case 'CAD': - $('.header-easydex-section') - .html(' Canadian Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/cad_transparent_header_bg.png")'); + renderAssetGFX('cad', 'cad', 'Canadian Dollar'); break; case 'CHF': - $('.header-easydex-section') - .html(' Swiss Franc'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/chf_transparent_header_bg.png")'); + renderAssetGFX('chf', 'chf', 'Swiss Franc'); break; case 'NZD': - $('.header-easydex-section') - .html(' New Zealand Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/nzd_transparent_header_bg.png")'); + renderAssetGFX('nzd', 'nzd', 'New Zealand Dollar'); break; case 'CNY': - $('.header-easydex-section') - .html(' Chinese Yuan'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/cny_transparent_header_bg.png")'); + renderAssetGFX('cny', 'cny', 'Chinese Yuan'); break; case 'RUB': - $('.header-easydex-section') - .html(' Russian Ruble'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/rub_transparent_header_bg.png")'); + renderAssetGFX('rub', 'rub', 'Russian Ruble'); break; case 'MXN': - $('.header-easydex-section') - .html(' Mexican peso'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/mxn_transparent_header_bg.png")'); + renderAssetGFX('mxn', 'mxn', 'Mexican Peso'); break; case 'BRL': - $('.header-easydex-section') - .html(' Brazilian Real'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/brl_transparent_header_bg.png")'); + renderAssetGFX('brl', 'brl', 'Brazilian Real'); break; case 'INR': - $('.header-easydex-section') - .html(' Indian Rupee'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/inr_transparent_header_bg.png")'); + renderAssetGFX('inr', 'inr', 'Indian Rupee'); break; case 'HKD': - $('.header-easydex-section') - .html(' Hong Kong Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/hkd_transparent_header_bg.png")'); + renderAssetGFX('hkd', 'hkd', 'Hong Kong Dollar'); break; case 'TRY': - $('.header-easydex-section') - .html(' Turkish Lira'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/try_transparent_header_bg.png")'); + renderAssetGFX('try', 'try', 'Turkish Lira'); break; case 'ZAR': - $('.header-easydex-section') - .html(' South African Rand'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/zar_transparent_header_bg.png")'); + renderAssetGFX('zar', 'zar', 'South African Rand'); break; case 'PLN': - $('.header-easydex-section') - .html(' Polish Zloty'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/pln_transparent_header_bg.png")'); + renderAssetGFX('pln', 'pln', 'Polish Zloty'); break; case 'NOK': - $('.header-easydex-section') - .html(' Norwegian Krone'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/nok_transparent_header_bg.png")'); + renderAssetGFX('nok', 'nok', 'Norwegian Krone'); break; case 'SEK': - $('.header-easydex-section') - .html(' Swedish Krona'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/sek_transparent_header_bg.png")'); + renderAssetGFX('sek', 'sek', 'Swedish Krona'); break; case 'DKK': - $('.header-easydex-section') - .html(' Danish Krone'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/dkk_transparent_header_bg.png")'); + renderAssetGFX('dkk', 'dkk', 'Danish Krone'); break; case 'CZK': - $('.header-easydex-section') - .html(' Czech Koruna'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/czk_transparent_header_bg.png")'); + renderAssetGFX('czk', 'czk', 'Czech Koruna'); break; case 'HUF': - $('.header-easydex-section') - .html(' Hungarian Forint'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/huf_transparent_header_bg.png")'); + renderAssetGFX('huf', 'huf', 'Hungarian Forint'); break; case 'ILS': - $('.header-easydex-section') - .html(' Israeli Shekel'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/ils_transparent_header_bg.png")'); + renderAssetGFX('ils', 'ils', 'Israeli Shekel'); break; case 'KRW': - $('.header-easydex-section') - .html(' Korean Won'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/krw_transparent_header_bg.png")'); + renderAssetGFX('krw', 'krw', 'Korean Won'); break; case 'MYR': - $('.header-easydex-section') - .html(' Malaysian Ringgit'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/myr_transparent_header_bg.png")'); + renderAssetGFX('myr', 'myr', 'Malaysian Ringgit'); break; case 'PHP': - $('.header-easydex-section') - .html(' Philippine Peso'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/php_transparent_header_bg.png")'); + renderAssetGFX('php', 'php', 'Philippine Peso'); break; case 'SGD': - $('.header-easydex-section') - .html(' Singapore Dollar'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/sgd_transparent_header_bg.png")'); + renderAssetGFX('sgd', 'sgd', 'Philippine Peso'); break; case 'THB': - $('.header-easydex-section') - .html(' Thai Baht'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/thb_transparent_header_bg.png")'); + renderAssetGFX('thb', 'thb', 'Thai Baht'); break; case 'BGN': - $('.header-easydex-section') - .html(' Bulgarian Lev'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/bgn_transparent_header_bg.png")'); + renderAssetGFX('bgn', 'bgn', 'Bulgarian Lev'); break; case 'IDR': - $('.header-easydex-section') - .html(' Indonesian Rupiah'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/idr_transparent_header_bg.png")'); + renderAssetGFX('idr', 'idr', 'Indonesian Rupiah'); break; case 'HRK': - $('.header-easydex-section') - .html(' Croatian Kuna'); - $('#easydex-header-div').css('background-image', 'url("assets/images/bg/hrk_transparent_header_bg.png")'); + renderAssetGFX('hrk', 'hrk', 'Croatian Kuna'); break; default: $('.header-easydex-section').html('' + coin + '');