• Hello guys, first off, great work on this. Love it and so happy to not have to use the full Jetpack : )

    So just wanted to give you a heads up and others a quick patch. The site I’m using this plugin on uses jQuery 1.9, which resulted in the plugin not working as the plugin currently uses the now deprecated $.browser object for jQuery < 1.9 (lines 137-140):

    if ( $.browser.mozilla )
         leftWidth -= 55;
    else if ( $.browser.msie )
         leftWidth -= 20;

    Not quite sure where WordPress core is in terms of adopting the use of jQuery 1.9, but wanted to throw out how I patched this up. I basically tested for whether $.browser is a valid function (aka if jQuery is < 1.9) and then setup the relevant code to handle both situations so we are gracefully handling both situations:

    if( ! $.isFunction( $.browser ) ) {
         var isMozilla = navigator.userAgent.match(/Firefox/i) != null;
         var isMSIE = navigator.userAgent.match(/MSIE/i) != null;
    
         if ( isMozilla )
              leftWidth -= 55;
         else if ( isMSIE )
              leftWidth -= 20;
         leftWidth += 'px';
    } else {
         if ( $.browser.mozilla )
              leftWidth -= 55;
         else if ( $.browser.msie )
              leftWidth -= 20;
         leftWidth += 'px';
    }

    It’s obviously not ideal to alter plugin code, which I realize, I just really wanted to use this and couldn’t find a Github repo for this : ) So by all means, use this as you see fit or when / if it makes sense. Thanks!

    https://www.ads-software.com/extend/plugins/carousel-without-jetpack/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Syed Balkhi

    (@smub)

    Hey Ryan,

    Thanks a lot for writing this patch. I try to keep this plugin up to date with the official Jetpack plugin. Any bug that is in the Jetpack Carousel plugin will be found in this plugin as well.

    As much as I would like to fix all the bugs before they do, I don’t want to. Because then it would make the updating process much harder. Currently all I do is copy/paste the Jetpack carousel module (change class name) and here is the new update.

    Fixing bugs, adding functionality, etc to this plugin would then essentially start a separate plugin dev. process.

    WordPress 3.6 should have jQuery 1.9, so I’m certain that an update of Jetpack and this plugin will follow right along with it ??

    Thread Starter Ryan Urban

    (@ryancurban)

    Hey Syed!

    You’re very welcome and that makes total sense. Figured as much : ) Just wanted to throw the patch out there for anyone already using jQuery 1.9.

    Cool, thanks for the response and again for doing the hard work for us of making this a separate plugin ; )

    Hi Ryan – Thanks for the fix, it is much appreciated… I almost abandoned the plugin and luckily found your post just in time!

    Thread Starter Ryan Urban

    (@ryancurban)

    My pleasure : )

    Thanks Ryan! Perfect fix.

    Thanks for this fix! Very helpful!

    Tried using this plugin with WordPress 3.6 and it doesnt seem to work. Would it work if i apply the patch suggested by the op of this thread?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Gallery plugin patch for jQuery 1.9 : )’ is closed to new replies.