Extension talk:Spoilers

Jump to navigation Jump to search

About this board

Orribu (talkcontribs)

Hey there!

Firstly, this is a super great extension and I can't wait to use it on the wiki!

I wanted to know if there was a way to translate it into a template so that the show message, hide message, and spoiler text could function as customizable parameters?

Thanks a ton!

Reply to "Spoilers Template?"

Inline button instead separate paragraph

8
Ovvldc (talkcontribs)

I would like to use this extension on my own wiki, but I'd prefer to put the spoiler warning inline. Unfortunately, I am not a Javascript programmer. I tried changing the return part of spoilerMagicTag to

return $parser->insertStripItem( $output, $parser->mStripState );

as suggested in

Manual:Parser functions#Controlling the parsing of output

but this did not work and all of the output was still in separate paragraphs, including two lines that I was separating with a <br /> tag at first.

How do I keep the parser from adding <p></p> containers around every line of output? :(.

Thanks for any hints

Ovvldc (talkcontribs)

The adding of <p> and </p> to every line in the text also stops me from starting a spoiler area with lists (start with * and #) and indented lines (start with:). Not as flexible as I had hoped :(.

Ovvldc (talkcontribs)

Actually, the bug seems to be that the <spoiler> tag assumes to end at the end of the line in wiki-format, if you are in a list. So

<spoiler>text
*more text</spoiler>

will work, but

*text <spoiler>
:more text</spoiler>

does not.

Clump (talkcontribs)

That's an (unfortunate) consequence of how wikitext lists are constructed and the improper nesting of tags that results in the generated HTML.

Your first example works because the unordered list is properly and entirely within the spoiler tags, and the "*" indicating a list is at the start of the line.

Your non-working example fails because the unordered list, and first list item too, are opened outside the spoiler tag, but become closed inside it.

Ovvldc (talkcontribs)
Clump (talkcontribs)

I don't think that would be easy. The spoiler region is identified by wrapping it in a tag (actually a nest of tags), and it is hard to ensure that is properly nested when you have only indirect control over the list tag construction. I suppose you could use explicit list html syntax to give some manual control, such as:

<ul><li>text <spoiler>
:more text</spoiler></li><li>outer list continues</li></ul>

or

*text <spoiler><dl><dd>more text</dd></dl></spoiler>
*outer list continues
Keyacom (talkcontribs)

Oh, that's a good idea. I will ask the good old Buoysel (talk | contribs) from PokéWiki to upload the extension to MediaWiki.org, but you can ask as well (in English or German; email-confirmed account required to edit pages there). I checked that on this special page that Buoysel is indeed the author of the extension. This doesn't work now, even with the right code because there is no specified JavaScript for this on this site.

Ovvldc (talkcontribs)

If there is a spoiler extension that can work through tags, I would be very interested :)

Reply to "Inline button instead separate paragraph"
VolkoV (talkcontribs)

There is a copy&paste error in the SpoilersHooks.php on line 83, this should be $hideText=… instead of $showText=…

Ovvldc (talkcontribs)

confirmed

Reply to "Bug"
TorontonianOnlines (talkcontribs)

Hi there,

It looks like the Spoiler extension is running into some sort of bug on 1.30, wherein the text in the spoiler tags also appears at the top of the screen, overflowing the username, notifications button, contributions link, etc.

Would it be possible to fix this?

Thanks!

Jean Cognard (talkcontribs)

I've also installed this extension on MW 1.30 and, when used on a page, one message line "Array ( [show] => see details [hide] => hide details [text] => '"`UNIQ--DPL-00000001-QINU`"' )" is displayed on upper side.

Could it be fixed ? Thks, Jean

Reply to "Spoiler Extension on MW 1.30"

Spoiler-Button instantly disappears (although it is shown for a spöit second)

18
85.216.104.213 (talkcontribs)

I tried the extension on mediawiki 1.19 and really liked it. But after upgrading to 1.24.1 it does not work anymore. I know, that somebody already hast told you about this. But I wanted to give some more information - since i would really appreciate, if we could use it furthermore with mediawiki 1.24.1. As mentionend in the titel, the spoiler button can be seen for a split second when loading the page, but it disappears instantly. Another aspect I recognized is that on the special:version site, your extension is only mentioned in "extensions \ special pages", but not in "extensions \ parserhooks". Is that correct or does it probably give some hint about the problem - keeping in mind, that the <spoiler>-tag is in fact mentioned under "parser extension tags"?

ProgramCeltic (talkcontribs)

I had not heard about the instant disappearing. I'll take a look at it and update the extension. Thanks!

Bluekuma (talkcontribs)

Same problem here, mediawiki version 1.24.2. Here's how my html tree looks like using <spoiler show="show_message" hide="hide_message">spoiler_text</spoiler>. Setting .spoilers-button { display:inline; } by hand the button is visible but nothing happens clicking on it.

<div class="spoilers">
  <div class="spoilers-button-container">
    <p>
      <span class="spoilers-button" style="display: none;">
        <span class="spoilers-show">show_message</span>
        <span class="spoilers-hide" style="display: none;">hide_message</span>
      </span>
    </p>
   </div>
   <div class="spoilers-body" style="display: none;">spoiler_text</div>
 </div>
Asherett (talkcontribs)

Got the exact same problem. You can actually see the button "shrink" and then disappear in a split second. Any chance you can make this extension work again for 1.24.x?

Kumagor0 (talkcontribs)

I think I have same problem with MediaWiki 1.24.2. There is something like a spoiler for a moment but then it disappears.

Using it like this <spoiler>spoiler_text</spoiler> also causes these errors:
Notice: Undefined index: show in /var/www/html/extensions/Spoilers/Spoilers.hooks.php on line 42
Notice: Undefined index: hide in /var/www/html/extensions/Spoilers/Spoilers.hooks.php on line 43
while using <spoiler show="show_message" hide="hide_message">spoiler_text</spoiler> just shows nothing.

Please update extension OR release status, because it is probably not stable with modern versions.

ProgramCeltic (talkcontribs)

Extension has been updated and fixed for modern versions!

Kumagor0 (talkcontribs)

Still not working for me with MW 1.24.2.

<spoiler show="show_message" hide="hide_message">spoiler_text</spoiler> looks like show_message text, not a spoiler.

ProgramCeltic (talkcontribs)

Also, ran it against 1.24.2+, 1.25.2 as well. Everything looks good. If you don't mind putting sending over some screenshots, I may be able to help you further.

ProgramCeltic (talkcontribs)

Show Message is the button name for when a person click on it. Spoiler_text is the actual spoiler piece.

ProgramCeltic (talkcontribs)
ProgramCeltic (talkcontribs)

I'm updating the extension this week and plan a release by Friday at the latest!

Greylin (talkcontribs)

I have just updated to MediaWiki 1.26 and at first I thought everything was OK with Spoilers 1.3 because it works when the page first loads, but when I refresh the page the button disappears and all I can see is the name of the button - no actual button and no ability to see the hidden text. So once again I have restored Spoilers 1.0 and MediaWiki 1.23.6 because my project really needs spoiler buttons!

ProgramCeltic (talkcontribs)

Hey Greylin! I'll take a look at it versus 1.26. Thanks for the information.

ProgramCeltic (talkcontribs)

1.4 has been released to work with 1.26.

Greylin (talkcontribs)

Thank you, thank you! It's working perfectly.  :)

ProgramCeltic (talkcontribs)

Awesome! Thanks, for the update.

83.125.10.14 (talkcontribs)

same here. lame code skills

Reply to "Spoiler-Button instantly disappears (although it is shown for a spöit second)"

Spoiler Button doesn't work with MediaWiki 1.26

3
Greylin (talkcontribs)

This extension is indispensable to my project and I have been very grateful for the work that went into it. Any chance of an update please so that we can use it with MediaWiki 1.26?

ProgramCeltic (talkcontribs)

Yep, I will look into it!

ProgramCeltic (talkcontribs)

New release is out!

Reply to "Spoiler Button doesn't work with MediaWiki 1.26"

Spoiler-Button seen only in edit preview

3
Meekreau (talkcontribs)

I've decided to start a separate topic, although this may also be related to the previous one ("Spoiler-Button instantly disappears (although it is shown for a spöit second)"). The difference is that I do not see the button while viewing a page normally at all, only text "Show spoiler".

The following two points are new in my case:

  1. There is a fully functional button in edit preview
  2. Interestingly, touch LocalSettings.php or any other changes to the file fixes it until I edit any page in the wiki and save the changes

I use MySQL+PHP as shipped with Ubuntu 14.04.2 with Mediawiki 1.25.2 and Spoilers extension v.1.3. I've been able to reproduce the steps above on Bitnami Mediawiki Virtual Machine in Virtualbox. We might use it as a reference environment, too.

The problem is repoducible in both Firefox 40 and Google Chrome 44.0.2403.155.

80.245.147.81 (talkcontribs)

Im having the same Problem with 1.25.1

77.239.252.117 (talkcontribs)

Same

Reply to "Spoiler-Button seen only in edit preview"

Does it load spoiler content upon unveiling it or at page load?

3
109.91.15.84 (talkcontribs)

It could be nice to add a sentence to specify if the content in spoiler will be loaded together with the whole page content or only upon expanding the spoiler. Thanks!

ProgramCeltic (talkcontribs)
Reply to "Does it load spoiler content upon unveiling it or at page load?"

Not working in version 1.24.1

3
Greylin (talkcontribs)

This is a great little extension, absolutely invaluable to my wiki project, but sadly it doesn't seem to work with 1.24.1. I have restored 1.23.6 for now.

ProgramCeltic (talkcontribs)

I will have to look into the compatibility for 1.24.x. Thanks for letting me know.

ProgramCeltic (talkcontribs)
Reply to "Not working in version 1.24.1"
87.194.52.44 (talkcontribs)

This is a lovely little extension but it appears to stop wiki markup between the <spoiler></spoiler> tags from working. Is there a way round this?

ProgramCeltic (talkcontribs)

I will check into this and update the extension.

ProgramCeltic (talkcontribs)

I updated the extension to parse wiki markup in the tags.

ProgramCeltic (talkcontribs)
Reply to "Wiki markup stops working"