Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 2e88a02

Browse files
authored
Merge branch 'master' into negar/add_gtm_to_grid
2 parents bef601f + 6c58bc6 commit 2e88a02

File tree

21 files changed

+195
-236
lines changed

21 files changed

+195
-236
lines changed

src/javascript/_autogenerated/de.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/it.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/_autogenerated/pt.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/javascript/app_2/App/Components/Routes/route-with-sub-routes.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Route } from 'react-router-dom';
55
import { redirectToLogin } from '_common/base/login';
66
import BinarySocket from '_common/base/socket_base';
7+
import Language from '_common/language';
78
import routes from 'Constants/routes';
89
import GTM from 'Utils/gtm';
910
import LoginPrompt from '../Elements/login-prompt.jsx';
@@ -30,6 +31,7 @@ const RouteWithSubRoutes = route => {
3031
);
3132
}
3233

34+
Language.setCookie();
3335
const title = route.title ? `${route.title} | ` : '';
3436
document.title = `${ title }${ default_title }`;
3537
BinarySocket.wait('website_status').then(() => {

src/root_files/app/index.html

Lines changed: 25 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'de': 'de|at|li',
2727
'es': 'ar|bo|cl|co|cr|cu|do|ec|sv|gt|hn|mx|ni|pa|py|pr|es|uy|ve',
2828
'fr': 'fr|ad|bj|bf|cf|cg|ga|gn|ml|mc|ne|sn|tg',
29+
'id': 'id',
2930
'it': 'it',
3031
'ko': 'kr',
3132
'pl': 'po',
@@ -48,30 +49,13 @@
4849
var loginid = localStorage.getItem('active_loginid');
4950
var client_info = JSON.parse(localStorage.getItem('client.accounts') || '{}')[loginid];
5051
var is_logged_in = client_info && client_info['token'];
51-
window.location.href = (lang || 'en').toLowerCase() + '/' + (is_logged_in ? 'trading' : 'home') + '.html' + window.location.search;
52-
}
53-
function isDelayedRedirect() {
54-
if (isGtmApplicable() && !redirectTimeOut) {
55-
redirectTimeOut = setTimeout(redirect, 5000);
56-
} else {
57-
clearTimeout(redirectTimeOut);
58-
redirect();
59-
}
60-
}
61-
function isGtmApplicable() {
62-
return /(www|staging)\.binary\.(com|me)/i.test(window.location.hostname);
63-
}
64-
function pushEvent() {
65-
if (isGtmApplicable()) {
66-
dataLayer.push({
67-
'event': 'page_load',
68-
'eventCallback': function() {
69-
isDelayedRedirect();
70-
}
71-
});
72-
} else {
73-
isDelayedRedirect();
74-
}
52+
53+
var search = window.location.search ? window.location.search : '';
54+
var has_external_referrer = document.referrer && !/\.binary\.(com|me)/.test(document.referrer);
55+
var has_utm_source = /utm_source/.test(search);
56+
var utm_source = has_external_referrer && !has_utm_source ? ((search ? '&' : '?') + 'utm_source=' + new URL(document.referrer).hostname) : '';
57+
58+
window.location.href = (lang || 'en').toLowerCase() + '/' + (is_logged_in ? 'trading' : 'home') + '.html' + search + utm_source;
7559
}
7660

7761
if (/^https:\/\/staging\.binary\.com\/translations\//i.test(window.location.href)) {
@@ -81,32 +65,25 @@
8165
localStorage.setItem('index_referrer', document.referrer);
8266
}
8367
lang = getCookieItem('language');
84-
var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=1');
85-
ws.onopen = function(e) {
86-
ws.send(JSON.stringify({'website_status': '1'}));
87-
};
88-
ws.onmessage = function(msg) {
89-
var response = JSON.parse(msg.data);
90-
if (response.msg_type === 'website_status') {
91-
if (!lang && !response.error && response.hasOwnProperty('website_status')) {
92-
lang = getLanguage(response.website_status.clients_country);
68+
if (lang) {
69+
redirect();
70+
} else {
71+
var ws = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=1');
72+
ws.onopen = function(e) {
73+
ws.send(JSON.stringify({'website_status': '1'}));
74+
};
75+
ws.onmessage = function(msg) {
76+
var response = JSON.parse(msg.data);
77+
if (response.msg_type === 'website_status') {
78+
if (!response.error && response.hasOwnProperty('website_status')) {
79+
lang = getLanguage(response.website_status.clients_country);
80+
}
81+
ws.close();
82+
redirect();
9383
}
94-
ws.close();
95-
pushEvent(); // we need website_status.clients_country
96-
}
97-
};
84+
};
85+
}
9886
}
9987
</script>
10088
</head>
101-
<body>
102-
<!-- Google Tag Manager -->
103-
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-MZWFF7"
104-
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
105-
<script data-cfasync="false">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
106-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
107-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
108-
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
109-
})(window,document,'script','dataLayer','GTM-MZWFF7');</script>
110-
<!-- End Google Tag Manager -->
111-
</body>
11289
</html>

