Skip to content

Commit 362bc2a

Browse files
Merge remote-tracking branch 'upstream/master' into mohammad/webpack
2 parents bd5cf79 + 79421f4 commit 362bc2a

File tree

16 files changed

+40
-28
lines changed

16 files changed

+40
-28
lines changed

scripts/bin/GenerateStaticData.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ sub _texts {
404404
push @texts, localize('Withdrawal for your account is not allowed at this moment. Please contact [_1] to unlock it.');
405405

406406
#strings for japanws page
407+
push @texts, localize('Japan');
407408
push @texts, localize('Questions');
408409
push @texts, localize('True');
409410
push @texts, localize('False');

scripts/config/pages.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ sub all_pages {
7070
['new_account/maltainvestws', 'new_account/maltainvestws', 'default', 'Financial Account Opening'],
7171
['new_account/knowledge_testws', 'japan/knowledge_test', 'default', 'Real Money Account Opening'],
7272

73-
['resources', 'resources/index', 'default', 'Resources'],
74-
['resources/asset_indexws', 'resources/asset_indexws', 'default', 'Asset Index', 'ja'],
75-
['resources/market_timesws', 'resources/market_timesws', 'default', 'Trading Times'],
73+
['resources', 'resources/index', 'default', 'Resources', 'ja'],
74+
['resources/asset_indexws', 'resources/asset_indexws', 'default', 'Asset Index', 'ja'],
75+
['resources/market_timesws', 'resources/market_timesws', 'default', 'Trading Times', 'ja'],
7676

7777
['user/security/api_tokenws', 'user/security/api_tokenws', 'default', 'API Token', 'ja'],
7878
['user/security/change_passwordws', 'user/security/change_passwordws', 'default', 'Change Password'],

scripts/lib/BS.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ sub menu {
213213
# resources
214214
my $resources_items_ref = {
215215
id => 'topMenuResources',
216+
class => 'ja-hide',
216217
url => url_for('/resources'),
217218
text => localize('Resources'),
218219
link_class => 'pjaxload',

src/images/pages/about/mac-ja.png

180 KB
Loading

src/javascript/binary/common_functions/frontend.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ function handle_residence_state_ws(){
396396
if (select) {
397397
appendTextValueChild(select, residence.text, residence.value, residence.disabled ? 'disabled' : undefined);
398398
}
399-
if (phoneElement && phoneElement.value === '' && residence.phone_idd && residenceValue === residence.value) {
399+
if (residenceValue !== 'jp' && phoneElement && phoneElement.value === '' && residence.phone_idd && residenceValue === residence.value) {
400400
phoneElement.value = '+' + residence.phone_idd;
401401
}
402402
}
@@ -411,11 +411,15 @@ function handle_residence_state_ws(){
411411
} else if (type === 'website_status') {
412412
var status = response.website_status;
413413
if (status && status.clients_country) {
414+
if (status.clients_country === 'jp' || japanese_client()) {
415+
$('#residence').replaceWith('<label>' + text.localize('Japan') + '</label>');
416+
}
414417
var clientCountry = $('#residence option[value="' + status.clients_country + '"]');
415418
if (!clientCountry.attr('disabled')) {
416419
clientCountry.prop('selected', true);
417420
}
418421
}
422+
$('#residence').removeClass('invisible');
419423
return;
420424
} else if (type === 'get_financial_assessment' && objectNotEmpty(response.get_financial_assessment)) {
421425
for (var key in response.get_financial_assessment) {

src/javascript/binary/websocket_pages/trade/charts/highchartws.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ var Highchart = (function() {
124124

125125
// display comma after every three digits instead of space
126126
Highcharts.setOptions({
127-
lang: {thousandsSep: ','}
127+
global: {
128+
timezoneOffset: japanese_client() ? -9 * 60 : 0 // Converting chart time to JST.
129+
},
130+
lang: {thousandsSep: ','}
128131
});
129132

130133
// display a guide for clients to know how we are marking entry and exit spots

src/javascript/binary/websocket_pages/trade/common.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,10 @@ function chartFrameSource() {
911911
}
912912

913913
function setChartSource() {
914-
document.getElementById('chart_frame').src = 'https://webtrader.binary.com?affiliates=true&instrument=' + document.getElementById('underlying').value + '&timePeriod=1t&gtm=true&lang=' + (page.language() || 'en').toLowerCase();
914+
var ja = japanese_client();
915+
document.getElementById('chart_frame').src = 'https://webtrader.binary.com?affiliates=true&instrument=' + document.getElementById('underlying').value + '&timePeriod=1t&gtm=true&lang=' + (page.language() || 'en').toLowerCase() +
916+
'&hideOverlay=' + (ja ? 'true' : 'false') + '&hideShare=' + (ja ? 'true' : 'false') + '&timezone=GMT+' + (ja ? '9' : '0') +
917+
'&hideFooter=' + (ja ? 'true' : 'false');
915918
}
916919

917920
// ============= Functions used in /trading_beta =============

src/javascript/binary/websocket_pages/user/account/settings/settings_detailsws.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,17 @@ var SettingsDetailsWS = (function() {
175175

176176
function getJPSchema(data) {
177177
var V2 = ValidateV2;
178-
return {
179-
hedge_asset_amount: [
180-
function(v) { return dv.ok(v.trim()); },
181-
V2.required,
182-
V2.regex(/^\d+$/, [Content.localize().textNumbers]),
183-
],
184-
};
178+
if (/Hedging/.test($('#PurposeOfTrading').val())) {
179+
return {
180+
hedge_asset_amount: [
181+
function(v) { return dv.ok(v.trim()); },
182+
V2.required,
183+
V2.regex(/^\d+$/, [Content.localize().textNumbers]),
184+
]
185+
};
186+
} else {
187+
return true;
188+
}
185189
}
186190

187191
function submitNonJP(data) {

src/javascript/binary/websocket_pages/user/new_account/virtual_acc_opening.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pjax_config_page("new_account/virtualws", function() {
4747
Content.populate();
4848
handle_residence_state_ws();
4949
BinarySocket.send({residence_list: 1});
50+
BinarySocket.send({website_status: 1});
5051

5152
var form = $('#virtual-form')[0];
5253
if (!form) return;

src/javascript/binary_japan/knowledge_test/knowledge_test.init.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,12 @@ var KnowledgeTest = (function() {
8585
}
8686

8787
function showDisallowedMsg(jpStatus) {
88-
var nextTestEpoch = jpStatus.next_test_epoch;
89-
var lastTestEpoch = jpStatus.last_test_epoch;
90-
91-
var nextTestDate = new Date(nextTestEpoch * 1000);
92-
var lastTestDate = new Date(lastTestEpoch * 1000);
93-
9488
var msgTemplate =
9589
'{JAPAN ONLY}Dear customer, you are not allowed to take knowledge test until [_1]. Last test taken at [_2].';
9690

9791
var msg = page.text.localize(msgTemplate, [
98-
nextTestDate.toUTCString(),
99-
lastTestDate.toUTCString(),
92+
toJapanTimeIfNeeded(jpStatus.next_test_epoch),
93+
toJapanTimeIfNeeded(jpStatus.last_test_epoch)
10094
]);
10195

10296
showMsgOnly(msg);

src/templates/about/index.html.tt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
</h1>
77
<div class="gr-row">
88
<div class="gr-7 gr-12-m">
9-
<img class="mac responsive" src="[% request.url_for('images/pages/about/mac.svg') %]"/>
9+
<img class="mac responsive ja-hide" src="[% request.url_for('images/pages/about/mac.svg') %]"/>
10+
<img class="mac responsive hidden ja-show" src="[% request.url_for('images/pages/about/mac-ja.png') %]"/>
1011
</div>
1112
<div class="gr-5 gr-12-m">
1213
<p>

src/templates/home/index.html.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@
238238
<ul class="checked">
239239
<li>[% l("{Japan Only}Trade the major currencies") %]</li>
240240
<li>[% l("{Japan Only}Trade all binary option types") %]</li>
241-
<li>[% l("{Japan Only}") %]Payout from 1 to 10</li>
242-
<li>[% l("{Japan Only}") %]Two-way pricing</li>
241+
<li>[% l("{Japan Only}Payout from 1 to 10") %]</li>
242+
<li>[% l("{Japan Only}Two-way pricing") %]</li>
243243
</ul>
244244
</div>
245245
<div class="gr-5">

src/templates/japan/company_profile.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="gr-parent gr-padding-30">
1+
<div class="gr-parent gr-padding-30 static_full">
22
<h2>[% l("{JAPAN ONLY}Company Profile") %]</h2>
33
<table>
44
<tr>

src/templates/new_account/japanws.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
</div>
353353
</div>
354354
<div class="gr-padding-10 gr-row clear">
355-
<div class="gr-4 form_label">
355+
<div class="gr-4 form_label nowrap">
356356
<label for="otc-derivative-trading">[% l('OTC Derivative (Option) Trading') %]</label>
357357
</div>
358358
<div class="gr-8">

src/templates/new_account/virtualws.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<label for="residence">[% l('Country of residence') %]</label>
4444
</div>
4545
<div class="gr-8">
46-
<select name="residence" id="residence"></select>
46+
<select name="residence" id="residence" class="invisible"></select>
4747
</div>
4848
</div>
4949
</fieldset>

src/templates/resources/index.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1>[% l("Resources") %]</h1>
22
<p>[% l("Do you want to learn more about the markets and how to trade them? Check out the resources below.") %]</p>
33
<div class="gr-row">
4-
<div class="gr-3 gr-8-m gr-parent ja-hide">
4+
<div class="gr-3 gr-8-m gr-parent">
55
<div class="gr-8 gr-padding-10">
66
<a class="pjaxload" href="[% request.url_for('/resources/asset_indexws') %]" id="asset-index">
77
<img class="responsive charting-page-icon" id="charting_icon" src="[% request.url_for('images/pages/resources/asset-index.svg') %]"/>

0 commit comments

Comments
 (0)