-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.entry.js
More file actions
executable file
·206 lines (172 loc) · 6.44 KB
/
main.entry.js
File metadata and controls
executable file
·206 lines (172 loc) · 6.44 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import '@babel/polyfill';
import Alpine from 'alpinejs';
import Accordion from './components/accordion';
import ActualHeight from './components/actual-height';
import AnchorNav from './components/anchor-nav';
import BackLink from './components/back-link';
import Carousel from './components/carousel';
import CountdownCTA from './components/countdown-cta';
import CTATrigger from './components/cta-trigger';
import PeekFullCarousel from './components/carousel-full-peek';
import PeekCarousel from './components/carousel-peek';
import EmailShare from './components/email-share';
import EventToggleSwitch from './components/event-toggle-switch';
import FormFocus from './components/form-focus';
import GridSizeVariables from './components/grid-size-variables';
import HeaderDrawer from './components/header-drawer';
import './components/home-menu';
import './components/lazyload-images';
import MobileSubMenu from './components/mobile-sub-menu';
import './components/modal';
import './components/outdated-banner';
import './components/parallax';
import Sticky from './components/position-sticky-event';
import ProgrammeToggleSwitch from './components/programme-toggle-switch';
import ProjectFilters from './components/project-filters';
import RelatedContent from './components/related-content';
import ScholarshipFeeStatusToggle from './components/scholarship-fee-status-toggle';
import ScholarshipList from './components/scholarship-list';
import SitewideAlert from './components/sitewide-alert';
import Slideshow from './components/slideshow';
import TableHint from './components/table-hint';
import './components/stats-block';
import './components/sticky-header';
import './components/sticky-point';
import SubMenu from './components/submenu';
import Tabs from './components/tabs';
import VideoModal from './components/video-modal';
import VideoPlayer from './components/video-stream';
import CollapsibleNav from './components/collapsible-nav';
import EmbeddedFooterCTA from './components/embedded-footer-cta';
import '../sass/main.scss';
document.addEventListener('DOMContentLoaded', () => {
/* eslint-disable no-new, no-restricted-syntax */
// GridSizeVariables first to ensure custom properites are populated
for (const gridVariables of document.querySelectorAll(
GridSizeVariables.selector(),
)) {
new GridSizeVariables(gridVariables);
}
for (const sitewideAlert of document.querySelectorAll(
SitewideAlert.selector(),
)) {
new SitewideAlert(sitewideAlert);
}
for (const formFocus of document.querySelectorAll(FormFocus.selector())) {
new FormFocus(formFocus);
}
for (const tabs of document.querySelectorAll(Tabs.selector())) {
new Tabs(tabs);
}
for (const accordion of document.querySelectorAll(Accordion.selector())) {
new Accordion(accordion);
}
for (const carousel of document.querySelectorAll(Carousel.selector())) {
new Carousel(carousel);
}
for (const peekcarousel of document.querySelectorAll(
PeekCarousel.selector(),
)) {
new PeekCarousel(peekcarousel);
}
for (const peekfullcarousel of document.querySelectorAll(
PeekFullCarousel.selector(),
)) {
new PeekFullCarousel(peekfullcarousel);
}
for (const slideshow of document.querySelectorAll(Slideshow.selector())) {
new Slideshow(slideshow);
}
for (const headerdrawer of document.querySelectorAll(
HeaderDrawer.selector(),
)) {
new HeaderDrawer(headerdrawer);
}
for (const backlink of document.querySelectorAll(BackLink.selector())) {
new BackLink(backlink);
}
for (const submenu of document.querySelectorAll(SubMenu.selector())) {
new SubMenu(submenu);
}
for (const relatedcontent of document.querySelectorAll(
RelatedContent.selector(),
)) {
new RelatedContent(relatedcontent);
}
for (const mobilesubmenu of document.querySelectorAll(
MobileSubMenu.selector(),
)) {
new MobileSubMenu(mobilesubmenu);
}
// Toggle subnav visibility
for (const subnavBack of document.querySelectorAll('[data-subnav-back]')) {
subnavBack.addEventListener('click', () => {
subnavBack.parentNode.classList.remove('is-visible');
});
}
for (const videomodal of document.querySelectorAll(VideoModal.selector())) {
new VideoModal(videomodal);
}
for (const projectfilters of document.querySelectorAll(
ProjectFilters.selector(),
)) {
new ProjectFilters(projectfilters);
}
for (const sticky of document.querySelectorAll(Sticky.selector())) {
new Sticky(sticky);
}
for (const anchornav of document.querySelectorAll(AnchorNav.selector())) {
new AnchorNav(anchornav);
}
for (const emailshare of document.querySelectorAll(EmailShare.selector())) {
new EmailShare(emailshare);
}
for (const scholarshiplist of document.querySelectorAll(
ScholarshipList.selector(),
)) {
new ScholarshipList(scholarshiplist);
}
for (const eventtoggleswitch of document.querySelectorAll(
EventToggleSwitch.selector(),
)) {
new EventToggleSwitch(eventtoggleswitch);
}
for (const scholarshipFeeStatusToggle of document.querySelectorAll(
ScholarshipFeeStatusToggle.selector(),
)) {
new ScholarshipFeeStatusToggle(scholarshipFeeStatusToggle);
}
for (const studymodetoggleswitch of document.querySelectorAll(
ProgrammeToggleSwitch.selector(),
)) {
new ProgrammeToggleSwitch(studymodetoggleswitch);
}
for (const tablehint of document.querySelectorAll(TableHint.selector())) {
new TableHint(tablehint);
}
for (const videoStream of document.querySelectorAll(
VideoPlayer.selector(),
)) {
new VideoPlayer(videoStream);
}
for (const collapsibleNav of document.querySelectorAll(
CollapsibleNav.selector(),
)) {
new CollapsibleNav(collapsibleNav);
}
for (const countdowncta of document.querySelectorAll(
CountdownCTA.selector(),
)) {
new CountdownCTA(countdowncta);
}
for (const ctatrigger of document.querySelectorAll(CTATrigger.selector())) {
new CTATrigger(ctatrigger);
}
for (const embeddedfootercta of document.querySelectorAll(
EmbeddedFooterCTA.selector(),
)) {
new EmbeddedFooterCTA(embeddedfootercta);
}
new ActualHeight();
Alpine.start();
});