MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

if (mw.config.get('skin') == 'timeless') { $('#catlinks-sidebar').find(".mw-portlet-body").find("ul").wrap(' ') .closest('details') .prepend('Show full category list ');

$('#mw-normal-catlinks').find("ul").wrap(' ') .closest('details') .prepend('Show full category list ');

$('#catlinks').children.not('#mw-normal-catlinks').hide; }

/* Adding functionality for unblurring spoilers by clicking on them*/ function unblurSpoilerOnClick { var mousedOverBlur = document.querySelector(':hover.spoilerblur'); if (mousedOverBlur) { mousedOverBlur.classList.remove("spoilerblur"); } } document.body.addEventListener('click', unblurSpoilerOnClick, true);

/* Adding functionality for generalised spoilers */ function unspoilOnClick { var mousedOver = document.querySelector(':hover.spoiler-inline'); if (mousedOver) { mousedOver.classList.toggle('spoiled'); } } document.body.addEventListener('click', unspoilOnClick, true);

document.querySelectorAll('.spoiler-inline').forEach(spoiler => { spoiler.addEventListener('click', function handleClick(event) { event.target.classList.toggle('spoiled2'); }); });