// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat/MIT
function URLBuild(path, full = false) {
    return (full ? fullSiteURL : siteURL) + path;
}

function redirect(url) {
    window.location.href = url;
}

$(document).ready(function () {
    $('[data-action="logout"]').click(function () {
        const url = $(this).data('link');
        $.post(url, {
            token: csrfToken
        }).done(function () {
            window.location.reload();
        });
    });
});

$(function () {
    $('.ui.sidebar').sidebar('attach events', '.toc.item');

    $('.ui.dropdown:not(.search):not(.upward)').dropdown();
    $('.ui.dropdown.upward:not(.search)').dropdown({ direction: 'upward' });

    $('[data-toggle="tooltip"]').popup({
        hoverable: true
    });

    $('[data-toggle="popup"]').popup({
        hoverable: true,
        variation: 'special flowing',
    });

    $('[data-toggle="modal"]').click(function () {
        let att = $(this).attr("data-target");
        $(att).modal('show');
    });

    $('.message .close').on('click', function () {
        $(this).closest('.message').transition('fade');
    });

    $('.tabular.menu .item').tab();
});

$(function () {
    if (loadingTime !== '') {
        $('#page_load').html(loadingTime);
    }
});

$(function () {
    const cachedUsers = {};

    $('*[data-poload]').mouseenter(function () {
        const elem = this;
        $.get(
            $(elem).data('poload'),
            function (data) {
                if (debugging) {
                    console.log(data);
                }

                data = JSON.parse(data);
                cachedUsers[$(elem).data('poload')] = data;

                const tmp = document.createElement('div');
                tmp.innerHTML = data.html;

                const img = tmp.getElementsByTagName('img')[0];
                const image = new Image();
                image.src = img.src;
            }
        );
    });

    $('*[data-poload]').popup({
        hoverable: true,
        html: '<i class="circle notch loading icon"></i>',
        delay: { show: 500, hide: 200 },
        onShow: function (e) { this.html(cachedUsers[$(e).data('poload')].html) }
    });

    const timezone = document.getElementById('timezone');
    if (timezone) {
        const dateFormatter = Intl.DateTimeFormat();
        const timezoneValue = dateFormatter.resolvedOptions().timeZone;
        if (timezoneValue) {
            timezone.value = timezoneValue;
        }
    }
});

const announcements = document.querySelectorAll('[id^="announcement"]');
announcements.forEach((announcement) => {
    const closeButton = announcement.querySelector('.close');
    if (closeButton) {
        closeButton.addEventListener('click', () => {
            document.cookie = announcement.id + '=true; path=/';
        });
    }
});
// @license-end

@@ -242,16 +242,506 @@
 url;%0A%7D%0A%0A
+function copy(element) %7B%0A    const target = $(element);%0A%0A    if (window.isSecureContext) %7B%0A        navigator.clipboard.writeText(target.text());%0A    %7D else %7B%0A        target.select();%0A        document.execCommand('copy');%0A    %7D%0A%0A    $('body').toast(%7B%0A        showIcon: 'checkmark',%0A        message: copied,%0A        class: 'success',%0A        progressUp: true,%0A        displayTime: 6000,%0A        showProgress: 'bottom',%0A        pauseOnHover: false,%0A        position: 'bottom left',%0A    %7D);%0A%7D%0A%0A
 $(docume

Add back copy function