1///////////////////////////////// 2//TOPã¸æ»ããã¿ã³ 3///////////////////////////////// 4(function($){ 5 var prevScrollTop = -1; 6 var $window = $(window); 7 $window.scroll(function(){ 8 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[scrollTop]ã«æ ¼ç´ 9 var scrollTop = $window.scrollTop(); 10 var threashold = 600; 11 var s1 = (prevScrollTop > threashold); 12 var s2 = (scrollTop > threashold); 13 14 // ã¹ã¬ãã·ã§ã«ããè·¨ãã æã®ã¿å¦çããã 15 if (s1 ^ s2) { 16 if (s2) { 17 //[#page-top]ããã£ãããã§ã¼ãã¤ã³ãã 18 $('#page-top').fadeIn('slow'); 19 } else { 20 //ãã以å¤ã ã£ãããã§ã¼ãã¢ã¦ããã 21 $('#page-top').fadeOut('slow'); 22 } 23 } 24 25 prevScrollTop = scrollTop; 26 }); 27 //ãã¿ã³(id:move-page-top)ã®ã¯ãªãã¯ã¤ãã³ã 28 $('#move-page-top').click(function(){ 29 //ãã¼ã¸ãããã¸ç§»åãã 30 $('body,html').animate({ 31 scrollTop: 1 32 }, 800); 33 }); 34})(jQuery); 35 36///////////////////////////////// 37//ã¹ã¯ãã¼ã«è¿½å¾ 38///////////////////////////////// 39var wrapperTop;//追å¾ã¨ãªã¢ã®ãããä½ç½®ãæ ¼ç´ï¼è¿½å¾éå§ä½ç½® 40var wrapperHeight;//追å¾ã¨ãªã¢ã®é«ããæ ¼ç´ 41var sidebarHeight;//ãµã¤ããã¼ã®é«ããæ ¼ç´ 42 43//éåæããã°ãã¼ãããã£ã¦ã追å¾éå§ä½ç½®ããããªãããã«ä¿®æ£ï¼ç¡çããï¼ 44//ã¹ãã¼ããªè¯ãæ¹æ³ãããã°ããææãé¡ããã¾ãã 45setInterval(function (){ 46 wrapperHeight = jQuery('#sidebar-scroll').outerHeight(); 47 sidebarHeight = jQuery('#sidebar').outerHeight(); 48 wrapperTop = sidebarHeight - wrapperHeight + 240; 49}, 2000); 50 51(function($) { 52 $(document).ready(function() { 53 /* 54 Ads Sidewinder 55 by Hamachiya2. http://d.hatena.ne.jp/Hamachiya2/20120820/adsense_sidewinder 56 */ 57 var main = $('#main'); // ã¡ã¤ã³ã«ã©ã ã®ID 58 var side = $('#sidebar'); // ãµã¤ããã¼ã®ID 59 var wrapper = $('#sidebar-scroll'); // ã¹ã¯ãã¼ã«è¿½å¾è¦ç´ ã®ID 60 var side_top_margin = 60; 61 if (!wrapper.size()) {return;}//ã¹ã¯ãã¼ã«è¿½å¾ã¨ãªã¢ã«ã¦ã¤ã¸ã§ãããå ¥ã£ã¦ããªãã¨ãã¯ã¹ã«ã¼ 62 if (side.css('clear') == 'both') {return;}//ã¬ã¹ãã³ã·ãã§ãµã¤ããã¼ããã¼ã¸ä¸ã«è¡¨ç¤ºãã¦ããã¨ãã¯ã¹ã«ã¼ 63 64 if (main.length === 0 || side.length === 0 || wrapper.length === 0) { 65 return; 66 } 67 68 var w = $(window); 69 wrapperHeight = wrapper.outerHeight(); 70 wrapperTop = wrapper.offset().top;//ã¨ããããããã¥ã¡ã³ããèªã¿è¾¼ãã æç¹ã§ã¹ã¯ãã¼ã«è¿½å¾é åã®
70é«ããåå¾ 71 var sideLeft = side.offset().left; 72 //console.log(wrapperTop); 73 74 var sideMargin = { 75 top: side.css('margin-top') ? side.css('margin-top') : 0, 76 right: side.css('margin-right') ? side.css('margin-right') : 0, 77 bottom: side.css('margin-bottom') ? side.css('margin-bottom') : 0, 78 left: side.css('margin-left') ? side.css('margin-left') : 0 79 }; 80 81 var winLeft; 82 var pos; 83 84 var scrollAdjust = function() { 85 var 86 sideHeight = side.outerHeight(), 87 mainHeight = main.outerHeight(), 88 mainAbs = main.offset().top + mainHeight, 89 winTop = w.scrollTop()+side_top_margin, 90 winLeft = w.scrollLeft(), 91 winHeight = w.height(); 92 var nf = (winTop > wrapperTop) && (mainHeight > sideHeight) ? true : false; 93 pos = !nf ? 'static' : (winTop + wrapperHeight) > mainAbs ? 'absolute' : 'fixed'; 94 if (pos === 'fixed') { 95 side.css({ 96 position: pos, 97 top: '', 98 bottom: winHeight - wrapperHeight, 99 left: sideLeft - winLeft, 100 margin: 0, 101 marginBottom: '-'+side_top_margin+'px' 102 }); 103 104 } else if (pos === 'absolute') { 105 side.css({ 106 position: pos, 107 top: mainAbs - sideHeight, 108 bottom: '', 109 left: sideLeft, 110 margin: 0, 111 marginBottom: '-'+side_top_margin+'px' 112 }); 113 114 } else { 115 side.css({ 116 position: pos, 117 marginTop: sideMargin.top, 118 marginRight: sideMargin.right, 119 marginBottom: sideMargin.bottom, 120 marginLeft: sideMargin.left 121 }); 122 } 123 }; 124 125 var resizeAdjust = function() { 126 side.css({ 127 position:'static', 128 marginTop: sideMargin.top, 129 marginRight: sideMargin.right, 130 marginBottom: sideMargin.bottom, 131 marginLeft: sideMargin.left 132 }); 133 sideLeft = side.offset().left; 134 winLeft = w.scrollLeft(); 135 if (pos === 'fixed') { 136 side.css({ 137 position: pos, 138 left: sideLeft - winLeft, 139 margin: 0, 140 marginBottom: '-'+side_top_margin+'px' 141 }); 142 143 } else if (pos === 'absolute') { 144 side.css({ 145 position: pos, 146 left: sideLeft, 147 margin: 0, 148 marginBottom: '-'+side_top_margin+'px' 149 }); 150 } 151 }; 152 w.on('load', scrollAdjust); 153 w.on('scroll', scrollAdjust); 154 w.on('resize', resizeAdjust); 155 }); 156})(jQuery); 157 158///////////////////////////////// 159// ã¡ãã¥ã¼ãã¿ã³ã®éé 160///////////////////////////////// 161(function($){ 162 $(document).ready(function() { 163 $('#mobile-menu-toggle').click(function(){ 164 var header_menu = $('#navi ul'); 165 if (header_menu.css('display') == 'none') { 166 header_menu.slideDown(); 167 } else{ 168 header_menu.slideUp(); 169 } 170 }); 171 }); 172})(jQuery); 173 174/////////////////////////////////// 175// ã½ã¼ã·ã£ã«ãã¿ã³ã«ã¦ã³ãã®éåæåå¾ 176/////////////////////////////////// 177(function($){ 178 $(window).scroll(function(){ 179 //console.log($('#sidebar').css('clear')); 180 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[now]ã«æ ¼ç´ 181 var now = $(window).scrollTop(); 182 var sharebar = $('#sharebar'); 183 if (!sharebar.size()) {return;} 184 var main = $('#main'); 185 var sharebar_top = sharebar.offset().top; 186 var sharebar_h = sharebar.outerHeight(); 187 var main_top = main.offset().top; 188 var main_h = main.outerHeight(); 189 190 var bottom_line = main_h-400; 191 if(now < (main_h-sharebar_h)){ 192 if (now > main_top) { 193 sharebar.css({ 194 position: 'fixed', 195 top: '70px' 196 }); 197 } else{ 198 sharebar.css({ 199 position: 'absolute', 200 top: main_top+70 201 }); 202 } 203 }else{ 204 sharebar.css({ 205 position: 'absolute', 206 top: main_h-sharebar_h 207 }); 208 } 209 }); 210})(jQuery); 211 212// // Twitterã®ã·ã§ã¢æ°ãåå¾ 213// function fetch_twitter_count(url, selector) { 214// jQuery.ajax({ 215// url:'//urls.api.twitter.com/1/urls/count.json', 216// dataType:'jsonp', 217// timeout: 10000, //10sec 218// data:{ 219// url:url 220// } 221// }).done(function(res){
222// jQuery( selector ).text( res.count || 0 ); 223// }).fail(function(){ 224// jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 225// }); 226// } 227 228// //Twitterã®ã·ã§ã¢æ°ãåå¾ï¼èªåã®ãµã¼ãã¼ããPHPã§åå¾ï¼ 229// function fetch_twitter_count(url, selector) { 230// jQuery.ajax({ 231// url: social_count_config.theme_url+'/lib/fetch-twitter.php?url='+url, 232// dataType:'text', 233// timeout: 10000, //10sec 234// }).done(function(res){ 235// jQuery( selector ).text( res || 0 ); 236// }).fail(function(){ 237// jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 238// }); 239// } 240 241//count.jsoonããTwitterã®ãã¤ã¼ãæ°ãåå¾ 242function fetch_twitter_count_from_count_jsoon(url, selector) { 243 jQuery.ajax({ 244 url:'//jsoon.digitiminimi.com/twitter/count.json', 245 dataType:'jsonp', 246 timeout: 10000, //10sec 247 data:{ 248 url:url 249 }, 250 success:function(res){ 251 jQuery( selector ).html( res.count || 0 ); 252 }, 253 error:function(){ 254 jQuery( selector ).html('error'); 255 } 256 }); 257} 258 259 260//Facebookã®ã·ã§ã¢æ°ãåå¾ 261function fetch_facebook_count(url, selector) { 262 jQuery.ajax({ 263 url:'https://graph.facebook.com/', 264 dataType:'jsonp', 265 timeout: 10000, //10sec 266 data:{ id:url } 267 }).done(function(res){ 268 //console.log(res); 269 if ( res.share && res.share.share_count ) { 270 jQuery( selector ).text( res.share.share_count ); 271 } else { 272 jQuery( selector ).text( 0 ); 273 } 274 }).fail(function(){ 275 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 276 }); 277} 278 279//Googleï¼ã®ã·ã§ã¢æ°ãåå¾ 280function fetch_google_plus_count(url, selector) { 281 jQuery.ajax({ 282 url: social_count_config.theme_url+'/lib/fetch-google-plus.php?url='+url, 283 dataType:'text', 284 timeout: 10000, //10sec 285 }).done(function(res){ 286 jQuery( selector ).text( res || 0 ); 287 }).fail(function(){ 288 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 289 }); 290} 291 292//ã¯ã¦ãªããã¯ãã¼ã¯ã§ã¯ã¦ãæ°ãåå¾ 293function fetch_hatebu_count(url, selector) { 294 jQuery.ajax({ 295 url:'//b.hatena.ne.jp/entry.count?callback=?', 296 //url:'//api.b.st-hatena.com/entry.count?callback=?', 297 dataType:'jsonp', 298 timeout: 10000, //10sec 299 data:{ 300 url:url 301 } 302 }).done(function(res){ 303 jQuery( selector ).text( res || 0 ); 304 }).fail(function(){ 305 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 306 }); 307} 308 309//ãã±ããã®ã¹ããã¯æ°ãåå¾ 310function fetch_pocket_count(url, selector) { 311 jQuery.ajax({ 312 url: social_count_config.theme_url+'/lib/fetch-pocket.php?url='+url, 313 dataType:'text', 314 timeout: 10000, //10sec 315 }).done(function(res){ 316 jQuery( selector ).text( res || 0 ); 317 }).fail(function(){ 318 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 319 }); 320} 321 322//feedlyã®è³¼èªè æ°ãåå¾ 323function fetch_feedly_count(rss_url, selector) { 324 jQuery.ajax({ 325 url: social_count_config.theme_url+'/lib/fetch-feedly.php?url='+rss_url, 326 dataType:'text', 327 timeout: 10000, //10sec 328 }).done(function(res){ 329 jQuery( selector ).text( res || 0 ); 330 }).fail(function(){ 331 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 332 }); 333} 334 335//Push7ã§è³¼èªè æ°ãåå¾ 336function fetch_push7_count(app_no, selector) { 337 url = 'https://api.push7.jp/api/v1/'+app_no+'/head'; 338 jQuery.ajax({ 339 url:url, 340 dataType:'json', 341 timeout: 10000, //10sec 342 data:{ 343 url:url 344 } 345 }).done(function(res){ 346 jQuery( selector ).text( res.subscribers || 0 ); 347 }).fail(function(){ 348 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 349 }); 350} 351 352jQuery(function(){ 353 if (typeof social_count_config !== 'undefined') { 354 //console.log(social_count_config.all_sns_share_btns_visible); 355 //ã·ã§ã¢ãã¿ã³ãå ¨é¨è¡¨ç¤ºãã¦ããã¨ã 356 if ( social_count_config.all_sns_share_btns_visible && 357 social_count_config.all_share_count_visible ) { 358 359 //Twitterã«ã¦ã³ãã®åå¾ 360 if ( social_count_config.twitter_btn_visible ){ 361 fetch_twitter_count_from_count_jsoon(social_count_config.permalink, '.twitter-count'); 362 } 363 364 //Facebookã«ã¦ã³ãã®åå¾ 365 if ( social_count_config.facebook_btn_visible ){ 366 fetch_facebook_count(social_count_config.permalink, '.facebook-count'); 367 } 368 //Googleï¼ã«ã¦ã³ãã®åå¾ 369 if ( social_count_config.google_plus_btn_visible ){ 370 fetch_google_plus_count(social_count_config.permalink, '.googleplus-count'); 371 } 372 //ã¯ã¦ãã«ã¦ã³ãã®åå¾ 373 if ( social_count_config.hatena_btn_visible ){ 374 fetch_hatebu_count(social_count_config.permalink, '.hatebu-count'); 375 } 376 //Pocketã«ã¦ã³ãã®åå¾ 377 if ( social_count_config.pocket_btn_visible ){ 378 fetch_pocket_count(social_count_config.permalink, '.pocket-count'); 379 } 380 //feedlyã«ã¦ã³ãã®åå¾ 381 if ( social_count_config.feedly_btn_visible ){ 382 fetch_feedly_count(social_count_config.rss2_url, '.feedly-count'); 383 } 384 //push7ã«ã¦ã³ãã®åå¾ 385 if ( social_count_config.push7_btn_visible ){ 386 fetch_push7_count(social_count_config.push7_app_no, '.push7-count'); 387 } 388 389 } 390 391 } 392 393 if (typeof lazyload_config !== 'undefined') { 394 jQuery('img').lazyload(lazyload_config); 395 } 396}); 397 398function doMasonry() { 399 jQuery('#list').masonry({ //<!-- #listã¯è¨äºä¸è¦§ãå²ãã§ãé¨å --> 400 itemSelector: '.entry', //<!--.entryã¯åè¨äºãå²ãã§ãé¨å--> 401 isAnimated: false //<!--ã¢ãã¡ã¼ã·ã§ã³ON--> 402 }); 403} 404 405jQuery(window).load(function(){ 406 if (typeof do_masonry !== 'undefined') { 407 doMasonry() 408 } 409}); 410jQuery(function(){ 411 if (typeof do_masonry !== 'undefined') { 412 doMasonry() 413 } 414}); 415 416///////////////////////////////////
417// ã¬ã¹ãã³ã¹è¡¨ç¤ºæã®ã¡ãã¥ã¼ã®æå 418// ã¡ãã¥ã¼ã®ã¹ã¿ã¤ã«è¡¨ç¤ºå´©ãã®é²æ¢ 419/////////////////////////////////// 420(function($){ 421 $(window).resize(function(){ 422 if ( $(window).width() > 1110 ) { 423 $('#navi-in ul').removeAttr('style'); 424 } 425 }); 426})(jQuery); 427 428/////////////////////////////////// 429// Facebookãã¼ã¸ãããã¨ãªã¢ã®ãªãµã¤ãºï¼Androidãã©ã¦ã¶å¯¾å¿ç¨ï¼ 430/////////////////////////////////// 431function adjast_article_like_arrow_box() { 432 var w = jQuery('#main').width(); 433 jQuery('#main .article-like-arrow-box').css('width', (w - 114) + 'px'); 434 w = jQuery('#sidebar').width(); 435 jQuery('#sidebar .article-like-arrow-box').css('width', (w - 114) + 'px'); 436 //console.log(w); 437} 438jQuery(window).resize(function() { 439 adjast_article_like_arrow_box() 440}); 441 442jQuery(document).ready(function() { 443 adjast_article_like_arrow_box() 444}); 445 446// /////////////////////////////////// 447// // Twitterã®ãã¤ã¼ãæ°åå¾é¢æ°ãå¼ã³åºã 448// /////////////////////////////////// 449// jQuery(function(){ 450// if (typeof social_count_config !== 'undefined') { 451// //ã·ã§ã¢ãã¿ã³ãå ¨é¨è¡¨ç¤ºãã¦ããã¨ã 452// if ( social_count_config.all_sns_share_btns_visible && 453// social_count_config.all_share_count_visible && 454// social_count_config.twitter_count_visible ) { 455// fetch_twitter_count_from_count_jsoon('http://nelog.jp/google-map-to-amp', '.twitter-count'); 456// } 457// } 458// }); 459 460///////////////////////////////// 461// æãç³ã¿å¼ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ãã 462///////////////////////////////// 463(function($) { 464 $(function() { 465 var wgts = $(".widget_archive");//ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããå ¨ã¦ãåå¾ 466 //ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããã1ã¤ãã¤å¦çãã 467 wgts.each(function(i, el) { 468 var wgt = $(el); 469 470 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 471 var has_date_count = wgt.text().match(/\d+å¹´\d+æ\s\(\d+\)/); 472 //æ¥ä»è¡¨ç¤ºã ãã 473 var has_date_only = wgt.text().match(/\d+å¹´\d+æ/) && !has_date_count; 474 475 //æ¥ä»è¡¨ç¤ºããã¦ããã¨ãï¼ãããããã¦ã³è¡¨ç¤ºã§ãªãæï¼ 476 if ( has_date_count || has_date_only ) { 477 var 478 clone = wgt.clone(),//ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããã®è¤è£½ã使 479 year = []; 480 //ã¯ãã¼ã³ã¯ã¦ã£ã¸ã§ãããå¾ã«ã«æ¿å ¥ãã¯ãã¼ã³ã¯cssã§é表示 481 wgt.after(clone); 482 clone.attr("class", "archive_clone").addClass('hide'); 483 484 var 485 acv = wgt, //ã¦ã£ã¸ã§ãã 486 acvLi = acv.find("li"); //ã¦ã£ã¸ã§ããå ã®liå ¨ã¦ 487 //ul.yearsãã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããç´ä¸ã«è¿½å ãã¦ãã®DOMãåå¾ 488 var acv_years = acv.append('<ul class="years"></ul>').find("ul.years"); 489 490 //liã®ããã¹ãããå¹´ãã©ããããããã調ã¹ã 491 acvLi.each(function(i) { 492 var reg = /(\d+)å¹´(\d+)æ/; 493 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 494 if ( has_date_count ) { 495 reg = /(\d+)å¹´(\d+)æ\s\((\d+)\)/; 496 } 497 var dt = $(this).text().match(reg); 498 year.push(dt[1]); 499 500 }); 501 $.unique(year); //éè¤åé¤ 502 503 acvLi.unwrap(); //liã®è¦ªã®ulãè§£é¤ 504 505 //æç¨¿å¹´ãããã ãä¸ã«ãããã¯ãä½ã 506 var 507 yearCount = year.length, 508 ii = 0; 509 while (ii < yearCount) { 510 acv_years.append("<li class='year_" + year[ii] + "'><a class='year'>" + year[ii] + "å¹´</a><ul class='month'></ul></li>"); 511 ii++; 512 } 513 514 //ä½ã£ããããã¯å ã®ulã«å å®¹ãæ´å½¢ãã¦ç§»å 515 //ãªãªã¸ãã«ã®ã¯ãã¼ã³ã¯é çªã«åé¤ 516 var j = 0; 517 acvLi.each(function(i, el) { 518 var reg = /(\d+)å¹´(\d+)æ/; 519 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 520 if ( has_date_count ) { 521 reg = /(\d+)å¹´(\d+)æ\s\((\d+)\)/; 522 } 523 var 524 dt = $(this).text().match(reg), 525 href = $(this).find("a").attr("href"); 526 527 //æã®è¿½å 528 var rTxt = "<li><a href='" + href + "'>" + "" + dt[2] + "æ</a>"; 529 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 530 if ( has_date_count ) {
531 rTxt += " (" + dt[3] + ")" + "</li>"; //æç¨¿æ°ã®è¿½å 532 } 533 534 //使ããæã®HTMLã追å ãä¸è¦ãªãã®ã¯åé¤ 535 if (year[j] === dt[1]) { 536 acv_years.find(".year_" + year[j] + " ul").append(rTxt); 537 $(this).remove(); 538 } else { 539 j++; 540 acv_years.find(".year_" + year[j] + " ul").append(rTxt); 541 $(this).remove(); 542 } 543 }); 544 545 //ã¯ãã¼ã³è¦ç´ ãåé¤ 546 clone.remove(); 547 548 //ç´è¿ã®å¹´ã®æå以å¤ã¯.hide 549 acv.find("ul.years ul:not(:first)").addClass("hide"); 550 551 //å¹´ãã¯ãªãã¯ã§ãã°ã«show 552 acv.find("a.year").on("click", function() { 553 $(this).next().toggleClass("hide"); 554 }); 555 }//if has_date_count || has_date_only 556 });//wgts.each 557 558 }); 559 560})(jQuery); 561 562///////////////////////////////// 563//ãã¼ãã«ã«ã¬ã¹ãã³ã·ãç¨ã®ã©ããã追å ãã 564///////////////////////////////// 565// (function($){ 566// $('table:not(.table-wrap table)').wrap('<div class="table-wrap"></div>'); 567// })(jQuery); 568
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.