• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • VaultWiki CSS and js files are included in every forum page

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: VaultWiki CSS and js files are included in every forum page

    • Issue Tools
      • View Changes
    1. issueid=1260 March 11, 2010 6:45 AM
      kmike kmike is offline
      Junior Member
      VaultWiki CSS and js files are included in every forum page

      On each forum page outside of the Wiki forums (even on non-forum-content pages such as misc.php), I see two CSS files are included which are related to VaultWiki:
      special-2664521c-00011.css?v=257
      special_important.css?v=257

      Two Javascript files are included, too:
      special_section.js?v=257
      special_autolink.js?v=257

      It would be great if VaultWiki didn't inject its CSS and Javascript into unrelated forum pages. Because of this, each forum page requires 4 additional HTTP requests before it could be displayed. It's a big no-no according to the best practices for making a fast web site.
    Issue Details
    Issue Number 1260
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Styling / CSS
    Status Not a Bug
    Priority 3 - Loss of Functionality
    Affected Version 2.5.7
    Fixed Version (none)
    Milestone VaultWiki 3.0.0
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. March 11, 2010 11:07 AM
      pegasus pegasus is offline
      VaultWiki Team
      This issue note was made as an issue.
      AFAIK, this is done by design, because those files contain the formatting for wiki BB-Codes which can be used in forum content (and are listed on misc.php). For vBulletin 4, the number and size of the requests were reduced, and this is something we're working on improving further in RC 2 or 3.
      Reply Reply  
    2. March 11, 2010 11:44 AM
      kmike kmike is offline
      Junior Member
      Are Javascript files required for styling, too?

      If we disable the usage of Wiki bbcodes outside of the Wiki forums, could injecting of the VaultWiki styles be disabled?
      Reply Reply  
    3. March 11, 2010 12:30 PM
      pegasus pegasus is offline
      VaultWiki Team
      The Javascript files are required for the functionality of the H tag and wiki link AJAX popups.
      There is currently no way to disable usage of wiki BB-Codes outside of wiki forums.

      Any of these files should only be included if the BB-Code parser was initialized on a page. Again, reducing the footprint of these items is going to be addressed in an upcoming RC build.
      Reply Reply  
    4. March 11, 2010 12:43 PM
      kmike kmike is offline
      Junior Member
      I got an impression that the styles footprint will only be reduced in vB 4?
      Reply Reply  
    5. March 11, 2010 12:54 PM
      pegasus pegasus is offline
      VaultWiki Team
      The style footprint is already slightly reduced in vB 4, because it allowed handling CSS in a more focused way (e.g. combined HTTP requests, CSS-rollup, loading CSS templates individually). Selective CSS inclusion is already done in vB 3 to an extent, but it is only possible when the CSS is NOT saved as a file.

      While some improvements simply aren't possible in vB 3, we are planning a rewrite of the CSS for both vB 3 and vB 4 to improve client-side performance across the board.
      Reply Reply  
    6. March 11, 2010 1:48 PM
      kmike kmike is offline
      Junior Member
      Ok, disabling AJAX preview popup gets rid of special_autolink.js.
      Since we don't need VaultWiki codes in the main forums (except [wiki] itself), I think I'll remove them from the bbcode list and see about removing those stylesheets from the rest of the forums.
      Reply Reply  
    7. March 11, 2010 3:59 PM
      pegasus pegasus is offline
      VaultWiki Team
      Don't delete the Custom BB-Code entry, as this will cause problems in other places. You should just set $show['special_css'] = false; before global_complete.
      Reply Reply  
    8. March 11, 2010 4:23 PM
      kmike kmike is offline
      Junior Member
      I just used the Code Manager to disable displaying all VaultWiki codes in the non-wiki areas, including the bbcode list ("Show BB-Code in the vBulletin FAQ"). That should stop 99% of the members from using them in the forums. Even if some bbcode sneaks in, only [H] and AJAX preview (which could be disabled) will be unstyled once all custom VaultWiki styles are gone from the rest of the forums. I can live with that.

      To make VaultWiki related styles to load only in showwiki.php, I did this small change:

      Code:
      diff --git a/vault/special_plugins.php b/vault/special_plugins.php
      index 9b3fc4a..2cd692d 100644
      --- a/vault/special_plugins.php
      +++ b/vault/special_plugins.php
      @@ -862,8 +862,8 @@ function special_cache_templates()
                      $globaltemplates[] = 'vault_general_links';
              }
       
      -       if (
      -               in_array(THIS_SCRIPT, array(
      +       if ( THIS_SCRIPT == 'showwiki'
      +/*             in_array(THIS_SCRIPT, array(
                              'index',
                              'project',
                              'projectpost',
      @@ -877,6 +877,7 @@ function special_cache_templates()
                              THIS_SCRIPT != 'inlinemod' AND
                              THIS_SCRIPT != 'postings'
                      )
      +*/
              )
              {
                      if (!$vbulletin->options['storecssasfile'])
      Reply Reply  
    9. March 11, 2010 4:36 PM
      pegasus pegasus is offline
      VaultWiki Team
      That change will remove it from the cached template list, which will mean that it will use resources to query the database for them instead. Like I said above, you just want to set $show['special_css'] = false - recommend finding it in vault/special_plugins_bbcode.php.
      Reply Reply  
    10. March 12, 2010 1:09 AM
      kmike kmike is offline
      Junior Member
      Thanks for the quick and informative replies and support, much appreciated!

      I can see the merits of your approach, however I think you are mistaken about my solution. Nowhere else these two templates responsible for the inclusion of VaultWiki CSS and JS (vault_general_headinclude and vault_general_footer) are added to the retrieved template list, so they won't be fetched again from the database if disabled in that place.
      Reply Reply  
    11. March 12, 2010 1:56 AM
      pegasus pegasus is offline
      VaultWiki Team
      For the two templates in question, you are correct, but I still recommend using a custom plugin so you can keep these changes when you upgrade.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 12:02 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.