vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to add this spoiler ? bbcode (https://vborg.vbsupport.ru/showthread.php?t=311888)

katie hunter 06-03-2014 02:33 PM

How to add this spoiler ? bbcode
 
I am currently using a different one on my forum but I like this version more used on Discourse forum. It blurs txt or images until you click on it to see it.

Ex https://meta.discourse.org/t/folding-spoilers/16123/2

How can I add this spoiler to my custom bbcode ? What would be the HMLT code for it ?

Lynne 06-03-2014 02:35 PM

This is in the source code for that:

HTML Code:

<span class="spoiled" style="background-color: transparent; color: transparent; text-shadow: 0px 0px 10px black; cursor: pointer;">This is a spoiler</span>
So, perhaps try that html.

(I don't know why they have given it a class when they haven't even defined the class in the CSS and instead using it inline.)

katie hunter 06-03-2014 02:38 PM

Hi Lynne, thanks.

The version i use on my forum is this

HTML Code:

<div style="margin: 0px;">
<div class="smallfont" style="margin-bottom: 2px;">
<strong>Spoiler!</strong> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }"
type="button" />

</div>
<div class="alt2" style="border: 0px inset; padding: 0px;">
<div class="spoiler" style="display: none;">{param}</div>
</div>
</div>


It is not working. I tried the code you send me but it doesn't open i.e., txt or image would show once i click on the blurry stuff.

Quote:

Originally Posted by Lynne (Post 2500553)
(I don't know why they have given it a class when they haven't even defined the class in the CSS and instead using it inline.)

They're using Ruby on Rails, not sure how that language works with css.

Lynne 06-03-2014 04:30 PM

Their spoiler js is in here - https://meta-discourse.r.worldssl.ne...7955c85949a.js So, you'd have to un-minify it in order to grab it.

katie hunter 06-03-2014 04:50 PM

This looks rather complicated, i don't think it is that complicated... but i will ask around more.

--------------- Added [DATE]1401846448[/DATE] at [TIME]1401846448[/TIME] ---------------

the code would be something similar to this but not exactly working the same way

HTML Code:

<div style="margin: 0px;">
<div class="smallfont" style="margin-bottom: 2px;">
<strong>Spoiler!</strong> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }"
type="button" />

</div>
<div class="alt2" style="border: 0px inset; padding: 0px;">
<div class="spoiler" style="display: none;">{param}</div>
</div>
</div>


katie hunter 07-15-2014 11:44 PM

Hi Lynne, would this file help built this spoiler bbcode ?

https://github.com/discourse/discour...pts/spoiler.js


All times are GMT. The time now is 04:45 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01601 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete