1(function ($) { 2 var window_width = window.innerWidth; 3 $(document).on('ready', function () { 4 initdesktopVideoMovements(); 5 initmobileVideoPopups(); 6 $('.featured_videos_wrap').outerHeight($('.video_player_wrap').outerHeight() + 23); 7 8 9 //resize 10 $(window).on('resize orientationchange', function () { 11 if (window_width != window.innerWidth) { 12 $('.featured_videos_wrap').outerHeight($('.video_player_wrap').outerHeight() + 23); 13 14 waitForFinalEvent(function () { 15 setTimeout(function () { 16 window_width = window.innerWidth; 17 initdesktopVideoMovements(); 18 initmobileVideoPopups(); 19 }, 500); 20 }, 300, "re-init or destroy swiper on video landing page resize"); 21 } 22 }); 23 }); 24 25 26 window.initmobileVideoPopups = function initmobileVideoPopups() { 27 $('#more_videos_section').on('click', '.vid', function (e) { 28 if (window.innerWidth < 768) { 29 var vidsrc = ''; 30 var vid_iframe = $(this).find('iframe'); 31 var vid_wrapper = $(this).find('.fluid-width-video-wrapper'); 32 if (vid_wrapper.length > 0) { 33 vidsrc = vid_wrapper; 34 } else { 35 vidsrc = vid_iframe; 36 } 37 var vidcode = $(this).find('.vid-code'); 38 var vidimage = $(this).find('.vid-graphic'); 39 setTimeout(function () { 40 $.magnificPopup.open({ 41 items: { 42 src: vidsrc 43 }, 44 type: 'inline', 45 midClick: true, 46 mainClass: 'mfp-fade video-popup', 47 removalDelay: 600, 48 closeBtnInside: false, 49 callbacks: { 50 open: function () { 51 $(vidimage).show(); 52 }, 53 close: function () { 54 // Reset video on close: 55 if (vidcode.length > 0) { 56 $(vidcode).empty(); 57 $(vidimage).fadeIn(); 58 } 59 } 60 } 61 }); 62 }, 300); 63 } 64 }); 65 66 } 67 68 function initdesktopVideoMovements() { 69 if ($(".featured_vids .vid_image").length > 0 && window.innerWidth >= 768) { 70 $(".featured_vids .vid_image").on('click', function () { 71 var clicked_id = $(this).closest('article').attr('id'); 72 clicked_id = '#' + clicked_id; 73 var target_id = $('.video_player_wrap.featured_vids article').attr('id'); 74 $(clicked_id).swap({ 75 target: target_id, // Mandatory. The ID of the element we want to swap with 76 opacity: "0.25", // Optional. If set will give the swapping elements a translucent effect while in motion 77 speed: 300, // Optional. The time taken in milliseconds for the animation to occur 78 callback: function () { // Optional. Callback function once the swap is complete 79 //changing out vid iframes and cover images 80 $('.video_pool .vid').each(function () { 81 var vidcode = $(this).find('.vid-code'); 82 var vidimage = $(this).find('.vid-graphic'); 83 if (vidcode.length > 0) { 84 $(vidcode).empty(); 85 $(vidimage).fadeIn(); 86 } 87 88 }); 89 } 90 }); 91 }); 92 } 93 } 94 95})(jQuery); 96 97
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.