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

Commit 84b44f8

Browse files
author
alamin-deriv
committed
Merge branch 'Change_of_social_icon_links_in_the_footer_for_uk_and_eu' of github.com:alamin-deriv/binary-static into Change_of_social_icon_links_in_the_footer_for_uk_and_eu
2 parents 17c3604 + 5477f08 commit 84b44f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+928
-154
lines changed

scripts/config/pages.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = [
2525
['new_account/realws', 'app/new_account/real', 'default', 'Real Money Account Opening'],
2626
['new_account/virtualws', 'app/new_account/virtual', 'default', 'Create New Virtual-money Account'],
2727
['new_account/welcome', 'app/new_account/welcome_page', 'default', 'Welcome to Binary.com'],
28+
['new_account/welcome_onboarding', 'app/new_account/welcome_onboarding', 'default', 'Welcome to Binary.com'],
2829

2930
['resources', 'app/resources/index', 'default', 'Resources'],
3031
['resources/asset_indexws', 'app/resources/asset_index', 'full_width', 'Asset Index'],

scripts/js_texts/extracted_strings_app.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ module.exports = [
258258
'IP Address',
259259
'Identity card',
260260
'If it doesn’t work, download a QR code scanner from Google Play or the App Store',
261+
'If you have an account with us, we\'ll send you a link to your email in a few minutes to reset your password.',
261262
'In the EU, financial binary options are only available to professional investors.',
262263
'In/Out',
263264
'Indicates required field',
@@ -395,7 +396,6 @@ module.exports = [
395396
'Please [_1]log in[_2] or [_3]sign up[_4] to view this page.',
396397
'Please accept the terms and conditions.',
397398
'Please check your email for further instructions.',
398-
'Please check your email for the password reset link.',
399399
'Please choose a currency',
400400
'Please click on the link in the email to reset your binary password.',
401401
'Please click on the link in the email to reset your trading password.',
@@ -707,8 +707,8 @@ module.exports = [
707707
'Yes, I\'m sure',
708708
'You are categorised as a professional client.',
709709
'You are categorised as a retail client. Apply to be treated as a professional trader.',
710-
'You are limited to one fiat account. You can change the currency of your fiat account anytime before you make a first-time deposit or create an MT5 account.',
711-
'You can [_1]set a new currency[_2] before you deposit for the first time or create an MT5 account.',
710+
'You are limited to one fiat account. You can change the currency of your fiat account anytime before you make a first-time [_1].',
711+
'You can [_1]set a new currency[_2] before you deposit for the first [_3].',
712712
'You can close this window without interrupting your trade.',
713713
'You can no longer change the currency because you\'ve created an MT5 account.',
714714
'You can no longer change the currency because you\'ve made a first-time deposit.',
@@ -793,6 +793,8 @@ module.exports = [
793793
'close',
794794
'day',
795795
'days',
796+
'deposit',
797+
'deposit or create an MT5 account',
796798
'details',
797799
'e.g. United States',
798800
'for account [_1]',
@@ -810,6 +812,8 @@ module.exports = [
810812
'space',
811813
'tick',
812814
'ticks',
815+
'time',
816+
'time or create an MT5 account',
813817
'{SPAIN ONLY}However, Binary Investments (Europe) Ltd has assessed your knowledge and experience and deems the product appropriate for you.',
814818
'{SPAIN ONLY}This is a product with leverage. You should be aware that losses may be higher than the amount initially paid to purchase the product.',
815819
'{SPAIN ONLY}You are about to purchase a product that is not simple and may be difficult to understand: Contracts for difference and forex. As a general rule, the CNMV considers that such products are not appropriate for retail clients, due to their complexity.',

src/images/pages/welcome/cfd.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/pages/welcome/ddown.svg

Lines changed: 1 addition & 0 deletions
Loading

src/images/pages/welcome/doptions.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/images/pages/welcome/notsure.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/javascript/_autogenerated/ach.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/fr.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/id.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/ko.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/pl.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/_autogenerated/ru.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/vi.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/zh_cn.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/zh_tw.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/base/binary_pages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const FinancialAccOpening = require('../pages/user/new_account/financial_acc
4444
const RealAccOpening = require('../pages/user/new_account/real_acc_opening');
4545
const VirtualAccOpening = require('../pages/user/new_account/virtual_acc_opening');
4646
const WelcomePage = require('../pages/user/new_account/welcome_page');
47+
const WelcomePageOnboarding = require('../pages/user/new_account/welcome_onboarding');
4748
const ResetPassword = require('../pages/user/reset_password');
4849
const TradingResetPassword = require('../pages/user/trading_reset_password');
4950
const SetCurrency = require('../pages/user/set_currency');
@@ -136,6 +137,7 @@ const pages_config = {
136137
two_factor_authentication: { module: TwoFactorAuthentication, is_authenticated: true },
137138
virtualws : { module: VirtualAccOpening, not_authenticated: true },
138139
welcome : { module: WelcomePage, is_authenticated: true, only_virtual: true },
140+
welcome_onboarding : { module: WelcomePageOnboarding, is_authenticated: true, only_virtual: true },
139141
withdrawws : { module: PaymentAgentWithdraw, is_authenticated: true, only_real: true },
140142

141143
'affiliate-ib' : { module: AffiliatesIBLanding },

src/javascript/app/common/content_visibility.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,23 @@ const ContentVisibility = (() => {
195195
};
196196

197197
const centerSelect = ($el) => {
198-
const option_width = getTextWidth($el.children(':selected').html());
199-
const empty_space = '280' - option_width; // in mobile all select drop-downs are hardcoded to be at 280px in css
200-
$el.css('text-indent', (empty_space / 2) - 7); // 7px is for the drop-down arrow
198+
const option_width = getTextWidth($el.children(':selected').text());
199+
const center_option_text = option_width / 2;
200+
$el.css('text-indent', `calc(50% - ${center_option_text}px)`);
201201
};
202202

203203
const centerAlignSelect = (should_init) => {
204204
$(window).off('resize', centerAlignSelect);
205-
$center_select_m = ((typeof should_init === 'boolean' && should_init) || !$center_select_m) ? $('.center-select-m') : $center_select_m;
205+
$('#frm_real #trading_experience_form select, #frm_real #financial_info_form select').addClass('center-select-m');
206+
$center_select_m = ((typeof should_init === 'boolean' && should_init) || !$center_select_m) ? $('#frm_real .center-select-m') : $center_select_m;
206207

207208
if ($(window).width() <= 480) {
209+
const financial_form_selects = $('#frm_real select');
210+
financial_form_selects.get().forEach((element) => {
211+
const option_width = getTextWidth($(element).children(':selected').text());
212+
const center_option_text = option_width / 2;
213+
$(element).css('text-indent', `calc(50% - ${center_option_text}px)`);
214+
});
208215
$center_select_m.on('change', function() {
209216
centerSelect($(this));
210217
});

src/javascript/app/components/date_picker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const DatePicker = (() => {
120120
const checkWidth = (selector) => {
121121
const $selector = $(selector);
122122
const date_picker_conf = date_pickers[selector].config_data;
123+
const value = $selector.attr('data-value') || $selector.val();
123124
if (window.innerWidth < 770) {
124125
if (!date_picker_conf.native) {
125126
hide(selector);
@@ -128,15 +129,14 @@ const DatePicker = (() => {
128129
}
129130
if (checkInput('date', 'not-a-date') && $selector.attr('data-picker') !== 'native') {
130131
hide(selector);
131-
$selector.attr({ type: 'date', 'data-picker': 'native' }).val($selector.attr('data-value')).removeClass('clear');
132+
$selector.attr({ type: 'date', 'data-picker': 'native' }).val(value).removeClass('clear');
132133
if ($selector.attr('readonly')) $selector.attr('data-readonly', 'readonly').removeAttr('readonly');
133134
if (date_picker_conf.minDate !== undefined) $selector.attr('min', toDate(date_picker_conf.minDate));
134135
if (date_picker_conf.maxDate !== undefined) $selector.attr('max', toDate(date_picker_conf.maxDate));
135136
return;
136137
}
137138
}
138139
if ((window.innerWidth > 769 && $selector.attr('data-picker') !== 'jquery') || (window.innerWidth < 770 && !checkInput('date', 'not-a-date'))) {
139-
const value = $selector.attr('data-value') || $selector.val();
140140
const format_value = value && date_picker_conf.type !== 'diff' ? toReadableFormat(moment(value)) : $selector.val();
141141
$selector.attr({ type: 'text', 'data-picker': 'jquery', 'data-value': value }).removeAttr('min max').val(format_value);
142142
if ($selector.attr('data-readonly')) $selector.attr('readonly', 'readonly').removeAttr('data-readonly');

src/javascript/app/pages/cashier/cashier.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ const Cashier = (() => {
9393
const has_upgrade = upgrade_info.can_upgrade || upgrade_info.can_open_multi
9494
|| can_change;
9595
const account_action_text = has_upgrade ? `<br />${localize('[_1]Manage your accounts[_2]', [`<a href=${Url.urlFor('user/accounts')}>`, '</a>'])}` : '';
96+
const is_iom_client = Client.get('residence') === 'im' || State.getResponse('website_status.clients_country') === 'im';
97+
const change_text_for_iom = is_iom_client ? localize('time') : localize('time or create an MT5 account');
98+
const url_user_account = `<a href=${Url.urlFor('user/accounts')}>`;
9699

97100
const missingCriteria = (has_mt5, has_transaction) => {
98101
const existing_mt5_msg = localize('You can no longer change the currency because you\'ve created an MT5 account.') + account_action_text;
@@ -113,7 +116,7 @@ const Cashier = (() => {
113116
const currency_hint = Currency.isCryptocurrency(currency)
114117
? localize('Don\'t want to trade in [_1]? You can open another cryptocurrency account.', `${Currency.getCurrencyDisplayCode(currency)}`) + account_action_text
115118
: has_no_mt5 && has_no_transaction
116-
? localize('You can [_1]set a new currency[_2] before you deposit for the first time or create an MT5 account.', can_change ? [`<a href=${Url.urlFor('user/accounts')}>`, '</a>'] : ['', ''])
119+
? localize('You can [_1]set a new currency[_2] before you deposit for the first [_3].', [can_change ? url_user_account : '', can_change ? '</a>' : '', change_text_for_iom])
117120
: missingCriteria(!has_no_mt5, !has_no_transaction);
118121

119122
elementInnerHtml(el_current_currency, currency_message);

src/javascript/app/pages/user/account/settings/iphistory/iphistory.data.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,23 @@ const IPHistoryData = (() => {
1515
{ name: 'IE', regex: /trident\/\d+\.\d+;.*[rv:]+(\d+\.\d)/i },
1616
{ name: 'Firefox', regex: /firefox\/([\d\w.-]+)/i },
1717
{ name: 'Binary app', regex: /binary\.com V([\d.]+)/i },
18+
{ name: 'iPhone', regex: /\b(iPhone\d*)\b.*(DP2P)\b/ig },
19+
{ name: 'Android', regex: /\b(Android\d*)\b.*(DP2P)\b/ig },
20+
{ name: 'Dart', regex: /dart\/([\d\w.-]+)/i },
1821
];
1922
for (let i = 0; i < lookup.length; i++) {
2023
const info = lookup[i];
21-
const match = user_agent.match(info.regex);
24+
let match = user_agent.match(info.regex);
2225
if (match !== null) {
26+
let app;
27+
if (['Android', 'iPhone'].includes(info.name)) {
28+
match = user_agent.match(/(:?DP2P\/([\d\w.-]+))/ig)[0].split('/');
29+
app = match[0];
30+
}
2331
return {
2432
name : info.name,
2533
version: match[1],
34+
...app && { app },
2635
};
2736
}
2837
}

src/javascript/app/pages/user/account/settings/iphistory/iphistory.ui.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const IPHistoryUI = (() => {
1212
const action = localize(data.action /* localize-ignore */); // from login_history API call, can be (login|logout)
1313
const browser = data.browser;
1414
let browser_string = browser ? `${browser.name} v${browser.version}` : 'Unknown';
15-
const patt = /^(opera|chrome|safari|firefox|IE|Edge|SeaMonkey|Chromium|Binary app) v[0-9.]+$/i;
15+
if (browser && browser.app) {
16+
browser_string += ` ${browser.app} app`;
17+
}
18+
const patt = /(opera|chrome|safari|firefox|IE|Edge|SeaMonkey|Chromium|Binary app|Android|iPhone|Dart) v[0-9.]+(\b.*DP2P app)?$/i;
1619
if (!patt.test(browser_string) && browser_string !== 'Unknown') {
1720
browser_string = 'Error';
1821
}

src/javascript/app/pages/user/lost_password.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const LostPassword = (() => {
1818
BinaryPjax.load(`${urlFor('user/reset_passwordws')}#token=${$('#txt_verification_code').val()}`);
1919
}, false);
2020
} else {
21-
$(form_id).html($('<div/>', { class: 'notice-msg', text: localize('Please check your email for the password reset link.') }));
21+
$(form_id).html($('<div/>', { class: 'notice-msg', text: localize('If you have an account with us, we\'ll send you a link to your email in a few minutes to reset your password.') }));
22+
2223
}
2324
} else if (response.error) {
2425
const $form_error = $('#form_error');

src/javascript/app/pages/user/metatrader/metatrader.ui.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,6 @@ const MetaTraderUI = (() => {
633633
$form.find('#view_3').find('#trading_password_new_user').setVisibility(1);
634634
if (has_mt5_account) {
635635
$form.find('#trading_password_input').setVisibility(0);
636-
$form.find('#new_user_cancel_button').on('click', () => {
637-
location.reload();
638-
});
639636
$form.find('#has_mt5_new_user_btn_submit_new_account').setVisibility(1);
640637
} else {
641638
$form.find('#new_user_btn_submit_new_account').setVisibility(1);

src/javascript/app/pages/user/new_account/virtual_acc_opening.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const State = require('../../../../_common/storage').State;
1414
const urlFor = require('../../../../_common/url').urlFor;
1515
const Utility = require('../../../../_common/utility');
1616
const isEuCountrySelected = require('../../../../_common/utility').isEuCountrySelected;
17+
const ClientBase = require('../../../../_common/base/client_base');
1718
const isBinaryApp = require('../../../../config').isBinaryApp;
1819

1920
const VirtualAccOpening = (() => {
@@ -104,7 +105,7 @@ const VirtualAccOpening = (() => {
104105
const req = [
105106
{ selector: '#client_password', validations: ['req', 'password'] },
106107

107-
{ selector: '#residence' },
108+
{ selector: '#residence' , validations: ['req'] },
108109
{ selector: '#email_consent' },
109110
{ request_field: 'utm_source', value: TrafficSource.getSource(utm_data) },
110111
{ request_field: 'new_account_virtual', value: 1 },
@@ -137,12 +138,13 @@ const VirtualAccOpening = (() => {
137138
LocalStore.remove('signup_device');
138139
BinarySocket.send({ get_account_status: 1 }).then((account_status) => {
139140
const is_unwelcome_uk = account_status.get_account_status.status.some(status => status === 'unwelcome') && (/gb/.test(residence));
141+
const upgrade_info = ClientBase.getBasicUpgradeInfo();
140142
Client.processNewAccount({
141143
email : new_account.email,
142144
loginid : new_account.client_id,
143145
token : new_account.oauth_token,
144146
is_virtual : true,
145-
redirect_url: is_unwelcome_uk ? urlFor('new_account/realws') : urlFor('new_account/welcome'),
147+
redirect_url: getRedirectUrl(is_unwelcome_uk, residence, upgrade_info),
146148
});
147149
});
148150
}
@@ -175,6 +177,17 @@ const VirtualAccOpening = (() => {
175177
}
176178
};
177179

180+
const getRedirectUrl = (is_unwelcome_uk, residence, upgrade_info) => {
181+
182+
const { can_upgrade_to } = upgrade_info;
183+
if (is_unwelcome_uk) return urlFor('new_account/realws');
184+
if (can_upgrade_to.includes('svg') && residence !== 'au') {
185+
return urlFor('new_account/welcome_onboarding');
186+
}
187+
if (residence === 'au') return urlFor('user/metatrader');
188+
189+
return urlFor('new_account/welcome');
190+
};
178191
const showFormError = (message, url) => {
179192
$('#virtual-form').html($('<p/>', { html: Utility.template(message, [urlFor(url)]) }));
180193
};

0 commit comments

Comments
 (0)