• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[BB code] Spoiler

CyberAP

Well-known member
#1
I think you know what I'm talknig about.
Spoiler hides info into one line (block)
Code
Anything here
 

Brogan

XenForo moderator
Staff member
#2
I use a button for my spoiler like so:

Code:
[spoiler={TEXT1}]{TEXT2}[/spoiler]
Code:
<div class="spoiler"><div class="quotetitle"><input type="button" value="{TEXT1}" style="font-size:11px;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 = '{TEXT1}'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT2}</div></div></div>
Custom BB Code isn't yet possible but if someone could code that in it would be great.

Oh and fix the problem with not being able to use apostrophes in the {TEXT1} field :D
 

Jeremy

Well-known member
#4
I'm now intrigued. I should stay away from XenForo, my productivity drops. I'll see if I can get a custom BBcode working later. :/ Should be able to figure it out. :)
 

anotheralias

Well-known member
#6
Can I tag on a request for the other kind of spoiler code here too - the one that blacks out the text - or should I start a new thread for that?
 

Jeremy

Well-known member
#7
I'm working on one that uses Brogan's code, but I hope to make it so that you can add your own via the control panel.
 

EQnoble

Well-known member
#8
I have one that i've been waiting to work into XF...will try for tonight. Some one give me a desired default color for the spoiler to appear in. If not I will just use one of the default XF colors.
 

Jeremy

Well-known member
#9
EQnoble, if you'd like, send me the code and I will get it into my release. Brogan's is (no offense), extremely plain.
 

EQnoble

Well-known member
#13
EQnoble, if you'd like, send me the code and I will get it into my release. Brogan's is (no offense), extremely plain.
gimme another day if you can, long day and feel wrecked. I just need to fix a callback argument and some css and it should be all ready to go but I am too tired right this minute... I'll edit this post and update it

http://noobanomics.me
I broke it this is the best example I could manifest for the time being.