1(function ($) { 2 "use strict"; 3 4 jQuery(document).ready(function () { // READY EVENT 5 "use strict"; 6 // Selectors to trigger PopUps comma separated 7 let videoLink = jQuery("#yt--popper, #yt--popper-extra, .yt--popper, .yt--popper-extra"); 8 9 videoLink.magnificPopup({ 10 type: 'iframe', 11 iframe: extendMagnificIframe() 12 }); 13 14 /* FUNCTION: Magnific Extend - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 15 function extendMagnificIframe() { 16 17 var $start = 0; 18 var $iframe = { 19 markup: '<div class="mfp-iframe-scaler">' + 20 '<div class="mfp-close"></div>' + 21 '<iframe class="mfp-iframe" frameborder="0" allow="autoplay" allowfullscreen></iframe>' + 22 '</div>' + 23 '<div class="mfp-bottom-bar">' + 24 '<div class="mfp-title"></div>' + 25 '</div>', 26 patterns: { 27 youtube: { 28 index: 'youtu', 29 id: function (url) { 30 31 var m = url.match(/^.*(?:youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#\&\?]*).*/); 32 if (!m || !m[1]) return null; 33 34 if (url.indexOf('t=') != -1) { 35 36 var $split = url.split('t='); 37 var hms = $split[1].replace('h', ':').replace('m', ':').replace('s', ''); 38 var a = hms.split(':'); 39 40 if (a.length == 1) { 41 42 $start = a[0]; 43 44 } else if (a.length == 2) { 45 46 $start = (+a[0]) * 60 + (+a[1]); 47 48 } else if (a.length == 3) { 49 50 $start = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); 51 52 } 53 } 54 55 var suffix = '?autoplay=1&rel=0'; 56 57 if ($start > 0) { 58 59 suffix = '?start=' + $start + '&autoplay=1&rel=0'; 60 } 61 62 return m[1] + suffix; 63 }, 64 src: 'https://www.youtube.com/embed/%id%?autoplay=1' 65 }, 66 vimeo: { 67 index: 'vimeo.com/', 68 id: function (url) { 69 var m = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/); 70 if (!m || !m[5]) return null; 71 return m[5]; 72 }, 73 src: '//player.vimeo.com/video/%id%?autoplay=1' 74 } 75 } 76 }; 77 78 return $iframe; 79 80 } 81 82 }); // END READY 83 84 85})(jQuery); // END SCRIPT
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.