fix lightbox magnific noConflict mode and plugins path var

This commit is contained in:
Ian 2014-10-28 11:23:50 +01:00
parent cc632a389a
commit 705a827b07
4 changed files with 22 additions and 13 deletions

View file

@ -1,4 +1,7 @@
------------------------------------------------------------------------
2.0.1: fix magnific noConflict mode and plugins path default var
------------------------------------------------------------------------
Version 2.0: Major update
* prettyPhoto js 3.1.5 and css update
* added lightbox 2 jquery - Lightbox v.2.7.1
@ -12,16 +15,22 @@ Version 2.0: Major update
* added cleanup to remove old packages on update
* changed some lang constants
------------------------------------------------------------------------
1.9.8: update lightbox2 prototype.js to 1.7.2 to avoid this.each is not a function errors
------------------------------------------------------------------------
1.9.7: Bump version to propagate new .htaccess
------------------------------------------------------------------------
1.9.6: Compatibility fixes
------------------------------------------------------------------------
1.9.5: prettyPhoto 3.1.4 update, allow configuration of default object
------------------------------------------------------------------------
1.9.4: prettyPhoto 3.1 update
------------------------------------------------------------------------
1.9.3, 1.9.2: Added/fixed prettyPhoto
------------------------------------------------------------------------

View file

@ -1,11 +1,11 @@
jQuery(document).ready(function(){
jQuery(document).ready(function($){
// remove anchors onclick handler, if have
jQuery('a[rel^="colorbox"]').removeAttr('onclick');
jQuery('a[rel^="singlebox"]').removeAttr('onclick');
$('a[rel^="colorbox"]').removeAttr('onclick');
$('a[rel^="singlebox"]').removeAttr('onclick');
// init by group - init with :visible to ensure to not show hidden elements via hideafter function in imageselectorplus ranges
jQuery('a:visible[rel^="colorbox"]').colorbox({
$('a:visible[rel^="colorbox"]').colorbox({
slideshow: true,
slideshowAuto: false,
slideshowSpeed: 6000,
@ -13,7 +13,7 @@ jQuery(document).ready(function(){
maxWidth: '98%'
});
// this is a single image only init - plugin option : Single Image
jQuery('a:visible[rel="singlebox"]').colorbox({
$('a:visible[rel="singlebox"]').colorbox({
rel: 'nofollow',
scalePhotos: true,
maxWidth: '98%'

View file

@ -1,8 +1,8 @@
jQuery(document).ready(function(){
jQuery(document).ready(function($){
// remove anchors onclick handler, if have
jQuery('a[rel^="magnificPopup"]').removeAttr('onclick');
jQuery('a[rel="onemagnificPopup"]').removeAttr('onclick');
$('a[rel^="magnificPopup"]').removeAttr('onclick');
$('a[rel="onemagnificPopup"]').removeAttr('onclick');
// get all magnificPopup anchors by group
$('a:visible[rel^="magnificPopup"]').each(function() {
@ -22,7 +22,7 @@ jQuery(document).ready(function(){
});
// this is a single image only init - plugin option : Single Image
jQuery('a:visible[rel="onemagnificPopup"]').magnificPopup({
$('a:visible[rel="onemagnificPopup"]').magnificPopup({
type:'image'
});

View file

@ -28,7 +28,7 @@ class serendipity_event_lightbox extends serendipity_event {
$propbag->add('name', PLUGIN_EVENT_LIGHTBOX_NAME);
$propbag->add('description', PLUGIN_EVENT_LIGHTBOX_DESC);
$propbag->add('author', 'Thomas Nesges, Andy Hopkins, Lokesh Dhakar, Cody Lindley, Stephan Manske, Grischa Brockhaus, Ian');
$propbag->add('version', '2.0');
$propbag->add('version', '2.0.1');
$propbag->add('requirements', array(
'serendipity' => '1.6',
'php' => '5.3.0'
@ -100,7 +100,7 @@ class serendipity_event_lightbox extends serendipity_event {
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_EVENT_LIGHTBOX_PATH);
$propbag->add('description', PLUGIN_EVENT_LIGHTBOX_PATH_DESC);
$propbag->add('default', str_replace('//', '/', $serendipity['serendipityHTTPPath'] . preg_replace('@^.*(/plugins.*)@', '$1', dirname(__FILE__))));
$propbag->add('default', $serendipity['serendipityHTTPPath'] . '/plugins/serendipity_event_lightbox');
break;
case 'init_js':
@ -211,9 +211,9 @@ class serendipity_event_lightbox extends serendipity_event {
echo ' <script type="text/javascript" src="' . $pluginDir . '/jquery-1.11.1.min.js" charset="utf-8"></script>' . "\n";
}
// remove anchors possible onclick handler
echo ' <script type="text/javascript">jQuery(document).ready(function(){ jQuery(\'a[rel^="prettyPhoto"]\').removeAttr("onclick"); }); </script>' . "\n";
echo ' <script type="text/javascript"> jQuery(document).ready(function(){ jQuery(\'a[rel^="prettyPhoto"]\').removeAttr("onclick"); }); </script>' . "\n";
echo ' <script type="text/javascript" src="' . $pluginDir . '/prettyphoto/js/jquery.prettyPhoto.min.js" charset="utf-8"></script>' . "\n";
echo ' <script type="text/javascript">jQuery(document).ready(function(){ jQuery(\'a:visible[rel^="prettyPhoto"]\').prettyPhoto(' . $this->get_config('init_js') . '); }); </script>' . "\n";
echo ' <script type="text/javascript"> jQuery(document).ready(function(){ jQuery(\'a:visible[rel^="prettyPhoto"]\').prettyPhoto(' . $this->get_config('init_js') . '); }); </script>' . "\n";
}
return true;
break;