Skip to content

Commit da1e338

Browse files
committed
Merge pull request #1 from binary-com/master
Release to Production
2 parents 7825e59 + af9c444 commit da1e338

File tree

12 files changed

+85
-14
lines changed

12 files changed

+85
-14
lines changed

scripts/compile.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
['styles', 'home/styles', 'haml', 'full_width', 'Styles'],
5151
['affiliate/signup', 'affiliates/signup', 'toolkit', 'default', 'Affiliate'],
5252
['user/logintrouble', 'misc/logintrouble', 'toolkit', 'default', 'Login trouble'],
53+
['endpoint', 'misc/endpoint', 'toolkit', 'default', 'Endpoint'],
5354
['legal/us_patents', 'legal/us_patents', 'toolkit', 'default', 'US Patents'],
5455
['cashier', 'cashier/index', 'haml', 'default', 'Cashier'],
5556
['cashier/payment_methods', 'cashier/payment_methods', 'toolkit', 'default', 'Payment Methods'],

scripts/lib/BS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ sub menu {
298298
id => 'topMenuApplications',
299299
url => url_for('/applications'),
300300
text => localize('Applications'),
301-
link_class => 'pjaxload',
301+
link_class => 'ja-hide pjaxload',
302302
};
303303

304304
# push @{$menu}, $self->_main_menu_trading();

src/javascript/binary/base/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ URL.prototype = {
368368
staticHost = staticHost.substr(0, staticHost.indexOf('/js/') + 1);
369369
}
370370
else {
371-
staticHost = 'https://static.binary.com/';
371+
staticHost = 'https://www.binary.com/';
372372
}
373373

374374
window.staticHost = staticHost;

src/javascript/binary/endpoint.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pjax_config_page("endpoint", function(){
2+
return {
3+
onLoad: function() {
4+
$('#new_endpoint').on('click', function () {
5+
var server_url = $('#server_url').val(),
6+
app_id = $('#app_id').val();
7+
if (Trim(server_url) !== '') localStorage.setItem('server_url', server_url);
8+
if (Trim(app_id) !== '') localStorage.setItem('app_id', app_id);
9+
window.location.reload();
10+
});
11+
$('#reset_endpoint').on('click', function () {
12+
localStorage.removeItem('server_url');
13+
localStorage.removeItem('app_id');
14+
window.location.reload();
15+
});
16+
}
17+
};
18+
});

