turtle-wow-source-kinda/Dumps/Source Code/8 - Development_website/develop/resources/js/turtle.js
Brian Oost a1d5bb70b2 Init
2024-08-06 18:06:40 +02:00

65 lines
1.5 KiB
JavaScript

var THEME = THEME || {};
(function(jQuery) {
"use strict";
THEME.initialize = {
init: function() {
THEME.initialize.general();
THEME.initialize.removeHashFragment();
},
general: function() {
window.addEventListener('analytic-register-new-user', (event) => {
const page = event?.detail?.page;
if (!page) {
return;
}
_paq.push([
'trackEvent',
'Account',
'New',
page
]);
})
window.addEventListener('analytic-log-out-user', event => {
_paq.push(['resetUserId']);
_paq.push(['appendToTrackingUrl', 'new_visit=1']);
_paq.push(['trackPageView']);
_paq.push(['appendToTrackingUrl', '']);
})
function openModal(imageSrc) {
$('#lightbox img').attr('src', imageSrc);
}
window.openModal = openModal;
},
removeHashFragment: function() {
var url = window.location.href;
if (url.includes('/#/')) {
var urlWithoutFragment = url.replace('/#/', '/');
window.location.href = urlWithoutFragment;
}
}
};
THEME.documentOnReady = {
init: function() {
THEME.initialize.init();
},
};
$(document).ready(THEME.documentOnReady.init);
})($);