From e6f7bee2d1e6ae80cb23448060f47fb97b0428ab Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Wed, 17 Apr 2019 17:07:06 +0800 Subject: [PATCH 01/28] add message --- src/selfexclusion/selfexclusion.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index f736bdf5bf..d2ad520c48 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -101,8 +101,22 @@
+
+
+

{it.L('To self-exclude from all online gambling companies licensed in Great Britain, go to [_1].', 'www.gamstop.co.uk')}

+
+
+
+
+
+

{it.L('Self-exclusion on this website only applies to your [_1] account and does not include other companies or websites.', it.website_name)}

+

{it.L('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.')}

+

{it.L('To self-exclude from all online gambling companies licensed in Great Britain, you may go to [_1].', 'www.gamstop.co.uk')}

+
+
+
From d28f0a9658eeb793378be3c21bac1e48cbb3cb83 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Wed, 17 Apr 2019 17:15:15 +0800 Subject: [PATCH 02/28] fix it l undefined --- src/selfexclusion/selfexclusion.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index d2ad520c48..efbf001a8c 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -103,7 +103,7 @@
-

{it.L('To self-exclude from all online gambling companies licensed in Great Britain, go to [_1].', 'www.gamstop.co.uk')}

+

To self-exclude from all online gambling companies licensed in Great Britain, go to www.gamstop.co.uk

@@ -112,9 +112,9 @@
-

{it.L('Self-exclusion on this website only applies to your [_1] account and does not include other companies or websites.', it.website_name)}

-

{it.L('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.')}

-

