Some BBCode reccomendations

Hi everybody.
I'd like to recommend that the admins install a couple of useful BBCodes.
The first one automatically opens URLs in a new tab/window (depending on the individual browser settings). This is useful for people who add external links to images, text, articles or anything else related to the discussion. This way someone can read the relevant information without losing the thread. There are several scripts that will do this, and many of them include other functions as well.
The second one is a spoiler button. Anything in [spoiler] tags is hidden, and revealed when clicked. I found this one particularly useful on support forums where people would often post screenshots of their problem in the post. The problem there is that you suddenly have these huge images breaking up the logical flow of the thread, and making it very difficult to navigate on mobile devices with smaller screens.
An open source implementation that I used is quite simple and effective:
That's the HTML replacement, and the actual BBCode is:
I'd like to recommend that the admins install a couple of useful BBCodes.
The first one automatically opens URLs in a new tab/window (depending on the individual browser settings). This is useful for people who add external links to images, text, articles or anything else related to the discussion. This way someone can read the relevant information without losing the thread. There are several scripts that will do this, and many of them include other functions as well.
The second one is a spoiler button. Anything in [spoiler] tags is hidden, and revealed when clicked. I found this one particularly useful on support forums where people would often post screenshots of their problem in the post. The problem there is that you suddenly have these huge images breaking up the logical flow of the thread, and making it very difficult to navigate on mobile devices with smaller screens.
An open source implementation that I used is quite simple and effective:
- Code: Select all
<div style="margin:20px; margin-top:5px"><div class="quotetitle"><b>Spoiler:</b> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" 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'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
That's the HTML replacement, and the actual BBCode is:
- Code: Select all
[spoiler]{TEXT}[/spoiler]