Skip to content

Commit

Permalink
1.5.2
Browse files Browse the repository at this point in the history
* Fix: Slideshow loops out of control (Mirage of Wallentin)
* Fix: Lightbox fails when group by posts disabled (Lange Fix)
* Add: Option to use the image's URI as caption when link title not set (Under UI options)
  • Loading branch information
archetyped committed Mar 18, 2011
1 parent a4ed300 commit b04458a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
14 changes: 10 additions & 4 deletions js/dev/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Lightbox = {
initialize: function(options) {
this.options = $.extend(true, {
animate : true, // resizing animations
captionSrc : true, //Use image source URI if title not set
autoPlay : true, // should slideshow start automatically
borderSize : 10, // if you adjust the padding in the CSS, you will need to update this variable
containerID : document, // lightbox container object
Expand Down Expand Up @@ -167,7 +168,7 @@ Lightbox = {
this.get('slbClose').html(s.closeLink);
this.get('navNext').html(s.nextLink);
this.get('navPrev').html(s.prevLink);
this.get('navSlideControl').html(s.stopSlideshow);
this.get('navSlideControl').html(((this.playSlides) ? s.stopSlideshow : s.startSlideshow));
},

/**
Expand Down Expand Up @@ -227,8 +228,12 @@ Lightbox = {
var inner = $(imageLink).find('img').first();
if ( $(inner).length )
caption = $(inner).attr('title') || $(inner).attr('alt');
if ( !caption )
caption = imageLink.text() || imageLink.attr('href') || '';
if ( !caption && imageLink.text().length )
caption = imageLink.text();
else if ( this.options.captionSrc )
caption = imageLink.attr('href');
else
caption = '';
}
return caption;
},
Expand Down Expand Up @@ -307,7 +312,7 @@ Lightbox = {
t.resizeImageContainer(imgPreloader.width, imgPreloader.height);
//Restart slideshow if active
if ( t.isSlideShowActive() )
t.startSlideshow();
t.startSlideShow();
});

imgPreloader.src = this.imageArray[this.activeImage].link;
Expand Down Expand Up @@ -405,6 +410,7 @@ Lightbox = {
startSlideShow: function() {
this.playSlides = true;
var t = this;
clearInterval(this.slideShowTimer);
this.slideShowTimer = setInterval(function() { t.showNext(); t.pauseSlideShow(); }, this.options.slideTime * 1000);
this.get('navSlideControl').text(this.options.strings.stopSlideshow);
},
Expand Down
36 changes: 18 additions & 18 deletions js/lib.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Simple Lightbox
Plugin URI: http://archetyped.com/tools/simple-lightbox/
Description: Customizable Lightbox for Wordpress
Version: 1.5.1
Version: 1.5.2
Author: Archetyped
Author URI: http://archetyped.com
*/
Expand Down
Loading

0 comments on commit b04458a

Please sign in to comment.