1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/** 11 * NodeList.forEach polyfill for IE 12 * 13 * @see https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach 14 */ 15if (window.NodeList && !NodeList.prototype.forEach) { 16 NodeList.prototype.forEach = Array.prototype.forEach; 17} 18 19/** 20 * Custom Event polyfill for >= IE9 21 * 22 * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill 23 */ 24(function () { 25 if (typeof window.CustomEvent === "function") return false; 26 27 function CustomEvent(event, params) { 28 params = params || { bubbles: false, cancelable: false, detail: null }; 29 var evt = document.createEvent('CustomEvent'); 30 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); 31 return evt; 32 } 33 34 window.CustomEvent = CustomEvent; 35})(); 36 37(function ($) { 38 // Free version only support 1 video per page/ post. 39 var popup = document.querySelector('.wp-video-popup-wrapper'); 40 var speed = 200; 41 42 function init() { 43 if (!popup) return; 44 setupOpenActions(); 45 setupVideoHeight(); 46 setupCloseActions(); 47 } 48 49 function setupOpenActions() { 50 // Setup trigger for single popup. 51 setupOpenTriggers('.wp-video-popup'); 52 53 // Setup trigger for single popup (backward compatibility support). 54 setupOpenTriggers('.ryv-popup'); 55 } 56 57 function setupOpenTriggers(triggerSelector) { 58 var triggers = document.querySelectorAll(triggerSelector); 59 if (!triggers) return; 60 61 triggers.forEach(function (trigger) { 62 trigger.addEventListener('click', function (e) { 63 e.preventDefault(); 64 openPopup(); 65 }); 66 }); 67 } 68 69 function setupCloseActions() { 70 // Close on click. 71 popup.addEventListener('click', function (e) { 72 if (e.target == this || e.target.classList.contains('wp-video-popup-close')) closePopup(); 73 }); 74 75 // Close on escape. 76 document.addEventListener('keyup', function (e) { 77 if (e.key !== 'Escape' && e.key !== 'Esc' && e.keyCode !== 27) return; 78 if ($(popup).is(':visible')) closePopup(); 79 }); 80 } 81 82 function setupVideoHeight() { 83 window.addEventListener('resize', function () { 84 var video = document.querySelector('.wp-video-popup-video.is-resizable'); 85 if (video) $(video).height($(video).width() * 0.5625); 86 }); 87 } 88 89 function openPopup() { 90 var video = popup.querySelector('.wp-video-popup-video'); 91 92 document.body.insertBefore(popup, document.body.firstChild); 93 94 $(popup).css({ display: 'flex' }).stop().animate({ 95 opacity: 1 96 }, speed); 97 98 $(video).stop().fadeIn(speed); 99 video.src = video.dataset.wpVideoPopupUrl; 100 101 window.dispatchEvent(new Event('resize')); 102 } 103 104 function closePopup() { 105 var video = popup.querySelector('.wp-video-popup-video'); 106 107 $(popup).stop().animate({ 108 opacity: 0 109 }, speed, function () { 110 $(popup).css({ display: 'none' }); 111 }); 112 113 $(video).stop().fadeOut(speed, function () { 114 video.src = ''; 115 }); 116 } 117
118 init(); 119})(jQuery); 120}
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.