Author Topic: Easy Spoiler - Load on pages that contain spoilers only  (Read 4125 times)

nico

  • Tadpole
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Easy Spoiler - Load on pages that contain spoilers only
« on: August 16, 2014, 08:52:33 PM »
Hello, i wonder if it's possible to code easy spoiler in a way that only loads the resources it needs to display the spoiler only on posts/pages that actually have the spoiler shortcode on them?

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spoiler - Load on pages that contain spoilers only
« Reply #1 on: August 19, 2014, 10:59:08 AM »
I believe there might.  Ill look into it.  If memory serves there is a catch to it.  If WP loop does help with this and we strip the resource file it may only help spoilers in the main article and not in the comments or sidebars which would break.

Joshfonbigg

  • Tadpole
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • สมัคร ibcbet
Re: Easy Spoiler - Load on pages that contain spoilers only
« Reply #2 on: December 26, 2014, 08:36:36 AM »
You find out how to fix it yet?

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Easy Spoiler - Load on pages that contain spoilers only
« Reply #3 on: January 14, 2015, 12:08:31 PM »
Sorry I did look and it but nothing obvious.  The plugin APIs ask the plugin for its headers, then ask it to handle shortcodes.  I bet its possible though, I just don't know the inner workings that well.

You could compress  the easy-spoiler js file... its about 3K right now and that is on every page.  Would that help a little?  http://javascriptcompressor.com can cut it down to 1.5K.  It removes all the whitespace, comments, etc. and even renames variable names to be just a few letters.


 

anything