{it.L('To self-exclude from all online gambling companies licensed in Great Britain, you may go to [_1].', '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.

From a6e275483e6088eecff6b9c58ebc237854e8a486 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Thu, 18 Apr 2019 14:00:21 +0800 Subject: [PATCH 03/28] add styling --- src/selfexclusion/selfexclusion.css | 8 ++++++++ src/selfexclusion/selfexclusion.html | 18 ++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/selfexclusion/selfexclusion.css b/src/selfexclusion/selfexclusion.css index 9d3ac885b6..a0a4cb8e5e 100644 --- a/src/selfexclusion/selfexclusion.css +++ b/src/selfexclusion/selfexclusion.css @@ -42,3 +42,11 @@ text-align: center; margin-top: 5px; } + +.selfexclusion_notice { + margin: 10px auto; + color: #000; + background-color: #fef1cf; + padding: 10px; + overflow: hidden; +} \ No newline at end of file diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index efbf001a8c..a74e0cbebb 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -101,22 +101,16 @@
-
-
-

To self-exclude from all online gambling companies licensed in Great Britain, go to 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.

-
-
+
From 3e3ec4ed4907ff7be06bbd5c45387ef45c0397cb Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Thu, 18 Apr 2019 14:15:31 +0800 Subject: [PATCH 04/28] change to scss --- src/selfexclusion/selfexclusion.css | 52 ----------- src/selfexclusion/selfexclusion.html | 130 +++++++++++++-------------- src/selfexclusion/selfexclusion.scss | 47 ++++++++++ 3 files changed, 112 insertions(+), 117 deletions(-) delete mode 100644 src/selfexclusion/selfexclusion.css create mode 100644 src/selfexclusion/selfexclusion.scss diff --git a/src/selfexclusion/selfexclusion.css b/src/selfexclusion/selfexclusion.css deleted file mode 100644 index a0a4cb8e5e..0000000000 --- a/src/selfexclusion/selfexclusion.css +++ /dev/null @@ -1,52 +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; -} - -.selfexclusion_notice { - margin: 10px auto; - color: #000; - background-color: #fef1cf; - padding: 10px; - overflow: hidden; -} \ No newline at end of file diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index a74e0cbebb..f3eed398b7 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -1,113 +1,113 @@ -
-
+
+
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- + 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 customer support.
-
-
-
Maximum account cash balance
-
- +
+
+
Maximum account cash balance
+
+
- Once this limit is reached, you may no longer deposit. + Once this limit is reached, you may no longer deposit.
-
-
Daily turnover limit
-
- +
+
Daily turnover limit
+
+
- Maximum aggregate contract purchases per day + Maximum aggregate contract purchases per day
-
-
Daily limit on losses
-
- +
+
Daily limit on losses
+
+
- Maximum aggregate loss per day + Maximum aggregate loss per day
-
-
7-day turnover limit
-
- +
+
7-day turnover limit
+
+
- Maximum aggregate contract purchases over a 7-day period + Maximum aggregate contract purchases over a 7-day period
-
-
7-day limit on losses
-
- +
+
7-day limit on losses
+
+
- Maximum aggregate contract purchases over a 7-day period + Maximum aggregate contract purchases over a 7-day period
-
-
30-day turnover limit
-
- +
+
30-day turnover limit
+
+
- Maximum aggregate contract purchases over a 30-day period + Maximum aggregate contract purchases over a 30-day period
-
-
30-day limit on losses
-
- +
+
30-day limit on losses
+
+
- Maximum aggregate loss over a 30-day period + Maximum aggregate loss over a 30-day period
-
-
Maximum number of open positions
-
- +
+
Maximum number of open positions
+
+
-
-
Session duration limit, in minutes
-
- +
+
Session duration limit, in minutes
+
+
- You will be automatically logged out after such time + You will be automatically logged out after such time
-
-
Time out until
-
- +
+
Time out until
+
+
- Please enter date in the format YYYY-MM-DD + Please enter date in the format YYYY-MM-DD
-
- - Please enter time in the format HH:MM +
+ + Please enter time in the format HH:MM
-
-
Exclude me from the website until
-
- +
+
Exclude me from the website until
+
+
- Please enter date in the format YYYY-MM-DD + Please enter date in the format YYYY-MM-DD
-
-
+
-
+

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.

From 7bff6ce5da8e643afbfb5366f9c0797a17ce1951 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Thu, 18 Apr 2019 17:29:27 +0800 Subject: [PATCH 07/28] fix website status issue and refresh on update --- src/selfexclusion/selfexclusion.es6 | 8 ++++++-- src/selfexclusion/selfexclusion.html | 12 ++++++------ src/websitestatus/websitestatus.es6 | 2 -- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 050c51141b..a67887355b 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -85,6 +85,7 @@ const settingsData = { max_open_bets: null, session_duration_limit: null, exclude_until: null, + has_exclude_until: null, is_gamstop_client: null, timeout_until_date: null, timeout_until_time: null, @@ -172,6 +173,7 @@ const settingsData = { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); setOrRefreshTimer(); + refreshData(); }) .catch(function(err) { $.growl.error({ message: err.message }); @@ -245,7 +247,8 @@ const refreshData = function() { limits[index].set = true; } }); - + settingsData.has_exclude_until = response.get_self_exclusion.exclude_until; + settingsData.is_gamstop_client = isGamstopClient(); logoutBasedOnExcludeDateAndTimeOut(); } }) @@ -256,7 +259,8 @@ const refreshData = function() { }; const isGamstopClient = function() { - + const authorize = local_storage.get('authorize'); + return /gb/.test(authorize.country) && /iom|malta/.test(authorize.landing_company_name); } const setOrRefreshTimer = function() { diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index 7a3687cbce..60f1ddd697 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -3,12 +3,12 @@ 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 customer support.
-
+

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.

@@ -106,13 +106,13 @@
-
+
-
+

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.

+

To self-exclude from all online gambling companies licensed in Great Britain, you may go to www.gamstop.co.uk.

diff --git a/src/websitestatus/websitestatus.es6 b/src/websitestatus/websitestatus.es6 index 1859d8ecf2..b4f7708692 100644 --- a/src/websitestatus/websitestatus.es6 +++ b/src/websitestatus/websitestatus.es6 @@ -31,5 +31,3 @@ const set_currency_config = (website_status) => { } }; -liveapi.events.on('website_status', website_status); -liveapi.cached.send({ website_status: 1, subscribe: 1 }).then(website_status); From effafcec911aaadc305f23f335095872c43fca61 Mon Sep 17 00:00:00 2001 From: Ashkan Date: Fri, 19 Apr 2019 04:50:29 +0200 Subject: [PATCH 08/28] New translations messages.pot (Italian) --- translations/i18n/it.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translations/i18n/it.po b/translations/i18n/it.po index 1df0efb0be..2151fcff8e 100644 --- a/translations/i18n/it.po +++ b/translations/i18n/it.po @@ -7,10 +7,10 @@ msgstr "" "X-Crowdin-File: /development/translations/i18n/messages.pot\n" "Project-Id-Version: webtrader\n" "Content-Type: text/plain; charset=UTF-8\n" -"Last-Translator: binarycom \n" +"Last-Translator: binarycom\n" "Language-Team: Italian\n" "Language: it_IT\n" -"PO-Revision-Date: 2019-03-20 16:02\n" +"PO-Revision-Date: 2019-04-19 02:50\n" msgid "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" msgstr "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" @@ -802,16 +802,16 @@ msgid "In order to properly apply theme, a full refresh of page is required. Are msgstr "Per poter applicare lo sfondo in modo adeguato, è richiesto l'aggiornamento della pagina. Sei sicuro di voler procedere?" msgid "In the EU, financial products are offered by Binary Investments (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta, licensed and regulated as a Category 3 Investment Services provider by the Malta Financial Services Authority ([_1]licence no. IS/70156[_2])." -msgstr "" +msgstr "Nell'UE, i prodotti finanziari sono offerti da Binary Investments (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta, autorizzata e regolamentata come appartenente alla Categoria 3 dei fornitori di servizi di investimento dalla Malta Financial Services Authority ([_1]licenza n. IS/70156[_2])." msgid "In the EU, financial products are offered by Binary Investments (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta, regulated as a Category 3 Investment Services provider by the Malta Financial Services Authority ([_1]licence no. IS/70156[_2])." -msgstr "" +msgstr "Nell'UE, i prodotti finanziari sono offerti da Binary Investments (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta, regolamentata come appartenente alla Categoria 3 dei fornitori di servizi di investimento dalla Malta Financial Services Authority ([_1]licenza n. IS/70156[_2])." msgid "In the Isle of Man and the UK, Volatility Indices are offered by Binary (IOM) Ltd., First Floor, Millennium House, Victoria Road, Douglas, IM2 4RW, Isle of Man, British Isles; licensed and regulated respectively by (1) the Gambling Supervision Commission in the Isle of Man (current licence issued on 31 August 2017) and by (2) the Gambling Commission in the UK (licence [_1]reference no: 39172[_2])." msgstr "Nell'Isola di Man e nel Regno Unito, gli indici di volatilità sono offerti da Binary (IOM) Ltd., primo piano, Millennium House, Victoria Road, Douglas, IM2 4RW, Isola di Man, Isole Britanniche; autorizzata e regolamentata rispettivamente dalla (1) Gambling Supervision Commission dell'Isola di Man (licenza attuale emessa il 31 agosto 2017) e dalla (2) Gambling Commission del Regno Unito ([_1]licenza n. 39172[_2])." msgid "In the rest of the EU, Volatility Indices are offered by Binary (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta; licensed and regulated by (1) the Malta Gaming Authority in Malta (licence no. MGA/B2C/102/2000 issued on 01 August 2018), for UK clients by (2) the UK Gambling Commission (licence [_1]reference no: 39495[_2]), and for Irish clients by (3) the Revenue Commissioners in Ireland (Remote Bookmaker's Licence no. 1010285 issued on 1 July 2017). View complete [_3]Regulatory Information[_4]." -msgstr "" +msgstr "Nel resto dell'UE, gli indici di volatilità sono offerti dalla Binary (Europe) Ltd., Mompalao Building, Suite 2, Tower Road, Msida MSD1825, Malta, autorizzata e regolamentata dalla (1) Malta Gaming Authority di Malta (licenza n. MGA/B2C/102/2000 rilasciata il 01 agosto 2018); per i clienti nel Regno Unito dalla (2) UK Gambling Commission (licenza [_1]n. 39495[_2]) e per i clienti in Irlanda dalla (3) Revenue Commissioners irlandese (licenza del Remote Bookmaker n. 1010285 emessa l'1 luglio 2017). Consulta le [_3]informazioni complete sulla regolamentazione[_4]." msgid "In/Out" msgstr "In/Out" @@ -928,16 +928,16 @@ msgid "Loading Statement Table ..." msgstr "Caricamento dell'estratto conto..." msgid "Loading Token management ..." -msgstr "" +msgstr "Caricamento della gestione dei token ..." msgid "Loading Trading Times ..." -msgstr "" +msgstr "Caricamento degli orari di trading ..." msgid "Loading chart and trade menus ..." -msgstr "" +msgstr "Caricamento dei menu grafici e di trading ..." msgid "Loading custom theme configuration..." -msgstr "" +msgstr "Caricamento della configurazione dello sfondo personalizzata..." msgid "Loading portfolio ..." msgstr "Caricamento del portafoglio..." From b3577afe87f6a38a8568fdc7a74220fe688150ce Mon Sep 17 00:00:00 2001 From: Ashkan Date: Fri, 19 Apr 2019 05:00:31 +0200 Subject: [PATCH 09/28] New translations messages.pot (Italian) --- translations/i18n/it.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translations/i18n/it.po b/translations/i18n/it.po index 2151fcff8e..7f85932c78 100644 --- a/translations/i18n/it.po +++ b/translations/i18n/it.po @@ -10,7 +10,7 @@ msgstr "" "Last-Translator: binarycom\n" "Language-Team: Italian\n" "Language: it_IT\n" -"PO-Revision-Date: 2019-04-19 02:50\n" +"PO-Revision-Date: 2019-04-19 03:00\n" msgid "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" msgstr "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" @@ -1171,7 +1171,7 @@ msgid "Other" msgstr "Altro" msgid "Outside the EU, financial products are offered by Binary (C.R.) S.A., 5th Floor, Building 6 Centro Ejecutivo La Sabana, Sabana Sur, San José, Costa Rica, Binary (V) Ltd, Govant Building, Port Vila, PO Box 1276, Vanuatu, regulated by the Vanuatu Financial Services Commission ([_1]view licence[_2]), Binary (BVI) Ltd, 2nd Floor, O’Neal Marketing Associates Building, Wickham’s Cay II, P.O. Box 3174, Road Town, Tortola VB1110, British Virgin Islands, regulated by the British Virgin Islands Financial Services Commission ([_3]licence no. SIBA/L/18/1114[_4]), and Binary (FX) Ltd., Lot No. F16, First Floor, Paragon Labuan, Jalan Tun Mustapha, 87000 Labuan, Malaysia, regulated by the Labuan Financial Services Authority to carry on a money-broking business ([_5]licence no. MB/18/0024[_6])" -msgstr "" +msgstr "Al di fuori dell'UE, i prodotti finanziari vengono offerti da Binary (C.R.) S.A., quinto piano, Building 6 Centro Ejecutivo La Sabana, Sabana Sur, San José, Costa Rica, Binary (V) Ltd, Govant Building, Port Vila, PO Box 1276, Vanuatu, regolamentata dalla Vanuatu Financial Services Commission ([_1]visualizza licenza[_2]); Binary (BVI) Ltd, secondo piano, O’Neal Marketing Associates Building, Wickham’s Cay II, P.O. Box 3174, Road Town, Tortola VB1110, Isole Vergini britanniche, regolamentata dalla British Virgin Islands Financial Services Commission ([_3]licenza n. SIBA/L/18/1114[_4]) e Binary (FX) Ltd., lotto n. F16, primo piano, Paragon Labuan, Jalan Tun Mustapha, 87000 Labuan, Malaysia, regolamentata dalla Labuan Financial Services Authority per eseguire attività di intermediazione nel mercato finanziario ([_5]licenza n. MB/18/0024[_6])" msgid "Over" msgstr "Su" @@ -1183,7 +1183,7 @@ msgid "Overlap Studies" msgstr "Studi sovrapposti" msgid "PM" -msgstr "" +msgstr "PM" msgid "Password successfully updated." msgstr "La password è stata aggiornata." @@ -1453,7 +1453,7 @@ msgid "Self-Exclusion" msgstr "Auto esclusione" msgid "Self-Exclusion Facilities" -msgstr "" +msgstr "Funzioni di auto esclusione" msgid "Sell At Market" msgstr "Vendere sul mercato" @@ -1606,7 +1606,7 @@ msgid "The company holds customer funds in separate bank accounts to the operati msgstr "La società detiene i fondi dei clienti in conti bancari separati da quelli operativi, i quali non faranno parte, in caso di insolvenza, dell'asset della Società. Ciò rispecchia i requisiti della Commissione sul gioco d'azzardo per la segregazione dei fondi dei clienti a livello" msgid "The financial products offered via this website include binary options, contracts for difference (\"CFDs\") and other complex derivatives and financial products. Trading binary options may not be suitable for everyone. Trading CFDs carries a high level of risk since leverage can work both to your advantage and disadvantage. As a result, the products offered on this website may not be suitable for all investors because of the risk of losing all of your invested capital. You should never invest money that you cannot afford to lose, and never trade with borrowed money. Before trading in the complex financial products offered, please be sure to understand the risks involved and learn about [_1]Responsible Trading[_2]." -msgstr "" +msgstr "I prodotti finanziari offerti tramite il presente sito web includono opzioni binarie, contratti per differenza (CFD) e altri complessi strumenti derivati e prodotti finanziari. Il trading di opzioni binarie potrebbe non essere adatto a tutti. Il trading di CFD implica un elevato livello di rischio, poiché la leva finanziaria può agire sia a vantaggio che a svantaggio del Cliente. Di conseguenza, i prodotti finanziari offerti su questo sito web potrebbero non essere idonei per tutti gli investitori a causa del rischio di perdere l'intero capitale investito. È raccomandabile che i clienti non investano denaro che non possono permettersi di perdere e non effettuino trade con denaro prestato. Prima di fare trading con i complessi strumenti finanziari offerti, suggeriamo di accertarsi di comprendere i rischi potenziali e approfondire il tema del [_1]Trading Responsabile[_2]." msgid "There was a market data disruption during the contract period. For real-money accounts we will attempt to correct this and settle the contract properly, otherwise the contract will be cancelled and refunded. Virtual-money contracts will be cancelled and refunded." msgstr "" @@ -1627,7 +1627,7 @@ msgid "This field is required" msgstr "Questo campo è obbligatorio" msgid "This website’s services are not made available in certain countries such as the USA, Canada, Costa Rica, Hong Kong, Japan, or to persons under age 18." -msgstr "" +msgstr "I servizi di questo sito web non vengono resi disponibili in alcuni paesi come USA, Canada, Costa Rica, Hong Kong e Giappone, e agli individui di età inferiore ai 18 anni." msgid "Thu" msgstr "Gio" From 6c7f4041f32a753b96c5031f7490baca3d652d6f Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 19 Apr 2019 15:18:48 +0800 Subject: [PATCH 10/28] upgrade dependencies --- package-lock.json | 37 +++++++++++++++---------------------- package.json | 2 +- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 084250428a..fa2759469c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2784,9 +2784,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": { @@ -3654,9 +3654,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 +3670,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", @@ -5133,13 +5133,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": { @@ -7507,17 +7507,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": { diff --git a/package.json b/package.json index fdf6bf68d6..81424dd959 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", From 1f50e01ced09ae4fc3afd8306874f311701c4673 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 19 Apr 2019 15:23:43 +0800 Subject: [PATCH 11/28] prolong the message display --- src/selfexclusion/selfexclusion.es6 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index a67887355b..2188335a0f 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -176,8 +176,10 @@ const settingsData = { refreshData(); }) .catch(function(err) { - $.growl.error({ message: err.message }); - console.error(err); + $.growl.error({ + message: err.message, + duration: 7000, + }); }); } }; From d5c3586a595edf2ec548e611e7039005fd4b71de Mon Sep 17 00:00:00 2001 From: Ashkan Date: Mon, 22 Apr 2019 04:40:31 +0200 Subject: [PATCH 12/28] New translations messages.pot (Italian) --- translations/i18n/it.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translations/i18n/it.po b/translations/i18n/it.po index 7f85932c78..17443f4827 100644 --- a/translations/i18n/it.po +++ b/translations/i18n/it.po @@ -10,7 +10,7 @@ msgstr "" "Last-Translator: binarycom\n" "Language-Team: Italian\n" "Language: it_IT\n" -"PO-Revision-Date: 2019-04-19 03:00\n" +"PO-Revision-Date: 2019-04-22 02:40\n" msgid "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" msgstr "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" @@ -2101,5 +2101,5 @@ msgid "| Return" msgstr "| Rendimento" msgid "" -msgstr "" +msgstr "" From 876bbdc2eb85cb1bfbc6dc09b95dd59057380df1 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 22 Apr 2019 17:12:19 +0800 Subject: [PATCH 13/28] fixed growl --- src/selfexclusion/selfexclusion.es6 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 2188335a0f..c9230da76f 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -157,7 +157,7 @@ const settingsData = { if (message.length > 0) { message.forEach(function(msg, i) { - $.growl.error({ message: msg }); + $.growl.error({ message: msg, fixed: true }); }) return; } @@ -176,10 +176,7 @@ const settingsData = { refreshData(); }) .catch(function(err) { - $.growl.error({ - message: err.message, - duration: 7000, - }); + $.growl.error({ message: err.message, fixed: true }); }); } }; @@ -255,7 +252,7 @@ const refreshData = function() { } }) .catch(function(err) { - $.growl.error({ message: err.message }); + $.growl.error({ message: err.message, fixed: true }); console.error(err); }); }; From 7e2e1a975f64078137ba7c68670f0eb5759e4394 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 22 Apr 2019 17:14:08 +0800 Subject: [PATCH 14/28] add deploy branch script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 81424dd959..08677ddea7 100644 --- a/package.json +++ b/package.json @@ -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", From 998c4af485482c045bfcee85a3e5dc8786f66055 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 22 Apr 2019 20:25:08 +0800 Subject: [PATCH 15/28] add getcountry status --- src/selfexclusion/selfexclusion.es6 | 12 +++++++++--- src/selfexclusion/selfexclusion.html | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index c9230da76f..35c0f2b3ca 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -86,6 +86,7 @@ const settingsData = { 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, @@ -247,7 +248,9 @@ const refreshData = function() { } }); settingsData.has_exclude_until = response.get_self_exclusion.exclude_until; - settingsData.is_gamstop_client = isGamstopClient(); + 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(); } }) @@ -257,9 +260,12 @@ const refreshData = function() { }); }; -const isGamstopClient = function() { +const getCountryStatus = function() { const authorize = local_storage.get('authorize'); - return /gb/.test(authorize.country) && /iom|malta/.test(authorize.landing_company_name); + return { + has_iom_malta: /iom|malta/.test(authorize.landing_company_name), + has_uk: /gb/.test(authorize.country), + }; } const setOrRefreshTimer = function() { diff --git a/src/selfexclusion/selfexclusion.html b/src/selfexclusion/selfexclusion.html index 60f1ddd697..1408880d94 100644 --- a/src/selfexclusion/selfexclusion.html +++ b/src/selfexclusion/selfexclusion.html @@ -109,7 +109,7 @@
-
+

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.

From d668b2ffb4e792a12e10540e8526abd183d73b4a Mon Sep 17 00:00:00 2001 From: Ashkan Date: Thu, 25 Apr 2019 04:50:28 +0200 Subject: [PATCH 16/28] New translations messages.pot (Chinese Simplified) --- translations/i18n/zh_cn.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translations/i18n/zh_cn.po b/translations/i18n/zh_cn.po index 80b60f7d46..4c10283ec2 100644 --- a/translations/i18n/zh_cn.po +++ b/translations/i18n/zh_cn.po @@ -7,10 +7,10 @@ msgstr "" "X-Crowdin-File: /development/translations/i18n/messages.pot\n" "Project-Id-Version: webtrader\n" "Content-Type: text/plain; charset=UTF-8\n" -"Last-Translator: binarycom \n" +"Last-Translator: binarycom\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" -"PO-Revision-Date: 2019-04-05 14:40\n" +"PO-Revision-Date: 2019-04-25 02:50\n" msgid "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" msgstr "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" @@ -187,7 +187,7 @@ msgid "Account token not found." msgstr "找不到账户令牌。" msgid "Action" -msgstr "操作" +msgstr "交易" msgid "Active" msgstr "活跃" From b57567185a642172759bb74d25c2793718b1f6ca Mon Sep 17 00:00:00 2001 From: Ashkan Date: Thu, 25 Apr 2019 04:50:31 +0200 Subject: [PATCH 17/28] New translations messages.pot (Chinese Traditional) --- translations/i18n/zh_tw.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translations/i18n/zh_tw.po b/translations/i18n/zh_tw.po index 8725b6a20c..62a55eaa7d 100644 --- a/translations/i18n/zh_tw.po +++ b/translations/i18n/zh_tw.po @@ -7,10 +7,10 @@ msgstr "" "X-Crowdin-File: /development/translations/i18n/messages.pot\n" "Project-Id-Version: webtrader\n" "Content-Type: text/plain; charset=UTF-8\n" -"Last-Translator: binarycom \n" +"Last-Translator: binarycom\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2019-04-05 14:40\n" +"PO-Revision-Date: 2019-04-25 02:50\n" msgid "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" msgstr "\"http://www.gamblingcommission.gov.uk/Consumers/Protection-of-customer-funds.aspx\"" @@ -187,7 +187,7 @@ msgid "Account token not found." msgstr "找不到帳戶權杖。" msgid "Action" -msgstr "動作" +msgstr "交易" msgid "Active" msgstr "活躍" From b751a4f497cef85f11da66959b3d5c638fe9d714 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 29 Apr 2019 13:40:09 +0800 Subject: [PATCH 18/28] change send to cached send --- src/accountstatus/accountstatus.es6 | 6 +++--- src/cashier/deposit.es6 | 6 +++--- src/cashier/uk_funds_protection.es6 | 2 +- src/cashier/withdraw.es6 | 13 ++++++------- src/charts/chartingRequestMap.es6 | 2 +- src/copytrade/copytrade.es6 | 8 ++++++-- src/instruments/instruments.es6 | 1 + src/password/password.es6 | 2 +- src/portfolio/portfolio.es6 | 12 ++++++------ src/profittable/profitTable.es6 | 2 +- src/realitycheck/realitycheck.es6 | 1 + src/selfexclusion/selfexclusion.es6 | 3 ++- src/statement/statement.es6 | 4 +++- src/tc/tc.es6 | 2 +- src/token/token.es6 | 6 +++--- src/trade/tradeConf.es6 | 2 +- src/trade/tradeDialog.es6 | 10 +++++----- src/trade/tradeMenu.es6 | 1 + src/viewtransaction/viewTransaction.es6 | 6 +++--- src/windows/tracker.es6 | 1 + src/windows/windows.es6 | 1 + 21 files changed, 51 insertions(+), 40 deletions(-) diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 66dc70a60b..98c9c0043b 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -62,11 +62,11 @@ class AccountStatus { getStatus() { // Getting account status, website status, account settings and financial assessment. return Promise.all([ - liveapi.send({ get_account_status: 1 }), + liveapi.cached.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 }) + liveapi.cached.send({ mt5_login_list: 1 }) ]); } diff --git a/src/cashier/deposit.es6 b/src/cashier/deposit.es6 index 47991f0843..4bbed14378 100644 --- a/src/cashier/deposit.es6 +++ b/src/cashier/deposit.es6 @@ -136,7 +136,7 @@ function init_state(root) { deposit_win_view = rv.bind(root[0], state); /* get the cashier_url */ - liveapi.send({ + liveapi.cached.send({ cashier: 'deposit' }).then(function(data) { state.user.cashier_url = data.cashier; @@ -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; @@ -165,7 +165,7 @@ function init_state(root) { residence_promise.then(function() { if (!state.user.residence) return { paymentagent_list: { list: [] } }; - return liveapi.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); + return liveapi.cached.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); }).then((data) => { const pa_list = data.paymentagent_list.list .map((agent) => { diff --git a/src/cashier/uk_funds_protection.es6 b/src/cashier/uk_funds_protection.es6 index 64c022c78d..7ec4beed3c 100644 --- a/src/cashier/uk_funds_protection.es6 +++ b/src/cashier/uk_funds_protection.es6 @@ -22,7 +22,7 @@ export const init_win = () => new Promise((resolve, reject) => { }); const state = {}; state.accept = () => { - liveapi.send({ + liveapi.cached.send({ "tnc_approval": 1, "ukgc_funds_protection": 1 }).then(resolve,reject).then(()=>{ diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 9e5300a757..c10557883d 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -177,7 +177,7 @@ class Withdraw { } agent.hint = `Min: ${agent.min_amount} Max: ${agent.max_amount}`.i18n(); - liveapi.send({ + liveapi.cached.send({ verify_email: email, type: type }) @@ -205,7 +205,7 @@ class Withdraw { if (menu.choice === 'standard') { verify.disabled = true; - liveapi.send({ + liveapi.cached.send({ cashier: 'withdraw', verification_code: verify.token }) @@ -283,7 +283,7 @@ class Withdraw { verification_code: verify.code }; agent.disabled = true; - liveapi.send(request) + liveapi.cached.send(request) .then(data => { route.update('agent-done') agent.disabled = false; @@ -297,7 +297,6 @@ class Withdraw { transfer.submit = () => { if (transfer.account === '' || transfer.amount === '') { - console.log(transfer); empty_fields.show(); return; } @@ -309,7 +308,7 @@ class Withdraw { amount: transfer.amount }; transfer.disabled = true; - liveapi.send(req) + liveapi.cached.send(req) .then(data => { transfer.account = transfer.account.split("_to_")[1]; route.update('transfer-done'); @@ -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'); @@ -355,7 +354,7 @@ class Withdraw { }) .catch(error_handler); - liveapi.send({ payout_currencies: 1 }) + liveapi.cached.send({ payout_currencies: 1 }) .then(data => { agent.currency = data.payout_currencies[0]; }).catch(err => console.error(err)); diff --git a/src/charts/chartingRequestMap.es6 b/src/charts/chartingRequestMap.es6 index 68e6375b0f..9291879001 100644 --- a/src/charts/chartingRequestMap.es6 +++ b/src/charts/chartingRequestMap.es6 @@ -95,7 +95,7 @@ export const register = function(options) { map[key] = { symbol: options.symbol, granularity: granularity, subscribers: 0, chartIDs: [] }; if (req.subscribe) map[key].subscribers = 1; // how many charts have subscribed for a stream - return liveapi.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout + return liveapi.cached.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout .catch((up) => { /* if the market is closed try the same request without subscribing */ if (req.subscribe && up.code === 'MarketIsClosed') { diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 39a060223e..9469446a5c 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -87,6 +87,7 @@ instrumentPromise().then(instruments => { const refreshTraderStats = (loginid, token, scope) => { return new Promise((resolve, reject) => { liveapi + .cached .send({ copytrading_statistics: 1, trader_id: loginid, @@ -134,6 +135,7 @@ const state = { state.is_loading = true; liveapi + .cached .send({ set_settings: 1, allow_copiers, @@ -174,6 +176,7 @@ const state = { if (!settingsToSend.trade_types || settingsToSend.trade_types.length <= 0) delete settingsToSend.trade_types; liveapi + .cached .send(settingsToSend) .then(() => { newObj.disableStart = false; @@ -192,7 +195,7 @@ const state = { } } else { //Stop copying - liveapi.send({ + liveapi.cached.send({ copy_stop: state.traderTokens[index].yourCopySettings.copy_start }) .then(() => { @@ -211,7 +214,7 @@ const state = { const toBeRemovedItem = state.traderTokens[index]; state.traderTokens.splice(index, 1); updateLocalStorage(state); - liveapi.send({ + liveapi.cached.send({ copy_stop: toBeRemovedItem.yourCopySettings.copy_start }) .catch(e => {}); @@ -331,6 +334,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/password/password.es6 b/src/password/password.es6 index f689841c5d..e3f026193e 100644 --- a/src/password/password.es6 +++ b/src/password/password.es6 @@ -95,7 +95,7 @@ const init_state = (root) => { new_password: state.account.new_password }; state.btn.disabled = true; - liveapi.send(request) + liveapi.cached.send(request) .then((data) =>{ if(data.change_password !== 1){ throw { message: 'Failed to update the password'.i18n()}; diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index fe09660288..a9d0cb3a46 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -63,7 +63,7 @@ const proposalOpenContract = (command) => { if(command === 'subscribe') { ++subscribers; if(!subscribed_before && subscribers > 0) { - liveapi.send({ proposal_open_contract: 1,subscribe: 1 }) + liveapi.cached.send({ proposal_open_contract: 1,subscribe: 1 }) .then((data) => { subscribed_before = true; }) .catch((err) => { console.error(err); @@ -74,7 +74,7 @@ const proposalOpenContract = (command) => { else if(command === 'forget') { --subscribers; if(subscribed_before && subscribers === 0) { - liveapi.send({ forget_all: 'proposal_open_contract' }) + liveapi.cached.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; }) @@ -85,7 +85,7 @@ const proposalOpenContract = (command) => { } } else if( command === 'resubscribe' ) { - liveapi.send({ forget_all: 'proposal_open_contract' }) + liveapi.cached.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; --subscribers; @@ -157,7 +157,7 @@ const initPortfolioWin = () => { } }); - liveapi.send({ balance: 1 }) + liveapi.cached.send({ balance: 1 }) .then((data) => { currency = data.balance.currency; portfolioWin = windows.createBlankWindow($('
'), { @@ -183,7 +183,7 @@ const initPortfolioWin = () => { liveapi.events.off('transaction', on_transaction); }, refresh: () => { - liveapi.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); + liveapi.cached.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); forget_the_contracts(subscribed_contracts).then(init_table); } }); @@ -262,7 +262,7 @@ const forget_the_contracts = (contracts) => { const init_table = async () => { const processing_msg = $('#' + table.attr('id') + '_processing').show(); try { - const data = await liveapi.send({ portfolio: 1 }); + const data = await liveapi.cached.send({ portfolio: 1 }); const contracts = (data.portfolio && data.portfolio.contracts); //|| [ // { diff --git a/src/profittable/profitTable.es6 b/src/profittable/profitTable.es6 index 2e0133ff8b..517f6e1484 100644 --- a/src/profittable/profitTable.es6 +++ b/src/profittable/profitTable.es6 @@ -91,7 +91,7 @@ const refreshTable = (yyyy_mm_dd) => { processing_msg.hide(); }; - liveapi.send(request) + liveapi.cached.send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/realitycheck/realitycheck.es6 b/src/realitycheck/realitycheck.es6 index 1ab6496392..dbd2a0b916 100644 --- a/src/realitycheck/realitycheck.es6 +++ b/src/realitycheck/realitycheck.es6 @@ -67,6 +67,7 @@ const setOrRefreshTimer = (timeOutInMins) => { const logoutAfter_ms = timeOutInMins * 60 * 1000; timerHandler = setTimeout(() => { liveapi + .cached .send({ reality_check : 1 }) .then((data) => { /* diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index f240462498..d96c3db7a9 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -167,7 +167,7 @@ const settingsData = { } } - liveapi.send(data) + liveapi.cached.send(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); @@ -235,6 +235,7 @@ function logoutBasedOnExcludeDateAndTimeOut() { const refreshData = function() { $.growl.notice({ message: 'Loading self-exclusion settings.'.i18n() }); return liveapi + .cached .send({ get_self_exclusion: 1 }) .then(function(response) { if (response.get_self_exclusion) { diff --git a/src/statement/statement.es6 b/src/statement/statement.es6 index 3ae934b8f5..1283fe87cd 100644 --- a/src/statement/statement.es6 +++ b/src/statement/statement.es6 @@ -84,7 +84,9 @@ const refreshTable = (yyy_mm_dd) => { if(!loading) { loading = true; - liveapi.send(request) + liveapi + .cached + .send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/tc/tc.es6 b/src/tc/tc.es6 index 053ac60a83..bdb207be05 100644 --- a/src/tc/tc.es6 +++ b/src/tc/tc.es6 @@ -27,7 +27,7 @@ export const init = () => { const div = $(html).i18n(); div.find('.tc_landing_comp_name').html(landing_company_name); div.find('.button').click(() => { - liveapi.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message + liveapi.cached.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message win.dialog('destroy'); }); win = windows.createBlankWindow($('
'), { diff --git a/src/token/token.es6 b/src/token/token.es6 index bb8104197b..73ee59d4be 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -96,7 +96,7 @@ const init_state = (root) => { state.confirm.yes = () => { const token = state.confirm.token; state.confirm.visible = false; - liveapi.send({ api_token: 1, delete_token: token.token }) + liveapi.cached.send({ api_token: 1, delete_token: token.token }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); @@ -152,7 +152,7 @@ const init_state = (root) => { } state.token.btn_disabled = true; - liveapi.send(request).then((data) => { + liveapi.cached.send(request).then((data) => { state.token.name = ''; state.token.btn_disabled = false; $.growl.notice({ message: `${'Successfully added new token '.i18n()} ${request.new_token}` }); @@ -170,7 +170,7 @@ const init_state = (root) => { } token_win_view = rv.bind(root[0], state); - return liveapi.send({ api_token: 1 }) + return liveapi.cached.send({ api_token: 1 }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeConf.es6 b/src/trade/tradeConf.es6 index 6a100f466b..a4b98f4807 100644 --- a/src/trade/tradeConf.es6 +++ b/src/trade/tradeConf.es6 @@ -258,7 +258,7 @@ const registerTicks = (state, extra) => { }); function getTickHistory(start, ticks_history) { - liveapi.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) + liveapi.cached.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) .then((data) => { is_getting_history = false; data.history.prices.forEach((price, idx) => { diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 4b47ac63f3..c361d3fab2 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.send({payout_currencies: 1}) + liveapi.cached.send({payout_currencies: 1}) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; @@ -882,7 +882,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.send({forget: id}); + id && liveapi.cached.send({forget: id}); }); } @@ -890,7 +890,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { let response; for (let i = 0; i < times_to_retry; i++) { try { - response = await liveapi.send(request); + response = await liveapi.cached.send(request); state.proposal.error = ''; state.proposal.id = response.proposal && response.proposal.id; break; @@ -986,7 +986,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { } try { const [tradeConf] = await require(['trade/tradeConf']); - const data = await liveapi.send({ + const data = await liveapi.cached.send({ buy: state.proposal.id, price: state.proposal.ask_price * 1, }); @@ -1108,7 +1108,7 @@ export function init(symbol, contracts_for, saved_template, isTrackerInitiated) if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.send({forget: id}); + id && liveapi.cached.send({forget: id}); }); } chartingRequestMap.unregister(key); diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index f14216cbb8..b4d9f47585 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -37,6 +37,7 @@ const refresh_active_symbols = () => { const trade = $("#nav-menu").find(".trade"); menu.refreshMenu(trade, markets, (symbol, display_name, pip) => { liveapi + .cached .send({ contracts_for: symbol }) .then((res) => { require(['trade/tradeDialog'], diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index fdb744e3e4..eacaa4400c 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -185,7 +185,7 @@ export const init = (contract_id, transaction_id) => { resolve(); return; } - liveapi.send({proposal_open_contract: 1, contract_id}) + liveapi.cached.send({proposal_open_contract: 1, contract_id}) .then((data) => { const proposal = data.proposal_open_contract; /* check for market data disruption error */ @@ -418,7 +418,7 @@ const init_dialog = (proposal) => { const sellAtMarket = (state, root) => { state.sell.sell_at_market_enabled = false; require(['text!viewtransaction/viewTransactionConfirm.html', 'css!viewtransaction/viewTransactionConfirm.css']); - liveapi.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) + liveapi.cached.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) .then((data) => { state.proposal_open_contract.is_sold_before_expiry = true; const { sell } = data; @@ -657,7 +657,7 @@ const setupChart = (state, root) => { // setup tick/candle stream for chart if (!state.proposal_open_contract.is_ended) updateLiveChart(state, granularity); - liveapi.send(tick_history_request) + liveapi.cached.send(tick_history_request) .then((data) => { onTickHistorySuccess(data); getContractData(state, state.proposal_open_contract); diff --git a/src/windows/tracker.es6 b/src/windows/tracker.es6 index 9ed4cc4404..2bcd1c1610 100644 --- a/src/windows/tracker.es6 +++ b/src/windows/tracker.es6 @@ -85,6 +85,7 @@ const reopen_dialogs = (symbols, saved_states) => { when_authenticated().then(() => { data.data.tracker_id = ++counter; liveapi + .cached .send({contracts_for: data.data.symbol.symbol}) .then((res) => { require(['trade/tradeDialog'], (tradeDialog) => { diff --git a/src/windows/windows.es6 b/src/windows/windows.es6 index 73b2839e36..ba9ff2773e 100644 --- a/src/windows/windows.es6 +++ b/src/windows/windows.es6 @@ -185,6 +185,7 @@ export const init = function($parentObj) { const pip = '0.001'; liveapi + .cached .send({ contracts_for: sym.symbol }) .then((res) => { // open chart window and tradeDialog From 0910cc2f57b53c9d41f0ba391df6a71f801fc30d Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Tue, 30 Apr 2019 10:31:37 +0800 Subject: [PATCH 19/28] update node-sass --- package-lock.json | 36 ++++++++---------------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa2759469c..ce49cd7806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5327,24 +5327,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", @@ -5632,9 +5614,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": { @@ -5713,9 +5695,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 +5707,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", diff --git a/package.json b/package.json index 08677ddea7..1ed7963a7b 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "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", From 98b5fd6f8e838d1e2f49e42f0ac96681ab102ae6 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Thu, 2 May 2019 13:19:01 +0800 Subject: [PATCH 20/28] tostring handler --- src/viewtransaction/viewTransaction.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index fdb744e3e4..a22f7387f7 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -57,7 +57,7 @@ const initChart = (root, state, options) => { for (let i = 0; i < times.length; ++i) { data.push([times[i] * 1000, prices[i] * 1]); - display_decimals = Math.max(display_decimals, prices[i].substring(prices[i].indexOf('.') + 1).length); + display_decimals = Math.max(display_decimals, prices[i].toString().substring(prices[i].toString().indexOf('.') + 1).length); } } From 289344a7439b139bae60de22d1a0858a562f49c9 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:23:41 +0800 Subject: [PATCH 21/28] remove unnecessary cache --- src/cashier/deposit.es6 | 4 ++-- src/cashier/uk_funds_protection.es6 | 2 +- src/cashier/withdraw.es6 | 6 +++--- src/charts/chartingRequestMap.es6 | 2 +- src/copytrade/copytrade.es6 | 6 ++---- src/password/password.es6 | 2 +- src/portfolio/portfolio.es6 | 8 ++++---- src/realitycheck/realitycheck.es6 | 1 - src/selfexclusion/selfexclusion.es6 | 2 +- src/tc/tc.es6 | 2 +- src/token/token.es6 | 4 ++-- src/trade/tradeDialog.es6 | 6 +++--- 12 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/cashier/deposit.es6 b/src/cashier/deposit.es6 index 4bbed14378..771b254924 100644 --- a/src/cashier/deposit.es6 +++ b/src/cashier/deposit.es6 @@ -136,7 +136,7 @@ function init_state(root) { deposit_win_view = rv.bind(root[0], state); /* get the cashier_url */ - liveapi.cached.send({ + liveapi.send({ cashier: 'deposit' }).then(function(data) { state.user.cashier_url = data.cashier; @@ -165,7 +165,7 @@ function init_state(root) { residence_promise.then(function() { if (!state.user.residence) return { paymentagent_list: { list: [] } }; - return liveapi.cached.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); + return liveapi.send({ paymentagent_list: state.user.residence, currency: state.user.currency }); }).then((data) => { const pa_list = data.paymentagent_list.list .map((agent) => { diff --git a/src/cashier/uk_funds_protection.es6 b/src/cashier/uk_funds_protection.es6 index 7ec4beed3c..64c022c78d 100644 --- a/src/cashier/uk_funds_protection.es6 +++ b/src/cashier/uk_funds_protection.es6 @@ -22,7 +22,7 @@ export const init_win = () => new Promise((resolve, reject) => { }); const state = {}; state.accept = () => { - liveapi.cached.send({ + liveapi.send({ "tnc_approval": 1, "ukgc_funds_protection": 1 }).then(resolve,reject).then(()=>{ diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index c10557883d..16b029f866 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -177,7 +177,7 @@ class Withdraw { } agent.hint = `Min: ${agent.min_amount} Max: ${agent.max_amount}`.i18n(); - liveapi.cached.send({ + liveapi.send({ verify_email: email, type: type }) @@ -283,7 +283,7 @@ class Withdraw { verification_code: verify.code }; agent.disabled = true; - liveapi.cached.send(request) + liveapi.send(request) .then(data => { route.update('agent-done') agent.disabled = false; @@ -308,7 +308,7 @@ class Withdraw { amount: transfer.amount }; transfer.disabled = true; - liveapi.cached.send(req) + liveapi.send(req) .then(data => { transfer.account = transfer.account.split("_to_")[1]; route.update('transfer-done'); diff --git a/src/charts/chartingRequestMap.es6 b/src/charts/chartingRequestMap.es6 index 9291879001..68e6375b0f 100644 --- a/src/charts/chartingRequestMap.es6 +++ b/src/charts/chartingRequestMap.es6 @@ -95,7 +95,7 @@ export const register = function(options) { map[key] = { symbol: options.symbol, granularity: granularity, subscribers: 0, chartIDs: [] }; if (req.subscribe) map[key].subscribers = 1; // how many charts have subscribed for a stream - return liveapi.cached.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout + return liveapi.send(req, /*timeout:*/ 30 * 1000) // 30 second timeout .catch((up) => { /* if the market is closed try the same request without subscribing */ if (req.subscribe && up.code === 'MarketIsClosed') { diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 9469446a5c..24be5209f7 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -135,7 +135,6 @@ const state = { state.is_loading = true; liveapi - .cached .send({ set_settings: 1, allow_copiers, @@ -176,7 +175,6 @@ const state = { if (!settingsToSend.trade_types || settingsToSend.trade_types.length <= 0) delete settingsToSend.trade_types; liveapi - .cached .send(settingsToSend) .then(() => { newObj.disableStart = false; @@ -195,7 +193,7 @@ const state = { } } else { //Stop copying - liveapi.cached.send({ + liveapi.send({ copy_stop: state.traderTokens[index].yourCopySettings.copy_start }) .then(() => { @@ -214,7 +212,7 @@ const state = { const toBeRemovedItem = state.traderTokens[index]; state.traderTokens.splice(index, 1); updateLocalStorage(state); - liveapi.cached.send({ + liveapi.send({ copy_stop: toBeRemovedItem.yourCopySettings.copy_start }) .catch(e => {}); diff --git a/src/password/password.es6 b/src/password/password.es6 index e3f026193e..f689841c5d 100644 --- a/src/password/password.es6 +++ b/src/password/password.es6 @@ -95,7 +95,7 @@ const init_state = (root) => { new_password: state.account.new_password }; state.btn.disabled = true; - liveapi.cached.send(request) + liveapi.send(request) .then((data) =>{ if(data.change_password !== 1){ throw { message: 'Failed to update the password'.i18n()}; diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index a9d0cb3a46..daa7ec39a7 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -63,7 +63,7 @@ const proposalOpenContract = (command) => { if(command === 'subscribe') { ++subscribers; if(!subscribed_before && subscribers > 0) { - liveapi.cached.send({ proposal_open_contract: 1,subscribe: 1 }) + liveapi.send({ proposal_open_contract: 1,subscribe: 1 }) .then((data) => { subscribed_before = true; }) .catch((err) => { console.error(err); @@ -74,7 +74,7 @@ const proposalOpenContract = (command) => { else if(command === 'forget') { --subscribers; if(subscribed_before && subscribers === 0) { - liveapi.cached.send({ forget_all: 'proposal_open_contract' }) + liveapi.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; }) @@ -85,7 +85,7 @@ const proposalOpenContract = (command) => { } } else if( command === 'resubscribe' ) { - liveapi.cached.send({ forget_all: 'proposal_open_contract' }) + liveapi.send({ forget_all: 'proposal_open_contract' }) .then((data) => { subscribed_before = false; --subscribers; @@ -262,7 +262,7 @@ const forget_the_contracts = (contracts) => { const init_table = async () => { const processing_msg = $('#' + table.attr('id') + '_processing').show(); try { - const data = await liveapi.cached.send({ portfolio: 1 }); + const data = await liveapi.send({ portfolio: 1 }); const contracts = (data.portfolio && data.portfolio.contracts); //|| [ // { diff --git a/src/realitycheck/realitycheck.es6 b/src/realitycheck/realitycheck.es6 index dbd2a0b916..1ab6496392 100644 --- a/src/realitycheck/realitycheck.es6 +++ b/src/realitycheck/realitycheck.es6 @@ -67,7 +67,6 @@ const setOrRefreshTimer = (timeOutInMins) => { const logoutAfter_ms = timeOutInMins * 60 * 1000; timerHandler = setTimeout(() => { liveapi - .cached .send({ reality_check : 1 }) .then((data) => { /* diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 00d5c93368..ed8afe0426 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -169,7 +169,7 @@ const settingsData = { } } - liveapi.cached.send(data) + liveapisend(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); diff --git a/src/tc/tc.es6 b/src/tc/tc.es6 index bdb207be05..053ac60a83 100644 --- a/src/tc/tc.es6 +++ b/src/tc/tc.es6 @@ -27,7 +27,7 @@ export const init = () => { const div = $(html).i18n(); div.find('.tc_landing_comp_name').html(landing_company_name); div.find('.button').click(() => { - liveapi.cached.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message + liveapi.send({ "tnc_approval": 1 }).then(_ => window.location.reload()); // Reload page to remove previous notification message win.dialog('destroy'); }); win = windows.createBlankWindow($('
'), { diff --git a/src/token/token.es6 b/src/token/token.es6 index 73ee59d4be..4d16b7b08b 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -152,7 +152,7 @@ const init_state = (root) => { } state.token.btn_disabled = true; - liveapi.cached.send(request).then((data) => { + liveapi.send(request).then((data) => { state.token.name = ''; state.token.btn_disabled = false; $.growl.notice({ message: `${'Successfully added new token '.i18n()} ${request.new_token}` }); @@ -170,7 +170,7 @@ const init_state = (root) => { } token_win_view = rv.bind(root[0], state); - return liveapi.cached.send({ api_token: 1 }) + return liveapi.send({ api_token: 1 }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index c361d3fab2..8903050530 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -882,7 +882,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.cached.send({forget: id}); + id && liveapi.send({forget: id}); }); } @@ -986,7 +986,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { } try { const [tradeConf] = await require(['trade/tradeConf']); - const data = await liveapi.cached.send({ + const data = await liveapi.send({ buy: state.proposal.id, price: state.proposal.ask_price * 1, }); @@ -1108,7 +1108,7 @@ export function init(symbol, contracts_for, saved_template, isTrackerInitiated) if(state.proposal.last_promise) { state.proposal.last_promise.then(function(data){ var id = data && data.proposal && data.proposal.id; - id && liveapi.cached.send({forget: id}); + id && liveapi.send({forget: id}); }); } chartingRequestMap.unregister(key); From 419be8e562781aee40b1aab92117c714455c647a Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:25:50 +0800 Subject: [PATCH 22/28] cache active symbols refresh --- src/cashier/withdraw.es6 | 2 +- src/trade/tradeMenu.es6 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 16b029f866..668c8c6f84 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -205,7 +205,7 @@ class Withdraw { if (menu.choice === 'standard') { verify.disabled = true; - liveapi.cached.send({ + liveapi.send({ cashier: 'withdraw', verification_code: verify.token }) diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index b4d9f47585..ee0e669e58 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -10,6 +10,7 @@ const show_error = (err) => { }; const refresh_active_symbols = () => { liveapi + .cached .send({ active_symbols: 'brief' }) .then((data) => { /* clean up the data! */ From 5197a8e1a825cf58854b85baf4d1eecae17bc0de Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 11:29:39 +0800 Subject: [PATCH 23/28] remove sell cached --- src/profittable/profitTable.es6 | 2 +- src/selfexclusion/selfexclusion.es6 | 2 +- src/statement/statement.es6 | 1 - src/token/token.es6 | 2 +- src/trade/tradeDialog.es6 | 2 +- src/viewtransaction/viewTransaction.es6 | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/profittable/profitTable.es6 b/src/profittable/profitTable.es6 index 517f6e1484..2e0133ff8b 100644 --- a/src/profittable/profitTable.es6 +++ b/src/profittable/profitTable.es6 @@ -91,7 +91,7 @@ const refreshTable = (yyyy_mm_dd) => { processing_msg.hide(); }; - liveapi.cached.send(request) + liveapi.send(request) .then(refresh) .catch((err) => { refresh({}); diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index ed8afe0426..3b7dbdaad1 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -169,7 +169,7 @@ const settingsData = { } } - liveapisend(data) + liveapi.send(data) .then(function(response) { $.growl.notice({ message: 'Your changes have been updated'.i18n() }); logoutBasedOnExcludeDateAndTimeOut(); diff --git a/src/statement/statement.es6 b/src/statement/statement.es6 index 1283fe87cd..c9560ce194 100644 --- a/src/statement/statement.es6 +++ b/src/statement/statement.es6 @@ -85,7 +85,6 @@ const refreshTable = (yyy_mm_dd) => { if(!loading) { loading = true; liveapi - .cached .send(request) .then(refresh) .catch((err) => { diff --git a/src/token/token.es6 b/src/token/token.es6 index 4d16b7b08b..bb8104197b 100644 --- a/src/token/token.es6 +++ b/src/token/token.es6 @@ -96,7 +96,7 @@ const init_state = (root) => { state.confirm.yes = () => { const token = state.confirm.token; state.confirm.visible = false; - liveapi.cached.send({ api_token: 1, delete_token: token.token }) + liveapi.send({ api_token: 1, delete_token: token.token }) .then((data) => { const tokens = (data.api_token && data.api_token.tokens) || []; state.update_tokens(tokens); diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 8903050530..71b7012b56 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.cached.send({payout_currencies: 1}) + liveapi.cached.send({ payout_currencies: 1 }) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index eacaa4400c..912b88a2bc 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -418,7 +418,7 @@ const init_dialog = (proposal) => { const sellAtMarket = (state, root) => { state.sell.sell_at_market_enabled = false; require(['text!viewtransaction/viewTransactionConfirm.html', 'css!viewtransaction/viewTransactionConfirm.css']); - liveapi.cached.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) + liveapi.send({ sell: state.proposal_open_contract.contract_id, price: 0 }) .then((data) => { state.proposal_open_contract.is_sold_before_expiry = true; const { sell } = data; From e29348eb59f25e57421556c7e7d84dc15812ed24 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 16:51:45 +0800 Subject: [PATCH 24/28] remove unnecessary cached --- src/accountstatus/accountstatus.es6 | 4 ++-- src/copytrade/copytrade.es6 | 1 - src/portfolio/portfolio.es6 | 4 ++-- src/selfexclusion/selfexclusion.es6 | 1 - src/trade/tradeDialog.es6 | 4 ++-- src/trade/tradeMenu.es6 | 1 - src/viewtransaction/viewTransaction.es6 | 2 +- src/windows/tracker.es6 | 1 - 8 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/accountstatus/accountstatus.es6 b/src/accountstatus/accountstatus.es6 index 98c9c0043b..c354b9325f 100644 --- a/src/accountstatus/accountstatus.es6 +++ b/src/accountstatus/accountstatus.es6 @@ -62,11 +62,11 @@ class AccountStatus { getStatus() { // Getting account status, website status, account settings and financial assessment. return Promise.all([ - liveapi.cached.send({ get_account_status: 1 }), + liveapi.send({ get_account_status: 1 }), liveapi.cached.send({ website_status: 1 }), liveapi.cached.send({ 'get_settings': 1 }), liveapi.cached.send({ get_financial_assessment: 1 }), - liveapi.cached.send({ mt5_login_list: 1 }) + liveapi.send({ mt5_login_list: 1 }) ]); } diff --git a/src/copytrade/copytrade.es6 b/src/copytrade/copytrade.es6 index 24be5209f7..04062c1286 100644 --- a/src/copytrade/copytrade.es6 +++ b/src/copytrade/copytrade.es6 @@ -87,7 +87,6 @@ instrumentPromise().then(instruments => { const refreshTraderStats = (loginid, token, scope) => { return new Promise((resolve, reject) => { liveapi - .cached .send({ copytrading_statistics: 1, trader_id: loginid, diff --git a/src/portfolio/portfolio.es6 b/src/portfolio/portfolio.es6 index daa7ec39a7..fe09660288 100644 --- a/src/portfolio/portfolio.es6 +++ b/src/portfolio/portfolio.es6 @@ -157,7 +157,7 @@ const initPortfolioWin = () => { } }); - liveapi.cached.send({ balance: 1 }) + liveapi.send({ balance: 1 }) .then((data) => { currency = data.balance.currency; portfolioWin = windows.createBlankWindow($('
'), { @@ -183,7 +183,7 @@ const initPortfolioWin = () => { liveapi.events.off('transaction', on_transaction); }, refresh: () => { - liveapi.cached.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); + liveapi.send({ balance: 1 }).catch((err) => { console.error(err); $.growl.error({ message: err.message }); }); forget_the_contracts(subscribed_contracts).then(init_table); } }); diff --git a/src/selfexclusion/selfexclusion.es6 b/src/selfexclusion/selfexclusion.es6 index 3b7dbdaad1..35c0f2b3ca 100644 --- a/src/selfexclusion/selfexclusion.es6 +++ b/src/selfexclusion/selfexclusion.es6 @@ -237,7 +237,6 @@ function logoutBasedOnExcludeDateAndTimeOut() { const refreshData = function() { $.growl.notice({ message: 'Loading self-exclusion settings.'.i18n() }); return liveapi - .cached .send({ get_self_exclusion: 1 }) .then(function(response) { if (response.get_self_exclusion) { diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 71b7012b56..879686730c 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -440,7 +440,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { var update_currency = function() { /* change currency on user login */ if(liveapi.is_authenticated()) { - liveapi.cached.send({ payout_currencies: 1 }) + liveapi.send({ payout_currencies: 1 }) .then(function(data){ state.currency.value = data.payout_currencies[0]; state.currency.array = data.payout_currencies; @@ -890,7 +890,7 @@ function init_state(available,root, dialog, symbol, contracts_for_spot) { let response; for (let i = 0; i < times_to_retry; i++) { try { - response = await liveapi.cached.send(request); + response = await liveapi.send(request); state.proposal.error = ''; state.proposal.id = response.proposal && response.proposal.id; break; diff --git a/src/trade/tradeMenu.es6 b/src/trade/tradeMenu.es6 index ee0e669e58..2a5dde0e10 100644 --- a/src/trade/tradeMenu.es6 +++ b/src/trade/tradeMenu.es6 @@ -38,7 +38,6 @@ const refresh_active_symbols = () => { const trade = $("#nav-menu").find(".trade"); menu.refreshMenu(trade, markets, (symbol, display_name, pip) => { liveapi - .cached .send({ contracts_for: symbol }) .then((res) => { require(['trade/tradeDialog'], diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index 912b88a2bc..71e35b18d6 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -185,7 +185,7 @@ export const init = (contract_id, transaction_id) => { resolve(); return; } - liveapi.cached.send({proposal_open_contract: 1, contract_id}) + liveapi.send({proposal_open_contract: 1, contract_id}) .then((data) => { const proposal = data.proposal_open_contract; /* check for market data disruption error */ diff --git a/src/windows/tracker.es6 b/src/windows/tracker.es6 index 2bcd1c1610..9ed4cc4404 100644 --- a/src/windows/tracker.es6 +++ b/src/windows/tracker.es6 @@ -85,7 +85,6 @@ const reopen_dialogs = (symbols, saved_states) => { when_authenticated().then(() => { data.data.tracker_id = ++counter; liveapi - .cached .send({contracts_for: data.data.symbol.symbol}) .then((res) => { require(['trade/tradeDialog'], (tradeDialog) => { From 662793243c3460c17263005b9b0b373388e483e6 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Fri, 3 May 2019 16:53:51 +0800 Subject: [PATCH 25/28] remove contractfor cached --- src/cashier/withdraw.es6 | 2 +- src/windows/windows.es6 | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cashier/withdraw.es6 b/src/cashier/withdraw.es6 index 668c8c6f84..76e616d599 100644 --- a/src/cashier/withdraw.es6 +++ b/src/cashier/withdraw.es6 @@ -354,7 +354,7 @@ class Withdraw { }) .catch(error_handler); - liveapi.cached.send({ payout_currencies: 1 }) + liveapi.send({ payout_currencies: 1 }) .then(data => { agent.currency = data.payout_currencies[0]; }).catch(err => console.error(err)); diff --git a/src/windows/windows.es6 b/src/windows/windows.es6 index ba9ff2773e..73b2839e36 100644 --- a/src/windows/windows.es6 +++ b/src/windows/windows.es6 @@ -185,7 +185,6 @@ export const init = function($parentObj) { const pip = '0.001'; liveapi - .cached .send({ contracts_for: sym.symbol }) .then((res) => { // open chart window and tradeDialog From aefc67cf0b61dfbba5222b9c6837d98d99ce6b05 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Mon, 6 May 2019 10:49:40 +0800 Subject: [PATCH 26/28] remove tick history request --- src/trade/tradeConf.es6 | 2 +- src/viewtransaction/viewTransaction.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trade/tradeConf.es6 b/src/trade/tradeConf.es6 index a4b98f4807..6a100f466b 100644 --- a/src/trade/tradeConf.es6 +++ b/src/trade/tradeConf.es6 @@ -258,7 +258,7 @@ const registerTicks = (state, extra) => { }); function getTickHistory(start, ticks_history) { - liveapi.cached.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) + liveapi.send({ ticks_history, end: 'latest', start, style: 'ticks', count: 5000}) .then((data) => { is_getting_history = false; data.history.prices.forEach((price, idx) => { diff --git a/src/viewtransaction/viewTransaction.es6 b/src/viewtransaction/viewTransaction.es6 index 71e35b18d6..fdb744e3e4 100644 --- a/src/viewtransaction/viewTransaction.es6 +++ b/src/viewtransaction/viewTransaction.es6 @@ -657,7 +657,7 @@ const setupChart = (state, root) => { // setup tick/candle stream for chart if (!state.proposal_open_contract.is_ended) updateLiveChart(state, granularity); - liveapi.cached.send(tick_history_request) + liveapi.send(tick_history_request) .then((data) => { onTickHistorySuccess(data); getContractData(state, state.proposal_open_contract); From 585e39fb299b9192ef0c158d988cd5e2d92aa809 Mon Sep 17 00:00:00 2001 From: Amam Mustofa Date: Tue, 7 May 2019 17:41:07 +0800 Subject: [PATCH 27/28] fix dependencies --- package-lock.json | 71 +++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce49cd7806..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", @@ -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", @@ -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", @@ -5551,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", @@ -5682,7 +5719,7 @@ "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", - "tar": "^2.0.0", + "tar": "^4.4.2", "which": "1" }, "dependencies": { @@ -7511,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 1ed7963a7b..7c665d7d71 100644 --- a/package.json +++ b/package.json @@ -81,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", From 19b0c89855ec7375e7a2262b3625bc95d2e68d7e Mon Sep 17 00:00:00 2001 From: Ashkan Date: Wed, 8 May 2019 12:46:02 +0200 Subject: [PATCH 28/28] Revert "V20190508_0"