https://sou.edu/wp-content/themes/enfold/js/avia-snippet-lightbox.js?ver=6.0.9-b-modified-1739850206
1(function($) 2{ 3 "use strict"; 4 5 // ------------------------------------------------------------------------------------------- 6 // Ligthbox activation 7 // ------------------------------------------------------------------------------------------- 8 9 $.avia_utilities = $.avia_utilities || {}; 10 11 $.avia_utilities.av_popup = { 12 type: 'image', 13 mainClass: 'avia-popup mfp-zoom-in', 14 tLoading: '', 15 tClose: '', 16 removalDelay: 300, //delay removal by X to allow out-animation 17 closeBtnInside: true, 18 closeOnContentClick: false, 19 midClick: true, 20 autoFocusLast: false, // false, prevents issues with accordion slider 21 fixedContentPos: $('html').hasClass('av-default-lightbox-no-scroll'), // allows scrolling when lightbox is open but also removes any jumping because of scrollbar removal 22 iframe: { 23 patterns: { 24 youtube: { 25 index: 'youtube.com/watch', 26 id: function(url) { 27 let m = url.match(/[\\?\\&]v=([^\\?\\&]+)/), 28 id, 29 params; 30 31 if( ! m || ! m[1] ) 32 { 33 return null; 34 } 35 36 id = m[1]; 37 38 params = url.split('/watch'); 39 params = params[1]; 40 41 return id + params; 42 }, 43 src: '//www.youtube.com/embed/%id%' 44 }, 45 youtube_shorts: { 46 index: 'youtube.com/shorts', 47 id: function(url) { 48 let m = url.match(/(?:youtube\.com\/shorts\/)([a-zA-Z0-9_-]*)/), 49 id, 50 params; 51 52 if( ! m || ! m[1] ) 53 { 54 return null; 55 } 56 57 id = m[1]; 58 59 params = url.split('/shorts'); 60 params = params[1]; 61 62 return id + params; 63 }, 64 src: '//www.youtube.com/embed/%id%' 65 }, 66 vimeo: { 67 index: 'vimeo.com/', 68 id: function(url) { 69 let m = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})\/(\w{6,11})[?]?.*/), 70 params, 71 vid; 72 73 m = m ? m : url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/); 74 75 if( ! m || ! m[5] ) 76 { 77 return null; 78 } 79 80 vid = m[5]; 81 82 params = url.split('?'); 83 params = params[1] ? "?" + params[1] : ""; 84 85 if(m[6]) 86 { 87 vid = vid + (params ? params + "&h=" : "?h=") + m[6]; 88 } else { 89 vid = vid + params; 90 } 91 92 return vid; 93 }, 94 src: '//player.vimeo.com/video/%id%' 95 } 96 } 97 }, 98 image: { 99 titleSrc: function( item ) 100 { 101 var title = item.el.attr('title'); 102 if( ! title ) 103 { 104 title = item.el.find('img').attr('title'); 105 } 106 if( ! title ) 107 { 108 title = item.el.parent().next( '.wp-caption-text' ).html(); 109 } 110 if( typeof title != "undefined" ) 111 { 112 return title; 113 } 114 115 if( ! $( 'body' ).hasClass( 'avia-mfp-show-alt-text' ) ) 116 { 117 return ''; 118 } 119 120 // @since 4.7.6.2 check for alt attribute 121 var alt = item.el.attr('alt'); 122 if( typeof alt != "undefined" ) 123 { 124 return alt; 125 } 126 127 alt = item.el.find('img').attr('alt'); 128 if( typeof alt != "undefined" ) 129 { 130 return alt; 131 } 132 133 return ''; 134 } 135 }, 136 137 gallery: { 138 // delegate: options.autolinkElements, 139 tPrev: '', 140 tNext: '', 141 tCounter: '%curr% / %total%', 142 enabled: true, 143 preload: [1,1] // Will preload 1 - before current, and 1 after the current image 144 }, 145 146 callbacks: 147 { 148 beforeOpen: function() 149 { 150 //add custom css class for different styling 151 if( this.st.el && this.st.el.data('fixed-content') ) 152 { 153 this.fixedContentPos = true; 154 } 155 156 let elementCustomClass = ''; 157 158 if( this.st.el && this.st.el.data('custom_class') ) 159 { 160 elementCustomClass = this.st.el.data('custom_class').trim(); 161 } 162 else if( this.st.el ) 163 { 164 let element = $( this.st.el ), 165 href = element.attr( 'href' ); 166 167 if( ( href.indexOf( 'youtube.com' ) >= 0 ) && ( href.indexOf( '/shorts/' ) >= 0 ) ) 168 { 169 elementCustomClass = 'avia-mfp-is-video avia-mfp-video-9-16'; 170 } 171 } 172 173 if( elementCustomClass ) 174 { 175 this.st.mainClass += ' ' + elementCustomClass; 176 } 177 }, 178 179 open: function() 180 { 181 //overwrite default prev + next function. Add timeout for crossfade animation 182 $.magnificPopup.instance.next = function() 183 { 184 var self = this; 185 self.wrap.removeClass('mfp-image-loaded'); 186 setTimeout(function() { $.magnificPopup.proto.next.call(self); }, 120); 187 }; 188 189 $.magnificPopup.instance.prev = function() 190 { 191 var self = this; 192 self.wrap.removeClass('mfp-image-loaded'); 193 setTimeout(function() { $.magnificPopup.proto.prev.call(self); }, 120); 194 }; 195 196 //add custom css class for different styling 197 if( this.st.el && this.st.el.data('av-extra-class') ) 198 { 199 this.wrap.addClass( this.currItem.el.data('av-extra-class') ); 200 } 201 202 this.wrap.avia_swipe_trigger( {prev:'.mfp-arrow-left', next:'.mfp-arrow-right'} ); 203 }, 204 205 markupParse: function( template, values, item ) 206 { 207 if( typeof values.img_replaceWith == 'undefined' || typeof values.img_replaceWith.length == 'undefined' || values.img_replaceWith.length == 0 ) 208 { 209 return; 210 } 211 212 var img = $( values.img_replaceWith[0] ); 213 214 if( typeof img.attr( 'alt' ) != 'undefined' ) 215 { 216 return; 217 } 218 219 var alt = item.el.attr( 'alt' ); 220 if( typeof alt == "undefined" ) 221 { 222 alt = item.el.find('img').attr('alt'); 223 } 224 225 if( typeof alt != "undefined" ) 226 { 227 img.attr( 'alt', alt ); 228 } 229 230 return; 231 }, 232 233 imageLoadComplete: function() 234 { 235 var self = this; 236 setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16); 237 }, 238 239 change: function() 240 { 241 if( this.currItem.el ) 242 { 243 var current = this.currItem.el; 244 245 this.content.find( '.av-extra-modal-content, .av-extra-modal-markup' ).remove(); 246 247 if( current.data('av-extra-content') ) 248 { 249 var extra = current.data('av-extra-content'); 250 this.content.append( "<div class='av-extra-modal-content'>" + extra + "</div>" ); 251 } 252 253 if( current.data('av-extra-markup') ) 254 { 255 var markup = current.data('av-extra-markup'); 256 this.wrap.append( "<div class='av-extra-modal-markup'>" + markup + "</div>" ); 257 } 258 } 259 } 260 } 261 }; 262 263 $.fn.avia_activate_lightbox = function(variables) 264 { 265 266 var defaults = { 267 groups : ['.avia-slideshow', '.avia-gallery', '.av-horizontal-gallery', '.av-instagram-pics', '.portfolio-preview-image', '.portfolio-preview-content', '.isotope', '.post-entry', '.sidebar', '#main', '.main_menu', '.woocommerce-product-gallery'], 268 autolinkElements: 'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=webp], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="youtube.com/shorts"] , a[href*="screenr.com"], a[href*="iframe=true"]', 269 videoElements : 'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="youtube.com/shorts"] , a[href*="screenr.com"], a[href*="iframe=true"]',
270 exclude : '.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"], .pagination a' 271 }, 272 273 options = $.extend({}, defaults, variables), 274 275 active = ! $('html').is('.av-custom-lightbox'); 276 277 if( ! active) 278 { 279 return this; 280 } 281 282 return this.each(function() 283 { 284 var container = $(this), 285 videos = $(options.videoElements, this).not(options.exclude).addClass('mfp-iframe'), /*necessary class for the correct lightbox markup*/ 286 ajaxed = ! container.is('body') && ! container.is('.ajax_slide'); 287 for( var i = 0; i < options.groups.length; i++ ) 288 { 289 container.find(options.groups[i]).each(function() 290 { 291 var links = $(options.autolinkElements, this); 292 293 if( ajaxed ) 294 { 295 links.removeClass('lightbox-added'); 296 } 297 298 links.not(options.exclude).addClass('lightbox-added').magnificPopup($.avia_utilities.av_popup); 299 }); 300 } 301 302 }); 303 }; 304})(jQuery);
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.