1jQuery(document).ready(function () { 2 if (lightbox_type == 'old_type') { 3 4 var img = jQuery('a').filter(function () { 5 6 var href = jQuery(this).attr('href'); 7 if (typeof href !== 'undefined') { 8 href = href.toLowerCase(); 9 return href.substr(-4) == '.jpg' || href.substr(-5) == '.jpeg' || href.substr(-4) == '.png' || href.substr(-4) == '.gif'; 10 } 11 }); 12 13 img.addClass('group1'); 14 15 /***<select case-insensitive a tags>***/ 16 17 jQuery("body a[href$='.jpg'], body a[href$='.jpeg'], body a[href$='.png'], body a[href$='.gif']").addClass('group1'); 18 jQuery("body a[class*='catalog_group']").removeClass('group1'); 19 jQuery("body a[class*='catalog_slider_group']").removeClass('group1'); 20 jQuery("body a[class*='cboxElement']").removeClass('group1'); 21 22 jQuery('a[href*="youtube.com"],a[href*="youtu.bebe"]').not('a[href*="/channel/"]').not('a[href*="/user/"]').not('.huge_it_gallery_item').not('.huge_it_videogallery_item').not('.huge_it_portfolio_item').each(function () { 23 24 jQuery(this).addClass('youtube').addClass('group1'); 25 var url = jQuery(this).attr('href'); 26 var videoid = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/); 27 if (videoid) { 28 jQuery(this).attr('href', 'https://www.youtube.com/embed/' + videoid[1]); 29 } 30 }); 31 32 jQuery('a[href*="vimeo.com"]').not('a[href$="vimeo.com"]').not('a[href*="/channels/"]').not('.huge_it_gallery_item').not('.huge_it_videogallery_item').each(function () { 33 var href = jQuery(this).attr("href").split("/"); 34 if (Number(href[href.length - 1]) == Number(href[href.length - 1])) { 35 jQuery(this).addClass('vimeo').addClass('group1'); 36 var vimeourl = jQuery(this).attr('href'); 37 var vimeoid = vimeourl.substring(vimeourl.lastIndexOf("/") + 1, vimeourl.length); 38 jQuery(this).attr('href', 'http://player.vimeo.com/video/' + vimeoid); 39 } 40 }); 41 42 jQuery(".group1").colorbox({rel: 'group1'}); 43 jQuery(".group2").colorbox({rel: 'group2', transition: "fade"}); 44 jQuery(".group3").colorbox({rel: 'group3', transition: "none", width: "75%", height: "75%"}); 45 jQuery(".group4").colorbox({rel: 'group4', slideshow: true}); 46 jQuery(".ajax").colorbox(); 47 jQuery("a.youtube").colorbox({iframe: true, innerWidth: 640, innerHeight: 390}); 48 jQuery("a.vimeo").colorbox({iframe: true, innerWidth: 500, innerHeight: 409}); 49 jQuery(".iframe").colorbox({iframe: true, width: "80%", height: "80%"}); 50 jQuery(".inline").colorbox({inline: true, width: "50%"}); 51 jQuery(".callbacks").colorbox({ 52 onOpen: function () { 53 alert('onOpen: colorbox is about to open'); 54 }, 55 onLoad: function () { 56 alert('onLoad: colorbox has started to load the targeted content'); 57 }, 58 onComplete: function () { 59 alert('onComplete: colorbox has displayed the loaded content'); 60 }, 61 onCleanup: function () { 62 alert('onCleanup: colorbox has begun the close process'); 63 }, 64 onClosed: function () { 65 alert('onClosed: colorbox has completely closed'); 66 } 67 }); 68 69 jQuery('.non-retina').colorbox({rel: 'group5', transition: 'none'}); 70 jQuery('.retina').colorbox({rel: 'group5', transition: 'none', retinaImage: true, retinaUrl: true}); 71 } 72 else if (lightbox_type == 'new_type'){ 73 var img = jQuery('a').filter(function () { 74 75 var href = jQuery(this).attr('href'); 76 if (typeof href !== 'undefined') { 77 href = href.toLowerCase(); 78 return href.substr(-4) == '.jpg' || href.substr(-5) == '.jpeg' || href.substr(-4) == '.png' || href.substr(-4) == '.gif'; 79 } 80 }); 81 82 jQuery('a[href*="youtube.com"],a[href*="youtu.bebe"]').not('a[href*="/channel/"]').not('a[href*="/user/"]').not('.huge_it_gallery_item').not('.huge_it_videogallery_item').not('.huge_it_portfolio_item').each(function () { 83 jQuery(this).addClass('youtube').addClass('responsive_lightbox'); 84 var url = jQuery(this).attr('href'); 85 var videoid = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/); 86 if (videoid) { 87 jQuery(this).attr('href', 'https://www.youtube.com/embed/' + videoid[1]); 88 } 89 }); 90 91 jQuery('a[href*="vimeo.com"]').not('a[href$="vimeo.com"]').not('a[href*="/channels/"]').not('.huge_it_gallery_item').not('.huge_it_videogallery_item').each(function () { 92 var href = jQuery(this).attr("href").split("/"); 93 if (Number(href[href.length - 1]) == Number(href[href.length - 1])) { 94 jQuery(this).addClass('vimeo').addClass('responsive_lightbox'); 95 /*var vimeourl = jQuery(this).attr('href'); 96 var vimeoid = vimeourl.substring(vimeourl.lastIndexOf("/") + 1, vimeourl.length); 97 jQuery(this).attr('href', 'http://player.vimeo.com/video/' + vimeoid);*/ 98 } 99 }); 100 101 jQuery('a[href*="dailymotion.com"]').each(function () { 102 jQuery(this).addClass('dailymotion').addClass('responsive_lightbox'); 103 }); 104 105 img.removeClass('cboxElement').addClass('responsive_lightbox'); 106 107 jQuery("body a[href$='.jpg'], body a[href$='.jpeg'], body a[href$='.png'], body a[href$='.gif']").addClass('responsive_lightbox'); 108 // solve conflict with Portfolio Gallery 109 jQuery('.portfolio-gallery-content a').removeClass('responsive_lightbox'); 110 jQuery('.huge_it_portfolio_popup_list a').removeClass('responsive_lightbox'); 111 // solve conflict with Gallery 112 jQuery('.gallery-img-content a').removeClass('responsive_lightbox'); 113 // solve conflict with Gallery Video 114 jQuery('.gallery-video-content a').removeClass('responsive_lightbox'); 115 // solve conflict with Catalog 116 jQuery('.huge_it_catalog_container a').removeClass('responsive_lightbox'); 117 jQuery('section[id^="huge_it_catalog_content_"] a, div[id^="main-slider_"] a').removeClass('responsive_lightbox'); 118 // solve conflict with Soliloquy Carousel 119 jQuery('.soliloquy-item a').removeClass('responsive_lightbox'); 120 121 } 122}); 123 124jQuery(window).load(function(){ 125 var urls = []; 126 jQuery("body a[href$='.jpg'] > img, body a[href$='.jpeg'] > img, body a[href$='.png'] > img, body a[href$='.gif'] > img, body a[href*='www.youtube.com'] > img, body a[href*='vimeo.com'] > img").each(function(){ 127 urls.push(jQuery(this).attr('src')); 128 });
129 130 var data = { 131 action: 'lightbox_description', 132 urls: urls 133 }; 134 135 jQuery.post(ajaxUrl, data, function (response) { 136 if(response) { 137 response = JSON.parse(response); 138 for(var i = 0; i < jQuery("a.responsive_lightbox").length; i++){ 139 jQuery("a.responsive_lightbox").eq(i).find('img').attr('data-description', response[i]); 140 } 141 } 142 }); 143 144 jQuery('.responsive_lightbox').lightbox(); 145});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.