Skip to content

Commit 72010b3

Browse files
committed
Merge pull request binary-com#1120 from negar-binary/negar/remove_duplicated_js
negar/remove_duplicated_js
2 parents e7312ce + 6aafe22 commit 72010b3

File tree

233 files changed

+733
-7804
lines changed

Some content is hidden

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

233 files changed

+733
-7804
lines changed

scripts/compile.pl

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
['tour', 'static/tour', 'haml', 'full_width', 'Tour'],
4545
['responsible-trading', 'static/responsible_trading', 'haml', 'full_width', 'Responsible Trading'],
4646
['terms-and-conditions', 'legal/tac', 'toolkit', 'default', 'Terms and Conditions'],
47-
['terms-and-conditions-jp', 'legal_jp/tacjp', 'toolkit', 'default', 'Terms and Conditions'],
47+
['terms-and-conditions-jp', 'japan/legal/tacjp', 'toolkit', 'default', 'Terms and Conditions'],
4848
['resources', 'resources/index', 'haml', 'default', 'Resources'],
4949
['applications', 'applications/index', 'toolkit', 'default', 'Applications'],
5050
['about-us', 'about/index', 'haml', 'full_width', 'About Us'],
@@ -79,48 +79,48 @@
7979
['get-started/beginners-faq', 'get_started/beginners_faq', 'haml', 'get_started', 'FAQ'],
8080
['get-started/glossary', 'get_started/glossary', 'haml', 'get_started', 'Glossary'],
8181

82-
['get-started-jp', 'get_started_jp/get_started', 'toolkit', 'default', 'Get Started'],
82+
['get-started-jp', 'japan/get_started', 'toolkit', 'default', 'Get Started'],
8383

8484
## ws
85-
['cashier/authenticatews', 'cashier/authenticatews', 'toolkit', 'default', 'Authenticate'],
86-
['cashier/forwardws', 'cashier/deposit_withdraw_ws', 'toolkit', 'default', 'Cashier'],
87-
['cashier/limitsws', 'account/trading_withdrawal_limitws', 'toolkit', 'default', 'Account Limits'],
88-
['cashier/account_transferws', 'cashier/account_transferws', 'haml', 'default', 'Account Transfer'],
89-
['cashier/payment_agent_listws', 'cashier/payment_agent_listws', 'toolkit', 'default', 'Payment Agent Deposit'],
90-
['cashier/top_up_virtualws', 'cashier/top_up_virtualws', 'toolkit', 'default', 'Give Me More Money!'],
91-
['paymentagent/transferws', 'cashier/paymentagent_transferws', 'toolkit', 'default', 'Payment Agent Transfer'],
92-
['paymentagent/withdrawws', 'cashier/paymentagent_withdrawws', 'toolkit', 'default', 'Payment Agent Withdrawal'],
85+
['user/authenticatews', 'user/authenticatews', 'toolkit', 'default', 'Authenticate'],
86+
['cashier/forwardws', 'cashier/deposit_withdraw_ws', 'toolkit', 'default', 'Cashier'],
87+
['user/settings/limitsws', 'user/settings/limitsws', 'toolkit', 'default', 'Account Limits'],
88+
['account/account_transferws', 'user/account/account_transferws', 'haml', 'default', 'Account Transfer'],
89+
['cashier/payment_agent_listws', 'cashier/payment_agent_listws', 'toolkit', 'default', 'Payment Agent Deposit'],
90+
['cashier/top_up_virtualws', 'user/top_up_virtualws', 'toolkit', 'default', 'Give Me More Money!'],
91+
['paymentagent/transferws', 'cashier/paymentagent_transferws', 'toolkit', 'default', 'Payment Agent Transfer'],
92+
['paymentagent/withdrawws', 'cashier/paymentagent_withdrawws', 'toolkit', 'default', 'Payment Agent Withdrawal'],
9393

9494
['jptrading', 'bet/static', 'toolkit', 'default', 'Sharp Prices. Smart Trading.'],
9595
['trading', 'bet/static', 'toolkit', 'default', 'Sharp Prices. Smart Trading.'],
9696

