1(function (window, document) { 2 /** 3 * ã¦ã¼ã¶ã¼ã¤ãã³ãçºç«ã«ããé å»¶èªã¿è¾¼ã¿ 4 */ 5 function lazyLoadByUserEvent() 6 { 7 // ã¦ã¼ã¶ã¼ã¤ãã³ãã®è¨å®è§£é¤ 8 USER_EVENTS.forEach(function (userEvent) { 9 window.removeEventListener(userEvent, lazyLoadByUserEvent) 10 }); 11 // twitterã¹ã¯ãªããçæ 12 makeScriptElement('https://platform.twitter.com/widgets.js'); 13 // facebookã¹ã¯ãªããçæ 14 makeScriptElement('https://connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.5'); 15 } 16 17 /** 18 * ã¹ã¯ãªããè¦ç´ ãçæ 19 * @param src 20 */ 21 function makeScriptElement(src) 22 { 23 let element = document.createElement('script'); 24 element.type = 'text/javascript'; 25 element.async = true; 26 element.src = src; 27 28 let targetPositionElement = document.getElementsByTagName('script')[0]; 29 targetPositionElement.parentNode.insertBefore(element, targetPositionElement); 30 } 31 32 /** 33 * ã¦ã¼ã¶ã¼ã¤ãã³ãä¸è¦§ 34 * @type {*[]} 35 */ 36 const USER_EVENTS = [ 37 'scroll', 38 'mousemove', 39 'mousedown', 40 'touchstart', 41 'keydown' 42 ]; 43 44 // ã¦ã¼ã¶ã¼ã¤ãã³ãè¨å® 45 USER_EVENTS.forEach(function (userEvent) { 46 window.addEventListener(userEvent, lazyLoadByUserEvent) 47 }); 48})(window, document);
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.