1jQuery(document).ready(function ($) { 2 const $body = $('body'), 3 $copyDirectLink = $('.copy-direct-link'); 4 /** 5 * Scroll to title of ul element 6 * if the url contains this title 7 */ 8 if ($body.hasClass('page-template-page-forms')) { 9 let hash = window.location.hash; 10 if (hash.length > 1 && hash !== '#!') { 11 hash = hash.replace('#', ''); 12 let $match = $('#' + hash + ''); 13 14 if ($match.length > 0) { 15 $match.css({ 16 borderLeft: '5px solid #4da5e4', 17 }); 18 19 $('html, body').animate({ 20 scrollTop: $match.offset().top - 70, 21 }, 750); 22 } 23 } 24 } 25 26 if ($copyDirectLink.length > 0) { 27 $copyDirectLink.on('click', function (e) { 28 let $this = $(this); 29 let $parent = $this.parent('li'); 30 let anchor = $parent.attr('id'); 31 window.location.hash = '!'; 32 let url = window.location.href.replace('!', ''); 33 url = url += anchor; 34 copyToClipboard(url, $this); 35 }); 36 } 37 38 function copyToClipboard(val, blink) { 39 const $temp = $('<input>'); 40 $('body').append($temp); 41 $temp.val(val).select(); 42 document.execCommand('copy'); 43 $temp.remove(); 44 45 let confirm = blink.find('span'); 46 confirm.css('display', 'inline-flex'); 47 48 setTimeout(function () { 49 confirm.css('display', 'none'); 50 }, 1000); 51 } 52});
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.