Author Topic: BBCode spoiler  (Read 1515 times)

0 Members and 0 Guests are viewing this topic.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile
Re: BBCode spoiler
« on: April 20, 2018, 01:31:04 am »
EDIT:  Nevermind, I didn't read the whole post.  Whoops.  I thought you wanted a spoiler code for the forum.  But there already is one.  Again, woops.

This code should theoretically work for you.  (It's an old code from SMF for Free.
Code: [Select]
<script type="text/javascript src="/jquery.js></script><script>
b = document.getElementsByTagName("div");
for(x=0;x<b.length;x++){
if(b[x].className=="post" && b[x].innerHTML.match(/\[spoiler\](.*)\[\/spoiler\]/i)){
b[x].innerHTML = b[x].innerHTML.replace("[spoiler]"+RegExp.$1+"[/spoiler]","<div><div><a href='javascript:void(0)' onclick='$(this).parent().next().toggle()'>(Click to Show/Hide Spoiler)</a></div><div style='display:none' id='spoiler'>"+RegExp.$1+"</div></div>");
};};
</script>
« Last Edit: April 20, 2018, 01:32:49 am by Agent Moose »
Code: [Select]
//Hint hint :)
if(/action=profile;u=(.*);sa=UserPage/i.test(location.href)){
var number = RegExp.$1;
var username = (smf_id_member !== "0") ? document.getElementById("upper_section").getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerHTML : void(0);

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
543 Views
Last post August 12, 2011, 03:02:53 am
by CB
2 Replies
987 Views
Last post February 21, 2012, 12:23:17 am
by aIURbliS
no spoiler

Started by onbush Bugs

5 Replies
856 Views
Last post October 15, 2012, 03:51:35 pm
by onbush
4 Replies
1954 Views
Last post January 12, 2015, 06:54:30 pm
by CreateAForum
11 Replies
402 Views
Last post May 17, 2020, 09:48:42 pm
by coffeegirl