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 toggleSpoiler { this.classList.toggle('spoiled'); }

var spoilers = document.getElementsByClassName('spoiler-inline'); for (var i = 0; i < spoilers.length; i++) { spoilers[i].addEventListener('click', toggleSpoiler, false); }