diff --git a/package-lock.json b/package-lock.json index 084250428a..bbfc0ce41b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1743,6 +1743,11 @@ "resolved": "https://registry.npmjs.org/chosen-js/-/chosen-js-1.8.7.tgz", "integrity": "sha512-eVdrZJ2U5ISdObkgsi0od5vIJdLwq1P1Xa/Vj/mgxkMZf14DlgobfB6nrlFi3kW4kkvKLsKk4NDqZj1MU1DCpw==" }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -2784,9 +2789,9 @@ "dev": true }, "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esutils": { @@ -3321,6 +3326,14 @@ "rimraf": "^2.2.8" } }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "requires": { + "minipass": "^2.2.1" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3654,9 +3667,9 @@ "optional": true }, "grunt": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.3.tgz", - "integrity": "sha512-/JzmZNPfKorlCrrmxWqQO4JVodO+DVd5XX4DkocL/1WlLlKVLE9+SdEIempOAxDhWPysLle6afvn/hg7Ck2k9g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.4.tgz", + "integrity": "sha512-PYsMOrOC+MsdGEkFVwMaMyc6Ob7pKmq+deg1Sjr+vvMWp35sztfwKE7qoN51V+UEtHsyNuMcGdgMLFkBHvMxHQ==", "dev": true, "requires": { "coffeescript": "~1.10.0", @@ -3670,7 +3683,7 @@ "grunt-legacy-log": "~2.0.0", "grunt-legacy-util": "~1.1.1", "iconv-lite": "~0.4.13", - "js-yaml": "~3.5.2", + "js-yaml": "~3.13.0", "minimatch": "~3.0.2", "mkdirp": "~0.5.1", "nopt": "~3.0.6", @@ -5081,9 +5094,9 @@ } }, "jquery": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", - "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", + "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" }, "jquery-mousewheel": { "version": "3.1.13", @@ -5133,13 +5146,13 @@ "dev": true }, "js-yaml": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", - "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { - "argparse": "^1.0.2", - "esprima": "^2.6.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -5327,24 +5340,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, "logalot": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/logalot/-/logalot-2.1.0.tgz", @@ -5569,6 +5564,30 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + }, + "dependencies": { + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } + }, "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", @@ -5632,9 +5651,9 @@ "dev": true }, "nan": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", - "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==", + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", "dev": true }, "nanomatch": { @@ -5700,7 +5719,7 @@ "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", - "tar": "^2.0.0", + "tar": "^4.4.2", "which": "1" }, "dependencies": { @@ -5713,9 +5732,9 @@ } }, "node-sass": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz", - "integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -5725,12 +5744,10 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.11", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", + "nan": "^2.13.2", "node-gyp": "^3.8.0", "npmlog": "^4.0.0", "request": "^2.88.0", @@ -7507,17 +7524,10 @@ "supports-color": "^5.3.0" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "optional": true - }, "js-yaml": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", - "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "optional": true, "requires": { @@ -7538,14 +7548,24 @@ } }, "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.2.tgz", + "integrity": "sha512-BfkE9CciGGgDsATqkikUHrQrraBCO+ke/1f6SFAEMnxyyfN9lxC+nW1NFWMpqH865DhHIy9vQi682gk1X7friw==", + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + }, + "dependencies": { + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } } }, "tar-stream": { diff --git a/package.json b/package.json index fdf6bf68d6..7c665d7d71 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "babel-preset-stage-0": "^6.5.0", "concurrently": "^3.3.0", "connect": "^3.6.1", - "grunt": "^1.0.1", + "grunt": "^1.0.4", "grunt-babel": "^6.0.0", "grunt-bump": "^0.3.0", "grunt-cli": "^1.2.0", @@ -39,9 +39,10 @@ "grunt-shell": "^1.1.2", "grunt-text-replace": "^0.4.0", "lodash": "^4.17.5", - "node-sass": "^4.11.0" + "node-sass": "^4.12.0" }, "scripts": { + "deploy-branch": "grunt deploy-branch", "deploy-gh-pages": "grunt deploy", "start": "grunt && concurrently -k \"grunt watch\" \"grunt connect\"", "watch": "grunt watch", @@ -80,7 +81,7 @@ "datatables.net-jqui": "^1.10.15", "es6-promise": "^4.1.1", "highstock-release": "^5.0.10", - "jquery": "^3.2.1", + "jquery": "^3.4.1", "jquery-sparkline": "^2.4.0", "jquery-ui-dist": "1.12.0", "jquery-ui-iconfont": "^2.1.0", diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 66dc70a60b..c354b9325f 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -64,7 +64,7 @@ class AccountStatus { return Promise.all([ liveapi.send({ get_account_status: 1 }), liveapi.cached.send({ website_status: 1 }), - liveapi.send({ 'get_settings': 1 }), + liveapi.cached.send({ 'get_settings': 1 }), liveapi.cached.send({ get_financial_assessment: 1 }), liveapi.send({ mt5_login_list: 1 }) ]); diff --git a/src/cashier/deposit.es6 b/src/cashier/deposit.es6 index 47991f0843..771b254924 100644 --- a/src/cashier/deposit.es6 +++ b/src/cashier/deposit.es6 @@ -154,7 +154,7 @@ function init_state(root) { }); /* get the residence field and its states */ - var residence_promise = liveapi.send({ get_settings: 1 }) + var residence_promise = liveapi.cached.send({ get_settings: 1 }) .then(function(data) { state.user.residence = data.get_settings.country_code; state.user.residence_name = data.get_settings.country; diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 9e5300a757..76e616d599 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -297,7 +297,6 @@ class Withdraw { transfer.submit = () => { if (transfer.account === '' || transfer.amount === '') { - console.log(transfer); empty_fields.show(); return; } @@ -344,7 +343,7 @@ class Withdraw { } } - liveapi.send({ get_settings: 1 }) + liveapi.cached.send({ get_settings: 1 }) .then(data => { agent.residence = data.get_settings.country_code; const currency = local_storage.get('currency'); diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 39a060223e..04062c1286 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -331,6 +331,7 @@ const initConfigWindow = () => { state.allowCopy.allow_copiers = 0; } else { liveapi + .cached .send({ get_settings: 1 }) .then((settings) => { state.is_loading = false; diff --git a/src/instruments/instruments.es6 b/src/instruments/instruments.es6 index 12ee7193b1..087d47a47a 100755 --- a/src/instruments/instruments.es6 +++ b/src/instruments/instruments.es6 @@ -8,6 +8,7 @@ import "common/util"; function refresh_active_symbols() { liveapi + .cached .send({ active_symbols: 'brief' }) .then(function(data) { local_storage.set('active_symbols', data.active_symbols); diff --git a/src/selfexclusion/selfexclusion.css b/src/selfexclusion/selfexclusion.css deleted file mode 100644 index 9d3ac885b6..0000000000 --- a/src/selfexclusion/selfexclusion.css +++ /dev/null @@ -1,44 +0,0 @@ -.self-exclusion .webtrader-dialog { - width: auto !important; -} - -.selfexclusion { - padding-bottom: 20px; -} - -.selfexclusion_headerContent { - padding: 10px; -} - -.selfexclusion_bodyContent { - margin: auto; - padding: 10px; - border: solid 1px #E5E5E5; - display: table; -} - -.selfexclusion_row { - display: table-row; -} - -.selfexclusion_col { - display: table-cell; - padding: 5px 5px 10px 5px; -} - -.selfexclusion_inputHint { - font-size: 11px; -} - -.selfexclusion .text-vertical-align { - line-height:2em; -} - -.selfexclusion_input { - width : 270px; -} - -.selfexclusion_updateBtnContainer { - text-align: center; - margin-top: 5px; -} diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index f240462498..35c0f2b3ca 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -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'), @@ -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()); @@ -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; } @@ -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 }); }); } }; @@ -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; diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index f736bdf5bf..1408880d94 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -1,108 +1,118 @@ -
If you are considering self-exclusion, you may wish to register with GAMSTOP.
+GAMSTOP is a free service that enables you to self-exclude from all online gambling companies licensed in Great Britain.
+To find out more and to sign up with GAMSTOP, please visit www.gamstop.co.uk.
+Self-exclusion on this website only applies to your Binary.com account and does not include other companies or websites.
+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.
+To self-exclude from all online gambling companies licensed in Great Britain, you may go to www.gamstop.co.uk.