/[drupal]/contributions/modules/lightbox2/js/lightbox.js
ViewVC logotype

Diff of /contributions/modules/lightbox2/js/lightbox.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5.2.6.4.94, Thu Jan 1 14:06:23 2009 UTC revision 1.5.2.6.4.95, Thu Jan 1 15:54:44 2009 UTC
# Line 286  var Lightbox = { Line 286  var Lightbox = {
286      var rel_style = null;      var rel_style = null;
287      var i = 0;      var i = 0;
288    
289        // Set the title for image alternative text.
290        var alt = imageLink.title;
291        if (!alt) {
292          var img = $(imageLink).find("img");
293          if (img && $(img).attr("alt")) {
294            alt = $(img).attr("alt");
295          }
296          else {
297            alt = title;
298          }
299        }
300    
301    
302      if ($(imageLink).attr('id') == 'lightboxAutoModal') {      if ($(imageLink).attr('id') == 'lightboxAutoModal') {
303        rel_style = rel_parts["style"];        rel_style = rel_parts["style"];
304        Lightbox.imageArray.push(['#lightboxAutoModal > *', title, rel_style, 1]);        Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
305      }      }
306      else {      else {
307        // Handle lightbox images with no grouping.        // Handle lightbox images with no grouping.
308        if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {        if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
309          Lightbox.imageArray.push([imageLink.href, title]);          Lightbox.imageArray.push([imageLink.href, title, alt]);
310        }        }
311    
312        // Handle iframes with no grouping.        // Handle iframes with no grouping.
313        else if ((rel == 'lightframe' || rel == 'lightmodal') && !rel_group) {        else if ((rel == 'lightframe' || rel == 'lightmodal') && !rel_group) {
314          rel_style = rel_parts["style"];          rel_style = rel_parts["style"];
315          Lightbox.imageArray.push([imageLink.href, title, rel_style]);          Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
316        }        }
317    
318        // Handle video.        // Handle video.
319        else if (rel == "lightvideo") {        else if (rel == "lightvideo") {
320          // rel_group contains style information for videos.          // rel_group contains style information for videos.
321          rel_style = rel_group;          rel_style = rel_group;
322          Lightbox.imageArray.push([imageLink.href, title, rel_style]);          Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
323        }        }
324    
325        // Handle iframes and lightbox & slideshow images.        // Handle iframes and lightbox & slideshow images.
# Line 323  var Lightbox = { Line 336  var Lightbox = {
336                  if (Lightbox.isLightframe || Lightbox.isModal) {                  if (Lightbox.isLightframe || Lightbox.isModal) {
337                    rel_style = rel_data["style"];                    rel_style = rel_data["style"];
338                  }                  }
339                  Lightbox.imageArray.push([anchor.href, anchor_title, rel_style]);                  Lightbox.imageArray.push([anchor.href, anchor_title, alt, rel_style]);
340                }                }
341              }              }
342            }            }
# Line 407  var Lightbox = { Line 420  var Lightbox = {
420          imgPreloader.onload = function() {          imgPreloader.onload = function() {
421            var photo = document.getElementById('lightboxImage');            var photo = document.getElementById('lightboxImage');
422            photo.src = Lightbox.imageArray[Lightbox.activeImage][0];            photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
423            photo.alt = Lightbox.imageArray[Lightbox.activeImage][1];            photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];
424    
425            var imageWidth = imgPreloader.width;            var imageWidth = imgPreloader.width;
426            var imageHeight = imgPreloader.height;            var imageHeight = imgPreloader.height;
# Line 454  var Lightbox = { Line 467  var Lightbox = {
467          };          };
468    
469          imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];          imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
470          imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][1];          imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
471        }        }
472    
473        // Set up frame size, etc.        // Set up frame size, etc.
# Line 466  var Lightbox = { Line 479  var Lightbox = {
479            $('#lightboxFrame').attr('frameborder', '0');            $('#lightboxFrame').attr('frameborder', '0');
480          }          }
481          var iframe = document.getElementById('lightboxFrame');          var iframe = document.getElementById('lightboxFrame');
482          var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][2];          var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
483          iframe = Lightbox.setStyles(iframe, iframeStyles);          iframe = Lightbox.setStyles(iframe, iframeStyles);
484          Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));          Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
485        }        }
486        else if (Lightbox.isVideo || Lightbox.isModal) {        else if (Lightbox.isVideo || Lightbox.isModal) {
487          var container = document.getElementById('modalContainer');          var container = document.getElementById('modalContainer');
488          var modalStyles = Lightbox.imageArray[Lightbox.activeImage][2];          var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
489          container = Lightbox.setStyles(container, modalStyles);          container = Lightbox.setStyles(container, modalStyles);
490          if (Lightbox.isVideo) {          if (Lightbox.isVideo) {
491            Lightbox.modalHeight =  parseInt(container.height, 10);            Lightbox.modalHeight =  parseInt(container.height, 10);
# Line 581  var Lightbox = { Line 594  var Lightbox = {
594          }          }
595          else {          else {
596            var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);            var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
597            if (Lightbox.imageArray[Lightbox.activeImage][3]) {            if (Lightbox.imageArray[Lightbox.activeImage][4]) {
598              $(src).appendTo("#modalContainer");              $(src).appendTo("#modalContainer");
599            }            }
600            else {            else {

Legend:
Removed from v.1.5.2.6.4.94  
changed lines
  Added in v.1.5.2.6.4.95

  ViewVC Help
Powered by ViewVC 1.1.2