src/javascript/binary/pages/client/logged_in.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var LoggedInHandler = (function() {
4646
redirect_url = page.url.default_redirect_url();
4747
var lang_cookie = $.cookie('language');
4848
if(lang_cookie && lang_cookie !== page.language()) {
49-
redirect_url.replace(new RegExp('\/' + page.language() + '\/', 'i'), '/' + lang_cookie.toLowerCase() + '/');
49+
redirect_url = redirect_url.replace(new RegExp('\/' + page.language() + '\/', 'i'), '/' + lang_cookie.toLowerCase() + '/');
5050
}
5151
}
5252
document.getElementById('loading_link').setAttribute('href', redirect_url);

src/javascript/binary/socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function BinarySocketClass() {
2020
authorized = false,
2121
timeouts = {},
2222
req_number = 0,
23-
socketUrl = socket_url + '?app_id=' + app_id + (page.language() ? '&l=' + page.language() : '');
23+
socketUrl = getSocketURL() + '?app_id=' + getAppId() + (page.language() ? '&l=' + page.language() : '');
2424

2525
var clearTimeouts = function(){
2626
for(var k in timeouts){

src/javascript/binary/static/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var Login = (function() {
1313
};
1414

1515
var login_url = function() {
16-
return 'https://oauth.binary.com/oauth2/authorize?app_id=' + app_id + '&l=' + page.language();
16+
return 'https://oauth.binary.com/oauth2/authorize?app_id=' + getAppId() + '&l=' + page.language();
1717
};
1818

1919
var is_login_pages = function() {

src/javascript/config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
/*
22
* Configuration values needed in js codes
3-
*
3+
*
44
* NOTE:
55
* Please use the following command to avoid accidentally committing personal changes
66
* git update-index --assume-unchanged src/javascript/config.js
77
*
88
*/
99

10-
var app_id = '1';
11-
var socket_url = 'wss://ws.binaryws.com/websockets/v3';
10+
function getAppId() {
11+
return localStorage.getItem('app_id') ? localStorage.getItem('app_id') :
12+
/staging\.binary\.com/i.test(window.location.hostname) ? '1098' : '1';
13+
}
14+
15+
function getSocketURL() {
16+
return localStorage.getItem('server_url') ? 'wss://' + localStorage.getItem('server_url') + '/websockets/v3' : 'wss://ws.binaryws.com/websockets/v3';
17+
}

src/templates/haml/layouts/default/javascripts.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
!= "window.page_params = { settings: ". $javascript->{settings} . "};"
33

44
- foreach my $lib (@{ $javascript->{libs} }) {
5-
%script{:src => $lib :defer=>"true"}
5+
%script{:async => "true", :defer => "true", :src => $lib}
66
- }
77

88
%script{:async => "true", :defer => "true", :src => "https://apis.google.com/js/platform.js"}

src/templates/toolkit/account/trading_withdrawal_limitws.html.tt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@
1414
<tr class="flex-tr">
1515
<td class="flex-tr-child" id="max-open-position">
1616
<a href="#" id="max-open-position-tooltip" rel="tooltip" title="">
17-
<img src="https://static.binary.com/images/common/question_1.png">
17+
<img src="[% request.url_for('images/common/question_1.png') %]">
1818
</a>
1919
</td>
2020
<td class="flex-tr-child" id="open-positions"></td>
2121
</tr>
2222
<tr class="flex-tr">
2323
<td class="flex-tr-child" id="max-acc-balance">
2424
<a href="#" id="max-acc-balance-tooltip" rel="tooltip" title="">
25-
<img src="https://static.binary.com/images/common/question_1.png">
25+
<img src="[% request.url_for('images/common/question_1.png') %]">
2626
</a>
2727
</td>
2828
<td class="flex-tr-child" id="account-balance"></td>
2929
</tr>
3030
<tr class="flex-tr">
3131
<td class="flex-tr-child" id="max-daily-turnover">
3232
<a href="#" id="max-daily-turnover-tooltip" rel="tooltip" title="">
33-
<img src="https://static.binary.com/images/common/question_1.png">
33+
<img src="[% request.url_for('images/common/question_1.png') %]">
3434
</a>
3535
</td>
3636
<td class="flex-tr-child" id="daily-turnover"></td>
3737
</tr>
3838
<tr class="flex-tr">
3939
<td class="flex-tr-child" id="max-aggregate">
4040
<a href="#" id="max-aggregate-tooltip" rel="tooltip" title="">
41-
<img src="https://static.binary.com/images/common/question_1.png">
41+
<img src="[% request.url_for('images/common/question_1.png') %]">
4242
</a>
4343
</td>
4444
<td class="flex-tr-child" id="payout"></td>

src/templates/toolkit/global/javascripts.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</script>
55

66
[%= FOREACH js IN javascript.libs =%]
7-
<script src='[%= js =%]' defer></script>
7+
<script src='[%= js =%]' defer async></script>
88
[%= END =%]
99

1010
<script src="https://apis.google.com/js/platform.js" defer async></script>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<div class="endpoint-config">
2+
<h1>[% l('Change API Endpoint') %]</h1>
3+
<div class="grd-parent grd-row-padding">
4+
<div class="rbox form">
5+
<div class="rbox-wrap">
6+
<fieldset>
7+
<legend>[% l('Details') %]</legend>
8+
<div class="grd-row-padding row clear">
9+
<div class="grd-grid-4 form_label">
10+
<label for="server_url">[% l('Server') %]</label>
11+
</div>
12+
<div class="grd-grid-8">
13+
<input type="text" class="text" id="server_url" maxlength="30"></input>
14+
<p class="hint">
15+
[% l('e.g. www.binaryqa36.com') %]
16+
</p>
17+
<p class="errorfield" id="error-server_url" style="display:none"></p>
18+
</div>
19+
</div>
20+
<div class="grd-row-padding row clear">
21+
<div class="grd-grid-4 form_label">
22+
<label for="app_id">[% l('OAuth App ID (Optional)') %]</label>
23+
</div>
24+
<div class="grd-grid-8">
25+
<input type="text" class="text" id="app_id" maxlength="30"></input>
26+
<p class="hint">
27+
[% l('e.g. id-HXSSH5AIQylFwsiUcXGqpXApvnFe') %]
28+
<br/>
29+
[% l('You have to register and get App ID before you can use different OAuth server for authentication. For more information refer to OAuth details on https://developers.binary.com/.') %]
30+
</p>
31+
<p class="errorfield" id="error-app_id" style="display:none"></p>
32+
</div>
33+
</div>
34+
</fieldset>
35+
<fieldset class="center-aligned" id="formlayout">
36+
<div class="button" style="display:inline-block">
37+
<button class="button" id="new_endpoint">[% l('Submit') %]</button>
38+
</div>
39+
<div class="button" style="display:inline-block">
40+
<button class="button" id="reset_endpoint">[% l('Reset to Original Settings') %]</button>
41+
</div>
42+
</fieldset>
43+
</div>
44+
</div>
45+
</div>
46+
</div>

0 commit comments

Comments
 (0)