C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- 9 D H1_- D
H1_- iD D s z
n~! n~! n~! n~! n~! n~! { n~! | n~! } n~! ~ n~! n~! A:: n~! D D D D
D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- A D H1_- D
H1_- iD D s qz
n~! n~! n~! n~! n~! n~! { n~! | n~! } n~! ~ n~! n~! A:: n~! D D D D D D D D D D
D D D D D D D D D D D D D D D D
D D D D D D D D D D a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- I D H1_- D
H1_- iD D s Qz
n~! n~! n~! n~! n~! n~! { n~! | n~! } n~! ~ n~! n~! A:: n~! D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- D H1_- D
H1_- iD a D !
@ 3_- C1_- D H1_- D
H1_- iD D s 1z
IE fix
(function () {
if (typeof NodeList.prototype.forEach === "function") return false;
NodeList.prototype.forEach = Array.prototype.forEach;
})();
(function(win, globalVar) {
var loginC = function() {
var _this = this;
_this.config = {
storageSTS: 'loginData',
storageRememberme: 'rememberMe',
storageUserInfo: 'userInfo',
inMemStorage:{},
userInfo: '/api/logininfo/v1.1/aggregatedInfo?avatar=true&realcid=true&cidList=',
logOut: '../../api/sts/v2/logout/default.htm',
logoutTitle: "Logout",
parentID: 'nav_for_mobile',
elemID: 'login_user_details',
loggedInClass: 'loggedInMode',
loggedOutID: 'TBanqueLogout',
bodyLoadingClass: 'waiting_for_login_status',
logOutEventName:'etoroUserLogOut',
logInEventName:'etoroUserLoggedIn'
}
}
loginC.prototype.setLoginDataToMemory = function(loginData){
this.config.inMemStorage[this.config.storageSTS] = btoa(JSON.stringify(loginData));
}
loginC.prototype.storageMethod = function(action,arg){
var _this = this;
var result = null;
var testLS = this.testStorage();
if(testLS){
result = win.localStorage[action].apply(win.localStorage,arg);
}
// handle localStorage issue in private browsing on iphone safari
switch(action) {
case 'getItem':
if(!result){
// no data in the localStorage
result = _this.config.inMemStorage[arg[0]];
}
break;
case 'removeItem':
delete _this.config.inMemStorage[arg[0]];
break;
case 'setItem':
_this.config.inMemStorage[arg[0]] = arg[1];
break;
default:
break;
}
return result;
}
loginC.prototype.testStorage = function() {
try {
localStorage.getItem('test');
sessionStorage.getItem('test');
return true;
} catch (e) {
// localStorage - not supported
return false;
}
}
loginC.prototype.getLoginFromStorage = function() {
var _this = this;
try {
var ls = localStorage,
ss = sessionStorage,
ld = (ls.getItem(this.config.storageRememberme) !== 'true' ? ss : ls).getItem(this.config.storageSTS),
ab = window.atob || function(x) {
return x
};
var stsData = null;
if(!ld){
ld = _this.storageMethod('getItem',[this.config.storageSTS]);
stsData = JSON.parse(atob(ld))['stsData'];
}
else{
stsData = JSON.parse(ab(ld))['stsData'];
}
return stsData;
} catch (e) {
return null;
}
}
loginC.prototype.resetStorage = function() {
this.storageMethod('removeItem',[this.config.storageUserInfo]);
}
loginC.prototype.logOutSTS = function(stsData, callback) {
var _this = this;
var httpUrl = this.config.logOut;
etoroLoggerApps.wp_etoro_site.http('POST', httpUrl, {
authorization: stsData.accessToken,
accounttype: 'Real',
applicationidentifier: etoroLoggerApps.wp_etoro_site.config.AppName,
applicationversion: etoroLoggerApps.wp_etoro_site.config.ApplicationVersion
}, 'json', null, null, function(success, data) {
callback(success, data);
})
}
loginC.prototype.removeLoginState = function() {
var c = this.config;
var el = document.getElementById(c.elemID);
if (el) el.parentNode.removeChild(el);
document.body.classList.remove(c.loggedInClass);
}
loginC.prototype.logOut = function() {
var _this = this;
var stsData = _this.getLoginData();
if (stsData && stsData.accessToken) {
_this.logOutSTS(stsData, function(success, data) {
if (success) {
_this.isLoggedIn = false;
_this.username = null;
try{
TBanque.logout();
}
catch(e){}
//document.addEventListener('etoroUserLogOut', function (e) {}, false);
var event = new Event(_this.config.logOutEventName);
document.dispatchEvent(event);
_this.removeLoginState();
_this.resetStorage();
_this.storageMethod('removeItem',[_this.config.storageSTS]);
}
});
} else {
_this.removeLoginState();
}
}
loginC.prototype.getUserInfo = function(cid, callback) {
var _this = this;
var httpUrl = this.config.userInfo + '%5B' + cid + '%5D';
var user = null;
etoroLoggerApps.wp_etoro_site.http('GET', httpUrl, {}, '', null, '', function(success, _data) {
try {
var responce = _data.target.responseText;
} catch (e) {
var responce = {};
callback(null);
}
if (success) {
try {
var data = JSON.parse(responce);
if (data.Users && data.Users[0]) {
user = data.Users[0];
var selectedAvatar = user.avatars.filter(function(obj) {
return (obj.height === 150);
})[0];
user.selectedAvatar = selectedAvatar;
callback(user);
} else {
callback(null);
}
} catch (e) {
// log here
etoroLoggerApps.wp_etoro_site.send([{
Level: 'warn',
Url: httpUrl,
Message: "Can't JSON parsing error",
Exception: e
}]);
callback(null)
}
} else {
console.log('error');
callback(null)
}
})
}
loginC.prototype.getLoginData = function() {
var tokenValid = false,
loginData, now, expiration, gap;
loginData = this.getLoginFromStorage();
loginData = loginData || {};
if (loginData && loginData.expirationUnixTimeMs) {
now = Math.round((new Date()).getTime()); // UNIX timestamp (ms)
expiration = loginData.expirationUnixTimeMs ? loginData.expirationUnixTimeMs : 0;
gap = expiration - now;
if (gap > 0) {
// token valid
tokenValid = true;
}
}
loginData.expired = !tokenValid;
return loginData;
}
loginC.prototype.getInfo = function(callback) {
callback = callback? callback : function(){};
var _this = this;
var avatar = null;
var username = null;
var loginData = _this.getLoginData();
if (!loginData.expired) {
_this.isLoggedIn = true;
localValue = _this.storageMethod('getItem',[_this.config.storageUserInfo]);
try {
localValue = JSON.parse(localValue);
if (localValue.cid && localValue.avatar && localValue.username) {
if (loginData.realCid == localValue.cid) {
avatar = localValue.avatar;
username = localValue.username;
callback(localValue);
}
}
} catch (e) {
}
if (avatar && username) {
_this.setLoginStatus('login', username, avatar);
} else {
this.getUserInfo(loginData.realCid, function(user) {
var userInfo = {
username:user.username,
cid: user.realCID,
avatar: user.selectedAvatar.url
}
var localValue = JSON.stringify(userInfo);
_this.storageMethod('setItem',[_this.config.storageUserInfo, localValue]);
_this.setLoginStatus('login', user.username, user.selectedAvatar.url);
callback(userInfo);
})
}
} else {
// token expired
_this.resetStorage();
callback(null);
}
}
loginC.prototype.setLoginStatus = function(action, username, avatar) {
var _this = this;
var c = this.config;
var el = document.getElementById(c.elemID);
var updateOnly = el;
if (action === 'login') {
username = username.replace(/["']/g, '');
username = encodeURIComponent(username);
_this.username = username;
var imgSrc = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
if (avatar) {
avatar = encodeURIComponent(avatar).replace(/%3A/g,':').replace(/%2F/g,'/');
imgSrc = avatar;
}
var LoggedInHTML = '{username}' + c.logoutTitle + '';
LoggedInHTML = LoggedInHTML.replace('{url}', imgSrc).replace('{username}', username);
if (!updateOnly) {
el = document.createElement('div');
}
el.id = c.elemID;
el.innerHTML = LoggedInHTML;
if (!updateOnly) {
document.getElementById(c.parentID).appendChild(el);
}
document.body.classList.add(c.loggedInClass);
var loggedOutElem = document.getElementById(c.loggedOutID);
if (loggedOutElem) {
loggedOutElem.addEventListener("click", function() {
_this.logOut();
});
}
} else {
//logout
_this.logOut();
}
}
loginC.prototype.onPageLoad = function(callback) {
var _this = this;
this.getInfo(callback);
}
win[globalVar] = loginC;
})(window, 'TBanqueUserLoginOnSite');
var etoroUserLogin = new TBanqueUserLoginOnSite();
document.addEventListener(etoroUserLogin.config.logInEventName, function (e) {
etoroUserLogin.getInfo(null);
}, false);
document.addEventListener("DOMContentLoaded", function(event) {
etoroUserLogin.onPageLoad(null);
document.body.classList.remove(etoroUserLogin.config.bodyLoadingClass);
});
/*============================= Auto Login - END ============================= */
/*============================= Disclaimers - Start ============================= */
window.etoroDisclaimers = {
hideDisclaimerInThisPage:false,
}
/*============================= Disclaimers - END ============================= */
Economic Calendar: Live Updates for Financial Events | TBanque
Many assets become volatile in and around certain financial events. For example, the monthly Non-Farm Payroll report often impacts the US dollar. To seize relevant opportunities when the market is moving, it is important to stay updated on recent happenings and upcoming events in global markets. TBanque’s Economic Calendar has all the relevant events and details regarding which currency they affect together with their level of importance.
How to use the economic calendar:
Choose the time zone and dates relevant to your trades (default: your time-zone and current week)