2011-04-27, 19:26:09
Hello,
I wrote a small plugin which adds the ability to use BBTag like spoiler tags on GetSimple Pages.
Spoiler means that the Text inside the [spoiler]-Tags will not be visible to the visitors, until they click the "Spoiler" Button (or hover the text if JS is disabled).
It is very useful if you have content that some visitors may not want to see.
Usage:
Simplest usage would be without any additional arguments:
It will create a button with the caption: Show Spoiler, when it's clicked, it shows the spoiler text. (And button caption will change to Hide Spoiler)
A bit more complex usage would be if you set a special button caption:
This would create a button with the caption Click to show/hide a super secret text, when you click it will show the spoiler text. (The button caption will not change)
The more advanced way if the following, where you set show caption and hide caption:
Which will create a button with the caption Click to show a super secret text. When the user clicks on it, it will show the spoiler text and the button caption will change to Click to hide a super secret text. (Note that the delimiter for the two captions is |||, so you can't use it if you want a single caption spoiler button.
Changelog:
Version 1.1
I wrote a small plugin which adds the ability to use BBTag like spoiler tags on GetSimple Pages.
Spoiler means that the Text inside the [spoiler]-Tags will not be visible to the visitors, until they click the "Spoiler" Button (or hover the text if JS is disabled).
It is very useful if you have content that some visitors may not want to see.
Usage:
Simplest usage would be without any additional arguments:
Code:
[spoiler]This is my spoiler text[/spoiler]
A bit more complex usage would be if you set a special button caption:
Code:
[spoiler=Click to show/hide a super secret text]This is my spoiler text[/spoiler]
The more advanced way if the following, where you set show caption and hide caption:
Code:
[spoiler=Click to show a super secret text|||Click to hide a super secret text]This is my spoiler text[/spoiler]
Changelog:
Version 1.1
- Background-Color is now set to transparent when javascript is enabled.
- Background-Color and Text-Color are now both set to #333, so that the text isn't readable until it is hovered (when JS is disabled)
- Now you can use [spoiler=Custom Text]My hidden Text[/spoiler] to give the spoiler button a custom caption
- Will not add javascript and css code if no spoiler is used on the page
- Improved onload function to not conflict with other plugins Thanks to singulae from the forum!
- Fixes a bug with line breaks in spoilers
- Rewrote Javascript Code (thanks to frnkkpp, he did most of the work), cleaned up PHP code
- Added ability to specify different text for show/hide
- Changed default button text to Show Spoiler and Hide Spoiler
- HTML produced by the spoiler plugin should now be valid
- Added Settings:
- Set default show/hide text
- Decide if button/link should appear after or before the spoiler
- Switch between Link and Button
- Set default show/hide text
- Improved JavaScript to work with IE6 and higher Versions and with latest Firefox 8 (more)
- Fixed another Firefox issue, where the Button/Link text won't change properly
- Added support for custom classes for button and div
- Switched to domready to load faster
- Fixed some strict php errors
- Fixed a bug with custom classes, everything should work fine now