dyerware

Support => Wordpress Plugins => Topic started by: nico on August 16, 2014, 08:52:33 PM

Title: Easy Spoiler - Load on pages that contain spoilers only
Post by: nico 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?
Title: Re: Easy Spoiler - Load on pages that contain spoilers only
Post by: doug@dyerware.com 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.
Title: Re: Easy Spoiler - Load on pages that contain spoilers only
Post by: Joshfonbigg on December 26, 2014, 08:36:36 AM
You find out how to fix it yet?
Title: Re: Easy Spoiler - Load on pages that contain spoilers only
Post by: doug@dyerware.com 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.