Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2014, 03:33 PM
katie hunter's Avatar
katie hunter katie hunter is offline
 
Join Date: May 2007
Posts: 533
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 ?
Reply With Quote
  #2  
Old 06-03-2014, 03:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
Благодарность от:
katie hunter
  #3  
Old 06-03-2014, 03:38 PM
katie hunter's Avatar
katie hunter katie hunter is offline
 
Join Date: May 2007
Posts: 533
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
(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.
Reply With Quote
  #4  
Old 06-03-2014, 05:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-03-2014, 05:50 PM
katie hunter's Avatar
katie hunter katie hunter is offline
 
Join Date: May 2007
Posts: 533
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #6  
Old 07-16-2014, 12:44 AM
katie hunter's Avatar
katie hunter katie hunter is offline
 
Join Date: May 2007
Posts: 533
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

https://github.com/discourse/discour...pts/spoiler.js
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11153 seconds
  • Memory Usage 2,218KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete