Skip to content

Commit

Permalink
fix: remove remainder of the files
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-deriv committed Jan 3, 2024
1 parent 4f8e0ff commit 5aacb0d
Show file tree
Hide file tree
Showing 63 changed files with 157 additions and 8,546 deletions.
Binary file added src/images/common/logos/xxhdpi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/javascript/_common/__tests__/tests_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports = {
setURL,
getApiToken: () => 'hhh9bfrbq0G3dRf',
api : new LiveApi({ websocket, appId: 1 }),
};
};
41 changes: 0 additions & 41 deletions src/javascript/_common/__tests__/third_party_links.js

This file was deleted.

64 changes: 0 additions & 64 deletions src/javascript/_common/image_slider.js

This file was deleted.

53 changes: 0 additions & 53 deletions src/javascript/_common/image_utility.js

This file was deleted.

23 changes: 0 additions & 23 deletions src/javascript/app/common/__tests__/account_opening.js

This file was deleted.

56 changes: 16 additions & 40 deletions src/javascript/app/common/content_visibility.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const Client = require('../base/client');
const BinarySocket = require('../base/socket');
const MetaTrader = require('../pages/user/metatrader/metatrader');
const State = require('../../_common/storage').State;
const updateTabDisplay = require('../../_common/tab_selector').updateTabDisplay;

/*
data-show attribute controls element visibility based on
Expand Down Expand Up @@ -44,41 +42,38 @@ const updateTabDisplay = require('../../_common/tab_selector').updateTabDisplay;
data-show='SVG' -> throws error
*/

const visible_classname = 'data-show-visible';
const mt_company_rule = 'mtcompany';
const eu_country_rule = 'eucountry';
const options_blocked_rule = 'optionsblocked';

const ContentVisibility = (() => {
let $center_select_m;

const init = () => {
let arr_mt5fin_shortcodes;

return new Promise(resolve => {
const init = () =>
new Promise(resolve => {
BinarySocket.wait('authorize', 'landing_company', 'website_status').then(() => {
const current_landing_company_shortcode = State.getResponse('authorize.landing_company_name') || 'default';
const mt_financial_company = State.getResponse('landing_company.mt_financial_company');
const mt_gaming_company = State.getResponse('landing_company.mt_gaming_company');
// const current_landing_company_shortcode = State.getResponse('authorize.landing_company_name') || 'default';
// const mt_financial_company = State.getResponse('landing_company.mt_financial_company');
// const mt_gaming_company = State.getResponse('landing_company.mt_gaming_company');

// Check if mt_financial_company is offered, if not found, switch to mt_gaming_company
const mt_landing_company = mt_financial_company || mt_gaming_company;
// const mt_landing_company = mt_financial_company || mt_gaming_company;

// Check mt_financial_company by account type, since we are offering different landing companies for financial and financial_stp
arr_mt5fin_shortcodes = mt_landing_company ? Object.keys(mt_landing_company)
.map((key) => mt_landing_company[key].shortcode) : [];
// arr_mt5fin_shortcodes = mt_landing_company ? Object.keys(mt_landing_company)
// .map((key) => mt_landing_company[key].shortcode) : [];

controlVisibility(
current_landing_company_shortcode,
MetaTrader.isEligible(),
// We then pass the list of found mt5fin company shortcodes as an array
arr_mt5fin_shortcodes
);
// controlVisibility(
// current_landing_company_shortcode,
// MetaTrader.isEligible(),
// // We then pass the list of found mt5fin company shortcodes as an array
// arr_mt5fin_shortcodes
// );

resolve();
});
});
};
})
;

const generateParsingErrorMessage = (reason, attr_str) => (
`Invalid data-show attribute value! ${reason} Given value: '${attr_str}'.`
Expand Down Expand Up @@ -173,25 +168,6 @@ const ContentVisibility = (() => {
return show_element;
};

const controlVisibility = (current_landing_company_shortcode, client_has_mt_company, mt5_login_list) => {
document.querySelectorAll('[data-show]').forEach(el => {
const attr_str = el.dataset.show;
if (shouldShowElement(attr_str, current_landing_company_shortcode, client_has_mt_company, mt5_login_list)) {
el.classList.add(visible_classname);
} else {
const open_tab_url = new RegExp(`\\?.+_tabs=${el.id}`, 'i');
// check if we hide a tab that's open
// then redirect to the url without query
if (el.classList.contains('tm-li') && open_tab_url.test(window.location.href)) {
const { origin, pathname } = window.location;
window.location.href = origin + pathname;
}
}
});

updateTabDisplay();
};

// if text is hidden, we need to append it to body to be able to get its width
const getTextWidth = (text) => {
const $el = $('<span />', { text });
Expand Down
24 changes: 0 additions & 24 deletions src/javascript/app/common/verification_code.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/javascript/app/common/verify_email.js

This file was deleted.

Loading

0 comments on commit 5aacb0d

Please sign in to comment.