WP jQuery Lightbox - Version 1.3.4.2

Version Description

(2011-02-01) = * Fallbacks for people using older jQuery

Download this release

Release Info

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

Code changes from version 1.3.4.1 to 1.3.4.2

jquery.lightbox.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * WP jQuery Lightbox
3
- * Version 1.3.4.1 - 2011-01-31
4
  * @author Ulf Benjaminsson (http://www.ulfben.com)
5
  *
6
  * This is a modified version of Warren Krevenkis Lightbox-port (see notice below) for use in the WP jQuery Lightbox-
@@ -36,12 +36,18 @@
36
  (function($){
37
  $.fn.lightbox = function(options) {
38
  var opts = $.extend({}, $.fn.lightbox.defaults, options);
39
- return $(this).on("click", function () {
40
  initialize();
41
  start(this);
42
  return false;
43
- });
44
- function initialize() {
 
 
 
 
 
 
45
  $(window).bind('orientationchange', resizeListener);
46
  $(window).bind('resize', resizeListener);
47
  // if (opts.followScroll) { $(window).bind('scroll', orientListener); }
1
  /**
2
  * WP jQuery Lightbox
3
+ * Version 1.3.4.2 - 2011-02-01
4
  * @author Ulf Benjaminsson (http://www.ulfben.com)
5
  *
6
  * This is a modified version of Warren Krevenkis Lightbox-port (see notice below) for use in the WP jQuery Lightbox-
36
  (function($){
37
  $.fn.lightbox = function(options) {
38
  var opts = $.extend({}, $.fn.lightbox.defaults, options);
39
+ function onClick() {
40
  initialize();
41
  start(this);
42
  return false;
43
+ }
44
+ if(parseFloat($().jquery) >= 1.7){
45
+ return $(this).on("click", onClick);
46
+ }else{
47
+ return $(this).live("click", onClick); //deprecated since 1.7
48
+ }
49
+
50
+ function initialize() {
51
  $(window).bind('orientationchange', resizeListener);
52
  $(window).bind('resize', resizeListener);
53
  // if (opts.followScroll) { $(window).bind('scroll', orientListener); }
jquery.lightbox.min.js CHANGED
@@ -1 +1 @@
1
- (function(a){a.fn.lightbox=function(k){var t=a.extend({},a.fn.lightbox.defaults,k);return a(this).on("click",function(){e();o(this);return false});function e(){a(window).bind("orientationchange",p);a(window).bind("resize",p);a("#overlay").remove();a("#lightbox").remove();t.isIE8=u();t.inprogress=false;if(t.jsonData&&t.jsonData.length>0){var B=t.jsonDataParser?t.jsonDataParser:a.fn.lightbox.parseJsonData;t.imageArray=[];t.imageArray=B(t.jsonData)}var y='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+t.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+t.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var A='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(t.displayHelp){A+='<span id="helpDisplay">'+t.strings.help+"</span>"}A+='<a href="javascript://" id="bottomNavClose" title="'+t.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var z;if(t.navbarOnTop){z='<div id="overlay"></div><div id="lightbox">'+A+y+"</div>";a("body").append(z);a("#imageDataContainer").addClass("ontop")}else{z='<div id="overlay"></div><div id="lightbox">'+y+A+"</div>";a("body").append(z)}a("#overlay").click(function(){h()}).hide();a("#lightbox").click(function(){h()}).hide();a("#loadingLink").click(function(){h();return false});a("#bottomNavClose").click(function(){h();return false});a("#outerImageContainer").width(t.widthCurrent).height(t.heightCurrent);a("#imageDataContainer").width(t.widthCurrent);if(!t.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function p(y){if(t.resizeTimeout){clearTimeout(t.resizeTimeout);t.resizeTimeout=false}t.resizeTimeout=setTimeout(function(){x(false)},50)}function w(){var z=a(document).height();if(t.isIE8&&z>4096){z=4096}var y=a(window).height()-t.adminBarHeight;return new Array(a(document).width(),z,a(window).width(),y,a(document).height())}function u(){var z=false;if(document.createElement){var y=document.createElement("div");if(y&&y.querySelectorAll){y.innerHTML='<object><param name=""></object>';z=y.querySelectorAll("param").length!=1}y=null}return z}function g(){var z=0;var y=0;if(self.pageYOffset){y=self.pageYOffset;z=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop;z=document.documentElement.scrollLeft}else{if(document.body){y=document.body.scrollTop;z=document.body.scrollLeft}}}if(t.adminBarHeight&&parseInt(a("#wpadminbar").css("top"),10)===0){y+=t.adminBarHeight}return new Array(z,y)}function o(C){a("select, embed, object").hide();var A=w();var y=g();var z=0;a("#overlay").hide().css({width:A[0]+"px",height:A[1]+"px",opacity:t.overlayOpacity}).fadeIn(400);if(t.isIE8&&A[1]==4096){if(y[1]>=1000){z=y[1]-1000;if((A[4]-(y[1]+3096))<0){z-=(y[1]+3096)-A[4]}a("#overlay").css({top:z+"px"})}}imageNum=0;if(!t.jsonData){t.imageArray=[];if(!C.rel||(C.rel=="")){var B="";if(C.title){B=C.title}else{if(a(this).children(":first-child").attr("title")){B=a(this).children(":first-child").attr("title")}}t.imageArray.push(new Array(C.href,t.displayTitle?B:""))}else{a("a").each(function(){if(this.href&&(this.rel==C.rel)){var G="";var E="";var I="";var D=a(this);if(this.title){G=this.title}else{if(D.children("img:first-child").attr("title")){G=D.children("img:first-child").attr("title")}}if(D.parent().next(".gallery-caption").html()){var H=D.parent().next(".gallery-caption");E=H.html();I=H.text()}else{if(D.next(".wp-caption-text").html()){E=D.next(".wp-caption-text").html();I=D.next(".wp-caption-text").text()}}G=a.trim(G);I=a.trim(I);if(G.toLowerCase()==I.toLowerCase()){G=E;E=""}var F="";if(G!=""){F='<span id="titleText">'+G+"</span>"}if(E!=""){if(G!=""){F+="<br />"}F+='<span id="captionText">'+E+"</span>"}t.imageArray.push(new Array(this.href,t.displayTitle?F:""))}})}}if(t.imageArray.length>1){for(i=0;i<t.imageArray.length;i++){for(j=t.imageArray.length-1;j>i;j--){if(t.imageArray[i][0]==t.imageArray[j][0]){t.imageArray.splice(j,1)}}}while(t.imageArray[imageNum][0]!=C.href){imageNum++}}m(y[1],y[0]).show();v(imageNum)}function m(y,z){if(t.resizeSpeed>0){a("#lightbox").animate({top:y},250,"linear");return a("#lightbox").animate({left:z},250,"linear")}return a("#lightbox").css({top:y+"px",left:z+"px"})}function v(y){if(t.inprogress==false){t.inprogress=true;t.activeImage=y;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();l()}}function l(){t.imgPreloader=new Image();t.imgPreloader.onload=function(){a("#lightboxImage").attr("src",t.imageArray[t.activeImage][0]);x();f()};t.imgPreloader.src=t.imageArray[t.activeImage][0]}function x(){if(!t.imgPreloader){return}var B=t.imgPreloader.width;var y=t.imgPreloader.height;var D=w();var J=(D[2]<D[0])?D[0]:D[2];a("#overlay").css({width:J+"px",height:D[1]+"px"});var H=(D[3])-(a("#imageDataContainer").height()+(2*t.borderSize));var I=(D[2])-(2*t.borderSize);if(t.fitToScreen){var z=H-t.marginSize;var K=I-t.marginSize;var E=1;if(y>z){E=z/y}B=B*E;y=y*E;E=1;if(B>K){E=K/B}B=Math.round(B*E);y=Math.round(y*E)}var C=g();var A=C[1]+(H*0.5);var F=A-y*0.5;var G=C[0];a("#lightboxImage").width(B).height(y);n(B,y,F,G)}function n(B,z,D,C){t.widthCurrent=a("#outerImageContainer").outerWidth();t.heightCurrent=a("#outerImageContainer").outerHeight();var y=Math.max(350,B+(t.borderSize*2));var A=(z+(t.borderSize*2));t.xScale=(y/t.widthCurrent)*100;t.yScale=(A/t.heightCurrent)*100;m(D,C);c();a("#imageDataContainer").animate({width:y},t.resizeSpeed,"linear");a("#outerImageContainer").animate({width:y},t.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:A},t.resizeSpeed,"linear",function(){d()})});r();a("#prevLink").height(z);a("#nextLink").height(z)}function d(){a("#imageData").show();a("#caption").show();a("#loading").hide();if(t.resizeSpeed>0){a("#lightboxImage").fadeIn("fast")}else{a("#lightboxImage").show()}t.inprogress=false}function f(){if(t.loopImages&&t.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[(t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[(t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1][0]}else{if((t.imageArray.length-1)>t.activeImage){preloadNextImage=new Image();preloadNextImage.src=t.imageArray[t.activeImage+1][0]}if(t.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=t.imageArray[t.activeImage-1][0]}}}function c(){a("#numberDisplay").html("");a("#caption").html("").hide();if(t.imageArray[t.activeImage][1]){a("#caption").html(t.imageArray[t.activeImage][1]).show()}var B="";var A="";var C=(t.imageArray.length>1)?t.strings.image+(t.activeImage+1)+t.strings.of+t.imageArray.length:"";var z=(t.displayDownloadLink)?'<a href="'+t.imageArray[t.activeImage][0]+'" id="downloadLink" target="'+t.linkTarget+'">'+t.strings.download+"</a>":"";var y="";if(t.imageArray.length>1&&!t.disableNavbarLinks){if((t.activeImage)>0||t.loopImages){A='<a title="'+t.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+t.strings.prevLinkText+"</a>"}if(((t.activeImage+1)<t.imageArray.length)||t.loopImages){y+='<a title="'+t.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+t.strings.nextLinkText+"</a>"}}B=A+B+C+z+y;if(B!=""){a("#numberDisplay").html(B).show()}}function r(){if(t.imageArray.length>1){a("#hoverNav").show();if(t.loopImages){a("#prevLink,#prevLinkText").show().click(function(){v((t.activeImage==0)?(t.imageArray.length-1):t.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){v((t.activeImage==(t.imageArray.length-1))?0:t.activeImage+1);return false})}else{if(t.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){v(t.activeImage-1);return false})}if(t.activeImage!=(t.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){v(t.activeImage+1);return false})}}b()}}function h(){q();a("#lightbox").hide();a("#overlay").fadeOut();a("select, object, embed").show()}function s(B){var C=B.data.opts;var y=B.keyCode;var z=27;var A=String.fromCharCode(y).toLowerCase();if((A=="x")||(A=="o")||(A=="c")||(y==z)){h()}else{if((A=="p")||(y==37)){if(C.loopImages){q();v((C.activeImage==0)?(C.imageArray.length-1):C.activeImage-1)}else{if(C.activeImage!=0){q();v(C.activeImage-1)}}}else{if((A=="n")||(y==39)){if(t.loopImages){q();v((C.activeImage==(C.imageArray.length-1))?0:C.activeImage+1)}else{if(C.activeImage!=(C.imageArray.length-1)){q();v(C.activeImage+1)}}}}}return false}function b(){a(document).bind("keydown",{opts:t},s)}function q(){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={adminBarHeight:28,overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null,followScroll:false,isIE8:false};a(document).ready(function(d){var b=(typeof JQLBSettings=="object");if(b&&JQLBSettings.resizeSpeed){JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)}if(b&&JQLBSettings.marginSize){JQLBSettings.marginSize=parseInt(JQLBSettings.marginSize)}var c={help:" Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"};d('a[rel^="lightbox"]').lightbox({adminBarHeight:d("#wpadminbar").height()||0,linkTarget:(b&&JQLBSettings.linkTarget.length)?JQLBSettings.linkTarget:"_self",displayHelp:(b&&JQLBSettings.help.length)?true:false,marginSize:(b&&JQLBSettings.marginSize)?JQLBSettings.marginSize:0,fitToScreen:(b&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(b&&JQLBSettings.resizeSpeed>=0)?JQLBSettings.resizeSpeed:400,displayDownloadLink:(b&&JQLBSettings.displayDownloadLink=="0")?false:true,navbarOnTop:(b&&JQLBSettings.navbarOnTop=="0")?false:true,strings:(b&&typeof JQLBSettings.help=="string")?JQLBSettings:c})})})(jQuery);
1
+ (function(a){a.fn.lightbox=function(k){var u=a.extend({},a.fn.lightbox.defaults,k);function p(){e();o(this);return false}if(parseFloat(a().jquery)>=1.7){return a(this).on("click",p)}else{return a(this).live("click",p)}function e(){a(window).bind("orientationchange",q);a(window).bind("resize",q);a("#overlay").remove();a("#lightbox").remove();u.isIE8=v();u.inprogress=false;if(u.jsonData&&u.jsonData.length>0){var C=u.jsonDataParser?u.jsonDataParser:a.fn.lightbox.parseJsonData;u.imageArray=[];u.imageArray=C(u.jsonData)}var z='<div id="outerImageContainer"><div id="imageContainer"><iframe id="lightboxIframe" /><img id="lightboxImage"><div id="hoverNav"><a href="javascript://" title="'+u.strings.prevLinkTitle+'" id="prevLink"></a><a href="javascript://" id="nextLink" title="'+u.strings.nextLinkTitle+'"></a></div><div id="loading"><a href="javascript://" id="loadingLink"><div id="jqlb_loading"></div></a></div></div></div>';var B='<div id="imageDataContainer" class="clearfix"><div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav">';if(u.displayHelp){B+='<span id="helpDisplay">'+u.strings.help+"</span>"}B+='<a href="javascript://" id="bottomNavClose" title="'+u.strings.closeTitle+'"><div id="jqlb_closelabel"></div></a></div></div></div>';var A;if(u.navbarOnTop){A='<div id="overlay"></div><div id="lightbox">'+B+z+"</div>";a("body").append(A);a("#imageDataContainer").addClass("ontop")}else{A='<div id="overlay"></div><div id="lightbox">'+z+B+"</div>";a("body").append(A)}a("#overlay").click(function(){h()}).hide();a("#lightbox").click(function(){h()}).hide();a("#loadingLink").click(function(){h();return false});a("#bottomNavClose").click(function(){h();return false});a("#outerImageContainer").width(u.widthCurrent).height(u.heightCurrent);a("#imageDataContainer").width(u.widthCurrent);if(!u.imageClickClose){a("#lightboxImage").click(function(){return false});a("#hoverNav").click(function(){return false})}}function q(z){if(u.resizeTimeout){clearTimeout(u.resizeTimeout);u.resizeTimeout=false}u.resizeTimeout=setTimeout(function(){y(false)},50)}function x(){var A=a(document).height();if(u.isIE8&&A>4096){A=4096}var z=a(window).height()-u.adminBarHeight;return new Array(a(document).width(),A,a(window).width(),z,a(document).height())}function v(){var A=false;if(document.createElement){var z=document.createElement("div");if(z&&z.querySelectorAll){z.innerHTML='<object><param name=""></object>';A=z.querySelectorAll("param").length!=1}z=null}return A}function g(){var A=0;var z=0;if(self.pageYOffset){z=self.pageYOffset;A=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){z=document.documentElement.scrollTop;A=document.documentElement.scrollLeft}else{if(document.body){z=document.body.scrollTop;A=document.body.scrollLeft}}}if(u.adminBarHeight&&parseInt(a("#wpadminbar").css("top"),10)===0){z+=u.adminBarHeight}return new Array(A,z)}function o(D){a("select, embed, object").hide();var B=x();var z=g();var A=0;a("#overlay").hide().css({width:B[0]+"px",height:B[1]+"px",opacity:u.overlayOpacity}).fadeIn(400);if(u.isIE8&&B[1]==4096){if(z[1]>=1000){A=z[1]-1000;if((B[4]-(z[1]+3096))<0){A-=(z[1]+3096)-B[4]}a("#overlay").css({top:A+"px"})}}imageNum=0;if(!u.jsonData){u.imageArray=[];if(!D.rel||(D.rel=="")){var C="";if(D.title){C=D.title}else{if(a(this).children(":first-child").attr("title")){C=a(this).children(":first-child").attr("title")}}u.imageArray.push(new Array(D.href,u.displayTitle?C:""))}else{a("a").each(function(){if(this.href&&(this.rel==D.rel)){var H="";var F="";var J="";var E=a(this);if(this.title){H=this.title}else{if(E.children("img:first-child").attr("title")){H=E.children("img:first-child").attr("title")}}if(E.parent().next(".gallery-caption").html()){var I=E.parent().next(".gallery-caption");F=I.html();J=I.text()}else{if(E.next(".wp-caption-text").html()){F=E.next(".wp-caption-text").html();J=E.next(".wp-caption-text").text()}}H=a.trim(H);J=a.trim(J);if(H.toLowerCase()==J.toLowerCase()){H=F;F=""}var G="";if(H!=""){G='<span id="titleText">'+H+"</span>"}if(F!=""){if(H!=""){G+="<br />"}G+='<span id="captionText">'+F+"</span>"}u.imageArray.push(new Array(this.href,u.displayTitle?G:""))}})}}if(u.imageArray.length>1){for(i=0;i<u.imageArray.length;i++){for(j=u.imageArray.length-1;j>i;j--){if(u.imageArray[i][0]==u.imageArray[j][0]){u.imageArray.splice(j,1)}}}while(u.imageArray[imageNum][0]!=D.href){imageNum++}}m(z[1],z[0]).show();w(imageNum)}function m(z,A){if(u.resizeSpeed>0){a("#lightbox").animate({top:z},250,"linear");return a("#lightbox").animate({left:A},250,"linear")}return a("#lightbox").css({top:z+"px",left:A+"px"})}function w(z){if(u.inprogress==false){u.inprogress=true;u.activeImage=z;a("#loading").show();a("#lightboxImage").hide();a("#hoverNav").hide();a("#prevLink").hide();a("#nextLink").hide();l()}}function l(){u.imgPreloader=new Image();u.imgPreloader.onload=function(){a("#lightboxImage").attr("src",u.imageArray[u.activeImage][0]);y();f()};u.imgPreloader.src=u.imageArray[u.activeImage][0]}function y(){if(!u.imgPreloader){return}var C=u.imgPreloader.width;var z=u.imgPreloader.height;var E=x();var K=(E[2]<E[0])?E[0]:E[2];a("#overlay").css({width:K+"px",height:E[1]+"px"});var I=(E[3])-(a("#imageDataContainer").height()+(2*u.borderSize));var J=(E[2])-(2*u.borderSize);if(u.fitToScreen){var A=I-u.marginSize;var L=J-u.marginSize;var F=1;if(z>A){F=A/z}C=C*F;z=z*F;F=1;if(C>L){F=L/C}C=Math.round(C*F);z=Math.round(z*F)}var D=g();var B=D[1]+(I*0.5);var G=B-z*0.5;var H=D[0];a("#lightboxImage").width(C).height(z);n(C,z,G,H)}function n(C,A,E,D){u.widthCurrent=a("#outerImageContainer").outerWidth();u.heightCurrent=a("#outerImageContainer").outerHeight();var z=Math.max(350,C+(u.borderSize*2));var B=(A+(u.borderSize*2));u.xScale=(z/u.widthCurrent)*100;u.yScale=(B/u.heightCurrent)*100;m(E,D);c();a("#imageDataContainer").animate({width:z},u.resizeSpeed,"linear");a("#outerImageContainer").animate({width:z},u.resizeSpeed,"linear",function(){a("#outerImageContainer").animate({height:B},u.resizeSpeed,"linear",function(){d()})});s();a("#prevLink").height(A);a("#nextLink").height(A)}function d(){a("#imageData").show();a("#caption").show();a("#loading").hide();if(u.resizeSpeed>0){a("#lightboxImage").fadeIn("fast")}else{a("#lightboxImage").show()}u.inprogress=false}function f(){if(u.loopImages&&u.imageArray.length>1){preloadNextImage=new Image();preloadNextImage.src=u.imageArray[(u.activeImage==(u.imageArray.length-1))?0:u.activeImage+1][0];preloadPrevImage=new Image();preloadPrevImage.src=u.imageArray[(u.activeImage==0)?(u.imageArray.length-1):u.activeImage-1][0]}else{if((u.imageArray.length-1)>u.activeImage){preloadNextImage=new Image();preloadNextImage.src=u.imageArray[u.activeImage+1][0]}if(u.activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=u.imageArray[u.activeImage-1][0]}}}function c(){a("#numberDisplay").html("");a("#caption").html("").hide();if(u.imageArray[u.activeImage][1]){a("#caption").html(u.imageArray[u.activeImage][1]).show()}var C="";var B="";var D=(u.imageArray.length>1)?u.strings.image+(u.activeImage+1)+u.strings.of+u.imageArray.length:"";var A=(u.displayDownloadLink)?'<a href="'+u.imageArray[u.activeImage][0]+'" id="downloadLink" target="'+u.linkTarget+'">'+u.strings.download+"</a>":"";var z="";if(u.imageArray.length>1&&!u.disableNavbarLinks){if((u.activeImage)>0||u.loopImages){B='<a title="'+u.strings.prevLinkTitle+'" href="#" id="prevLinkText">'+u.strings.prevLinkText+"</a>"}if(((u.activeImage+1)<u.imageArray.length)||u.loopImages){z+='<a title="'+u.strings.nextLinkTitle+'" href="#" id="nextLinkText">'+u.strings.nextLinkText+"</a>"}}C=B+C+D+A+z;if(C!=""){a("#numberDisplay").html(C).show()}}function s(){if(u.imageArray.length>1){a("#hoverNav").show();if(u.loopImages){a("#prevLink,#prevLinkText").show().click(function(){w((u.activeImage==0)?(u.imageArray.length-1):u.activeImage-1);return false});a("#nextLink,#nextLinkText").show().click(function(){w((u.activeImage==(u.imageArray.length-1))?0:u.activeImage+1);return false})}else{if(u.activeImage!=0){a("#prevLink,#prevLinkText").show().click(function(){w(u.activeImage-1);return false})}if(u.activeImage!=(u.imageArray.length-1)){a("#nextLink,#nextLinkText").show().click(function(){w(u.activeImage+1);return false})}}b()}}function h(){r();a("#lightbox").hide();a("#overlay").fadeOut();a("select, object, embed").show()}function t(C){var D=C.data.opts;var z=C.keyCode;var A=27;var B=String.fromCharCode(z).toLowerCase();if((B=="x")||(B=="o")||(B=="c")||(z==A)){h()}else{if((B=="p")||(z==37)){if(D.loopImages){r();w((D.activeImage==0)?(D.imageArray.length-1):D.activeImage-1)}else{if(D.activeImage!=0){r();w(D.activeImage-1)}}}else{if((B=="n")||(z==39)){if(u.loopImages){r();w((D.activeImage==(D.imageArray.length-1))?0:D.activeImage+1)}else{if(D.activeImage!=(D.imageArray.length-1)){r();w(D.activeImage+1)}}}}}return false}function b(){a(document).bind("keydown",{opts:u},t)}function r(){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={adminBarHeight:28,overlayOpacity:0.8,borderSize:10,imageArray:new Array,activeImage:null,inprogress:false,widthCurrent:250,heightCurrent:250,xScale:1,yScale:1,displayTitle:true,disableNavbarLinks:true,loopImages:true,imageClickClose:true,jsonData:null,jsonDataParser:null,followScroll:false,isIE8:false};a(document).ready(function(d){var b=(typeof JQLBSettings=="object");if(b&&JQLBSettings.resizeSpeed){JQLBSettings.resizeSpeed=parseInt(JQLBSettings.resizeSpeed)}if(b&&JQLBSettings.marginSize){JQLBSettings.marginSize=parseInt(JQLBSettings.marginSize)}var c={help:" Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.",prevLinkTitle:"previous image",nextLinkTitle:"next image",prevLinkText:"&laquo; Previous",nextLinkText:"Next &raquo;",closeTitle:"close image gallery",image:"Image ",of:" of ",download:"Download"};d('a[rel^="lightbox"]').lightbox({adminBarHeight:d("#wpadminbar").height()||0,linkTarget:(b&&JQLBSettings.linkTarget.length)?JQLBSettings.linkTarget:"_self",displayHelp:(b&&JQLBSettings.help.length)?true:false,marginSize:(b&&JQLBSettings.marginSize)?JQLBSettings.marginSize:0,fitToScreen:(b&&JQLBSettings.fitToScreen=="1")?true:false,resizeSpeed:(b&&JQLBSettings.resizeSpeed>=0)?JQLBSettings.resizeSpeed:400,displayDownloadLink:(b&&JQLBSettings.displayDownloadLink=="0")?false:true,navbarOnTop:(b&&JQLBSettings.navbarOnTop=="0")?false:true,strings:(b&&typeof JQLBSettings.help=="string")?JQLBSettings:c})})})(jQuery);
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: 3.3
6
  Tested up to: 3.3.1
7
- Stable tag: 1.3.4.1
8
 
9
  A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous. Improved for mobile devices.
10
 
@@ -28,6 +28,9 @@ If you value [my plugins](http://profiles.wordpress.org/users/ulfben/), please h
28
 
29
  *[//Ulf Benjaminsson](http://profiles.wordpress.org/users/ulfben/)*
30
 
 
 
 
31
  = 1.3.4.1 (2011-01-31) =
32
  * Updated deprecated jQuery calls (thanks; David Naber)
33
 
@@ -41,7 +44,6 @@ If you value [my plugins](http://profiles.wordpress.org/users/ulfben/), please h
41
  * Added translations: [Romanian](http://wordpress.org/support/topic/wp-jquery-lightbox-romanian-translation?replies=1), [French](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-french-translation?replies=2#post-2187626) and [Hebrew](www.sagive.co.il)
42
  * Updated: Russian language icons (thanks; Ilya Gorenburg), [Japanese translation](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation-for-133?replies=1)
43
 
44
-
45
  = 1.3.3 (2011-06-12) =
46
  * Fixes [for Internet Explorer](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-jquery-version-and-ie-issues) (A million thanks to [David Grayston](http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/#more-342)!).
47
  * Fix for [mixed HTTP/HTTPS installations](http://wordpress.org/support/topic/mixed-http-and-https-installation-problems).
@@ -104,6 +106,9 @@ If you value [my plugins](http://profiles.wordpress.org/users/ulfben/), please h
104
  * [More info about this issue](http://wordpress.org/support/topic/122-worked-13-does-not-work-for-me?replies=19)
105
 
106
  == Changelog ==
 
 
 
107
  = 1.3.4.1 (2011-01-31) =
108
  * Updated deprecated jQuery calls (thanks; David Naber)
109
 
@@ -166,6 +171,9 @@ If you value [my plugins](http://profiles.wordpress.org/users/ulfben/), please h
166
  * Release.
167
 
168
  == Upgrade Notice ==
 
 
 
169
  = 1.3.4.1 (2011-01-31) =
170
  Updated deprecated jQuery calls (thanks; David Naber)
171
 
4
  Tags: lightbox, jquery, nodal, image, display, ulfben
5
  Requires at least: 3.3
6
  Tested up to: 3.3.1
7
+ Stable tag: 1.3.4.2
8
 
9
  A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous. Improved for mobile devices.
10
 
28
 
29
  *[//Ulf Benjaminsson](http://profiles.wordpress.org/users/ulfben/)*
30
 
31
+ = 1.3.4.2 (2011-02-01) =
32
+ * Fallbacks for people using older jQuery
33
+
34
  = 1.3.4.1 (2011-01-31) =
35
  * Updated deprecated jQuery calls (thanks; David Naber)
36
 
44
  * Added translations: [Romanian](http://wordpress.org/support/topic/wp-jquery-lightbox-romanian-translation?replies=1), [French](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-french-translation?replies=2#post-2187626) and [Hebrew](www.sagive.co.il)
45
  * Updated: Russian language icons (thanks; Ilya Gorenburg), [Japanese translation](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-japanese-translation-for-133?replies=1)
46
 
 
47
  = 1.3.3 (2011-06-12) =
48
  * Fixes [for Internet Explorer](http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-jquery-version-and-ie-issues) (A million thanks to [David Grayston](http://www.grayston.net/2011/internet-explorer-v8-and-opacity-issues/#more-342)!).
49
  * Fix for [mixed HTTP/HTTPS installations](http://wordpress.org/support/topic/mixed-http-and-https-installation-problems).
106
  * [More info about this issue](http://wordpress.org/support/topic/122-worked-13-does-not-work-for-me?replies=19)
107
 
108
  == Changelog ==
109
+ = 1.3.4.2 (2011-02-01) =
110
+ * Fallbacks for people using older jQuery
111
+
112
  = 1.3.4.1 (2011-01-31) =
113
  * Updated deprecated jQuery calls (thanks; David Naber)
114
 
171
  * Release.
172
 
173
  == Upgrade Notice ==
174
+ = 1.3.4.2 (2011-02-01) =
175
+ * Fallbacks for people using older jQuery
176
+
177
  = 1.3.4.1 (2011-01-31) =
178
  Updated deprecated jQuery calls (thanks; David Naber)
179
 
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.3.4.1
7
  Author: Ulf Benjaminsson
8
  Author URI: http://www.ulfben.com
9
  */
@@ -91,7 +91,7 @@ function jqlb_css(){
91
  }
92
  function jqlb_js() {
93
  if(is_admin() || is_feed()){return;}
94
- wp_enqueue_script('jquery', '', array(), false, true);
95
  wp_enqueue_script('wp-jquery-lightbox', plugins_url(JQLB_SCRIPT, __FILE__ ), Array('jquery'), '1.3.4.1', true);
96
  wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
97
  'fitToScreen' => get_option('jqlb_resize_on_demand'),
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.3.4.2
7
  Author: Ulf Benjaminsson
8
  Author URI: http://www.ulfben.com
9
  */
91
  }
92
  function jqlb_js() {
93
  if(is_admin() || is_feed()){return;}
94
+ wp_enqueue_script('jquery', '', array(), '1.7.1', true);
95
  wp_enqueue_script('wp-jquery-lightbox', plugins_url(JQLB_SCRIPT, __FILE__ ), Array('jquery'), '1.3.4.1', true);
96
  wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
97
  'fitToScreen' => get_option('jqlb_resize_on_demand'),