News:

Create A Forum Installed

Author Topic: BBCode spoiler  (Read 2210 times)

0 Members and 2 Guests are viewing this topic.

Offline geckogirl

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile

Badges: (View All)
Topic Starter First Post Combination
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

Share on Facebook Share on Twitter


Offline CreateAForum

  • Administrator
  • *****
  • Posts: 7186
  • Karma: 327
    • View Profile

Badges: (View All)
Avatar Linux User Tenth year Anniversary
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

Badges: (View All)
Linux User Mobile User Level 5
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: 34
  • Karma: 0
    • View Profile

Badges: (View All)
Level 4 Fourth year Anniversary Linux User
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

Badges: (View All)
Linux User Mobile User Level 5
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
2 Replies
1189 Views
Last post February 21, 2012, 12:23:17 am
by aIURbliS
no spoiler

Started by onbush Bugs

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

Started by Sushi Bugs

1 Replies
858 Views
Last post January 19, 2017, 04:54:18 am
by CreateAForum
11 Replies
2014 Views
Last post May 17, 2020, 09:48:42 pm
by coffeegirl