1'use strict'; 2 3(function(Drupal, $) { 4 5 Drupal.behaviors.wistiaLazyLoad = { 6 attach: function(context, settings) { 7 8 $(once('thumbnail', ".wistia_embed", context)).each(function() { 9 10 let wistiaElement = $(this); 11 if (!wistiaElement.hasClass('wistia_nothumbnail')) { 12 13 $.get( 14 "https://fast.wistia.net/oembed?url=http://home.wistia.com/medias/" + wistiaElement.data("id") + "?embedType=async_popover&videoWidth=558", 15 function (data) { 16 17 wistiaElement.find('.wistia_thumbnail').attr("src", data.thumbnail_url); 18 } 19 ); 20 } 21 }); 22 23 $(once('lazyload', ".wistia_embed", context)).on('click', function() { 24 25 let wistiaElement = $(this); 26 if (!wistiaElement.hasClass('lazyload-init')) { 27 28 wistiaElement.find('.wistia-play-button').hide(); 29 30 let videoId = wistiaElement.data("id"); 31 $.getScript('https://fast.wistia.com/assets/external/E-v1.js', function() { 32 33 window.wistiaInit = function(W) { 34 35 setTimeout(function() { 36 37 W.api("wistia-" + videoId).play(); 38 }, 100); 39 }; 40 wistiaElement.addClass('lazyload-init'); 41 }); 42 } 43 }); 44 } 45 }; 46})(Drupal, 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.