Assets & Markets

latviešu valoda
Ελληνικά
Русский
Українська
български
العربية
ภาษาไทย
বাংলা
한국어
日本語
简体中文
繁體中文 (台灣)
`; var frag = document.createRange().createContextualFragment('
' + htmlcode + '
'); let wrapper = document.createElement('div'); wrapper.appendChild(frag); const el = wrapper.firstChild; const swaltext = "Select Language and Region"; setTimeout(function() { $('.setregionbtn').off('click'); $('.setregionbtn').on('click', function() { $('.setregionbtn').removeClass('active'); $(this).addClass('active'); window.location = location.protocol + '//' + location.host + location.pathname + "?lang=" + $(this).data('lang'); }); },100); swal({ text: " ", content: el, className: "quick-settings-modal", buttons: { }, }); $(".swal-modal .swal-text").html(` `); $("#settingslanguage").off('click'); $("#settingslanguage").on('click', function() { $(".poptabs-link").removeClass('active'); $(this).addClass('active'); var htmlcode = `
Choose a language:
English
Bahasa Indonesia
Deutsch
Español
Français
Filipino
Italiano
Polski
Português (BR)
Português (PT)
Română
Svenska
Slovenčina
Slovenščina
Tiếng Việt
latviešu valoda
Ελληνικά
Русский
Українська
български
العربية
ภาษาไทย
বাংলা
한국어
日本語
简体中文
繁體中文 (台灣)
`; $("#settingscontent").html(htmlcode); $('.setregionbtn').off('click'); $('.setregionbtn').on('click', function() { $('.setregionbtn').removeClass('active'); $(this).addClass('active'); window.location = location.protocol + '//' + location.host + location.pathname + "?lang=" + $(this).data('lang'); }); }); $("#settingscurrency").off('click'); $("#settingscurrency").on('click', function() { $(".poptabs-link").removeClass('active'); $(this).addClass('active'); let selectHTML = `
Select Currency:
`; $("#settingscontent").html(selectHTML); $('#currencySelector').selectize({ preload: true, valueField: "currencyCode", labelField: "currencyCode", /*sortField: 'currencyCode',*/ searchField: ['currencyCode', 'currencyName'], load: function (query, callback) { this.settings.load = null; $.ajax({ url: '/api/v2/currency/simplelist2', type: 'GET', dataType: 'json', success: function (response) { callback(response); const currencySelector = $('#currencySelector')[0]; if (currencySelector) { currencySelector.selectize.setValue(currentCurrency.toUpperCase()); } } }); }, render: { item: function (item, escape) { return `
  ` + item.currencyCode + `   ` + item.currencyName + `   ` + item.currencySymbol + `
`; }, option: function (item, escape) { return `
  ` + item.currencyCode + `   ` + item.currencyName + `   ` + item.currencySymbol + `
