routerEntryHandlers = [];
addRouterEntryHandler = (handler) => {
routerEntryHandlers.push(handler);
};
removeRouterEntryHandler = (handler) => {
routerEntryHandlers = routerEntryHandlers.filter((h) => h !== handler);
};
routerEntry = (path, title) => {
routerEntryHandlers.forEach((handler) => handler(path, title));
};
copyText = (text, message, alert) => {
navigator.clipboard.writeText(text).then(() => {
(alert !== false) && $alert.notify({
type: 'success',
message: (message || 'Text copied to clipboard.'),
toast: true,
});
});
};
$$class(document.body).toggleOn(loading, 'overlay');
Loading...
getLinkClasses = (key) => {
return {
'text-white': (section === key),
'text-neutral-200': (section !== key),
};
};
const title = ({"title":"Terms of Service"}).title;
document.title = `${title} | Studendly`;
target = document.querySelector('#modal-mount');
targetParent = target.parentElement;
targetParent.style.display = 'none';
setVisible = (show) => {
if (show != isVisible){
isVisible = show;
targetParent.style.display = (show ? 'flex' : 'none');
}
};
init = (options) => {
options = options || {};
disableParentClick = options.disableParentClick || false;
$rel.gt((options.duration || 0), 0) && window.setTimeout(() => hide(), options.duration);
!options.hidden && show();
};
show = () => setVisible(true);
hide = () => setVisible(false);
toggleVisible = () => setVisible(!isVisible);
($event.target === targetParent) && !disableParentClick && hide();