Plugin compatibility code

Many plugins run after the page has loaded and process existing content. Since Infinite Scroll dynamically adds new content to the page, sometimes you have to execute additional code to reinitialize those plugins.

For the plugins below, the following code goes in the Javascript Callback option.

Lightbox JS 1.0:
No compatibility code available.
Lightbox JS 2.0:

myLightbox.updateImageList();

Shutter Reloaded:

shutterReloaded.Init('sh');

Thickbox:

 tb_init( $('a.thickbox, area.thickbox, input.thickbox',this) );

1 Pixel Out Audio Player:
Compatible! Version 2.0, too.
Yahoo Media Player:

YAHOO.MediaPlayer.addTracks( this );

HighslideJS:

$('a.highslide',this).click(function() {  return hs.expand(this);})

WP-SimpleViewer:
Not compatible.
Flare Smith Feed Flare:
Not compatible. (relies on inline script tags)

ShareThis plugin:
Not compatible. (relies on inline script tags)

SyntaxHighlighter Evolved:

SyntaxHighlighter.highlight(undefined,$('pre',this).get());

Smooth Scroll Links [SSL]

$('a',this).each(function(){
 ss.addEvent(this,'click',ss.smoothScroll);
});

To refer to the most recently added content:

    this;     // as of ver 1.1, the keyword this is the content wrapper (typically a DIV)
    $(this);  // the jQuery object including this
    $jQis('#infscr-page-'+INFSCR.currPage) // old 'n busted ver 1.0 style.

22 Responses to “Plugin compatibility code”

  1. BOLL says:

    This works for Shutter Reloaded:

    shutterReloaded.Init('sh');

    Though it seems the script needs more code to be executed, as it fails to display the half transparent shade over the entire page when more posts has been loaded. Something that the author of Shutter Reloaded might have to look into.

  2. Paul Irish says:

    Hmmm.. yeah i think that’s the best trick thats immediately obvious. It probably needs to revaluate the window height. Thanks for testing that out.

  3. Space Roach says:

    What about simpleviewer? I can’t get it to show the galleries when brought in from the infinite scroll. Otherwise everything is perfect.

  4. pinocchio says:

    what about highslide?
    Please tell me.

    WP Plugin is Highslide Integration
    http://highslideintegration.scrollleiste.de/

    JS site
    http://highslide.com/

  5. Paul Irish says:

    HighslideJS:

    $jQis('#infscr-page-'+INFSCR.currPage +' a.highslide').click(function() {
     return hs.expand(this);
    });
  6. pinocchio says:

    Thank you.

  7. pinocchio says:

    i inserted code in “Infinite Scroll Options > Javascript to be called after the next posts are fetched: ” but highslide js did not work.
    Do you have different thing?
    anyway, thank you~

  8. pinocchio says:

    I’m ugly English. So I hope you understand it.
    First, thank you for the solution about highslide.
    well, how about jw flv player? I try it but can’t find. help me, please.

  9. Paul Irish says:

    Thanks for the links, pinocchio. :)

    Right now infinite scroll cannot support those plugins. They inject <script> tags into the document, and the internal’s of infinite scroll are stripping out those tags.

    Next version I’ll release will have a workaround and will shoot to support those tags. Sorry and thanks!

  10. pinocchio says:

    Thank you for the answer. Good luck with everything.

  11. Jerry says:

    Hi Paul!

    I am in the process of building a tumblr-style site that makes use of “Viper’s Video Quicktags” that pinocchio mentions as well as your plugin. Have you got your above-mentioned workaround running yet? I could really use it. :)

    I should mention I literally cheered when I found your plugin because it’s *exactly* what I was looking for. Thanks for all the work you’ve put into this!

  12. Paul Irish says:

    Jerry,

    Sorry but as it stands, those plugins wont integrate. :(

    Viper should probably rewrite his scripts to abide by javascript coding standards a bit better. ;-)

  13. Shawn says:

    I have a problem with the audio player 2.0b6. It is not being loaded on any of the pages that scroll into view (multiple themes). In Firefox it just shows a blank area, in IE it shows like an excerpt and says ‘Audio clip: flash required’ - Anyone know the solution? What java code can i pass to load correctly?

  14. ricky says:

    Hi guys, does anyone have a Javascript Callback for lightbox gallery? Since I’ ve installed infinite scrool, the images don’t pop up anymore in the older posts!

    plugin: http://wordpress.org/extend/plugins/lightbox-gallery/

    my blog:

    http://www.visualjourney.eu

    BTW great JOB!

  15. Paul Irish says:

    For the lightbox gallery:

    	jQuery('a[rel*=lightbox]',this).lightBox();
    	jQuery('.gallery1 a',this).lightBox({captionPosition:'gallery'});
    	jQuery('.gallery1 a',this).tooltip({track:true, delay:0, showURL: false});
  16. Shawn says:

    (I fixed my audio player problem.)

    I use a plugin called Floatbox, http://randomous.com/floatbox/home
    I have a problem, the functions of it only work on the 1st page, and not on the 2nd, 3rd etc. that are scrolled into view. Anyone know a java code to load BEFORE or after that might fix this?

  17. Paul Irish says:

    Floatbox isn’t compatible right now… Their script could be hacked a bit to make it work… and i’d love to do that, but i’m quite busy right now so unless you’re paying up, I can’t help ya. :)

  18. Shawn says:

    New question, I’m using the Thesis theme w/teaser post boxes, and inf scroll shows the loading image, but never loads the next page. Anyone know a solution?

  19. ricky says:

    Adding one single post to my blog causes “infinite scroll” to load only one set of posts. Works well in categories, problem occurs only in the loop. I’m getting mad about this, since I can no longer post anything! removing on post from the firsts 2 sets gets the scroll working again.

    Any ideas?

    I’m using lightbox gallery plugin and this callback:

    jQuery(’a[rel*=lightbox]‘,this).lightBox();
    jQuery(’.gallery1 a’,this).lightBox({captionPosition:’gallery’});
    jQuery(’.gallery1 a’,this).tooltip({track:true, delay:0, showURL: false});

    my blog:

    http://www.visualjourney.eu

    Thank you guys!

  20. Paul Irish says:

    @ricky,

    I’m not seeing the lightBox or tooltip plugins added to your page.

  21. mike masters says:

    Your pluggin would be wonderful for my site, I have spent six hours trying to configure it for Thesis and I am just about to give up.
    Got a suggestion for me???

Leave a Reply