Skip to content

Commit f33a0be

Browse files
author
Chris Gårdenberg
committed
wip: Adding message listener to the window, so we can get the events from the external booking form from EduAdmin, for analytics integration.
1 parent ba1e525 commit f33a0be

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

content/scripts/frontend/frontendjs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,11 @@ var eduGlobalMethods = {
629629
function numberWithSeparator(x, sep) {
630630
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, sep);
631631
}
632+
window.addEventListener('message', function (event) {
633+
if (!event.data.type) {
634+
return;
635+
}
636+
});
632637
var oldonload = window.onload;
633638
window.onload = function (ev) {
634639
if (oldonload) {

src/scripts/frontend/frontendjs.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,14 @@ function numberWithSeparator(x: string, sep: string) {
925925
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, sep);
926926
}
927927

928+
window.addEventListener('message', (event) => {
929+
if (!event.data.type) {
930+
return;
931+
}
932+
933+
934+
});
935+
928936
let oldonload = window.onload as any;
929937
window.onload = function (ev: Event) {
930938
if (oldonload) {

0 commit comments

Comments
 (0)