SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 23, 2012, 05:41:26 am

Login with username, password and session length
Members
Total Members: 10069
Latest: tetsujrock
Stats
Total Posts: 28682
Total Topics: 4975
Online Today: 94
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 70
Total: 70
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Help with spoiler tag  (Read 1478 times)
S3NTYN3L
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: January 14, 2008, 03:20:28 pm »

I know, I know...
You're going to tell me that there are already several of them written and why the heck bother with another...

True,  but I don't like them at all...
The best one around, by AzaToth, is WAY OVERDONE...
It requires you to enable permissions in MANY different places and/or on a per-board basis... WTF is that about!?
Not to mention that I find the three different "types" of output somewhat pointless...

Now, I've already got some code in place on my forum, (you can see it in action here), using the Custom BB Code mod written by Sarke,
but I'd REALLY like to implement it as a "standalone" bbcode.
In such a way that it works like the [url], [quote], [b], etc tags.
Which is to say, BY DEFAULT! You can either enable it or disable it along with the others via the ACP.


Here's the css and javascript I'm currently using and would like to see used in the standalone tag:

javascript:
Code:
<div style="margin: 20px;"><div style="padding: 0px 0px 2px 0px;"><input type="button" class="spoilerheader" value="Show Spoiler" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      this.innerText = ''; this.value = 'Hide Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Spoiler'; }"></div><div class="spoilercontainer"><div style="display: none;">
{content}</div>
</div>
</div>

css:
Code:
/* Spoiler Tag */
.spoilerheader
{
   color: #BBBBBB;
   font-weight: bold;
   text-decoration: underline;
   display: block;
   background: transparent;
   border: 0px;
}

.spoilercontainer
{
   color: #BBBBBB;
   background: transparent;
   border: 1px #000000 solid;
   padding-left: 5px;
   padding-right: 5px;
}


I found this tutorial on creating your own bbcodes but I have no idea how the above javascript would get incorporated into it, nor do I know how I would incorporate the finished code into my forum...


So, please, won't you help me in my quest?
I'll give you a cookie!
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]

[May 17, 2012, 12:38:16 pm]

[May 15, 2012, 09:32:27 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.188 seconds with 19 queries.