Difference between revisions of "MediaWiki:Common.js"

From Project: Gorgon Wiki
Jump to: navigation, search
(Adding code for the Spoiler template)
 
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: See my comments in page discussion (trying to minimize page bloat here).
+
// 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();
});