1document.addEventListener('DOMContentLoaded', function () { 2 3// ç»é¢å¹ 360px æªæºã¯ JS ã§ viewport ãæ¸ãæãã 4 !(function () { 5 const viewport = document.querySelector('meta[name="viewport"]'); 6 function switchViewport() { 7 const value = 8 window.outerWidth > 360 9 ? 'width=device-width,initial-scale=1,viewport-fit=cover' 10 : 'width=360'; 11 if (viewport.getAttribute('content') !== value) { 12 viewport.setAttribute('content', value); 13 } 14 } 15 addEventListener('resize', switchViewport, false); 16 switchViewport(); 17 })(); 18 19// Twemoji 20 twemoji.parse(document.body); 21 22// ã¹ã¯ãã¼ã«ï¼ä¸ä¸ç§»åãã¿ã³ãã§ã¼ãã¤ã³ã¢ã¦ãã»ã°ãã¼ãã«ããclassä»å 23 $(function() { 24 const n = $('.scroll_btn'); 25 const g = $('.global_nav'); 26 n.hide(); 27 $(window).on('scroll', function() { 28 const scrollTop = $(this).scrollTop(); 29 if (scrollTop > 300) { 30 n.fadeIn(); 31 } else { 32 n.fadeOut(); 33 } 34 if (scrollTop > 120) { 35 g.addClass("move"); 36 } else { 37 g.removeClass("move"); 38 } 39 const docHeight = $(document).innerHeight(); 40 const windowHeight = $(window).innerHeight(); 41 const pageBottom = docHeight - windowHeight; 42 if (pageBottom <= scrollTop) { 43 n.fadeOut(); 44 } 45 }); 46 }); 47 48// update_list ticker 49 const items = document.querySelectorAll('.update_list li'); 50 if (items.length > 0) { 51 let currentIndex = 0; 52 function showNextItem() { 53 // ãã§ã¼ãã¢ã¦ããéå§ 54 items[currentIndex].classList.add('fade-out'); 55 // 次ã®ã¤ã³ããã¯ã¹ãè¨ç® 56 const nextIndex = (currentIndex + 1) % items.length; 57 // 次ã®é ç®ã表示ããåã«ãã§ã¼ãã¢ã¦ããçµããã®ãå¾ ã¤ 58 setTimeout(() => { 59 items[currentIndex].classList.remove('active', 'fade-out'); 60 items[nextIndex].classList.add('active'); 61 currentIndex = nextIndex; 62 }, 1000); // ãã§ã¼ãã¢ã¦ãã®æéï¼1ç§ï¼ã«åããã 63 } 64 // æåã®é ç®ãã¢ã¯ãã£ãã« 65 items[currentIndex].classList.add('active'); 66 // ã¤ã³ã¿ã¼ãã«ãè¨å® 67 setInterval(showNextItem, 5000); 68 } 69 70// .twitteråãè¾¼ã¿ããã¨ãã ããã¤ç¨ã¹ã¯ãªããåºå 71 if (document.querySelector('.twitter-tweet')) { 72 const script = document.createElement('script'); 73 script.src = "https://platform.twitter.com/widgets.js"; 74 script.async = true; 75 // bodyã®æå¾ã«è¿½å 76 document.body.appendChild(script); 77 } 78 79}); 80 81// ãã¼ã¸ç§»åæ¯ã«ããã¡ãã¥ã¼ã®ãã§ãã¯ããªã»ãã 82window.addEventListener('pageshow', function() { 83 document.getElementById('for_global_nav').checked = false; 84}); 85 86$(document).ready(function() { 87// ãã¿ãã¬ãã¿ã³ 88 if($('.hidearea').length){ 89 $('.hidearea').hidearea({ 90 view: '表示ãã', 91 color: '#000000', 92 speed: 'normal', 93 close: true 94 }); 95 }; 96// åé¤ç¢ºèª 97 $('a.delete').click(function() { 98 return confirm('æ¬å½ã«åé¤ãã¦ãããããã§ããï¼'); 99 }); 100 $('form.delete').submit(function() { 101 return confirm('æ¬å½ã«åé¤ãã¦ãããããã§ããï¼'); 102 }); 103 104// fancybox3 105 var extensions = ['gif', 'GIF', 'jpeg', 'JPEG', 'jpg', 'JPG', 'jpe', 'JPE', 'png', 'PNG', 'webp']; 106 var target = ''; 107 $.each(extensions, function() { 108 if (target) { 109 target += ','; 110 } 111 target += 'a[href$=\'.' + this + '\']'; 112 }); 113 $(target).attr({'data-fancybox': 'images'}); 114 $('a.colorbox').attr({ 115 'data-fancybox':'', 116 'data-type':'iframe' 117 }); 118 if($('script[src*="fancybox"]').length) { 119 $('[data-fancybox]').fancybox({ 120 // ãªãã·ã§ã³ãä¸è¨ã«è¨è¼ãã¦ããã¾ã 121 loop : true, // è¤æ°ç»å表示æã«æåã¨æå¾ãã«ã¼ãããã 122 toolbar : false, // ãã¼ã«ãã¼ã®é表示 123 protect: true, // å³ã¯ãªãã¯æå¶ 124 }); 125 } 126 127//Faviconä»ãªã³ã¯ 128 function faviconSetting(){ 129 const item = $('a.link_has_favicon'); 130 item.each(function(){ 131 const faviconUrl = $(this).attr('href'); 132 $(this).prepend('<img src="https://www.google.com/s2/favicons?domain=' + faviconUrl + '"> ') 133 }); 134 } 135 faviconSetting(); 136 137// å¼ç¨å 138 $('blockquote').each(function() { 139 if($(this).attr('cite')) { 140 const cite = $(this).attr('cite');
141 const cite_link = '<p class="cite_link" style=font-size:.8em;text-align:right;"><a href="'+cite+'" target="_blank">'+cite+'</a></p>'; 142 $(this).append(cite_link); 143 } 144 }); 145 146// copyURL 147 if($('.share-url').length){ 148 const clipboard = new ClipboardJS('.share-url'); 149 clipboard.on('success', function(e) { 150 $(e.trigger.nextElementSibling).fadeIn().delay(1000).fadeOut(); 151 }); 152 }; 153 154});
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.