document.addEventListener('DOMContentLoaded', () => { /** Load jQuery extensions **/ //Code via: https://stackoverflow.com/a/13106698 $.fn.highlight = function (fadeOut) { fadeOut = typeof fadeOut !== 'undefined' ? fadeOut : 5000; $(this).each(function () { let el = $(this); $("
") .width(el.outerWidth()) .height(el.outerHeight()) .css({ "position": "absolute", "left": el.offset().left, "top": el.offset().top, "background-color": "#ffff99", "opacity": ".7", "z-index": "9999999", "border-top-left-radius": parseInt(el.css("borderTopLeftRadius"), 10), "border-top-right-radius": parseInt(el.css("borderTopRightRadius"), 10), "border-bottom-left-radius": parseInt(el.css("borderBottomLeftRadius"), 10), "border-bottom-right-radius": parseInt(el.css("borderBottomRightRadius"), 10) }).appendTo('body').fadeOut(fadeOut).queue(function () { $(this).remove(); }); }); }; /** Setup jQuery.timeago **/ $.timeago.settings.cutoff = 365 * 24 * 60 * 60 * 1000; // Display original dates older than 1 year $("time").timeago(); /** Setup sidebar toggle **/ let sidebar_hidden = []; try { sidebar_hidden = (shm_cookie_get("ui-sidebar-hidden") || "").split("|"); for (let i=0; i