MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Created page with "→Any JavaScript here will be loaded for all users on every page load.: $(function () { var catlinks = document.getElementById('catlinks-sidebar'); var content = document.getElementById('mw-content'); if (catlinks && content) { content.appendChild(catlinks); } });" |
m Protected "MediaWiki:Common.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
||
| (15 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
if ( | |||
/* | |||
Template:Spoiler on dev.miraheze.org | |||
*/ | |||
$(function(){ | |||
//spoiler block behavior | |||
$('.spoiler').click(function(){ | |||
$(this).toggleClass('off'); | |||
}); | |||
// spoiler button behavior | |||
$('#spoilerbtn').text('Show all spoilers'); | |||
$('#spoilerbtn').click(function(){ | |||
$(this).toggleClass('hide'); | |||
$('.spoiler').toggleClass('showall'); | |||
if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); } | |||
else { $(this).text('Show all spoilers'); } | |||
}); | |||
}); | }); | ||
// [[Category:Scripts]] | |||
Latest revision as of 23:00, 19 October 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/*
Template:Spoiler on dev.miraheze.org
*/
$(function(){
//spoiler block behavior
$('.spoiler').click(function(){
$(this).toggleClass('off');
});
// spoiler button behavior
$('#spoilerbtn').text('Show all spoilers');
$('#spoilerbtn').click(function(){
$(this).toggleClass('hide');
$('.spoiler').toggleClass('showall');
if ($(this).is('.hide')){ $(this).text('Hide all spoilers'); }
else { $(this).text('Show all spoilers'); }
});
});
// [[Category:Scripts]]