vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - Most elegant Spoiler-Tag [BB-Code] (https://vborg.vbsupport.ru/showthread.php?t=279069)

Grazu 02-22-2012 11:00 PM

Most elegant Spoiler-Tag [BB-Code]
 
1 Attachment(s)
This mod is automatically compatible with vB3.6.x, vB3.7.x, vB3.8.x and vB4.x.x



Demo: http://Uniquecrew.net/Spoiler.php
Demo-Mirror: http://hrkleZ.bplaced.net/Files/Spoiler.html (as you can see in the source, images are base64 encoded in the Demo-Mirror)


Installation Instructions:
  1. Open your AdminCP Custom BB Codes => Add New BB Code
  2. Title: Spoiler
  3. BB Code Tag Name: Spoiler
  4. Replacement:
    HTML Code:

    <div style="padding: 0px 5px 0px 5px;  border: 1px solid #DF7401; margin-left: 20px; width: 40%"><div align="center" style="text-transform: none; border-bottom: none; display: block; padding: 3px 0px 3px 0px;">
    <span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
      if (spoiler.style.display != ''){
        this.parentNode.parentNode.style.width = '80%'
        this.parentNode.style.borderBottom = '1px solid #CCCCCC';
        spoiler.style.display = '';
        this.getElementsByTagName('a')[0].innerHTML = '->Close Spoiler<-';
      }else{
        this.parentNode.parentNode.style.width = '40%'
        this.parentNode.style.borderBottom = 'none';
        spoiler.style.display = 'none';
        this.getElementsByTagName('a')[0].innerHTML = '->Open Spoiler<-';
      }"
    />

    <a rel="nofollow" href="#" onClick="return false;" style="text-decoration: none;"><b style="font-size: 0.8em;">->Spoiler ?ffnen<-</b></a>
    </span>
    </div>
    <div class="quotecontent">
    <div align="center" style="display: none; padding: 5px 0px 5px 0px;"><br> {param}</div>
    </div>
    </div><br />

  5. Example: [SPOILER]Hidden Text Here[/SPOILER]
  6. Description: The [SPOILER]-Tag allows you to hidden or hide your text.
  7. Use {option}: No
  8. Button Image (Optional) => Upload this https://vborg.vbsupport.ru/attachmen...1&d=1330032950 Picture on you Server and enter the exact Address of it (/images/ is recommended).
  9. Remove Tag If Empty: Yes
  10. Disable BB Code Within This BB Code: No
  11. Disable Smilies Within This BB Code: No
  12. Disable Word Wrapping Within This BB Code: No
  13. Disable Automatic Link Parsing Within This BB Code: No
After you finished, you can compare your Settings with this Screenshot. ;)


I hope you like it! (:

This mod is automatically compatible with vB3.6.x, vB3.7.x, vB3.8.x and vB4.x.x

clutchthese 02-26-2012 06:58 AM

When viewing on mobile device, it crashes app and when in mobile browser, redirects to homepage.... Anything to fix this?

Grazu 02-27-2012 03:10 PM

Your mobile have to support JavaScript, all iPhones & Android-Devices are compatible with this. ;)

ceho 02-28-2012 06:06 PM

Hi, a very nice addon, thanks a lot :). There is just one thing that I don't get managed: I would like to have the font inside of the spoiler box that's saying Open/Close Spoiler in the same font style like the one that's displayed before opening the box for the first time. So I would like to add
Code:

style="text-decoration: none;"><b style="font-size: 0.8em;"
into the span tag that contains the onClick stuff etc. But I don't get it. Would you mind helping me that the fonts are displayed all the same? Thanks a lot :).

clutchthese 02-28-2012 08:27 PM

Quote:

Originally Posted by Grazu (Post 2303886)
Your mobile have to support JavaScript, all iPhones & Android-Devices are compatible with this. ;)

I'm talking the iphone app... via mobile suite.

It is on an iphone. you can open the spoiler, but to select the pic for a bigger view results in a crash.

Grazu 02-29-2012 02:03 PM

@ceho:
Maybe this could help you ;)
HTML Code:

<div style="padding: 0px 5px 0px 5px;  border: 1px solid #DF7401; margin-left: 20px; width: 40%">
<div align="center" style="text-transform: none; border-bottom: none; display: block; padding: 3px 0px 3px 0px;">
<span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
  if (spoiler.style.display != ''){
    this.parentNode.parentNode.style.width = '80%'
    this.parentNode.style.borderBottom = '1px solid #CCCCCC';
    spoiler.style.display = '';
    this.getElementsByTagName('a')[0].innerHTML = '->Spoiler schlie?en<-';
  }else{
    this.parentNode.parentNode.style.width = '40%'
    this.parentNode.style.borderBottom = 'none';
    spoiler.style.display = 'none';
    this.getElementsByTagName('a')[0].innerHTML = '->Spoiler ?ffnen<-';
  }"
/>

<a rel="nofollow" href="#" onClick="return false;" style="text-decoration: none;"><b style="font-size: 0.8em;">->Spoiler ?ffnen<-</b></a>
</span>
</div>
<div class="quotecontent">
<div align="center" style="display: none; padding: 5px 0px 5px 0px;"><br> <b style="font-size: 0.8em;">{param}</b></div>
</div>
</div><br />

Quote:

Originally Posted by clutchthese (Post 2304387)
I'm talking the iphone app... via mobile suite.

It is on an iphone. you can open the spoiler, but to select the pic for a bigger view results in a crash.

I'm using Safari, without problems. (:

ceho 02-29-2012 05:16 PM

Hi Grazu, thanks very much. That's part of it :). Actually I want to change the font inside of this bit:

Code:

<span onClick="var spoiler = this.parentNode.parentNode.getElementsByTagName('div')[2];
  if (spoiler.style.display != ''){
    this.parentNode.parentNode.style.width = '98%'
    this.parentNode.style.borderBottom = '1px dotted #000000';
    spoiler.style.display = '';
    this.getElementsByTagName('a')[0].innerHTML = '>> Close Download Links <<';
  }else{
    this.parentNode.parentNode.style.width = '98%'
    this.parentNode.style.borderBottom = 'none';
    spoiler.style.display = 'none';
    this.getElementsByTagName('a')[0].innerHTML = '>> Open Download Links <<';
  }" />

Any idea how to do this?

And would you have an idea if it's possible to always have the spoiler at the bottom of each post, automatically? Thanks and keep up the great work mate.

clutchthese 04-07-2012 11:04 AM

Has anyone else tried this on a mobile? On two of my forums it redirects to homepage (my site.com/#)

benjaminlwells 04-09-2012 02:31 PM

any way to make the spoiler keep hidden text from showing on widgets and blocks?

Amaury 05-06-2012 09:43 PM

Thank you.

Also, before opening it when first visiting said thread, it says "->Spoiler öffnen<-." However, once you open it, it changes to Close / Open Spoiler. What's offnen?

Is there a way to get it to say Open Spoiler when you first go to said thread?

Edit: Never mind, trying another one.


All times are GMT. The time now is 07:23 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.01101 seconds
  • Memory Usage 1,752KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete