Apparently, both jquery and sharethis use $ to refer to themselves. This leads to a namespace problem in javascript. With a jquery slideshow loaded, sharethis reports "undefined" for many page properties and doesn't share properly. For example, click the sharethis link at http://www.ccim.com/content/education-7. Problem has been reported to ShareThis tech support without any response.

Comments

robloach’s picture

Project: ShareThis » Jquery Slideshow
Version: 6.x-1.5 » 6.x-1.x-dev
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Sounds like a jQuery Slideshow problem. Using $ to refer to the jQuery object is the standard. The ShareThis button on http://www.ccim.com/content/education-7 worked for me here....

sstern-at-ccim’s picture

Thanks, Rob. We're looking at it. I don't think we're using slideshow anymore, so it will be easy to test.

nvoyageur’s picture

Sorry guys you got me. Here is the Jquery from the Jquery_Slideshow module

  $script = "Drupal.behaviors.jquerySlideshow = function(){
        $('.jquery_slideshow').css({height:'". $data['height'] ."px'});
        $('.jquery_slideshow').css({width:'". $data['width'] ."px'});
        $('#". $jq_slideshow_id ."').cycle({
          fx: '". variable_get('jquery_slideshow_effect', 'fade') ."',
          speed: ". variable_get('jquery_slideshow_speed', 500) .",
          timeout: ". variable_get('jquery_slideshow_timeout', 4000) ."
        });

      }";
  drupal_add_js($script, 'inline');
}
robloach’s picture

Hi Spydor. Although this might be off topic, you might be able to take advantage of the Javascript aggregation here........

jqueryslideshow.js

// $Id$
Drupal.behaviors.jQuerySlideshow = function(context) {
  if (Drupal.settings.jqueryslideshow) {
    jQuery.each(Drupal.settings.jqueryslideshow, function(id, options) {
      $('#' + id + ':not(".jqueryslideshow-processed")', context)
        .addClass('jqueryslideshow-processed')
        .css({height: options.height + 'px', width: options.width + 'px'})
        .cycle(options);
    });
  }
};

jqueryslideshow.module

  drupal_add_js('jqueryslideshow.js');
  drupal_add_js(array('jqueryslideshow' => array(
    $jq_slideshow_id => array(
      'width' => $data['width'],
      'height' => $data['height'],
      'fx' => variable_get('jquery_slideshow_effect', 'fade'),
      'speed' => variable_get('jquery_slideshow_speed', 500),
      'timeout' => variable_get('jquery_slideshow_timeout', 4000),
    ),
  )), 'setting');
nvoyageur’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This new javascript code is implemented in the latest 2.x version. Thanks Rob.