`; }, }, onFocus: function() { // this.clear(true); }, onBlur: function() { // this.setValue(currentCurrency.toUpperCase(), false); }, onItemAdd: (value, item) => { if (value.toLowerCase() != currentCurrency) { $('.setcurrencybtn').removeClass('active'); $(this).addClass('active'); localStorage.setItem('currency', value.toLowerCase()); setTimeout(() => { window.location = location.protocol + '//' + location.host + location.pathname; }, 200); } } }); setTimeout(() => { $('.setcurrencybtn').off('click'); $('.setcurrencybtn').on('click', function() { $('.setcurrencybtn').removeClass('active'); $(this).addClass('active'); localStorage.setItem('currency', $(this).data('currency')); window.location = location.protocol + '//' + location.host + location.pathname; }); }, 100); }); $("#settingstime").off('click'); $("#settingstime").on('click', function() { $(".poptabs-link").removeClass('active'); $(this).addClass('active'); var htmlcode = `
Select Timezone:
Select Time Format:
Choose a color theme:
Rise
Fall
Rise
Fall
Rise
Fall
`; $("#settingscontent").html(htmlcode); $('.color-preferences').on('click', function () { $('.color-preferences').removeClass('active'); $(this).addClass('active'); const riseColor = $(this).data('rise'); const fallColor = $(this).data('fall'); window.riseColor = riseColor; window.fallColor = fallColor; localStorage.setItem('colorPreferences', JSON.stringify({ rise: riseColor, fall: fallColor })); window.location = location.protocol + '//' + location.host + location.pathname; }) let savedColorPreferences = JSON.parse(localStorage.getItem('colorPreferences')); if (savedColorPreferences) { $('.color-preferences').each(function () { const riseColor = $(this).data('rise'); const fallColor = $(this).data('fall'); if (riseColor === savedColorPreferences.rise && fallColor === savedColorPreferences.fall) { $(this).addClass('active'); } }); } var selectizeControl = $('#timezoneSelector').selectize({ preload: true, valueField: "id", labelField: "label", searchField: ['id', 'label'], options: timezonesArray, render: { item: function (item, escape) { return `
` + escape(item.label) + `
`; }, option: function (item, escape) { return `
` + escape(item.label) + `
`; }, }, onLoad: function() { this.setValue({id: timezone}); }, onFocus: function() { // this.clear(true); }, onItemAdd: (value, item) => { if (value !== timezone) { localStorage.setItem('timezone', value); window.location = location.protocol + '//' + location.host + location.pathname; } } })[0].selectize; var selectizeControlFormat = $('#timeformatSelector').selectize({ preload: true, valueField: "id", labelField: "id", searchField: ['id'], options: [{id: "12h"}, {id: "24h"}], render: { item: function (item, escape) { return `
` + escape(item.id) + `
`; }, option: function (item, escape) { return `
` + escape(item.id) + `
`; }, }, onLoad: function() { this.setValue({id: timeformat}); }, onFocus: function() { // this.clear(true); }, onItemAdd: (value, item) => { if (value !== timeformat) { localStorage.setItem('timeformat', value); window.location = location.protocol + '//' + location.host + location.pathname; } } })[0].selectize; if (timezone) { selectizeControl.setValue(timezone); } if (timeformat) { selectizeControlFormat.setValue(timeformat); } }); }); var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="tooltip"]')) var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl) }) io.socket.get('/api/v2/getservertime', function gotResponse(data, jwRes) { if (jwRes.statusCode == 200) { if (data.timestamp_unix) { currentServerTime = data.timestamp_unix; let selectedTimezone = timezonesArray.find((item) => item.id === timezone)?.label?.replace(`(`, ``)?.replace(`)`, ``); if (selectedTimezone !== "UTC") { selectedTimezone = selectedTimezone.split(" ")[0]; } $('.currentServerTime').html(`${formatTime(currentServerTime * 1000)} ${selectedTimezone}`); } if (data.revision) { currentRevision = data.revision; } if (data.users_online) { $('.currentUsersOnline').html(data.users_online); } if (data.exchange_volume) { new Promise((resolve, reject) => { if (currency) { resolve(); } if (currentCurrency !== 'usd') { io.socket.get( `/api/v2/currency/simplelist2?currencyCode=${currentCurrency}`, function gotResponse(data, jwRes) { if (data && jwRes.statusCode == 200 && data.length) { currency = data[0]; } else { currency = { currencyCode: "usd", currencySymbol: "$", rateUsd: 1, }; } resolve(); } ); } else { currency = { currencyCode: "usd", currencySymbol: "$", rateUsd: 1, }; resolve(); } }).then(() => { const formattedVolume = formatCurrency(data.exchange_volume, false); $('.exchangeVolume').html(`${currency ? currency.currencySymbol : '$'}${parseInt(formattedVolume).toLocaleString()}`); }); } } }); io.socket.on('getservertime', function gotResponse(data) { if (data.timestamp_unix) { currentServerTime = data.timestamp_unix; } let roundTripTime = 0; //Date.now() - data.unix_microsec; if (roundTripTime < 300) { $('.connectionStatus').html(` Stable Connection`); } else if (roundTripTime < 600) { $('.connectionStatus').html(` Stable Connection`); } else if (roundTripTime < 900) { $('.connectionStatus').html(` Slow Connection`); } else if (roundTripTime >= 900) { $('.connectionStatus').html(` Unstable Connection`); } if (data.users_online) { $('.currentUsersOnline').html(data.users_online); } if (data.exchange_volume) { new Promise((resolve, reject) => { if (currency) { resolve(); } if (currentCurrency !== 'usd') { io.socket.get( `/api/v2/currency/simplelist2?currencyCode=${currentCurrency}`, function gotResponse(data, jwRes) { if (data && jwRes.statusCode == 200 && data.length) { currency = data[0]; } else { currency = { currencyCode: "usd", currencySymbol: "$", rateUsd: 1, }; } resolve(); } ); } else { currency = { currencyCode: "usd", currencySymbol: "$", rateUsd: 1, }; resolve(); } }).then(() => { const formattedVolume = formatCurrency(data.exchange_volume, false); $('.exchangeVolume').html(`${currency ? currency.currencySymbol : '$'}${parseInt(formattedVolume).toLocaleString()}`); }); } // check revision let isIgnore = localStorage.getItem('ignore.jsrevision.' + data.revision); //console.log('data.revision: ' + data.revision); //console.log('window.jsrevision: ' + window.jsrevision); if (data.revision != window.jsrevision && isIgnore != 'true') { // just try it once... localStorage.setItem('ignore.jsrevision.' + data.revision, 'true'); handleHardReload(window.location.href); } }); // This seems to work on chrome well async function handleHardReload(url) { console.log('Files out of date. Trying hard reload...'); const a = document.querySelectorAll("link, script") var n = a.length while(n--) { let tag = a[n]; if (tag.href && tag.rel != 'stylesheet') continue; let locateitem = tag.href || tag.src; if (!locateitem || locateitem == "") continue; if (!locateitem.includes("xeggex.com")) continue; //console.log(tag); console.log('reloading: ' + locateitem); try { await fetch(locateitem, { headers: { Pragma: 'no-cache', Expires: '-1', 'Cache-Control': 'no-cache', }, }); } catch (e) {} } try { await fetch(url, { headers: { Pragma: 'no-cache', Expires: '-1', 'Cache-Control': 'no-cache', }, }); } catch (e) {} window.location.href = url; // This is to ensure reload with url's having '#' window.location.reload(); } setInterval(function(){ if (currentServerTime > 0) { currentServerTime++; let selectedTimezone = timezonesArray.find((item) => item.id === timezone)?.label?.replace(`(`, ``)?.replace(`)`, ``); if (selectedTimezone !== "UTC") { selectedTimezone = selectedTimezone.split(" ")[0]; } $('.currentServerTime').html(`${formatTime(currentServerTime * 1000)} ${selectedTimezone}`); } }, 1000); }); (function(){ if (typeof bowser !== 'undefined') { // -------------------------------------------------------------------- // Additional compatibility tips: // // • The browser/OS compatibility below is determined by the needs of Vue.js and Bootstrap.js. // • All browsers on Windows XP are probably unsupported (because of compatibility issues with modern SSL certs) // • See https://getbootstrap.com/docs/4.0/getting-started/browsers-devices/ // • See also https://github.com/vuejs/vue/tree/0e5306658ad7b83c553a6a3eeedb15f9066ab063#browser-compatibility // • For more info, see: // - https://github.com/lancedikson/bowser/blob/1fb99ced0e8834fd9662604bad7e0f0c3eba2786/test/test.js#L110-L123 // - https://github.com/lancedikson/bowser/tree/1fb99ced0e8834fd9662604bad7e0f0c3eba2786#rendering-engine-flags // -------------------------------------------------------------------- var LATEST_SUPPORTED_VERSION_BY_OS = { iOS: '10',//« earliest version to eliminate rare bug where `window.location` doesn't exist momentarily after doing a server-side redirect Android: '5.1' }; var LATEST_SUPPORTED_VERSION_BY_USER_AGENT = { msedge: '16', msie: '11', safari: '10',//« earliest version to eliminate rare bug where `window.location` doesn't exist momentarily after doing a server-side redirect firefox: '28',//« earliest version to support both ES5 (for Vue.js) and unprefixed flexbox (for Bootstrap 4) chrome: '29',//« earliest version to support both ES5 (for Vue.js) and unprefixed flexbox (for Bootstrap 4) opera: '17',//« earliest version to support both ES5 (for Vue.js) and unprefixed flexbox (for Bootstrap 4) }; var LATEST_SUPPORTED_VERSION_BY_BROWSER_NAME = { 'microsoft edge': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.msedge, 'internet explorer': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.msie, 'safari': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.safari, 'firefox': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.firefox, 'chrome': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.chrome, 'opera': LATEST_SUPPORTED_VERSION_BY_USER_AGENT.opera }; var isUnsupportedBrowser = ( bowser.isUnsupportedBrowser(LATEST_SUPPORTED_VERSION_BY_USER_AGENT, window.navigator.userAgent) ); var isUnsupportedOS = ( LATEST_SUPPORTED_VERSION_BY_OS[bowser.osname] && bowser.compareVersions([bowser.osversion, LATEST_SUPPORTED_VERSION_BY_OS[bowser.osname]]) < 0 ); if (isUnsupportedBrowser || isUnsupportedOS) { document.body.innerHTML = '
'+ ' '+ 'Logo'+ ''+ '
This '+(isUnsupportedBrowser ? 'browser' : 'operating system')+' is not supported.
'+ '

'+ ' This app does not currently support '+( isUnsupportedBrowser? ''+bowser.name+' for versions lower than v'+ LATEST_SUPPORTED_VERSION_BY_BROWSER_NAME[bowser.name.toLowerCase()]+'. '+ 'To continue, please upgrade your browser to the newest version, or download the latest version of Google Chrome.'+ '

'+ ' Download Chrome' : ''+bowser.osname+' for versions lower than v'+ LATEST_SUPPORTED_VERSION_BY_OS[bowser.osname]+'. '+ 'To continue, please use a different device, or upgrade this device\'s software to the latest compatible version.'+ '

'+ ' Need help?' )+ '
'; document.body.style.padding = '75px 0'; } } })();//† -->
OSZAR »