Plugin Directory

Changeset 1301183


Ignore:
Timestamp:
12/05/2015 09:46:08 PM (10 years ago)
Author:
techotronic
Message:

add log output to JavaScript

Location:
jquery-colorbox/trunk/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • jquery-colorbox/trunk/js/jquery-colorbox-wrapper-min.js

    r620549 r1301183  
    1 var COLORBOX_INTERNAL_LINK_PATTERN=/^#.*/;var COLORBOX_SUFFIX_PATTERN=/\.(?:jpe?g|gif|png|bmp)/i;var COLORBOX_MANUAL="colorbox-manual";var COLORBOX_OFF_CLASS=".colorbox-off";var COLORBOX_LINK_CLASS=".colorbox-link";var COLORBOX_OFF="colorbox-off";var COLORBOX_CLASS_PATTERN="colorbox-[0-9]+";var COLORBOX_LINK_CLASS_PATTERN="colorbox-link-[0-9]+";jQuery(document).ready(function(){if(typeof jQueryColorboxSettingsArray!=="object"){jQueryColorboxSettingsArray=getColorboxConfigDefaults()}if(jQueryColorboxSettingsArray.autoColorboxJavaScript==="true"){colorboxAddManualClass()}if(jQueryColorboxSettingsArray.colorboxAddClassToLinks==="true"){colorboxAddClassToLinks()}if(jQueryColorboxSettingsArray.autoHideFlash==="true"){colorboxHideFlash();colorboxShowFlash()}colorboxSelector()});(function(a){colorboxShowFlash=function(){a(document).bind("cbox_closed",function(){var c=document.getElementsByTagName("object");for(i=0;i<c.length;i++){c[i].style.visibility="visible"}var b=document.getElementsByTagName("embed");for(i=0;i<b.length;i++){b[i].style.visibility="visible"}})}})(jQuery);(function(a){colorboxHideFlash=function(){a(document).bind("cbox_open",function(){var c=document.getElementsByTagName("object");for(i=0;i<c.length;i++){c[i].style.visibility="hidden"}var b=document.getElementsByTagName("embed");for(i=0;i<b.length;i++){b[i].style.visibility="hidden"}})}})(jQuery);(function(a){colorboxAddClassToLinks=function(){a("a:not(:contains(img))").each(function(d,f){var c=a(f);var b=c.attr("class");if(b!==undefined&&!b.match("colorbox")){var e=c.attr("href");if(e!==undefined&&a(f).attr("href").match(COLORBOX_SUFFIX_PATTERN)){c.addClass("colorbox-link")}}})}})(jQuery);(function(a){colorboxAddManualClass=function(){a("img").each(function(c,e){var d=a(e);var b=d.attr("class");if(b===undefined||!b.match("colorbox")){d.addClass("colorbox-manual")}})}})(jQuery);(function(a){colorboxSelector=function(){a("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(b,d){ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth;var c=a(d).attr("href");if(c!==undefined&&c.match(COLORBOX_SUFFIX_PATTERN)){colorboxImage(b,d)}});a("a[class*=colorbox-link]").each(function(b,d){ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);var c=a(d).attr("href");if(c!==undefined){colorboxLink(b,d,c)}})}})(jQuery);(function(a){colorboxImage=function(b,f){var d=a(f).find("img:first");var e=a(f).attr("class");if(e!==undefined){ColorboxLocal.colorboxGroupId=e.match(COLORBOX_CLASS_PATTERN)||e.match(COLORBOX_MANUAL)}if(!ColorboxLocal.colorboxGroupId){var g=d.attr("class");if(g!==undefined&&!g.match(COLORBOX_OFF)){ColorboxLocal.colorboxGroupId=g.match(COLORBOX_CLASS_PATTERN)||g.match(COLORBOX_MANUAL)}if(ColorboxLocal.colorboxGroupId){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[1];if(ColorboxLocal.colorboxGroupId==="manual"){ColorboxLocal.colorboxGroupId="nofollow"}var c=d.attr("title");if(c!==undefined){ColorboxLocal.colorboxTitle=c}if(jQueryColorboxSettingsArray.addZoomOverlay==="true"){colorboxAddZoomOverlayToImages(a(f),d)}colorboxWrapper(f)}}}})(jQuery);(function(a){colorboxLink=function(c,e,f){ColorboxLocal.colorboxGroupId=a(e).attr("class").match(COLORBOX_LINK_CLASS_PATTERN);if(ColorboxLocal.colorboxGroupId!==undefined&&ColorboxLocal.colorboxGroupId!==null){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[2]}else{ColorboxLocal.colorboxGroupId="nofollow"}var b=a(e);var d=b.attr("title");if(d!==undefined){ColorboxLocal.colorboxTitle=d}else{ColorboxLocal.colorboxTitle=""}if(f.match(COLORBOX_SUFFIX_PATTERN)){ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth}else{ColorboxLocal.colorboxMaxWidth=false;ColorboxLocal.colorboxMaxHeight=false;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxLinkHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxLinkWidth;if(f.match(COLORBOX_INTERNAL_LINK_PATTERN)){ColorboxLocal.colorboxInline=true}else{ColorboxLocal.colorboxIframe=true}}colorboxWrapper(e)}})(jQuery);(function(a){colorboxWrapper=function(b){a.each(ColorboxLocal,function(c,d){if(d==="false"){ColorboxLocal[c]=false}else{if(d==="true"){ColorboxLocal[c]=true}}});a(b).colorbox({transition:ColorboxLocal.colorboxTransition,speed:parseInt(ColorboxLocal.colorboxSpeed),title:ColorboxLocal.colorboxTitle,rel:ColorboxLocal.colorboxGroupId,scalePhotos:ColorboxLocal.colorboxScalePhotos,scrolling:ColorboxLocal.colorboxScrolling,opacity:ColorboxLocal.colorboxOpacity,preloading:ColorboxLocal.colorboxPreloading,overlayClose:ColorboxLocal.colorboxOverlayClose,escKey:ColorboxLocal.colorboxEscKey,arrowKey:ColorboxLocal.colorboxArrowKey,loop:ColorboxLocal.colorboxLoop,current:ColorboxLocal.colorboxCurrent,previous:ColorboxLocal.colorboxPrevious,next:ColorboxLocal.colorboxNext,close:ColorboxLocal.colorboxClose,xhrError:ColorboxLocal.colorboxXhrError,imgError:ColorboxLocal.colorboxImgError,iframe:ColorboxLocal.colorboxIframe,inline:ColorboxLocal.colorboxInline,width:ColorboxLocal.colorboxWidth,height:ColorboxLocal.colorboxHeight,initialWidth:ColorboxLocal.colorboxInitialWidth,initialHeight:ColorboxLocal.colorboxInitialHeight,maxWidth:ColorboxLocal.colorboxMaxWidth,maxHeight:ColorboxLocal.colorboxMaxHeight,slideshow:ColorboxLocal.colorboxSlideshow,slideshowSpeed:parseInt(ColorboxLocal.colorboxSlideshowSpeed),slideshowAuto:ColorboxLocal.colorboxSlideshowAuto,slideshowStart:ColorboxLocal.colorboxSlideshowStart,slideshowStop:ColorboxLocal.colorboxSlideshowStop})}})(jQuery);(function(a){colorboxAddZoomOverlayToImages=function(c,d){var b=a('<span class="zoomHover" style="opacity: 0;"></span>');c.css("float",d.css("float"));a(b).css("margin",d.css("margin"));b.css("padding",d.css("padding"));var e=a("-top","-left","-right","-bottom");a.each(e,function(f,g){b.css("margin"+g,d.css("margin"+g));b.css("padding"+g,d.css("padding"+g))});c.append(b);c.addClass("zoomLink");c.hover(function(){b.stop().animate({opacity:0.8},300);d.stop().animate({opacity:0.6},300)},function(){b.stop().animate({opacity:0},300);d.stop().animate({opacity:1},300)})}})(jQuery);(function(a){getColorboxConfigDefaults=function(){return{colorboxInline:false,colorboxIframe:false,colorboxGroupId:"",colorboxTitle:"",colorboxWidth:false,colorboxHeight:false,colorboxMaxWidth:false,colorboxMaxHeight:false,colorboxSlideshow:false,colorboxSlideshowAuto:false,colorboxScalePhotos:false,colorboxPreloading:false,colorboxOverlayClose:false,colorboxLoop:false,colorboxEscKey:true,colorboxArrowKey:true,colorboxScrolling:false,colorboxOpacity:"0.85",colorboxTransition:"elastic",colorboxSpeed:"350",colorboxSlideshowSpeed:"2500",colorboxClose:"close",colorboxNext:"next",colorboxPrevious:"previous",colorboxSlideshowStart:"start slideshow",colorboxSlideshowStop:"stop slideshow",colorboxCurrent:"{current} of {total} images",colorboxXhrError:"This content failed to load.",colorboxImgError:"This image failed to load.",colorboxImageMaxWidth:false,colorboxImageMaxHeight:false,colorboxImageHeight:false,colorboxImageWidth:false,colorboxLinkHeight:false,colorboxLinkWidth:false,colorboxInitialHeight:100,colorboxInitialWidth:300,autoColorboxJavaScript:false,autoHideFlash:false,autoColorbox:false,autoColorboxGalleries:false,colorboxAddClassToLinks:false,useGoogleJQuery:false,addZoomOverlay:false}}})(jQuery);(function(a){printArray=function(h,g){var b="";if(!g){g=0}var f="";for(var c=0;c<g+1;c++){f+="    "}if(typeof(h)==="object"){for(var d in h){var e=h[d];if(typeof(e)==="object"){b+=f+"'"+d+"' ...\n";b+=printArray(e,g+1)}else{b+=f+"'"+d+"' = \""+e+'"\n'}}}else{b="===>"+h+"<===("+typeof(h)+")"}return b}})(jQuery);
     1var COLORBOX_INTERNAL_LINK_PATTERN=/^#.*/;var COLORBOX_SUFFIX_PATTERN=/\.(?:jpe?g|gif|png|bmp)/i;var COLORBOX_MANUAL="colorbox-manual";var COLORBOX_OFF_CLASS=".colorbox-off";var COLORBOX_LINK_CLASS=".colorbox-link";var COLORBOX_OFF="colorbox-off";var COLORBOX_CLASS_PATTERN="colorbox-[0-9]+";var COLORBOX_LINK_CLASS_PATTERN="colorbox-link-[0-9]+";jQuery(document).ready(function(){console.group("jQuery Colorbox log messages");if(typeof jQueryColorboxSettingsArray!=="object"){jQueryColorboxSettingsArray=getColorboxConfigDefaults()}if(jQueryColorboxSettingsArray.autoColorboxJavaScript==="true"){colorboxAddManualClass()}if(jQueryColorboxSettingsArray.colorboxAddClassToLinks==="true"){colorboxAddClassToLinks()}if(jQueryColorboxSettingsArray.autoHideFlash==="true"){colorboxHideFlash();colorboxShowFlash()}colorboxSelector();console.groupEnd()});(function(a){colorboxShowFlash=function(){a(document).bind("cbox_closed",function(){console.group("Showing flash objects");var e=document.getElementsByTagName("object");for(var d=0;d<e.length;d++){console.debug("Show object %o",e[d]);e[d].style.visibility="visible"}var b=document.getElementsByTagName("embed");for(var c=0;c<b.length;c++){console.debug("Show embed %o",b[c]);b[c].style.visibility="visible"}console.groupEnd()})}})(jQuery);(function(a){colorboxHideFlash=function(){a(document).bind("cbox_open",function(){console.group("Hiding flash objects");var e=document.getElementsByTagName("object");for(var d=0;d<e.length;d++){console.debug("Hide object %o",e[d]);e[d].style.visibility="hidden"}var b=document.getElementsByTagName("embed");for(var c=0;c<b.length;c++){console.debug("Hide embed %o",b[c]);b[c].style.visibility="hidden"}console.groupEnd()})}})(jQuery);(function(a){colorboxAddClassToLinks=function(){console.group("Add colorbox-link class to links pointing to images");a("a:not(:contains(img))").each(function(d,f){var c=a(f);var b=c.attr("class");if(b!==undefined&&!b.match("colorbox")){var e=c.attr("href");if(e!==undefined&&a(f).attr("href").match(COLORBOX_SUFFIX_PATTERN)){console.log("Add colorbox-link class to %o.",c);c.addClass("colorbox-link")}}});console.groupEnd()}})(jQuery);(function(a){colorboxAddManualClass=function(){console.group("Add colorbox-manual class to images");a("img").each(function(c,e){var d=a(e);var b=d.attr("class");if(b===undefined||!b.match("colorbox")){console.debug("Add colorbox-manual class to image %o",d);d.addClass("colorbox-manual")}});console.groupEnd()}})(jQuery);(function(a){colorboxSelector=function(){console.group("Find image links and apply colorbox effect.");a("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(b,d){console.group("Found link %o.",d);ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth;var c=a(d).attr("href");if(c!==undefined&&c.match(COLORBOX_SUFFIX_PATTERN)){colorboxImage(b,d)}console.groupEnd()});console.groupEnd();console.group("Find links and apply colorbox effect.");a("a[class*=colorbox-link]").each(function(b,d){console.group("Found link %o.",d);ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);var c=a(d).attr("href");if(c!==undefined){colorboxLink(b,d,c)}console.groupEnd()});console.groupEnd()}})(jQuery);(function(a){colorboxImage=function(b,f){var d=a(f).find("img:first");var e=a(f).attr("class");if(e!==undefined){ColorboxLocal.colorboxGroupId=e.match(COLORBOX_CLASS_PATTERN)||e.match(COLORBOX_MANUAL)}if(!ColorboxLocal.colorboxGroupId){var g=d.attr("class");if(g!==undefined&&!g.match(COLORBOX_OFF)){ColorboxLocal.colorboxGroupId=g.match(COLORBOX_CLASS_PATTERN)||g.match(COLORBOX_MANUAL)}if(ColorboxLocal.colorboxGroupId){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[1];if(ColorboxLocal.colorboxGroupId==="manual"){ColorboxLocal.colorboxGroupId="nofollow"}var c=d.attr("title");if(c!==undefined){ColorboxLocal.colorboxTitle=c}if(jQueryColorboxSettingsArray.addZoomOverlay==="true"){colorboxAddZoomOverlayToImages(a(f),d)}console.log("Call colorbox for image %o.",d);colorboxWrapper(f)}}}})(jQuery);(function(a){colorboxLink=function(c,e,f){ColorboxLocal.colorboxGroupId=a(e).attr("class").match(COLORBOX_LINK_CLASS_PATTERN);if(ColorboxLocal.colorboxGroupId!==undefined&&ColorboxLocal.colorboxGroupId!==null){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[2]}else{ColorboxLocal.colorboxGroupId="nofollow"}var b=a(e);var d=b.attr("title");if(d!==undefined){ColorboxLocal.colorboxTitle=d}else{ColorboxLocal.colorboxTitle=""}if(f.match(COLORBOX_SUFFIX_PATTERN)){ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth}else{ColorboxLocal.colorboxMaxWidth=false;ColorboxLocal.colorboxMaxHeight=false;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxLinkHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxLinkWidth;if(f.match(COLORBOX_INTERNAL_LINK_PATTERN)){ColorboxLocal.colorboxInline=true}else{ColorboxLocal.colorboxIframe=true}}console.log("Call colorbox for link %o.",e);colorboxWrapper(e)}})(jQuery);(function(a){colorboxWrapper=function(b){a.each(ColorboxLocal,function(c,d){if(d==="false"){ColorboxLocal[c]=false}else{if(d==="true"){ColorboxLocal[c]=true}}});console.log("Apply colorbox to link %o with values %o",b,ColorboxLocal);a(b).colorbox({transition:ColorboxLocal.colorboxTransition,speed:parseInt(ColorboxLocal.colorboxSpeed),title:ColorboxLocal.colorboxTitle,rel:ColorboxLocal.colorboxGroupId,scalePhotos:ColorboxLocal.colorboxScalePhotos,scrolling:ColorboxLocal.colorboxScrolling,opacity:ColorboxLocal.colorboxOpacity,preloading:ColorboxLocal.colorboxPreloading,overlayClose:ColorboxLocal.colorboxOverlayClose,escKey:ColorboxLocal.colorboxEscKey,arrowKey:ColorboxLocal.colorboxArrowKey,loop:ColorboxLocal.colorboxLoop,current:ColorboxLocal.colorboxCurrent,previous:ColorboxLocal.colorboxPrevious,next:ColorboxLocal.colorboxNext,close:ColorboxLocal.colorboxClose,xhrError:ColorboxLocal.colorboxXhrError,imgError:ColorboxLocal.colorboxImgError,iframe:ColorboxLocal.colorboxIframe,inline:ColorboxLocal.colorboxInline,width:ColorboxLocal.colorboxWidth,height:ColorboxLocal.colorboxHeight,initialWidth:ColorboxLocal.colorboxInitialWidth,initialHeight:ColorboxLocal.colorboxInitialHeight,maxWidth:ColorboxLocal.colorboxMaxWidth,maxHeight:ColorboxLocal.colorboxMaxHeight,slideshow:ColorboxLocal.colorboxSlideshow,slideshowSpeed:parseInt(ColorboxLocal.colorboxSlideshowSpeed),slideshowAuto:ColorboxLocal.colorboxSlideshowAuto,slideshowStart:ColorboxLocal.colorboxSlideshowStart,slideshowStop:ColorboxLocal.colorboxSlideshowStop})}})(jQuery);(function(a){colorboxAddZoomOverlayToImages=function(c,d){var b=a('<span class="zoomHover" style="opacity: 0;"></span>');c.css("float",d.css("float"));c.append(b);c.addClass("zoomLink");c.hover(function(){b.stop().animate({opacity:0.8},300);d.stop().animate({opacity:0.6},300)},function(){b.stop().animate({opacity:0},300);d.stop().animate({opacity:1},300)})}})(jQuery);(function(a){getColorboxConfigDefaults=function(){return{colorboxInline:false,colorboxIframe:false,colorboxGroupId:"",colorboxTitle:"",colorboxWidth:false,colorboxHeight:false,colorboxMaxWidth:false,colorboxMaxHeight:false,colorboxSlideshow:false,colorboxSlideshowAuto:false,colorboxScalePhotos:false,colorboxPreloading:false,colorboxOverlayClose:false,colorboxLoop:false,colorboxEscKey:true,colorboxArrowKey:true,colorboxScrolling:false,colorboxOpacity:"0.85",colorboxTransition:"elastic",colorboxSpeed:"350",colorboxSlideshowSpeed:"2500",colorboxClose:"close",colorboxNext:"next",colorboxPrevious:"previous",colorboxSlideshowStart:"start slideshow",colorboxSlideshowStop:"stop slideshow",colorboxCurrent:"{current} of {total} images",colorboxXhrError:"This content failed to load.",colorboxImgError:"This image failed to load.",colorboxImageMaxWidth:false,colorboxImageMaxHeight:false,colorboxImageHeight:false,colorboxImageWidth:false,colorboxLinkHeight:false,colorboxLinkWidth:false,colorboxInitialHeight:100,colorboxInitialWidth:300,autoColorboxJavaScript:false,autoHideFlash:false,autoColorbox:false,autoColorboxGalleries:false,colorboxAddClassToLinks:false,useGoogleJQuery:false,addZoomOverlay:false}}})(jQuery);(function(a){printArray=function(h,g){var b="";if(!g){g=0}var f="";for(var c=0;c<g+1;c++){f+="    "}if(typeof(h)==="object"){for(var d in h){var e=h[d];if(typeof(e)==="object"){b+=f+"'"+d+"' ...\n";b+=printArray(e,g+1)}else{b+=f+"'"+d+"' = \""+e+'"\n'}}}else{b="===>"+h+"<===("+typeof(h)+")"}return b}})(jQuery);
  • jquery-colorbox/trunk/js/jquery-colorbox-wrapper.js

    r620549 r1301183  
    2424jQuery(document).ready(function() {
    2525
     26  console.group('jQuery Colorbox log messages');
    2627  //check if config JavaScript was successfully inserted. Load defaults otherwise.
    2728  if(typeof jQueryColorboxSettingsArray !== 'object') {
     
    4041  }
    4142  colorboxSelector();
     43  console.groupEnd();
    4244});
    4345
     
    5052  colorboxShowFlash = function() {
    5153    jQuery(document).bind('cbox_closed', function() {
     54      console.group('Showing flash objects');
    5255      var flashObjects = document.getElementsByTagName("object");
    5356      for (var i = 0; i < flashObjects.length; i++) {
     57        console.debug('Show object %o',flashObjects[i]);
    5458        flashObjects[i].style.visibility = "visible";
    5559      }
    5660      var flashEmbeds = document.getElementsByTagName("embed");
    5761      for (var j = 0; j < flashEmbeds.length; j++) {
     62        console.debug('Show embed %o',flashEmbeds[j]);
    5863        flashEmbeds[j].style.visibility = "visible";
    5964      }
     65      console.groupEnd();
    6066    });
    6167  };
     
    7278  colorboxHideFlash = function() {
    7379    jQuery(document).bind('cbox_open', function() {
     80      console.group('Hiding flash objects');
    7481      var flashObjects = document.getElementsByTagName("object");
    7582      for (var i = 0; i < flashObjects.length; i++) {
     83        console.debug('Hide object %o',flashObjects[i]);
    7684        flashObjects[i].style.visibility = "hidden";
    7785      }
    7886      var flashEmbeds = document.getElementsByTagName("embed");
    7987      for (var j = 0; j < flashEmbeds.length; j++) {
     88        console.debug('Hide embed %o',flashEmbeds[j]);
    8089        flashEmbeds[j].style.visibility = "hidden";
    8190      }
     91      console.groupEnd();
    8292    });
    8393  };
     
    93103(function(jQuery) {
    94104  colorboxAddClassToLinks = function() {
     105    console.group('Add colorbox-link class to links pointing to images');
    95106    jQuery("a:not(:contains(img))").each(function(index, link) {
    96107      var $link = jQuery(link);
     
    99110        var $linkHref = $link.attr("href");
    100111        if ($linkHref !== undefined && jQuery(link).attr("href").match(COLORBOX_SUFFIX_PATTERN)) {
     112          console.debug("Add colorbox-link class to %o.",$link);
    101113          $link.addClass('colorbox-link');
    102114        }
    103115      }
    104116    });
     117    console.groupEnd();
    105118  };
    106119})(jQuery);
     
    115128(function(jQuery) {
    116129  colorboxAddManualClass = function() {
     130    console.group('Add colorbox-manual class to images');
    117131    jQuery("img").each(function(index, image) {
    118132      var $img = jQuery(image);
    119133      var $imgClass = $img.attr("class");
    120134      if ($imgClass === undefined || !$imgClass.match('colorbox')) {
     135        console.debug('Add colorbox-manual class to image %o',$img);
    121136        $img.addClass('colorbox-manual');
    122137      }
    123138    });
     139    console.groupEnd();
    124140  };
    125141})(jQuery);
     
    134150(function(jQuery) {
    135151  colorboxSelector = function() {
    136 
     152    console.group('Find image links and apply colorbox effect.');
    137153    jQuery("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(index, link) {
     154      console.group("Found link %o.",link);
    138155      //create local copy of Colorbox array so that modifications can be made for every link
    139156      ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
     
    152169        //colorboxLink(index, link,$linkHref)
    153170      //}
    154     });
    155 
     171      console.groupEnd();
     172    });
     173    console.groupEnd();
     174
     175    console.group('Find links and apply colorbox effect.');
    156176    jQuery("a[class*=colorbox-link]").each(function(index, link) {
     177      console.group("Found link %o.",link);
    157178      //create local copy of Colorbox array so that modifications can be made for every link
    158179      ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
     
    162183        colorboxLink(index, link,$linkHref);
    163184      }
    164     });
     185      console.groupEnd();
     186    });
     187    console.groupEnd();
    165188  };
    166189})(jQuery);
     
    206229          colorboxAddZoomOverlayToImages(jQuery(link), $image);
    207230        }
    208 
     231        console.debug("Call colorbox for image %o.",$image);
    209232        colorboxWrapper(link);
    210233      }
     
    269292      }
    270293    }
    271 
     294    console.debug("Call colorbox for link %o.",link);
    272295    colorboxWrapper(link);
    273296  };
     
    295318    });
    296319
    297     //for debugging purposes: print current array to title attribute
    298 //    var currentArray;
    299 //    currentArray = '<!--';
    300 //    currentArray = currentArray + printArray(ColorboxLocal);
    301 //    currentArray = currentArray + '-->';
    302 //    ColorboxLocal.colorboxTitle += ColorboxLocal.colorboxTitle + currentArray;
     320    console.debug("Apply colorbox to link %o with values %o",link,ColorboxLocal);
    303321
    304322    //finally call Colorbox library
     
    380398(function (jQuery) {
    381399  colorboxAddZoomOverlayToImages = function ($link, $image) {
     400    console.debug("Add zoom hover to link %o",$link);
    382401    var $zoomHover = jQuery('<span class="zoomHover" style="opacity: 0;"></span>');
    383402
     
    465484
    466485// getColorboxConfigDefaults()
    467 
    468 /**
    469  * Print given array
    470  */
    471 (function (jQuery) {
    472   printArray = function(array, level) {
    473         var output = "";
    474         if (!level) {
    475           level = 0;
    476         }
    477 
    478         //The padding given at the beginning of the line.
    479         var padding = "";
    480         for (var j = 0; j < level + 1; j++) {
    481           padding += "    ";
    482         }
    483 
    484         if (typeof(array) === 'object') { //Array/Hashes/Objects
    485           for (var item in array) {
    486 
    487             var value = array[item];
    488 
    489             if (typeof(value) === 'object') { //If it is an array,
    490               output += padding + "'" + item + "' ...\n";
    491               output += printArray(value, level + 1);
    492             }
    493             else {
    494               output += padding + "'" + item + "' = \"" + value + "\"\n";
    495             }
    496           }
    497         }
    498         else { //Stings/Chars/Numbers etc.
    499           output = "===>" + array + "<===(" + typeof(array) + ")";
    500         }
    501 
    502         return output;
    503       };
    504 })(jQuery);
    505 
    506 // printArray()
Note: See TracChangeset for help on using the changeset viewer.