97-
['new_account/virtualws', 'account/virtualws', 'toolkit', 'default', 'Create New Account'],
98-
['new_account/realws', 'account/realws', 'toolkit', 'default', 'Real Money Account Opening'],
99-
['new_account/japanws', 'account/japanws', 'toolkit', 'default', 'Real Money Account Opening'],
100-
['new_account/maltainvestws', 'account/maltainvestws', 'toolkit', 'default', 'Financial Account Opening'],
101-
['new_account/knowledge_testws', 'account/knowledge_test', 'toolkit', 'default', 'Real Money Account Opening'],
97+
['new_account/virtualws', 'new_account/virtualws', 'toolkit', 'default', 'Create New Account'],
98+
['new_account/realws', 'new_account/realws', 'toolkit', 'default', 'Real Money Account Opening'],
99+
['new_account/japanws', 'new_account/japanws', 'toolkit', 'default', 'Real Money Account Opening'],
100+
['new_account/maltainvestws', 'new_account/maltainvestws', 'toolkit', 'default', 'Financial Account Opening'],
101+
['new_account/knowledge_testws', 'japan/knowledge_test', 'toolkit', 'default', 'Real Money Account Opening'],
102102

103103
['resources/asset_indexws', 'resources/asset_indexws', 'toolkit', 'default', 'Asset Index'],
104104
['resources/market_timesws', 'resources/market_timesws', 'toolkit', 'default', 'Trading Times'],
105105

106-
['user/api_tokenws', 'account/api_tokenws', 'toolkit', 'default', 'API Token'],
107-
['user/change_passwordws', 'account/change_passwordws', 'toolkit', 'default', 'Change Password'],
108-
['user/openpositionsws', 'account/openpositionsws', 'toolkit', 'default', 'Portfolio'],
109-
['user/profit_tablews', 'account/profit_tablews', 'toolkit', 'default', 'Profit Table'],
110-
['user/self_exclusionws', 'account/self_exclusionws', 'toolkit', 'default', 'Account Details'],
111-
['user/settings/detailsws', 'account/settings_detailsws', 'toolkit', 'default', 'Personal Details'],
112-
['user/settings/securityws', 'cashier/settings_securityws', 'haml', 'default', 'Security'],
113-
['user/statementws', 'account/statementws', 'toolkit', 'default', 'Statement'],
114-
['user/my_accountws', 'account/my_accountws', 'toolkit', 'default', 'My Account'],
115-
['user/settingsws', 'account/settingsws', 'toolkit', 'default', 'Settings'],
116-
['user/iphistoryws', 'account/iphistory', 'toolkit', 'default', 'Login History'],
117-
['user/tnc_approvalws', 'legal/tnc_approvalws', 'toolkit', 'default', 'Terms and Conditions Approval'],
118-
['user/assessmentws', 'account/financial_assessmentws', 'toolkit', 'default', 'Financial Assessment'],
119-
['user/lost_passwordws', 'user/lost_passwordws', 'haml', 'default', 'Password Reset'],
120-
['user/reset_passwordws', 'user/reset_passwordws', 'haml', 'default', 'Password Reset'],
121-
['user/authorised_appsws', 'account/authorised_appsws', 'toolkit', 'default', 'Authorised Applications'],
122-
['user/reality_check_frequencyws', 'user/reality_check_frequencyws', 'haml', 'default', 'Reality Check'],
123-
['user/reality_check_summaryws', 'user/reality_check_summaryws', 'haml', 'default', 'Reality Check'],
106+
['user/settings/api_tokenws', 'user/settings/api_tokenws', 'toolkit', 'default', 'API Token'],
107+
['user/change_passwordws', 'user/settings/change_passwordws', 'toolkit', 'default', 'Change Password'],
108+
['user/portfoliows', 'user/portfoliows', 'toolkit', 'default', 'Portfolio'],
109+
['user/profit_tablews', 'user/profit_tablews', 'toolkit', 'default', 'Profit Table'],
110+
['user/settings/self_exclusionws', 'user/settings/self_exclusionws', 'toolkit', 'default', 'Account Details'],
111+
['user/settings/detailsws', 'user/settings/settings_detailsws', 'toolkit', 'default', 'Personal Details'],
112+
['user/settings/securityws', 'user/account/settings_securityws', 'haml', 'default', 'Security'],
113+
['user/statementws', 'user/statementws', 'toolkit', 'default', 'Statement'],
114+
['user/my_accountws', 'user/my_accountws', 'toolkit', 'default', 'My Account'],
115+
['user/settingsws', 'user/settingsws', 'toolkit', 'default', 'Settings'],
116+
['user/settings/iphistoryws', 'user/settings/iphistory', 'toolkit', 'default', 'Login History'],
117+
['user/tnc_approvalws', 'legal/tnc_approvalws', 'toolkit', 'default', 'Terms and Conditions Approval'],
118+
['user/settings/assessmentws', 'user/settings/financial_assessmentws', 'toolkit', 'default', 'Financial Assessment'],
119+
['user/lost_passwordws', 'user/lost_passwordws', 'haml', 'default', 'Password Reset'],
120+
['user/reset_passwordws', 'user/reset_passwordws', 'haml', 'default', 'Password Reset'],
121+
['user/settings/authorised_appsws', 'user/settings/authorised_appsws', 'toolkit', 'default', 'Authorised Applications'],
122+
['user/reality_check_frequencyws', 'user/reality_check_frequencyws', 'haml', 'default', 'Reality Check'],
123+
['user/reality_check_summaryws', 'user/reality_check_summaryws', 'haml', 'default', 'Reality Check'],
124124

