1// Custom scripts file 2 3(function ($) { 4 5 'use strict'; 6 7 // Prevent people from copy-pasting on unpublished node pages. 8 $('body.node-unpublished').bind('copy paste cut drag drop', function (e) { 9 e.preventDefault(); 10 }); 11 12 // make download/external links open in new tab 13 $('.field--style-download-link,.field--style-external-link').find('.field__item a').each(function(){ 14 $(this).attr('target','_blank'); 15 }); 16 17 // add class for video styling. see _embedded-entity.scss 18 $('.embedded-entity').each(function(){ 19 if ($(this).find('.video-embed-field-responsive-video').length > 0) { 20 $(this).addClass('embedded-entity--video'); 21 } 22 }); 23 24 // Generic function that runs on window resize. 25 function resizeStuff() { 26 // Add a helper class for view tables when horizontal scrolling is needed. 27 $('.view--table-scroll').each(function() { 28 if ($(this).find('table').width() > $(this).width()) { 29 $(this).addClass('scrollable'); 30 } else { 31 $(this).removeClass('scrollable'); 32 } 33 }); 34 } 35 36 // Runs function once on window resize. 37 var TO = false; 38 $(window).resize(function () { 39 if (TO !== false) { 40 clearTimeout(TO); 41 } 42 43 // 200 is time in miliseconds. 44 TO = setTimeout(resizeStuff, 200); 45 }).resize(); 46 47 48})(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.