Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"node-sass": "^4.11.0"
},
"scripts": {
"deploy-branch": "grunt deploy-branch",
"deploy-gh-pages": "grunt deploy",
"start": "grunt && concurrently -k \"grunt watch\" \"grunt connect\"",
"watch": "grunt watch",
Expand Down
44 changes: 0 additions & 44 deletions src/selfexclusion/selfexclusion.css

This file was deleted.

25 changes: 19 additions & 6 deletions src/selfexclusion/selfexclusion.es6
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ const settingsData = {
max_open_bets: null,
session_duration_limit: null,
exclude_until: null,
has_exclude_until: null,
is_iom_malta: null,
is_gamstop_client: null,
timeout_until_date: null,
timeout_until_time: null,
binary_url_contact: getBinaryUrl('contact.html'),
Expand All @@ -109,7 +112,6 @@ const settingsData = {
const time = moment(scope.timeout_until_time, "HH:mm");
time_out.add(time.format('HH'), 'hours')
.add(time.format('mm'), 'minutes');
console.log(time_out, time.format('HH'),time.format('mm'));
}
if (time_out.isAfter(moment().add(6, "weeks"))) {
message.push("Please enter a value less than 6 weeks for time out until.".i18n());
Expand Down Expand Up @@ -156,7 +158,7 @@ const settingsData = {

if (message.length > 0) {
message.forEach(function(msg, i) {
$.growl.error({ message: msg });
$.growl.error({ message: msg, fixed: true });
})
return;
}
Expand All @@ -172,10 +174,10 @@ const settingsData = {
$.growl.notice({ message: 'Your changes have been updated'.i18n() });
logoutBasedOnExcludeDateAndTimeOut();
setOrRefreshTimer();
refreshData();
})
.catch(function(err) {
$.growl.error({ message: err.message });
console.error(err);
$.growl.error({ message: err.message, fixed: true });
});
}
};
Expand Down Expand Up @@ -245,16 +247,27 @@ const refreshData = function() {
limits[index].set = true;
}
});

settingsData.has_exclude_until = response.get_self_exclusion.exclude_until;
const country_status = getCountryStatus();
settingsData.is_iom_malta = country_status.has_iom_malta;
settingsData.is_gamstop_client = country_status.has_uk && country_status.has_iom_malta;
logoutBasedOnExcludeDateAndTimeOut();
}
})
.catch(function(err) {
$.growl.error({ message: err.message });
$.growl.error({ message: err.message, fixed: true });
console.error(err);
});
};

const getCountryStatus = function() {
const authorize = local_storage.get('authorize');
return {
has_iom_malta: /iom|malta/.test(authorize.landing_company_name),
has_uk: /gb/.test(authorize.country),
};
}

