Author Topic: BBCode spoiler  (Read 890 times)

0 Members and 0 Guests are viewing this topic.

Offline geckogirl

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
BBCode spoiler
« on: September 19, 2017, 01:52:59 pm »
I apologize if this has been asked and answered. I did do a search and was unable to find the answer I needed.


Is there a way to change the bbcode for spoiler?? the hover is a pain in the butt for larger areas of text, every time you try to scroll down you lose the box.


I would like to have a click to show / click to hide spoiler that stays open when you click on it.


Thank You

Social Buttons


Offline CreateAForum

  • Administrator
  • *****
  • Posts: 5182
  • Karma: 271
    • View Profile
Re: BBCode spoiler
« Reply #1 on: September 19, 2017, 05:57:37 pm »
At the moment we can't change it. Will look into in the future for improvements.
Like Create A Forum? Support me at https://www.patreon.com/vbgamer45/

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile
Re: BBCode spoiler
« Reply #2 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);

Offline thekreater

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
    • View Profile
Re: BBCode spoiler
« Reply #3 on: April 20, 2018, 06:34:17 am »
so, a lot of code from SMF is compatible?

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile
Re: BBCode spoiler
« Reply #4 on: May 31, 2018, 03:57:39 am »
Not a ton, but few are, yes.  It's more likely it will not work than will work.
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
407 Views
Last post August 12, 2011, 03:02:53 am
by CB
2 Replies
820 Views
Last post February 21, 2012, 12:23:17 am
by aIURbliS
no spoiler

Started by onbush Bugs

5 Replies
750 Views
Last post October 15, 2012, 03:51:35 pm
by onbush
4 Replies
1820 Views
Last post January 12, 2015, 06:54:30 pm
by CreateAForum
BBCode issue?

Started by Sushi Bugs

1 Replies
471 Views
Last post January 19, 2017, 04:54:18 am
by CreateAForum