[Evocms-plugins-commits] SF.net SVN: evocms-plugins:[807] jquery_lightbox_plugin/trunk/ _jquery_lig
Brought to you by:
blueyed
From: <af...@us...> - 2008-08-14 03:16:33
|
Revision: 807 http://evocms-plugins.svn.sourceforge.net/evocms-plugins/?rev=807&view=rev Author: afwas Date: 2008-08-14 03:16:32 +0000 (Thu, 14 Aug 2008) Log Message: ----------- Comparible with Gallery2 plugin Modified Paths: -------------- jquery_lightbox_plugin/trunk/_jquery_lightbox.plugin.php Modified: jquery_lightbox_plugin/trunk/_jquery_lightbox.plugin.php =================================================================== --- jquery_lightbox_plugin/trunk/_jquery_lightbox.plugin.php 2008-08-14 00:52:32 UTC (rev 806) +++ jquery_lightbox_plugin/trunk/_jquery_lightbox.plugin.php 2008-08-14 03:16:32 UTC (rev 807) @@ -99,26 +99,36 @@ //<!--[CDATA[ jQuery(document).ready(function(){ jQuery(function() { - var postDiv, newRel; - jQuery(\'.image_block img\').wrap(\'<a></a>\'); - postDiv = jQuery(\'.image_block\').parents(\'div\').find(\'*[@class*="ostpublished"]\').attr(\'class\'); - if(console.log && postDiv){console.log(\'postDiv.indexOf(" ")): \'+postDiv.indexOf(" ")+\' - \'+postDiv)}; - if(postDiv && postDiv.indexOf(" ")!=-1) { - var arrPostDiv = postDiv.split(" "); - postDiv = arrPostDiv[0]; + var postDiv, newRel, rel, checkRel; + checkRel = jQuery(this).find(\'a[@rel^="lightbox["]\').attr(\'rel\'); + if (checkRel && console.log) + { + console.log(\'checkRel = \'+checkRel); + } else if(console.log) + { + console.log(\'checkRel = undefined\'); } - postDiv=\'.\'+postDiv; - if(console.log && postDiv){console.log(\'postDiv: \'+postDiv)}; - jQuery(\'.image_block a\') - .each(function(i){jQuery(this).attr(\'title\', jQuery(this).children(\'img\').attr(\'title\'))}) - .each(function(i){jQuery(this).attr(\'href\', jQuery(this).children(\'img\').attr(\'src\'))}) - .each(function(i){newRel = jQuery(this).parents(\'div\').find(\'*[@id^="item_"]\').attr(\'id\'); - newRel = \'lightbox[\'+newRel+\']\'; - jQuery(this).attr(\'rel\', newRel)}); - var rel; + if (!checkRel) + { + jQuery(\'.image_block img\').wrap(\'<a></a>\'); + postDiv = jQuery(\'.image_block\').parents(\'div\').find(\'*[@class*="ostpublished"]\').attr(\'class\'); + if(console.log && postDiv){console.log(\'postDiv.indexOf(" ")): \'+postDiv.indexOf(" ")+\' - \'+postDiv)}; + if(postDiv && postDiv.indexOf(" ")!=-1) { + var arrPostDiv = postDiv.split(" "); + postDiv = arrPostDiv[0]; + } + postDiv=\'.\'+postDiv; + if(console.log && postDiv){console.log(\'postDiv: \'+postDiv)}; + jQuery(\'.image_block a\') + .each(function(i){jQuery(this).attr(\'title\', jQuery(this).children(\'img\').attr(\'title\'))}) + .each(function(i){jQuery(this).attr(\'href\', jQuery(this).children(\'img\').attr(\'src\'))}) + .each(function(i){newRel = jQuery(this).parents(\'div\').find(\'*[@id^="item_"]\').attr(\'id\'); + newRel = \'lightbox[\'+newRel+\']\'; + jQuery(this).attr(\'rel\', newRel)}); + } jQuery(\'div \'+postDiv) .each(function(j){ - rel=jQuery(this).find(\'.image_block a\').attr(\'rel\'); + rel=jQuery(this).find(\'a[@rel^="lightbox["]\').attr(\'rel\'); if(console.log){console.log(\'rel: \'+rel)}; if(console.log){console.log(jQuery(\'.image_block a[@rel^="\'+rel+\'"]\'))}; jQuery(\'.image_block a[@rel^="\'+rel+\'"]\').lightBox({ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |