1const THUMB_TYPES = [ 2 'maxresdefault.jpg', 3 'sddefault.jpg', 4 'hqdefault.jpg', 5 'mqdefault.jpg', 6 'default.jpg', 7]; 8const getYtThumbnail = async (videoId) => { 9 const loadImage = (src) => { 10 return new Promise((resolve, reject) => { 11 const img = new Image(); 12 img.onload = (e) => resolve(img); 13 img.src = src; 14 }); 15 }; 16 for (let i = 0; i < THUMB_TYPES.length; i++) { 17 const fileName = `https://img.youtube.com/vi/${videoId}/${THUMB_TYPES[i]}`; 18 const res = await loadImage(fileName); 19 if ( 20 !THUMB_TYPES[i + 1] 21 || (res).width > 120 22 ){ 23 return fileName; 24 } 25 } 26}; 27 28function getParam(name,url){ 29 if (!url) url=window.location.href; 30 name=name.replace(/[\[\]]/g,"\\$&"); 31 var regex=new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 32 results=regex.exec(url); 33 if (!results) return null; 34 if (!results[2]) return ''; 35 return decodeURIComponent(results[2].replace(/\+/g," ")); 36} 37 38/*----------------------------------------------- 39 * Include 40-------------------------------------------------*/ 41var dir = $('body').data('root'); 42var navlistsHTML = '_inc/nav.html'; 43var bnrlistsHTML = '_inc/bnr.html'; 44 45// nav.html 46function navListsInc(directory){ 47 $.ajax({ 48 type: 'get', 49 url: directory + navlistsHTML, 50 dataType: 'html', 51 success: function(data){ 52 data = data.replace(/\{\$root\}/g, directory); 53 $('.js-navLists').append(data); 54 } 55 }).done(function(data) { 56 var pageName = $('body').data('page'); 57 $('.js-nav').each(function(){ 58 var $activeNavItem = $(this).attr('data-nav'); 59 60 //activeNavã¨pagenameãä¸è´ 61 if($activeNavItem == pageName) { 62 $(this).addClass('is-active'); 63 } else { 64 $(this).removeClass('is-active'); 65 } 66 }); 67 }).fail(function() { 68 console.log('!!navigation communication error!!'); 69 }); 70} 71 72// bnr.html 73function bnrListsInc(directory){ 74 $.ajax({ 75 type: 'get', 76 url: directory + bnrlistsHTML, 77 dataType: 'html', 78 success: function(data){ 79 data = data.replace(/\{\$root\}/g, directory); 80 $('.js-bnrLists').append(data); 81 } 82 }).done(function(data) { 83 }).fail(function() { 84 console.log('!!banner communication error!!'); 85 }); 86} 87 88$(function(){ 89 $(".js-inc_shareLists").load(dir + "_inc/share.html"); 90 navListsInc(dir); 91 bnrListsInc(dir); 92}); 93 94/*----------------------------------------------- 95 * ãã©ã¦ã¶ãªãµã¤ãºãã¹ã¯ãã¼ã«æã®åå¦ç 96-------------------------------------------------*/ 97var pos = 0; 98function resizeScrollCommonHandle() { 99 ww = $(window).innerWidth(); 100 wh = $(window).innerHeight(); 101 sct = $(window).scrollTop(); 102 scl = $(window).scrollLeft(); 103 104 // headerãããã©ã¦ã¶ã®é«ããä¸åãå ´åãã¹ã¯ãã¼ã«ä¸ä¸ã§header表示ä½ç½®èª¿æ´ 105 var headerInHeight = $('.js-header__inner').innerHeight(); 106 var addSpace = wh - headerInHeight; 107 if(wh < headerInHeight) { 108 if($(this).scrollTop() < pos || $(this).scrollTop() < 50){ 109 //ä¸ 110 $('.js-header__inner').css({'top':'0px'}); 111 } else { 112 //ä¸ 113 $('.js-header__inner').css({'top':addSpace + 'px'}); 114 } 115 pos = $(this).scrollTop(); 116 } else {
117 $('.js-header__inner').css({'top':'0px'}); 118 } 119 120 // position:fixedã§æ¨ªå¹ 1200px以ä¸ã®å ´åãleftã®ç§»åå¤ãåå¾ 121 var $fixed = $('.js-fixed'); 122 if($fixed[0]) { 123 $fixed.each(function(){ 124 if(ww < 1200) { 125 $(this).css({'left':-(scl)+'px'}); 126 } else { 127 $(this).css({'left':'0'}); 128 } 129 }); 130 } 131} 132$(window).on('load resize scroll', function(){ 133 resizeScrollCommonHandle(); 134}); 135 136/*----------------------------------------------- 137 * Modal 138-------------------------------------------------*/ 139/** 140 * Normal modal 141 */ 142function normalModal(_mid) { 143 $('#js-normalModal').fadeIn(500); 144 $('#js-' + _mid).fadeIn(500); 145 $('body').css({'overflow':'hidden'}); 146} 147 148// Close 149function normalModalClose() { 150 $('#js-normalModal, .js-oneModal').fadeOut(500); 151 $('body').css({'overflow':''}); 152} 153 154// Close - ã¯ãªãã¯ã¤ãã³ã 155$('.js-normalModalIn').on('click touchend', function(e) { 156 if (!$(e.target).closest('.js-normalModalIn__cont').length) { 157 normalModalClose(); 158 } 159}); 160$('.js-normalModal-close').on('click', function() { 161 normalModalClose(); 162}); 163 164 165/** 166 * Youtube modal 167 */ 168function youtubeModal(_ytid) { 169 $('#js-youtubeModal').fadeIn(500); 170 $('body').css({'overflow':'hidden'}); 171 const ytURL = 'https://www.youtube.com/embed/'+_ytid+'?autoplay=1&rel=0'; 172 setTimeout(function(){ 173 $('.js-youtubeIframe').attr('src',ytURL); 174 },100); 175} 176 177// Close 178function youtubeModalClose() { 179 $('#js-youtubeModal').fadeOut(500); 180 $('body').css({'overflow':''}); 181 182 setTimeout(function(){ 183 $('.js-youtubeIframe').attr('src',''); 184 },500); 185} 186 187// Close - ã¯ãªãã¯ã¤ãã³ã 188$('.js-youtubeModalIn').on('click touchend', function(e) { 189 if (!$(e.target).closest('.js-youtubeModalIn__cont').length) { 190 youtubeModalClose(); 191 } 192}); 193$('.js-youtubeModal-close').on('click', function() { 194 youtubeModalClose(); 195}); 196 197 198/** 199 * Comment modal 200 */ 201function commentModal(_cid) { 202 const commentURL = dir + '_comment/'+_cid+'.html'; 203 $('.js-commentModalIn__cont').load(commentURL,function(){ 204 $('#js-commentModal').fadeIn(500); 205 $("body").css({'overflow':'hidden'}); 206 }); 207} 208 209// Close 210function commentModalClose() { 211 $('#js-commentModal').fadeOut(500, function(){ 212 $('.js-commentModalIn__cont').html(''); 213 }); 214 $('body').css({'overflow':''}); 215} 216 217// Close - ã¯ãªãã¯ã¤ãã³ã 218$('.js-commentModalIn').on('click touchend', function(e) { 219 if (!$(e.target).closest('.js-commentModalIn__cont').length) { 220 commentModalClose(); 221 } 222}); 223$('.js-commentModal-close').on('click', function() {
224 commentModalClose(); 225}); 226 227 228/*----------------------------------------------- 229-------------------------------------------------*/ 230// Anchor smooth scroll 231$('.js-anchor').on('click', function(){ 232 var speed = 1000; 233 var href= $(this).attr("href"); 234 var target = $(href == "#" || href == "" ? 'html' : href); 235 var position = target.offset().top; 236 $('body,html').animate({scrollTop:position}, speed, 'easeOutQuart'); 237 return false; 238}); 239 240// Menu 241$('.js-menu').on('click', function(){ 242 $(this).toggleClass('is-active'); 243 if($(this).hasClass('is-active')){ 244 $('.js-header').addClass('is-active'); 245 } else { 246 $('.js-header').removeClass('is-active'); 247 } 248}); 249 250// youtube thumbnail 251if($('.js-ytThumb')[0]){ 252 $('.js-ytThumb').each(function(){ 253 var ytID = $(this).data('ytid'); 254 $(this).css({'background-image':'url(https://img.youtube.com/vi/'+ytID+'/maxresdefault.jpg)'}) 255 }); 256} 257 258// pagetop 259$(document).on('click', '.js-pagetop', function(){ 260 var speed = 1000; 261 $('body,html').animate({scrollTop:0}, speed, 'easeOutQuart'); 262 return false; 263});
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.