src/root_files/app_2/index.html

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'de': 'de|at|li',
2626
'es': 'ar|bo|cl|co|cr|cu|do|ec|sv|gt|hn|mx|ni|pa|py|pr|es|uy|ve',
2727
'fr': 'fr|ad|bj|bf|cf|cg|ga|gn|ml|mc|ne|sn|tg',
28+
'id': 'id',
2829
'it': 'it',
2930
'ko': 'kr',
3031
'pl': 'po',
@@ -47,23 +48,14 @@
4748
var loginid = localStorage.getItem('active_loginid');
4849
var client_info = JSON.parse(localStorage.getItem('client.accounts') || '{}')[loginid];
4950
var is_logged_in = client_info && client_info['token'];
50-
window.location.href = (/\/app\//.test(window.location.pathname) ? '' : 'app/') + (lang || 'en').toLowerCase() + '/trade' + window.location.search;
51+
52+
var search = window.location.search ? window.location.search : '';
53+
var has_external_referrer = document.referrer && !/\.binary\.(com|me)/.test(document.referrer);
54+
var has_utm_source = /utm_source/.test(search);
55+
var utm_source = has_external_referrer && !has_utm_source ? ((search ? '&' : '?') + 'utm_source=' + new URL(document.referrer).hostname) : '';
56+
57+
window.location.href = (/\/app\//.test(window.location.pathname) ? '' : 'app/') + (lang || 'en').toLowerCase() + '/trade' + search + utm_source;
5158
}
52-
// function isGtmApplicable() {
53-
// return /(www|staging)\.binary\.(com|me)/i.test(window.location.hostname);
54-
// }
55-
// function pushEvent() {
56-
// if (isGtmApplicable()) {
57-
// dataLayer.push({
58-
// 'event': 'page_load',
59-
// 'eventCallback': function() {
60-
// redirect();
61-
// }
62-
// });
63-
// } else {
64-
// redirect();
65-
// }
66-
// }
6759

6860
if (document.referrer) {
6961
localStorage.setItem('index_referrer', document.referrer);
@@ -84,21 +76,9 @@
8476
}
8577
ws.close();
8678
redirect();
87-
// pushEvent(); // we need website_status.clients_country
8879
}
8980
};
9081
}
9182
</script>
9283
</head>
93-
<body>
94-
<!--&lt;!&ndash; Google Tag Manager &ndash;&gt;-->
95-
<!--<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-MZWFF7"-->
96-
<!--height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>-->
97-
<!--<script data-cfasync="false">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':-->
98-
<!--new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],-->
99-
<!--j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=-->
100-
<!--'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);-->
101-
<!--})(window,document,'script','dataLayer','GTM-MZWFF7');</script>-->
102-
<!--&lt;!&ndash; End Google Tag Manager &ndash;&gt;-->
103-
</body>
10484
</html>

src/translations/ach_UG.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: binary-static\n"
44
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
5-
"PO-Revision-Date: 2019-04-29 14:39\n"
5+
"PO-Revision-Date: 2019-04-30 05:54\n"
66
"Last-Translator: binarycom\n"
77
"Language-Team: Acholi\n"
88
"MIME-Version: 1.0\n"

src/translations/de_DE.po

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: binary-static\n"
44
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
5-
"PO-Revision-Date: 2019-04-29 14:36\n"
5+
"PO-Revision-Date: 2019-04-30 05:51\n"
66
"Last-Translator: binarycom\n"
77
"Language-Team: German\n"
88
"MIME-Version: 1.0\n"
@@ -4570,7 +4570,7 @@ msgid "Further information"
45704570
msgstr "Weitere Informationen"
45714571

45724572
msgid "Further instructions"
4573-
msgstr ""
4573+
msgstr "Weitere Anweisungen"
45744574

45754575
msgid "Further, the Company, under the above circumstances, or any other, reserves the right to adjust a client's account should any trade result in a disruption, miscarry or aborted trade."
45764576
msgstr "Weiterhin behält sich das Unternehmen unter den o.g. Umständen, oder anderen, das Recht vor, das Kundenkonto zu berichtigen, wenn ein Handel zu einem unvollständigen, missglückten oder abgebrochenen Kontrakt führt."
@@ -7672,7 +7672,7 @@ msgid "Personal Wealth Awards 2017"
76727672
msgstr "Personal Wealth Awards 2017"
76737673

76747674
msgid "Personal details"
7675-
msgstr ""
7675+
msgstr "Persönliche angaben"
76767676

76777677
msgid "Pillar 3 Disclosures"
76787678
msgstr "Pillar 3 Offenlegung"
@@ -7936,7 +7936,7 @@ msgid "Positions that are still open on Wednesday at 23:59:59 GMT will be charge
79367936
msgstr "Positionen die an einem Mittwoch um 23:59:59 GMT noch offen sind, wird der Swapsatz dreimal in Rechnung gestellt, um für Wochenenden aufzukommen - eine gängige Praxis für alle Broker."
79377937

79387938
msgid "Postal Code/ZIP"
7939-
msgstr ""
7939+
msgstr "Postleitzahl/PLZ"
79407940

79417941
msgid "Postal/ZIP code"
79427942
msgstr ""
@@ -8263,10 +8263,10 @@ msgid "Q. Miscellaneous"
82638263
msgstr "Q. Sonstiges"
82648264

82658265
msgid "Q3 2018"
8266-
msgstr ""
8266+
msgstr "Q3 2018"
82678267

82688268
msgid "Q4 2018"
8269-
msgstr ""
8269+
msgstr "Q4 2018"
82708270

82718271
msgid "Qiwi is a payment service provider that was founded in 2007. It provides individuals with a simple way to transfer money, receive payments, and pay online. For more information, please visit %1."
82728272
msgstr ""
@@ -8293,7 +8293,7 @@ msgid "RTS 27"
82938293
msgstr "RTS 27"
82948294

82958295
msgid "RTS 28"
8296-
msgstr ""
8296+
msgstr "RTS 28"
82978297

82988298
msgid "Range of markets"
82998299
msgstr "Auswahl an Märkten"

0 commit comments

Comments
 (0)