const setOrRefreshTimer = function() {

if (_.isUndefined(settingsData.session_duration_limit) || _.isNull(settingsData.session_duration_limit) || !_.isFinite(_.toNumber(settingsData.session_duration_limit))) return;
Expand Down
138 changes: 74 additions & 64 deletions src/selfexclusion/selfexclusion.html
Original file line number Diff line number Diff line change
@@ -1,108 +1,118 @@
<div class="selfexclusion">
<div class="selfexclusion_headerContent">
<div class="self-exclusion">
<div class="self-exclusion_header">
Online trading can become addictive. Fill in the form below
to limit your participation on the website or send a signed letter or fax to
our customer support team. Once set, you can only tighten your limits. Limits
will only be removed or loosened after 7 days with the exception of the self-
exclusion date, which cannot be removed or altered once you have confirmed it.
will only be removed or loosened after 7 days with the exception of the
self-exclusion date, which cannot be removed or altered once you have confirmed it.
To remove or increase your limits, please contact
<a rv-attr-href='binary_url_contact' target="_blank">customer support</a>.
</div>
<div class="selfexclusion_bodyContent">
<div class="selfexclusion_row">
<div class="selfexclusion_col">Maximum account cash balance</div>
<div class="selfexclusion_col">
<input class="selfexclusion_input" autofocus rv-value="max_balance" rv-on-change='trimString'>
<div id='gamstop_info_top' class='self-exclusion_header' rv-show='is_gamstop_client'>
<p>If you are considering self-exclusion, you may wish to register with GAMSTOP.</p>
<p>GAMSTOP is a free service that enables you to self-exclude from all online gambling companies licensed in Great Britain.</p>
<p>To find out more and to sign up with GAMSTOP, please visit <a target="_blank" rel="noopener noreferrer" href="https://www.gamstop.co.uk">www.gamstop.co.uk</a>.</p>
</div>
<div class="self-exclusion_body">
<div class="self-exclusion_row">
<div class="self-exclusion_col">Maximum account cash balance</div>
<div class="self-exclusion_col">
<input class="self-exclusion_input" autofocus rv-value="max_balance" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Once this limit is reached, you may no longer deposit.</span>
<span class="self-exclusion_input-hint">Once this limit is reached, you may no longer deposit.</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Daily turnover limit</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_turnover" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">Daily turnover limit</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_turnover" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate contract purchases per day</span>
<span class="self-exclusion_input-hint">Maximum aggregate contract purchases per day</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Daily limit on losses</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_losses" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">Daily limit on losses</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_losses" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate loss per day</span>
<span class="self-exclusion_input-hint">Maximum aggregate loss per day</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">7-day turnover limit</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_7day_turnover" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">7-day turnover limit</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_7day_turnover" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate contract purchases over a 7-day period</span>
<span class="self-exclusion_input-hint">Maximum aggregate contract purchases over a 7-day period</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">7-day limit on losses</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_7day_losses" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">7-day limit on losses</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_7day_losses" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate contract purchases over a 7-day period</span>
<span class="self-exclusion_input-hint">Maximum aggregate contract purchases over a 7-day period</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">30-day turnover limit</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_30day_turnover" min="0" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">30-day turnover limit</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_30day_turnover" min="0" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate contract purchases over a 30-day period</span>
<span class="self-exclusion_input-hint">Maximum aggregate contract purchases over a 30-day period</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">30-day limit on losses</div>
<div class="selfexclusion_col">
<input maxlength="20" class="selfexclusion_input" rv-value="max_30day_losses" min="0" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">30-day limit on losses</div>
<div class="self-exclusion_col">
<input maxlength="20" class="self-exclusion_input" rv-value="max_30day_losses" min="0" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">Maximum aggregate loss over a 30-day period</span>
<span class="self-exclusion_input-hint">Maximum aggregate loss over a 30-day period</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Maximum number of open positions</div>
<div class="selfexclusion_col">
<input class="selfexclusion_input" rv-value="max_open_bets" maxlength="3" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">Maximum number of open positions</div>
<div class="self-exclusion_col">
<input class="self-exclusion_input" rv-value="max_open_bets" maxlength="3" rv-on-change='trimString'>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Session duration limit, in minutes</div>
<div class="selfexclusion_col">
<input class="selfexclusion_input" rv-value="session_duration_limit" maxlength="5" rv-on-change='trimString'>
<div class="self-exclusion_row">
<div class="self-exclusion_col">Session duration limit, in minutes</div>
<div class="self-exclusion_col">
<input class="self-exclusion_input" rv-value="session_duration_limit" maxlength="5" rv-on-change='trimString'>
<br>
<span class="selfexclusion_inputHint">You will be automatically logged out after such time</span>
<span class="self-exclusion_input-hint">You will be automatically logged out after such time</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Time out until</div>
<div class="selfexclusion_col">
<input type="text" class="selfexclusion_input datepicker" rv-datepicker="timeout_until_date" numberOfMonths="1">
<div class="self-exclusion_row">
<div class="self-exclusion_col">Time out until</div>
<div class="self-exclusion_col">
<input type="text" class="self-exclusion_input datepicker" rv-datepicker="timeout_until_date" numberOfMonths="1">
<br>
<span class="selfexclusion_inputHint">Please enter date in the format YYYY-MM-DD</span>
<span class="self-exclusion_input-hint">Please enter date in the format YYYY-MM-DD</span>
</div>
<div class="selfexclusion_col">
<input type="text" class="selfexclusion_input timepicker" rv-timepicker="timeout_until_time">
<span class="selfexclusion_inputHint">Please enter time in the format HH:MM</span>
<div class="self-exclusion_col">
<input type="text" class="self-exclusion_input timepicker" rv-timepicker="timeout_until_time">
<span class="self-exclusion_input-hint">Please enter time in the format HH:MM</span>
</div>
</div>
<div class="selfexclusion_row">
<div class="selfexclusion_col">Exclude me from the website until</div>
<div class="selfexclusion_col">
<input type="text" class="selfexclusion_input" rv-datepicker="exclude_until" numberOfMonths="1">
<div class="self-exclusion_row">
<div class="self-exclusion_col">Exclude me from the website until</div>
<div class="self-exclusion_col">
<input type="text" class="self-exclusion_input" rv-datepicker="exclude_until" numberOfMonths="1">
<br>
<span class="selfexclusion_inputHint">Please enter date in the format YYYY-MM-DD</span>
<span class="self-exclusion_input-hint">Please enter date in the format YYYY-MM-DD</span>
</div>
</div>
</div>
<div>
<div class="selfexclusion_updateBtnContainer">
<button class="update-button text-vertical-align" rv-on-click="update">Update Settings</button>
<div class="self-exclusion_update-btn-container" rv-hide='has_exclude_until'>
<button class="self-exclusion_update-btn text-vertical-align" rv-on-click="update">Update Settings</button>
</div>
<div id='ukgc_requirement_notice' class='self-exclusion_notice' rv-show='has_exclude_until | and is_iom_malta'>
<p>Self-exclusion on this website only applies to your Binary.com account and does not include other companies or websites.</p>
<p>Since you feel the need to self-exclude, we strongly encourage you to exclude yourself from similar services that you may have signed up for.</p>
<p id='gamstop_info_bottom' rv-show='is_gamstop_client'>To self-exclude from all online gambling companies licensed in Great Britain, you may go to <a target='_blank' rel='noopener noreferrer' href='https://www.gamstop.co.uk'>www.gamstop.co.uk</a>.</p>
</div>
</div>
</div>
51 changes: 51 additions & 0 deletions src/selfexclusion/selfexclusion.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.self-exclusion {
padding-bottom: 20px;

.webtrader-dialog {
width: auto !important;
}
.text-vertical-align {
line-height: 2em;
}
&_header {
padding: 10px;

p {
margin-top: 0;
}
}
&_body {
margin: auto;
padding: 10px;
border: solid 1px #E5E5E5;
display: table;
}
&_row {
display: table-row;
}
&_col {
display: table-cell;
padding: 5px 5px 10px 5px;
}
&_input {
width : 270px;

&-hint {
font-size: 11px;
}
}
&_update-btn {
&-container {
text-align: center;
margin-top: 20px;
}
}
&_notice {
margin: 10px auto;
color: #000;
background-color: #fef1cf;
padding: 10px;
overflow: hidden;
font-size: 16px;
}
}
2 changes: 1 addition & 1 deletion src/websitestatus/websitestatus.es6
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ const set_currency_config = (website_status) => {
};

liveapi.events.on('website_status', website_status);
liveapi.cached.send({ website_status: 1 }).then(website_status);
liveapi.cached.send({ website_status: 1 }).then(website_status);