vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Quote Expander / Collapse - By Technidev (https://vborg.vbsupport.ru/showthread.php?t=321756)

Dave 02-07-2016 10:00 PM

Quote Expander / Collapse - By Technidev
 
1 Attachment(s)
Mark as installed = get support.

If you're tired of people quoting long posts and having to scroll past it, then this modification is definitely something you want to use.

This template modification will make it possible to resize quote containers and add an "Expand" button to it which can be clicked to view the whole quote.

This modification should work on pretty much all vBulletin 4 versions.

Installation
  1. Open the "showthread" template and paste the following above </body>
    HTML Code:

    <script>window.jQuery||document.write(unescape("%3Cscript src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));</script>
    <script>
    $(function(){
      $(".quote_container").each(function(index){
          if($(this).height() > 250){
            $(this).css({
                'height': '250px',
                'overflow': 'hidden'
            });

            $(this).parent().append('<div class="quote_expander"><a href="">Expand</a></div>');
          }
      });

      $(".quote_expander").click(function(){
          $(this).parent().find('.quote_container').css({'height': 'initial', 'overflow': 'initial'});
          $(this).remove();
          return false;
      });
    });
    </script>

  2. Now open the additional.css template under "CSS Templates" and add the following:
    HTML Code:

    .quote_expander{
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      -ms-box-sizing: border-box;
      box-sizing: border-box;
      font-size: 11px;
      text-align: center;
      color: rgb(63, 63, 63);
      cursor: pointer;
      padding-top: 65px;
      background: -webkit-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: -moz-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: -o-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: linear-gradient(to bottom, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      width: 100%;
      position: absolute;
      bottom: 0;
    }

  3. Done.

How to change the height of when the quote should be resized?
Change the 2 occurences of the number "250" in the showthread template to whatever height you want.

How to change the background color of the expander?
Change all occurences of the color "#C2CAD2" in the additional.css template to the hex code of the color you want.

Screenshots
https://vborg.vbsupport.ru/external/2016/02/15.png

MarkFL 02-08-2016 10:14 PM

Nice work, Dave! :)

I had to do something similar at the site I help admin (we have many users who will lazily quote an entire huge post to address one point), but I had to also account for LaTeX by MathJax making quotes grow after the DOM was in place. Fortunately they provide a script queue that will allow javascript to execute only after the LaTeX is done rendering.

Dave 02-08-2016 10:32 PM

Quote:

Originally Posted by MarkFL (Post 2564486)
Nice work, Dave! :)

I had to do something similar at the site I help admin (we have many users who will lazily quote an entire huge post to address one point), but I had to also account for LaTeX by MathJax making quotes grow after the DOM was in place. Fortunately they provide a script queue that will allow javascript to execute only after the LaTeX is done rendering.

Yeah I'm surprised vBulletin didn't create something like this themselves and that no one else released something like this before. Long quotes are the most annoying thing on forum boards.

Alan_SP 02-09-2016 10:04 AM

Only thing I would add, if it is possible, that users choose if they want their quotes expanded or collapsed.

ArcadeSyndicate 02-09-2016 11:11 AM

very nice, looks like xenforo :)

Dave 02-09-2016 09:48 PM

Quote:

Originally Posted by ArcadeSyndicate (Post 2564515)
very nice, looks like xenforo :)

Yep, that's where I got the idea from.

Techno Cowboy 02-22-2016 11:23 AM

Installed & Thanks! :cool:

X-or 08-05-2016 01:20 PM

it's very nice, and working in 4.2.3 PL2
wish you could make this into a plugin for easy install
wish also you could re-collapse after expansion
it can be improved but very useful nonetheless

Bulent Tekcan 10-29-2016 10:57 AM

Not work on 4.2.3 version, mesage not expand. When I press Expand button no any action. Can you check this problem ? Is it possible to make expand and collapse again function ?

Flipfloptrader 06-07-2017 10:58 AM

Works nicely on Avenger Fluid also on 4.2.5.


All times are GMT. The time now is 05:50 AM.

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.01263 seconds
  • Memory Usage 1,738KB
  • 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_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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