Thread:Manuel de la Fuente/@comment-5916303-20160122154801/@comment-5774380-20160122161346

Hello,

The Spoiler Alerts work in four steps:

1. Most of the function is created using this script: MediaWiki:SpoilerAlert.js

The message itself is contained in the section called /* Alert */. You can modify it if you want to change the text, image, colors, etc. I'd just ask you to keep the credits.

2. To enable it, put this code at the top of the MediaWiki:Common.js in your Wiki:

/* Spoiler Alert */ // This script must always be the very first executed importScriptPage('MediaWiki:SpoilerAlert.js');

3. The alert will not appear in every page of your Wiki, you have to add each page that you want to display the alerts to a category called "Spoilers". You can't either add every page in your Wiki to that category, otherwise it would be a violation to the Wikia's Terms of Use.

4. Additionally, we have a button to rehide spoilers at the top of each article. That's an independent function. If you want it too, put this code in your Common.js below the previous script:

$(window).load(function{   /* Adds option to hide spoilers to the row of buttons */    if ($.inArray("Spoilers", wgCategories) > -1) {        $('#WikiaPageHeader').append('Rehide spoilers');        $('#reset-spoilers').click(function { localStorage.removeItem("spoilerCache"); location.reload; });   } });

That'd be all. Good luck. :)