This repository was archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathstatic_pages.js
More file actions
66 lines (64 loc) · 2.4 KB
/
static_pages.js
File metadata and controls
66 lines (64 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const tabListener = require('@binary-com/binary-style').tabListener;
const ImageSlider = require('../../_common/image_slider');
const MenuSelector = require('../../_common/menu_selector');
const Scroll = require('../../_common/scroll');
const handleHash = require('../../_common/utility').handleHash;
const BinaryPjax = require('../../app/base/binary_pjax');
const Client = require('../../app/base/client');
const Header = require('../../app/base/header');
const getLanguage = require('../../_common/language.js').get;
const current_language = getLanguage().toLowerCase().replace(/_/g, '-');
const redirectToDeriv = (path = '') => () => {
if (current_language === 'en') {window.location.replace(`https://deriv.com/partners/${path}`);} else {window.location.replace(`https://deriv.com/${current_language}/partners/${path}`);}
};
module.exports = {
OpenPositions: {
onLoad: () => { Scroll.scrollToHashSection(); },
},
Careers: {
onLoad: () => { tabListener(); handleHash(); $('.has-tabs').tabs(); },
},
Locations: {
onLoad : () => { ImageSlider.init(); },
onUnload: () => { ImageSlider.onUnMount(); },
},
OpenSourceProjects: {
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
Partners: {
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
SecurityTesting: {
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
PaymentAgent: {
onLoad : redirectToDeriv('payment-agent'),
onUnload: () => { Scroll.offScroll(); },
},
handleTab: {
onLoad: () => { tabListener(); handleHash(); },
},
LandingPage: {
onLoad: () => {
if (Client.hasAccountType('real')) {
BinaryPjax.loadPreviousUrl();
} else {
Header.upgradeMessageVisibility();
}
},
},
AffiliatesFAQ: {
onLoad : () => { MenuSelector.init(['general', 'account-management-and-tracking', 'referral-tools', 'support']); },
onUnload: () => { MenuSelector.clean(); },
},
IBProgrammeFAQ: {
onLoad : () => { MenuSelector.init(['general', 'account-management', 'referral-tools']); },
onUnload: () => { MenuSelector.clean(); },
},
BinaryInNumbers: {
onLoad: () => { Scroll.scrollToHashSection(); },
},
};