WP jQuery Lightbox - Version 1.2.1

Version Description

Removed forgotten debug call. Important upgrade!

Download this release

Release Info

Developer ulfben
Plugin Icon wp plugin WP jQuery Lightbox
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

jquery.lightbox.js CHANGED
@@ -21,6 +21,7 @@
21
  * 6. honors empty captions / titles
22
  * 7. grabs image caption from WordPress [gallery] or media library output
23
  * 8. grabs image title if the link lacks one
 
24
  *
25
  **/
26
  (function(jQuery){
@@ -132,8 +133,7 @@
132
  s = imageLink.title;
133
  }else if(jQuery(this).children(':first-child').attr('title')){
134
  s = jQuery(this).children(':first-child').attr('title');
135
- }
136
- alert("single");
137
  opts.imageArray.push(new Array(imageLink.href, opts.displayTitle ? s : ''));
138
  } else {
139
  // if image is part of a set..
@@ -141,6 +141,7 @@
141
  if(this.href && (this.rel == imageLink.rel)){
142
  var title = '';
143
  var caption = '';
 
144
  var jqThis = jQuery(this);
145
  if(this.title){
146
  title = this.title;
@@ -148,10 +149,19 @@
148
  title = jqThis.children('img:first-child').attr('title');//grab the title from the image if the link lacks one
149
  }
150
  if(jqThis.parent().next('.gallery-caption').html()){
151
- caption = jqThis.parent().next('.gallery-caption').html();
 
 
152
  }else if(jqThis.next('.wp-caption-text').html()){
153
- caption = jqThis.next('.wp-caption-text').html();
 
154
  }
 
 
 
 
 
 
155
  var s = '';
156
  if(title != '' && caption != ''){
157
  s = title+'<br />'+caption;
21
  * 6. honors empty captions / titles
22
  * 7. grabs image caption from WordPress [gallery] or media library output
23
  * 8. grabs image title if the link lacks one
24
+ * 9. use only title if captions is identical
25
  *
26
  **/
27
  (function(jQuery){
133
  s = imageLink.title;
134
  }else if(jQuery(this).children(':first-child').attr('title')){
135
  s = jQuery(this).children(':first-child').attr('title');
136
+ }
 
137
  opts.imageArray.push(new Array(imageLink.href, opts.displayTitle ? s : ''));
138
  } else {
139
  // if image is part of a set..
141
  if(this.href && (this.rel == imageLink.rel)){
142
  var title = '';
143
  var caption = '';
144
+ var captionText = '';
145
  var jqThis = jQuery(this);
146
  if(this.title){
147
  title = this.title;
149
  title = jqThis.children('img:first-child').attr('title');//grab the title from the image if the link lacks one
150
  }
151
  if(jqThis.parent().next('.gallery-caption').html()){
152
+ var jq = jqThis.parent().next('.gallery-caption');
153
+ caption = jq.html();
154
+ captionText = jq.text();
155
  }else if(jqThis.next('.wp-caption-text').html()){
156
+ caption = jqThis.next('.wp-caption-text').html();
157
+ captionText = jqThis.next('.wp-caption-text').text();
158
  }
159
+ title = jQuery.trim(title);
160
+ captionText = jQuery.trim(captionText);
161
+ if(title.toLowerCase() == captionText.toLowerCase()){
162
+ title = caption;//to keep linked captions
163
+ caption = ''; //but not duplicate the text
164
+ }
165
  var s = '';
166
  if(title != '' && caption != ''){
167
  s = title+'<br />'+caption;
jquery.lightbox.min.js CHANGED
@@ -1 +1 @@
1
- (function(a){a.fn.lightbox=function(h){var s=a.extend({},a.fn.lightbox.defaults,h);return this.each(function(){a(this).click(function(){e();n(this);return false})});function e(){a("#overlay").remove();a("#lightbox").remove();s.inprogress=false;if(s.jsonData&&s.jsonData.length>0){var y=s.jsonDataParser?s.jsonDataParser:a.fn.lightbox.parseJsonData;s.imageArray=[];s.imageArray=y(s.jsonData)}var v='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+s.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+s.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var x='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(s.displayHelp){x+='<span id="helpDisplay">'+s.strings.help+"</span>"}x+='<a href="javascript://" id="bottomNavClose" title="'+s.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var w;if(s.navbarOnTop){w='<div id="overlay"></div><div id="lightbox">'+x+v+"</div>";a("body").append(w);a("#imageDataContainer").addClass("ontop")}else{w='<div id="overlay"></div><div id="lightbox">'+v+x+"</div>";a("body").append(w)}a("#overlay").click(function(){l()}).hide();a("#lightbox").click(function(){l()}).hide();a("#loadingLink").click(function(){l();return false});a("#bottomNavClose").click(function(){l();return false});a("#outerImageContainer").width(s.widthCurrent).height(s.heightCurrent);a("#imageDataContainer").width(s.widthCurrent);if(!s.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function u(){var v=new Array(a(document).width(),a(document).height(),a(window).width(),a(window).height());return v}function g(){var x,v;if(self.pageYOffset){v=self.pageYOffset;x=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){v=document.documentElement.scrollTop;x=document.documentElement.scrollLeft}else{if(document.body){v=document.body.scrollTop;x=document.body.scrollLeft}}}var w=new Array(x,v);return w}function o(x){var w=new Date();var v=null;do{v=new Date()}while(v-w<x)}function n(A){a("select, embed, object").hide();var w=u();a("#overlay").hide().css({width:"100%",height:w[1]+"px",opacity:s.overlayOpacity}).fadeIn(400);imageNum=0;if(!s.jsonData){s.imageArray=[];if(!A.rel||(A.rel=="")){var x="";if(A.title){x=A.title}else{if(a(this).children(":first-child").attr("title")){x=a(this).children(":first-child").attr("title")}}alert("single");s.imageArray.push(new Array(A.href,s.displayTitle?x:""))}else{a("a").each(function(){if(this.href&&(this.rel==A.rel)){var E="";var C="";var B=a(this);if(this.title){E=this.title}else{if(B.children("img:first-child").attr("title")){E=B.children("img:first-child").attr("title")}}if(B.parent().next(".gallery-caption").html()){C=B.parent().next(".gallery-caption").html()}else{if(B.next(".wp-caption-text").html()){C=B.next(".wp-caption-text").html()}}var D="";if(E!=""&&C!=""){D=E+"<br />"+C}else{if(E!=""){D=E}else{if(C!=""){D=C}}}s.imageArray.push(new Array(this.href,s.displayTitle?D:""))}})}}if(s.imageArray.length>1){for(i=0;i<s.imageArray.length;i++){for(j=s.imageArray.length-1;j>i;j--){if(s.imageArray[i][0]==s.imageArray[j][0]){s.imageArray.splice(j,1)}}}while(s.imageArray[imageNum][0]!=A.href){imageNum++}}var v=g();var z=v[1]+(w[3]/10);var y=v[0];a("#lightbox").css({top:z+"px",left:y+"px"}).show();if(!s.slideNavBar){a("#imageData").hide()}t(imageNum)}function t(v){if(s.inprogress==false){s.inprogress=true;s.activeImage=v;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();if(s.slideNavBar){a("#imageDataContainer").hide();a("#imageData").hide();k()}else{k()}}}function k(){imgPreloader=new Image();imgPreloader.onload=function(){var A=imgPreloader.width;var v=imgPreloader.height;if(s.fitToScreen){var w=u();var z=w[2]-3*s.borderSize;var y=w[3]-200;var x=1;if(v>y){x=y/v}A=A*x;v=v*x;x=1;if(A>z){x=z/A}A=A*x;v=v*x}a("#lightboxImage").attr("src",s.imageArray[s.activeImage][0]).width(A).height(v);m(A,v)};imgPreloader.src=s.imageArray[s.activeImage][0]}function l(){p();a("#lightbox").hide();a("#overlay").fadeOut(250);a("select, object, embed").show()}function f(){if(s.loopImages&&s.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=s.imageArray[(s.activeImage==(s.imageArray.length-1))?0:s.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=s.imageArray[(s.activeImage==0)?(s.imageArray.length-1):s.activeImage-1][0]}else{if((s.imageArray.length-1)>s.activeImage){preloadNextImage=new Image();preloadNextImage.src=s.imageArray[s.activeImage+1][0]}if(s.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=s.imageArray[s.activeImage-1][0]}}}function m(y,w){s.widthCurrent=a("#outerImageContainer").outerWidth();s.heightCurrent=a("#outerImageContainer").outerHeight();var v=Math.max(350,y+(s.borderSize*2));var x=(w+(s.borderSize*2));s.xScale=(v/s.widthCurrent)*100;s.yScale=(x/s.heightCurrent)*100;wDiff=s.widthCurrent-v;hDiff=s.heightCurrent-x;a("#imageDataContainer").animate({width:v},s.resizeSpeed,"linear");a("#outerImageContainer").animate({width:v},s.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:x},s.resizeSpeed,"linear",function(){d()})});if((hDiff==0)&&(wDiff==0)){if(a.browser.msie){o(250)}else{o(100)}}a("#prevLink").height(w);a("#nextLink").height(w)}function d(){a("#loading").hide();a("#lightboxImage").fadeIn(400);c();f();s.inprogress=false}function c(){a("#numberDisplay").html("");a("#imageDataContainer").slideDown("fast");a("#caption").hide();if(s.imageArray[s.activeImage][1]){a("#caption").html(s.imageArray[s.activeImage][1]).show()}if(s.imageArray.length>1){var w;w=s.strings.image+(s.activeImage+1)+s.strings.of+s.imageArray.length;if(!s.disableNavbarLinks){if((s.activeImage)>0||s.loopImages){w='<a title="'+s.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+s.strings.prevLinkText+"</a>"+w}if(((s.activeImage+1)<s.imageArray.length)||s.loopImages){w+='<a title="'+s.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+s.strings.nextLinkText+"</a>"}}a("#numberDisplay").html(w).show()}if(s.slideNavBar){a("#imageData").slideDown(s.navBarSlideSpeed)}else{a("#imageData").show()}var v=u();a("#overlay").height(v[1]);q()}function q(){if(s.imageArray.length>1){a("#hoverNav").show();if(s.loopImages){a("#prevLink,#prevLinkText").show().click(function(){t((s.activeImage==0)?(s.imageArray.length-1):s.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){t((s.activeImage==(s.imageArray.length-1))?0:s.activeImage+1);return false})}else{if(s.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){t(s.activeImage-1);return false})}if(s.activeImage!=(s.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){t(s.activeImage+1);return false})}}b()}}function r(y){var z=y.data.opts;var v=y.keyCode;var w=27;var x=String.fromCharCode(v).toLowerCase();if((x=="x")||(x=="o")||(x=="c")||(v==w)){l()}else{if((x=="p")||(v==37)){if(z.loopImages){p();t((z.activeImage==0)?(z.imageArray.length-1):z.activeImage-1)}else{if(z.activeImage!=0){p();t(z.activeImage-1)}}}else{if((x=="n")||(v==39)){if(s.loopImages){p();t((z.activeImage==(z.imageArray.length-1))?0:z.activeImage+1)}else{if(z.activeImage!=(z.imageArray.length-1)){p();t(z.activeImage+1)}}}}}}function b(){a(document).bind("keydown",{opts:s},r)}function p(){a(document).unbind("keydown")}};a.fn.lightbox.parseJsonData=function(c){var b=[];a.each(c,function(){b.push(new Array(this.url,this.title))});return b};a.fn.lightbox.defaults={overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,resizeSpeed:250,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,navbarOnTop:false,slideNavBar:false,navBarSlideSpeed:250,displayHelp:false,strings:{help:" \u2190 / P - previous image\u00a0\u00a0\u00a0\u00a0\u2192 / N - next image\u00a0\u00a0\u00a0\u00a0ESC / X - close image gallery",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of "},fitToScreen:false,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null}})(jQuery);jQuery(document).ready(function(){jQuery('a[rel^="lightbox"]').lightbox({fitToScreen:(typeof JQLBSettings=="object"&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(typeof JQLBSettings=="object"&&JQLBSettings.resizeSpeed>0)?JQLBSettings.resizeSpeed:250,imageClickClose:true})});
1
+ (function(a){a.fn.lightbox=function(h){var s=a.extend({},a.fn.lightbox.defaults,h);return this.each(function(){a(this).click(function(){e();n(this);return false})});function e(){a("#overlay").remove();a("#lightbox").remove();s.inprogress=false;if(s.jsonData&&s.jsonData.length>0){var y=s.jsonDataParser?s.jsonDataParser:a.fn.lightbox.parseJsonData;s.imageArray=[];s.imageArray=y(s.jsonData)}var v='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+s.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+s.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var x='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(s.displayHelp){x+='<span id="helpDisplay">'+s.strings.help+"</span>"}x+='<a href="javascript://" id="bottomNavClose" title="'+s.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var w;if(s.navbarOnTop){w='<div id="overlay"></div><div id="lightbox">'+x+v+"</div>";a("body").append(w);a("#imageDataContainer").addClass("ontop")}else{w='<div id="overlay"></div><div id="lightbox">'+v+x+"</div>";a("body").append(w)}a("#overlay").click(function(){l()}).hide();a("#lightbox").click(function(){l()}).hide();a("#loadingLink").click(function(){l();return false});a("#bottomNavClose").click(function(){l();return false});a("#outerImageContainer").width(s.widthCurrent).height(s.heightCurrent);a("#imageDataContainer").width(s.widthCurrent);if(!s.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function u(){var v=new Array(a(document).width(),a(document).height(),a(window).width(),a(window).height());return v}function g(){var x,v;if(self.pageYOffset){v=self.pageYOffset;x=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){v=document.documentElement.scrollTop;x=document.documentElement.scrollLeft}else{if(document.body){v=document.body.scrollTop;x=document.body.scrollLeft}}}var w=new Array(x,v);return w}function o(x){var w=new Date();var v=null;do{v=new Date()}while(v-w<x)}function n(A){a("select, embed, object").hide();var w=u();a("#overlay").hide().css({width:"100%",height:w[1]+"px",opacity:s.overlayOpacity}).fadeIn(400);imageNum=0;if(!s.jsonData){s.imageArray=[];if(!A.rel||(A.rel=="")){var x="";if(A.title){x=A.title}else{if(a(this).children(":first-child").attr("title")){x=a(this).children(":first-child").attr("title")}}s.imageArray.push(new Array(A.href,s.displayTitle?x:""))}else{a("a").each(function(){if(this.href&&(this.rel==A.rel)){var E="";var C="";var G="";var B=a(this);if(this.title){E=this.title}else{if(B.children("img:first-child").attr("title")){E=B.children("img:first-child").attr("title")}}if(B.parent().next(".gallery-caption").html()){var F=B.parent().next(".gallery-caption");C=F.html();G=F.text()}else{if(B.next(".wp-caption-text").html()){C=B.next(".wp-caption-text").html();G=B.next(".wp-caption-text").text()}}E=a.trim(E);G=a.trim(G);if(E.toLowerCase()==G.toLowerCase()){E=C;C=""}var D="";if(E!=""&&C!=""){D=E+"<br />"+C}else{if(E!=""){D=E}else{if(C!=""){D=C}}}s.imageArray.push(new Array(this.href,s.displayTitle?D:""))}})}}if(s.imageArray.length>1){for(i=0;i<s.imageArray.length;i++){for(j=s.imageArray.length-1;j>i;j--){if(s.imageArray[i][0]==s.imageArray[j][0]){s.imageArray.splice(j,1)}}}while(s.imageArray[imageNum][0]!=A.href){imageNum++}}var v=g();var z=v[1]+(w[3]/10);var y=v[0];a("#lightbox").css({top:z+"px",left:y+"px"}).show();if(!s.slideNavBar){a("#imageData").hide()}t(imageNum)}function t(v){if(s.inprogress==false){s.inprogress=true;s.activeImage=v;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();if(s.slideNavBar){a("#imageDataContainer").hide();a("#imageData").hide();k()}else{k()}}}function k(){imgPreloader=new Image();imgPreloader.onload=function(){var A=imgPreloader.width;var v=imgPreloader.height;if(s.fitToScreen){var w=u();var z=w[2]-3*s.borderSize;var y=w[3]-200;var x=1;if(v>y){x=y/v}A=A*x;v=v*x;x=1;if(A>z){x=z/A}A=A*x;v=v*x}a("#lightboxImage").attr("src",s.imageArray[s.activeImage][0]).width(A).height(v);m(A,v)};imgPreloader.src=s.imageArray[s.activeImage][0]}function l(){p();a("#lightbox").hide();a("#overlay").fadeOut(250);a("select, object, embed").show()}function f(){if(s.loopImages&&s.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=s.imageArray[(s.activeImage==(s.imageArray.length-1))?0:s.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=s.imageArray[(s.activeImage==0)?(s.imageArray.length-1):s.activeImage-1][0]}else{if((s.imageArray.length-1)>s.activeImage){preloadNextImage=new Image();preloadNextImage.src=s.imageArray[s.activeImage+1][0]}if(s.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=s.imageArray[s.activeImage-1][0]}}}function m(y,w){s.widthCurrent=a("#outerImageContainer").outerWidth();s.heightCurrent=a("#outerImageContainer").outerHeight();var v=Math.max(350,y+(s.borderSize*2));var x=(w+(s.borderSize*2));s.xScale=(v/s.widthCurrent)*100;s.yScale=(x/s.heightCurrent)*100;wDiff=s.widthCurrent-v;hDiff=s.heightCurrent-x;a("#imageDataContainer").animate({width:v},s.resizeSpeed,"linear");a("#outerImageContainer").animate({width:v},s.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:x},s.resizeSpeed,"linear",function(){d()})});if((hDiff==0)&&(wDiff==0)){if(a.browser.msie){o(250)}else{o(100)}}a("#prevLink").height(w);a("#nextLink").height(w)}function d(){a("#loading").hide();a("#lightboxImage").fadeIn(400);c();f();s.inprogress=false}function c(){a("#numberDisplay").html("");a("#imageDataContainer").slideDown("fast");a("#caption").hide();if(s.imageArray[s.activeImage][1]){a("#caption").html(s.imageArray[s.activeImage][1]).show()}if(s.imageArray.length>1){var w;w=s.strings.image+(s.activeImage+1)+s.strings.of+s.imageArray.length;if(!s.disableNavbarLinks){if((s.activeImage)>0||s.loopImages){w='<a title="'+s.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+s.strings.prevLinkText+"</a>"+w}if(((s.activeImage+1)<s.imageArray.length)||s.loopImages){w+='<a title="'+s.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+s.strings.nextLinkText+"</a>"}}a("#numberDisplay").html(w).show()}if(s.slideNavBar){a("#imageData").slideDown(s.navBarSlideSpeed)}else{a("#imageData").show()}var v=u();a("#overlay").height(v[1]);q()}function q(){if(s.imageArray.length>1){a("#hoverNav").show();if(s.loopImages){a("#prevLink,#prevLinkText").show().click(function(){t((s.activeImage==0)?(s.imageArray.length-1):s.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){t((s.activeImage==(s.imageArray.length-1))?0:s.activeImage+1);return false})}else{if(s.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){t(s.activeImage-1);return false})}if(s.activeImage!=(s.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){t(s.activeImage+1);return false})}}b()}}function r(y){var z=y.data.opts;var v=y.keyCode;var w=27;var x=String.fromCharCode(v).toLowerCase();if((x=="x")||(x=="o")||(x=="c")||(v==w)){l()}else{if((x=="p")||(v==37)){if(z.loopImages){p();t((z.activeImage==0)?(z.imageArray.length-1):z.activeImage-1)}else{if(z.activeImage!=0){p();t(z.activeImage-1)}}}else{if((x=="n")||(v==39)){if(s.loopImages){p();t((z.activeImage==(z.imageArray.length-1))?0:z.activeImage+1)}else{if(z.activeImage!=(z.imageArray.length-1)){p();t(z.activeImage+1)}}}}}}function b(){a(document).bind("keydown",{opts:s},r)}function p(){a(document).unbind("keydown")}};a.fn.lightbox.parseJsonData=function(c){var b=[];a.each(c,function(){b.push(new Array(this.url,this.title))});return b};a.fn.lightbox.defaults={overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,resizeSpeed:250,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,navbarOnTop:false,slideNavBar:false,navBarSlideSpeed:250,displayHelp:false,strings:{help:" \u2190 / P - previous image\u00a0\u00a0\u00a0\u00a0\u2192 / N - next image\u00a0\u00a0\u00a0\u00a0ESC / X - close image gallery",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of "},fitToScreen:false,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null}})(jQuery);jQuery(document).ready(function(){jQuery('a[rel^="lightbox"]').lightbox({fitToScreen:(typeof JQLBSettings=="object"&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(typeof JQLBSettings=="object"&&JQLBSettings.resizeSpeed>0)?JQLBSettings.resizeSpeed:250,imageClickClose:true})});
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://amzn.com/w/2QB6SQ5XX2U0N
4
  Tags: lightbox, jquery, nodal, image, display, ulfben
5
  Requires at least: 2.9.2
6
  Tested up to: 3.0.1
7
- Stable tag: 1.2
8
 
9
  A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous.
10
 
@@ -15,12 +15,16 @@ This plugin lets you keep [the awesome Lightbox 2](http://www.huddletogether.com
15
  Warren Krewenki [ported Lightbox over to jQuery](http://warren.mesozen.com/jquery-lightbox/) and this plugin is mostly a wrapper to his work.
16
  It provides an admin panel for configuration, (optional) auto-boxing of your image links and support for WordPress galleries, *including* [media library](http://codex.wordpress.org/Media_Library_SubPanel) titles and captions.
17
 
18
- Navigate the images with your keyboard: Arrows, P(revious)/N(ext) and X/C/ESC for close.
19
 
20
  See the plugin in action here: [http://game.hgo.se/blog/motion-capture/](http://game.hgo.se/blog/motion-capture/)
21
 
22
  *If you value [my plugins](http://profiles.wordpress.org/users/ulfben/) and want to motivate further development - please **help me out** by [downloading and installing DropBox](http://www.dropbox.com/referrals/NTIzMDI3MDk) from my refferal link. It's a cross-plattform application to sync your files online and across computers. A 2GB account is free and my refferal earns you a 250MB bonus!*
23
 
 
 
 
 
24
  = 1.2 (2010-10-12) =
25
  * Added support for Media Library titles and captions.
26
  * Minified the javascript (8.6KB vs 17.8KB)
@@ -56,6 +60,10 @@ No limits to the number of image sets per page or how many images are allowed in
56
 
57
  == Changelog ==
58
 
 
 
 
 
59
  = 1.2 (2010-10-12) =
60
  * Added support for Media Library titles and captions.
61
  * Minified the javascript (8.6KB vs 17.8KB)
@@ -71,6 +79,9 @@ No limits to the number of image sets per page or how many images are allowed in
71
 
72
  == Upgrade Notice ==
73
 
 
 
 
74
  = 1.2 =
75
  Support caption and titles from the Media Library
76
 
4
  Tags: lightbox, jquery, nodal, image, display, ulfben
5
  Requires at least: 2.9.2
6
  Tested up to: 3.0.1
7
+ Stable tag: 1.2.1
8
 
9
  A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous.
10
 
15
  Warren Krewenki [ported Lightbox over to jQuery](http://warren.mesozen.com/jquery-lightbox/) and this plugin is mostly a wrapper to his work.
16
  It provides an admin panel for configuration, (optional) auto-boxing of your image links and support for WordPress galleries, *including* [media library](http://codex.wordpress.org/Media_Library_SubPanel) titles and captions.
17
 
18
+ You can navigate the images with your keyboard: Arrows, P(revious)/N(ext) and X/C/ESC for close.
19
 
20
  See the plugin in action here: [http://game.hgo.se/blog/motion-capture/](http://game.hgo.se/blog/motion-capture/)
21
 
22
  *If you value [my plugins](http://profiles.wordpress.org/users/ulfben/) and want to motivate further development - please **help me out** by [downloading and installing DropBox](http://www.dropbox.com/referrals/NTIzMDI3MDk) from my refferal link. It's a cross-plattform application to sync your files online and across computers. A 2GB account is free and my refferal earns you a 250MB bonus!*
23
 
24
+ = 1.2.1 (2010-10-24) =
25
+ * [Use only caption if title is identical](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-title-captions-bug-found-solved-and-fix-proposed?replies=8#post-1748874)
26
+ * Removed a forgotten debug call
27
+
28
  = 1.2 (2010-10-12) =
29
  * Added support for Media Library titles and captions.
30
  * Minified the javascript (8.6KB vs 17.8KB)
60
 
61
  == Changelog ==
62
 
63
+ = 1.2.1 (2010-10-24) =
64
+ * [Use only caption if title is identical](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-title-captions-bug-found-solved-and-fix-proposed?replies=8#post-1748874)
65
+ * Removed a forgotten debug call
66
+
67
  = 1.2 (2010-10-12) =
68
  * Added support for Media Library titles and captions.
69
  * Minified the javascript (8.6KB vs 17.8KB)
79
 
80
  == Upgrade Notice ==
81
 
82
+ = 1.2.1 =
83
+ Removed forgotten debug call. Important upgrade!
84
+
85
  = 1.2 =
86
  Support caption and titles from the Media Library
87
 
wp-jquery-lightbox.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wp-jquery-lightbox
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
5
  Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
6
- Version: 1.2
7
  Author: Ulf Benjaminsson
8
  Author URI: http://www.ulfben.com
9
  */
@@ -13,20 +13,27 @@ if(!defined('WP_CONTENT_URL')){
13
  if(!defined('WP_PLUGIN_URL')){
14
  define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
15
  }
 
 
16
  define('JQLB_URL', WP_PLUGIN_URL.'/wp-jquery-lightbox/');
17
  define('JQLB_SCRIPT_URL', JQLB_URL.'jquery.lightbox.min.js');
18
  define('JQLB_STYLE_URL', JQLB_URL.'lightbox.min.css');
19
  add_action('admin_menu', 'jqlb_register_menu_item');
20
  add_action('wp_print_styles', 'jqlb_css');
21
  add_action('wp_print_scripts', 'jqlb_js');
22
- add_filter("plugin_action_links_$plugin", 'jqlb_add_plugin_actions' );
23
  add_filter('the_content', 'jqlb_autoexpand_rel_wlightbox', 99);
24
  add_filter('the_excerpt', 'jqlb_autoexpand_rel_wlightbox', 99);
25
- function jqlb_add_plugin_actions( $links ) { // Add a link to this plugin's settings page
26
- $settings_link = '<a href="' . get_option('siteurl') . '/wp-admin/options-general.php?page=jquery-lightbox-options">Settings</a>';
27
- array_unshift( $links, $settings_link );
 
28
  return $links;
29
  }
 
 
 
 
30
  function jqlb_register_menu_item() {
31
  register_setting( 'jqlb-settings-group', 'jqlb_automate');
32
  register_setting( 'jqlb-settings-group', 'jqlb_resize_on_demand');
@@ -69,7 +76,9 @@ function jqlb_pos_intval($v){
69
  function jqlb_options_panel(){
70
  if(!function_exists('current_user_can') || !current_user_can('manage_options')){
71
  die(__('Cheatin&#8217; uh?'));
72
- } ?>
 
 
73
  <div class="wrap">
74
  <h2>jQuery Lightbox</h2>
75
  <form method="post" action="options.php">
3
  Plugin Name: wp-jquery-lightbox
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-jquery-lightbox/
5
  Description: A drop in replacement for LightBox-2 and similar plugins. Uses jQuery to save you from the JS-library mess in your header. :)
6
+ Version: 1.2.1
7
  Author: Ulf Benjaminsson
8
  Author URI: http://www.ulfben.com
9
  */
13
  if(!defined('WP_PLUGIN_URL')){
14
  define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
15
  }
16
+ define('JQLB_DONATE_URL', 'http://www.amazon.com/gp/registry/wishlist/2QB6SQ5XX2U0N/105-3209188-5640446?reveal=unpurchased&filter=all&sort=priority&layout=standard&x=21&y=17');
17
+ define('JQLB_BASENAME', plugin_basename( __FILE__ ));
18
  define('JQLB_URL', WP_PLUGIN_URL.'/wp-jquery-lightbox/');
19
  define('JQLB_SCRIPT_URL', JQLB_URL.'jquery.lightbox.min.js');
20
  define('JQLB_STYLE_URL', JQLB_URL.'lightbox.min.css');
21
  add_action('admin_menu', 'jqlb_register_menu_item');
22
  add_action('wp_print_styles', 'jqlb_css');
23
  add_action('wp_print_scripts', 'jqlb_js');
24
+ add_filter('plugin_row_meta', 'jqlb_set_plugin_meta', 2, 10);
25
  add_filter('the_content', 'jqlb_autoexpand_rel_wlightbox', 99);
26
  add_filter('the_excerpt', 'jqlb_autoexpand_rel_wlightbox', 99);
27
+ function jqlb_set_plugin_meta( $links, $file ) { // Add a link to this plugin's settings page
28
+ if($file == JQLB_BASENAME) {
29
+ return array_merge($links, array(sprintf( '<a href="%s/wp-admin/options-general.php?page=%s">%s</a>', get_option('siteurl'), JQLB_BASENAME, __('Settings', 'wpdtree'))));
30
+ }
31
  return $links;
32
  }
33
+ function jqlb_add_admin_footer(){ //shows some plugin info in the footer of the config screen.
34
+ $plugin_data = get_plugin_data(__FILE__);
35
+ printf('%1$s by %2$s (who <a href="'.JQLB_DONATE_URL.'">appreciates books</a>) :)<br />', $plugin_data['Title'].' '.$plugin_data['Version'], $plugin_data['Author']);
36
+ }
37
  function jqlb_register_menu_item() {
38
  register_setting( 'jqlb-settings-group', 'jqlb_automate');
39
  register_setting( 'jqlb-settings-group', 'jqlb_resize_on_demand');
76
  function jqlb_options_panel(){
77
  if(!function_exists('current_user_can') || !current_user_can('manage_options')){
78
  die(__('Cheatin&#8217; uh?'));
79
+ }
80
+ add_action('in_admin_footer', 'jqlb_add_admin_footer');
81
+ ?>
82
  <div class="wrap">
83
  <h2>jQuery Lightbox</h2>
84
  <form method="post" action="options.php">