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:
<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:
/* 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!