Closed (won't fix)
Project:
Spoiler
Version:
6.x-1.1-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2009 at 23:07 UTC
Updated:
16 Mar 2009 at 00:35 UTC
I wanted a dropdown menu for spoilers, so I changed the spoiler.module on my local server:
function _spoiler_filter_process($text) {
return preg_replace('#\[spoiler=?(.*?)\](.*?)\[/spoiler\]#s', t('<fieldset class="collapsible collapsed"><legend>Spoiler: $1</legend><div>$2</div></fieldset>'), $text);
}
With this, it kinda resembles BBCode that uses [spoiler][/spoiler] tags, as well as the optional title with [spoiler=Title][/spoiler].
It also renders nicely on handheld devices as expanded text, whereas I was having viewing issues with the old CSS method. On my system, I also changed the _filter_tips function and _filter description to reflect the new behavior.
If others think this is useful, would it be possible to add this as an option?
Comments
Comment #1
Zen commentedThere's a new beta out with JS support and a theme function that you can use if necessary.
-K
Comment #2
Unity commentedThanks for this great hack. IMO this version is much better than the original. I used it in my Drupal 5 version of Spoiler, and it works great!