Difference between revisions of "MediaWiki:Common.js"
From Project: Gorgon Wiki
Gorgonzola (talk | contribs) (Adding code for the Spoiler template) |
Gorgonzola (talk | contribs) m |
||
| 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. */ | ||
| − | // Gorgonzola: | + | // Gorgonzola: Used by [[Template:Spoilers]] (reusing classes from <spoiler> extension) |
| − | |||
$('.spoilers-button').toggle(function() { | $('.spoilers-button').toggle(function() { | ||
$(this).parents('.spoilers').find('.spoilers-body').show(); | $(this).parents('.spoilers').find('.spoilers-body').show(); | ||
Revision as of 12:03, 23 September 2014
/* Any JavaScript here will be loaded for all users on every page load. */
// Gorgonzola: Used by [[Template:Spoilers]] (reusing classes from <spoiler> extension)
$('.spoilers-button').toggle(function() {
$(this).parents('.spoilers').find('.spoilers-body').show();
$(this).children('.spoilers-show').hide();
$(this).children('.spoilers-hide').show();
}, function() {
$(this).parents('.spoilers').find('.spoilers-body').hide();
$(this).children('.spoilers-show').show();
$(this).children('.spoilers-hide').hide();
});