/[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.2.102, Thu Jan 1 14:05:58 2009 UTC revision 1.5.2.6.2.103, Thu Jan 1 15:54:23 2009 UTC
# Line 291  var Lightbox = { Line 291  var Lightbox = {
291      var rel_style = null;      var rel_style = null;
292      var i = 0;      var i = 0;
293    
294    
295        // Set the title for image alternative text.
296        var alt = imageLink.title;
297        if (!alt) {
298          var img = $(imageLink).find("img");
299          if (img && $(img).attr("alt")) {
300            alt = $(img).attr("alt");
301          }
302          else {
303            alt = title;
304          }
305        }
306    
307      if ($(imageLink).attr('id') == 'lightboxAutoModal') {      if ($(imageLink).attr('id') == 'lightboxAutoModal') {
308        rel_style = rel_parts["style"];        rel_style = rel_parts["style"];
309        Lightbox.imageArray.push(['#lightboxAutoModal > *', title, rel_style, 1]);        Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
310      }      }
311      else {      else {
312        // Handle lightbox images with no grouping.        // Handle lightbox images with no grouping.
313        if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {        if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
314          Lightbox.imageArray.push([imageLink.href, title]);          Lightbox.imageArray.push([imageLink.href, title, alt]);
315        }        }
316    
317        // Handle iframes with no grouping.        // Handle iframes with no grouping.
318        else if ((rel == 'lightframe' || rel == 'lightmodal') && !rel_group) {        else if ((rel == 'lightframe' || rel == 'lightmodal') && !rel_group) {
319          rel_style = rel_parts["style"];          rel_style = rel_parts["style"];
320          Lightbox.imageArray.push([imageLink.href, title, rel_style]);          Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
321        }        }
322    
323        // Handle video.        // Handle video.
324        else if (rel == "lightvideo") {        else if (rel == "lightvideo") {
325          // rel_group contains style information for videos.          // rel_group contains style information for videos.
326          rel_style = rel_group;          rel_style = rel_group;
327          Lightbox.imageArray.push([imageLink.href, title, rel_style]);          Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
328        }        }
329    
330        // Handle iframes and lightbox & slideshow images.        // Handle iframes and lightbox & slideshow images.
# Line 328  var Lightbox = { Line 341  var Lightbox = {
341                  if (Lightbox.isLightframe || Lightbox.isModal) {                  if (Lightbox.isLightframe || Lightbox.isModal) {
342                    rel_style = rel_data["style"];                    rel_style = rel_data["style"];
343                  }                  }
344                  Lightbox.imageArray.push([anchor.href, anchor_title, rel_style]);                  Lightbox.imageArray.push([anchor.href, anchor_title, alt, rel_style]);
345                }                }
346              }              }
347            }            }
# Line 412  var Lightbox = { Line 425  var Lightbox = {
425          imgPreloader.onload = function() {          imgPreloader.onload = function() {
426            var photo = document.getElementById('lightboxImage');            var photo = document.getElementById('lightboxImage');
427            photo.src = Lightbox.imageArray[Lightbox.activeImage][0];            photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
428            photo.alt = Lightbox.imageArray[Lightbox.activeImage][1];            photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];
429    
430            var imageWidth = imgPreloader.width;            var imageWidth = imgPreloader.width;
431            var imageHeight = imgPreloader.height;            var imageHeight = imgPreloader.height;
# Line 459  var Lightbox = { Line 472  var Lightbox = {
472          };          };
473    
474          imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];          imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
475          imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][1];          imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
476        }        }
477    
478        // Set up frame size, etc.        // Set up frame size, etc.
# Line 471  var Lightbox = { Line 484  var Lightbox = {
484            $('#lightboxFrame').attr('frameborder', '0');            $('#lightboxFrame').attr('frameborder', '0');
485          }          }
486          var iframe = document.getElementById('lightboxFrame');          var iframe = document.getElementById('lightboxFrame');
487          var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][2];          var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
488          iframe = Lightbox.setStyles(iframe, iframeStyles);          iframe = Lightbox.setStyles(iframe, iframeStyles);
489          Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));          Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
490        }        }
491        else if (Lightbox.isVideo || Lightbox.isModal) {        else if (Lightbox.isVideo || Lightbox.isModal) {
492          var container = document.getElementById('modalContainer');          var container = document.getElementById('modalContainer');
493          var modalStyles = Lightbox.imageArray[Lightbox.activeImage][2];          var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
494          container = Lightbox.setStyles(container, modalStyles);          container = Lightbox.setStyles(container, modalStyles);
495          if (Lightbox.isVideo) {          if (Lightbox.isVideo) {
496            Lightbox.modalHeight =  parseInt(container.height, 10);            Lightbox.modalHeight =  parseInt(container.height, 10);
# Line 585  var Lightbox = { Line 598  var Lightbox = {
598          }          }
599          else {          else {
600            var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);            var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
601            if (Lightbox.imageArray[Lightbox.activeImage][3]) {            if (Lightbox.imageArray[Lightbox.activeImage][4]) {
602              $(src).appendTo("#modalContainer");              $(src).appendTo("#modalContainer");
603            }            }
604            else {            else {

Legend:
Removed from v.1.5.2.6.2.102  
changed lines
  Added in v.1.5.2.6.2.103

  ViewVC Help
Powered by ViewVC 1.1.2