| 1 |
|
// $Id$ |
| 2 |
|
|
| 3 |
|
/** |
| 4 |
|
* Compatibility with the Drupal 6 API. |
| 5 |
|
*/ |
| 6 |
|
Drupal.behaviors = Drupal.behaviors || {}; |
| 7 |
|
$(document).ready(function() { |
| 8 |
|
Drupal.behaviors.sharethis(document); |
| 9 |
|
}); |
| 10 |
|
|
| 11 |
|
/** |
| 12 |
|
* The Drupal behaviors for the ShareThis web service. |
| 13 |
|
*/ |
| 14 |
|
Drupal.behaviors.sharethis = function(context) { |
| 15 |
|
$('.sharethis-button:not(.sharethis-button-processed)', context).addClass('sharethis-button-processed').each(function (i, domElement) { |
| 16 |
|
var element = $(this); |
| 17 |
|
var shared_object = SHARETHIS.addEntry({ |
| 18 |
|
title: element.attr('title'), |
| 19 |
|
url: element.attr('href') |
| 20 |
|
}); |
| 21 |
|
var chicklet = element.attr('name'); |
| 22 |
|
if (chicklet != 'sharethis') { |
| 23 |
|
shared_object.attachChicklet(chicklet, domElement); |
| 24 |
|
} |
| 25 |
|
else { |
| 26 |
|
shared_object.attachButton(domElement, {button: false}); |
| 27 |
|
} |
| 28 |
|
}).click(function() { |
| 29 |
|
return false; |
| 30 |
|
}); |
| 31 |
|
}; |