125125
['logged_inws', 'global/logged_inws', 'toolkit', undef],
126126
['trade/bet_explanation', 'bet/explanation', 'toolkit', undef],

scripts/lib/BS.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ sub menu {
208208
push @{$my_account_ref->{sub_items}},
209209
{
210210
id => 'topMenuPortfolio',
211-
url => url_for('/user/openpositionsws'),
211+
url => url_for('/user/portfoliows'),
212212
text => localize('Portfolio'),
213213
link_class => 'with_login_cookies pjaxload',
214214
};
@@ -257,7 +257,7 @@ sub menu {
257257
push @{$my_account_ref->{sub_items}},
258258
{
259259
id => 'topMenuAuthenticateAccount',
260-
url => url_for('/cashier/authenticatews'),
260+
url => url_for('/user/authenticatews'),
261261
text => localize('Authenticate'),
262262
class => 'by_client_type client_real',
263263
link_class => 'with_login_cookies pjaxload',

src/javascript/binary/base.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ onLoad.queue(function () {
183183
onLoad.queue(function () {
184184
attach_date_picker('.has-date-picker');
185185
attach_time_picker('.has-time-picker');
186-
attach_inpage_popup('.has-inpage-popup');
187186
attach_tabs('.has-tabs');
188187
});
189188

@@ -243,3 +242,49 @@ $(document).ready(function () {
243242
}
244243
}
245244
});
245+
246+
var client_form;
247+
onLoad.queue(function() {
248+
client_form = new ClientForm({valid_loginids: page.settings.get('valid_loginids')});
249+
});
250+
251+
var ClientForm = function(init_params) {
252+
this.valid_loginids = new RegExp("^(" + init_params['valid_loginids'] + ")[0-9]+$", "i");
253+
};
254+
255+
ClientForm.prototype = {
256+
is_loginid_valid: function(login_id) {
257+
if (login_id.length > 0) {
258+
login_id = login_id.toUpperCase();
259+
return this.valid_loginids.test(login_id);
260+
}
261+
262+
return true;
263+
}
264+
};
265+
266+
var TUser = (function () {
267+
var data = {};
268+
return {
269+
set: function(a){ data = a; },
270+
get: function(){ return data; }
271+
};
272+
})();
273+
274+
/*
275+
* Make sure data js is loaded before this
276+
* else website will not work properly
277+
* objects texts_json, markets_list, markets_json
278+
* should be available
279+
*/
280+
281+
// make texts object as Localizable
282+
var texts = {};
283+
for (var key in texts_json) {
284+
if (texts_json.hasOwnProperty(key)) {
285+
texts[key] = new Localizable(texts_json[key]);
286+
}
287+
}
288+
289+
// make markets object
290+
var markets = new Markets(markets_list, markets_json);

src/javascript/binary/base/inpage_popup.js

Lines changed: 0 additions & 224 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)