Changeset 1301183
- Timestamp:
- 12/05/2015 09:46:08 PM (10 years ago)
- Location:
- jquery-colorbox/trunk/js
- Files:
-
- 2 edited
-
jquery-colorbox-wrapper-min.js (modified) (1 diff)
-
jquery-colorbox-wrapper.js (modified) (15 diffs)
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);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(){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 24 24 jQuery(document).ready(function() { 25 25 26 console.group('jQuery Colorbox log messages'); 26 27 //check if config JavaScript was successfully inserted. Load defaults otherwise. 27 28 if(typeof jQueryColorboxSettingsArray !== 'object') { … … 40 41 } 41 42 colorboxSelector(); 43 console.groupEnd(); 42 44 }); 43 45 … … 50 52 colorboxShowFlash = function() { 51 53 jQuery(document).bind('cbox_closed', function() { 54 console.group('Showing flash objects'); 52 55 var flashObjects = document.getElementsByTagName("object"); 53 56 for (var i = 0; i < flashObjects.length; i++) { 57 console.debug('Show object %o',flashObjects[i]); 54 58 flashObjects[i].style.visibility = "visible"; 55 59 } 56 60 var flashEmbeds = document.getElementsByTagName("embed"); 57 61 for (var j = 0; j < flashEmbeds.length; j++) { 62 console.debug('Show embed %o',flashEmbeds[j]); 58 63 flashEmbeds[j].style.visibility = "visible"; 59 64 } 65 console.groupEnd(); 60 66 }); 61 67 }; … … 72 78 colorboxHideFlash = function() { 73 79 jQuery(document).bind('cbox_open', function() { 80 console.group('Hiding flash objects'); 74 81 var flashObjects = document.getElementsByTagName("object"); 75 82 for (var i = 0; i < flashObjects.length; i++) { 83 console.debug('Hide object %o',flashObjects[i]); 76 84 flashObjects[i].style.visibility = "hidden"; 77 85 } 78 86 var flashEmbeds = document.getElementsByTagName("embed"); 79 87 for (var j = 0; j < flashEmbeds.length; j++) { 88 console.debug('Hide embed %o',flashEmbeds[j]); 80 89 flashEmbeds[j].style.visibility = "hidden"; 81 90 } 91 console.groupEnd(); 82 92 }); 83 93 }; … … 93 103 (function(jQuery) { 94 104 colorboxAddClassToLinks = function() { 105 console.group('Add colorbox-link class to links pointing to images'); 95 106 jQuery("a:not(:contains(img))").each(function(index, link) { 96 107 var $link = jQuery(link); … … 99 110 var $linkHref = $link.attr("href"); 100 111 if ($linkHref !== undefined && jQuery(link).attr("href").match(COLORBOX_SUFFIX_PATTERN)) { 112 console.debug("Add colorbox-link class to %o.",$link); 101 113 $link.addClass('colorbox-link'); 102 114 } 103 115 } 104 116 }); 117 console.groupEnd(); 105 118 }; 106 119 })(jQuery); … … 115 128 (function(jQuery) { 116 129 colorboxAddManualClass = function() { 130 console.group('Add colorbox-manual class to images'); 117 131 jQuery("img").each(function(index, image) { 118 132 var $img = jQuery(image); 119 133 var $imgClass = $img.attr("class"); 120 134 if ($imgClass === undefined || !$imgClass.match('colorbox')) { 135 console.debug('Add colorbox-manual class to image %o',$img); 121 136 $img.addClass('colorbox-manual'); 122 137 } 123 138 }); 139 console.groupEnd(); 124 140 }; 125 141 })(jQuery); … … 134 150 (function(jQuery) { 135 151 colorboxSelector = function() { 136 152 console.group('Find image links and apply colorbox effect.'); 137 153 jQuery("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(index, link) { 154 console.group("Found link %o.",link); 138 155 //create local copy of Colorbox array so that modifications can be made for every link 139 156 ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray); … … 152 169 //colorboxLink(index, link,$linkHref) 153 170 //} 154 }); 155 171 console.groupEnd(); 172 }); 173 console.groupEnd(); 174 175 console.group('Find links and apply colorbox effect.'); 156 176 jQuery("a[class*=colorbox-link]").each(function(index, link) { 177 console.group("Found link %o.",link); 157 178 //create local copy of Colorbox array so that modifications can be made for every link 158 179 ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray); … … 162 183 colorboxLink(index, link,$linkHref); 163 184 } 164 }); 185 console.groupEnd(); 186 }); 187 console.groupEnd(); 165 188 }; 166 189 })(jQuery); … … 206 229 colorboxAddZoomOverlayToImages(jQuery(link), $image); 207 230 } 208 231 console.debug("Call colorbox for image %o.",$image); 209 232 colorboxWrapper(link); 210 233 } … … 269 292 } 270 293 } 271 294 console.debug("Call colorbox for link %o.",link); 272 295 colorboxWrapper(link); 273 296 }; … … 295 318 }); 296 319 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); 303 321 304 322 //finally call Colorbox library … … 380 398 (function (jQuery) { 381 399 colorboxAddZoomOverlayToImages = function ($link, $image) { 400 console.debug("Add zoom hover to link %o",$link); 382 401 var $zoomHover = jQuery('<span class="zoomHover" style="opacity: 0;"></span>'); 383 402 … … 465 484 466 485 // getColorboxConfigDefaults() 467 468 /**469 * Print given array470 */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/Objects485 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.