jQuery Spoiler

User submitted BBCodes
Let us see what You have
There is no support here! Only Read Access!
Forum rules
We dont add more BBCodes to our database, but feel free to share and support your own BBCodes here.
Remember that it is not allowed to use {TEXT} inside the html tags!!!
It causes a serious security risk to your board and users.
Like this: <div style="{TEXT}">{TEXT}</div>
Green = OK - Red = forbidden
User avatar
marc1706
BBCoder II
BBCoder II
Posts: 8
Joined: 14 Apr 2010, 11:17

jQuery Spoiler

Post by marc1706 »

jQuery Spoiler

Image

NOTE:
In order to work, this spoiler will need jQuery. If your style already has jQuery included, it will work right out of the box, otherwise you will have to do this:
Download jQuery 1.4.2 from here: http://code.jquery.com/jquery-1.4.2.min.js
Save it on your computer and upload it to the template folder of your style(s) that will use the spoiler.

If you have more than one style for your users, do this for every style:
Open styles/*yourstyle*/template/overall_header.html
Find:

Code: Select all

</head>
Add before:

Code: Select all

<script src="{T_TEMPLATE_PATH}/jquery-1.4.2.min.js" type="text/javascript"></script>
If you downloaded a different version of jQuery, please replace "jquery-1.4.2.min.js" with the filename of your jQuery.

BBCode Usage:

Code: Select all

[spoiler={INTTEXT}]{TEXT}[/spoiler]
HTML Replacement:

Code: Select all

<dl class="codebox"><dt><a href="javascript&#058; void(0);" onclick="var spoiler = this.parentNode.parentNode.getElementsByTagName('dd')[0]; if ( spoiler.style.display == 'none' ) { $(spoiler).slideDown(); $(spoiler).fadeIn('slow'); this.innerHTML = ' [&minus;] {INTTEXT}'; } else { $(spoiler).slideUp(); $(spoiler).fadeOut('slow'); this.innerHTML = '[+] {INTTEXT}'; };">[+] {INTTEXT}</a></dt><dd style="display: none;">{TEXT}</dd></dl>
Help line:

Code: Select all

[Spoiler="Title"] Any Text [/Spoiler]
Demo:
http://www.youtube.com/watch?v=TWNyCU5AhrY
Last edited by marc1706 on 18 Aug 2010, 16:15, edited 1 time in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: jQuery Spoiler

Post by Stoker »

Looks nice :thumb:
Board rules! No PM support
User avatar
Stitch
BBCoder II
BBCoder II
Posts: 28
Joined: 06 Mar 2010, 06:08

Re: jQuery Spoiler

Post by Stitch »

This isn't working on my board for some reason. I do have the jQuery 1.4.2 installed on my board because I am using it with another mod already. All I am getting is the bbcode text.
[spoiler2="this is a test"]Testing this cool BBcode[/spoiler2]
Any ideas?
Image
KukY13
BBCoder III
BBCoder III
Posts: 96
Joined: 26 Jun 2010, 16:23
Contact:

Re: jQuery Spoiler

Post by KukY13 »

Stitch » 30 Jul 2010, 06:28 wrote:
[spoiler2="this is a test"]Testing this cool BBcode[/spoiler2]
Any ideas?
The Spoiler title is an {IDENTIFIER}, and if my memory serves me, it only allows A-Z, a-z, 0-9 and underscores.
So try changing the BBCode, and replace {IDENTIFIER} with {SIMPLETEXT}.
Image
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: jQuery Spoiler

Post by Stoker »

or INTTEXT
Board rules! No PM support
User avatar
Stitch
BBCoder II
BBCoder II
Posts: 28
Joined: 06 Mar 2010, 06:08

Re: jQuery Spoiler

Post by Stitch »

Ok after an hour of messing around I finally figured out the problem but don't know how to solve it. If you put a space in your title it will break the bbcode. As long as it is all one word it works fine.

This way does not work

Code: Select all

[spoiler2="this is a test"]Testing this cool BBcode[/spoiler2]

This way works

Code: Select all

[spoiler2="thisisatest"]Testing this cool BBcode[/spoiler2]
Image
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: jQuery Spoiler

Post by Stoker »

And if you use this as BBode Usage:

Code: Select all

[spoiler={INTTEXT}]{TEXT}[/spoiler]
?
Board rules! No PM support
User avatar
Stitch
BBCoder II
BBCoder II
Posts: 28
Joined: 06 Mar 2010, 06:08

Re: jQuery Spoiler

Post by Stitch »

Stoker » 01 Aug 2010, 07:25 wrote:And if you use this as BBode Usage:

Code: Select all

[spoiler={INTTEXT}]{TEXT}[/spoiler]
?
No sir..using INTEXT it doesn't work at all. Even without spaces in the title.
Image
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: jQuery Spoiler

Post by Stoker »

Hmm, so you are on one of the older versions of phpBB. Shame on you :D
Then try what KukY13 suggested, use SIMPLETEXT
Board rules! No PM support
User avatar
Stitch
BBCoder II
BBCoder II
Posts: 28
Joined: 06 Mar 2010, 06:08

Re: jQuery Spoiler

Post by Stitch »

I'm only one version behind. 3.0.6.
Image
Locked