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 if ( social_count_config.facebook_count_visible ) { 263 jQuery( selector ).text( social_count_config.facebook_count ); 264 } else { 265 jQuery( selector ).text( 0 ); 266 } 267 // jQuery.ajax({ 268 // url:'https://graph.facebook.com/', 269 // dataType:'jsonp', 270 // timeout: 10000, //10sec 271 // data:{ 272 // id: url 273 // } 274 // }).done(function(res){ 275 // console.log(fb_access_token); 276 // console.log(res); 277 // if ( facebookCount ) { 278 // jQuery( selector ).text( facebookCount ); 279 // } else { 280 // jQuery( selector ).text( 0 ); 281 // } 282 // }).fail(function(){ 283 // jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 284 // }); 285} 286 287//Googleï¼ã®ã·ã§ã¢æ°ãåå¾ 288function fetch_google_plus_count(url, selector) { 289 jQuery.ajax({ 290 url: social_count_config.theme_url+'/lib/fetch-google-plus.php?url='+url, 291 dataType:'text', 292 timeout: 10000, //10sec 293 }).done(function(res){ 294 jQuery( selector ).text( res || 0 ); 295 }).fail(function(){ 296 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 297 }); 298} 299 300//ã¯ã¦ãªããã¯ãã¼ã¯ã§ã¯ã¦ãæ°ãåå¾ 301function fetch_hatebu_count(url, selector) { 302 jQuery.ajax({ 303 url:'//b.hatena.ne.jp/entry.count?callback=?', 304 //url:'//api.b.st-hatena.com/entry.count?callback=?', 305 dataType:'jsonp', 306 timeout: 10000, //10sec 307 data:{ 308 url:url 309 } 310 }).done(function(res){ 311 jQuery( selector ).text( res || 0 ); 312 }).fail(function(){ 313 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 314 }); 315} 316 317//ãã±ããã®ã¹ããã¯æ°ãåå¾ 318function fetch_pocket_count(url, selector) { 319 jQuery.ajax({ 320 url: social_count_config.theme_url+'/lib/fetch-pocket.php?url='+url, 321 dataType:'text', 322 timeout: 10000, //10sec 323 }).done(function(res){ 324 jQuery( selector ).text( res || 0 ); 325 }).fail(function(){ 326 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 327 }); 328} 329 330//feedlyã®è³¼èªè æ°ãåå¾ 331function fetch_feedly_count(rss_url, selector) { 332 jQuery.ajax({ 333 url: social_count_config.theme_url+'/lib/fetch-feedly.php?url='+rss_url, 334 dataType:'text', 335 timeout: 10000, //10sec 336 }).done(function(res){ 337 jQuery( selector ).text( res || 0 ); 338 }).fail(function(){ 339 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 340 }); 341} 342 343//Push7ã§è³¼èªè æ°ãåå¾ 344function fetch_push7_count(app_no, selector) { 345 url = 'https://api.push7.jp/api/v1/'+app_no+'/head'; 346 jQuery.ajax({ 347 url:url, 348 dataType:'json', 349 timeout: 10000, //10sec 350 data:{ 351 url:url 352 } 353 }).done(function(res){ 354 jQuery( selector ).text( res.subscribers || 0 ); 355 }).fail(function(){ 356 jQuery( selector ).html('<span class="fa fa-exclamation"></span>'); 357 }); 358} 359 360jQuery(function(){ 361 if (typeof social_count_config !== 'undefined') { 362 //console.log(social_count_config.all_sns_share_btns_visible); 363 //ã·ã§ã¢ãã¿ã³ãå ¨é¨è¡¨ç¤ºãã¦ããã¨ã 364 if ( social_count_config.all_sns_share_btns_visible && 365 social_count_config.all_share_count_visible ) { 366 367 //Twitterã«ã¦ã³ãã®åå¾ 368 if ( social_count_config.twitter_btn_visible ){ 369 fetch_twitter_count_from_count_jsoon(social_count_config.permalink, '.twitter-count'); 370 } 371 372 //Facebookã«ã¦ã³ãã®åå¾ 373 if ( social_count_config.facebook_btn_visible ){ 374 fetch_facebook_count(social_count_config.permalink, '.facebook-count'); 375 } 376 //Googleï¼ã«ã¦ã³ãã®åå¾ 377 if ( social_count_config.google_plus_btn_visible ){ 378 fetch_google_plus_count(social_count_config.permalink, '.googleplus-count'); 379 } 380 //ã¯ã¦ãã«ã¦ã³ãã®åå¾ 381 if ( social_count_config.hatena_btn_visible ){ 382 fetch_hatebu_count(social_count_config.permalink, '.hatebu-count'); 383 } 384 //Pocketã«ã¦ã³ãã®åå¾ 385 if ( social_count_config.pocket_btn_visible ){ 386 fetch_pocket_count(social_count_config.permalink, '.pocket-count'); 387 } 388 //feedlyã«ã¦ã³ãã®åå¾ 389 if ( social_count_config.feedly_btn_visible ){ 390 fetch_feedly_count(social_count_config.rss2_url, '.feedly-count'); 391 } 392 //push7ã«ã¦ã³ãã®åå¾ 393 if ( social_count_config.push7_btn_visible ){ 394 fetch_push7_count(social_count_config.push7_app_no, '.push7-count'); 395 } 396 397 } 398 399 } 400 401 if (typeof lazyload_config !== 'undefined') { 402 jQuery('img').lazyload(lazyload_config); 403 } 404}); 405 406function doMasonry() { 407 jQuery('#list').masonry({ //<!-- #listã¯è¨äºä¸è¦§ãå²ãã§ãé¨å --> 408 itemSelector: '.entry', //<!--.entryã¯åè¨äºãå²ãã§ãé¨å--> 409 isAnimated: false //<!--ã¢ãã¡ã¼ã·ã§ã³ON--> 410 }); 411} 412 413jQuery(window).load(function(){ 414 if (typeof do_masonry !== 'undefined') { 415 doMasonry() 416 } 417}); 418jQuery(function(){ 419 if (typeof do_masonry !== 'undefined') { 420 doMasonry() 421 } 422}); 423
424/////////////////////////////////// 425// ã¬ã¹ãã³ã¹è¡¨ç¤ºæã®ã¡ãã¥ã¼ã®æå 426// ã¡ãã¥ã¼ã®ã¹ã¿ã¤ã«è¡¨ç¤ºå´©ãã®é²æ¢ 427/////////////////////////////////// 428(function($){ 429 $(window).resize(function(){ 430 if ( $(window).width() > 1110 ) { 431 $('#navi-in ul').removeAttr('style'); 432 } 433 }); 434})(jQuery); 435 436/////////////////////////////////// 437// Facebookãã¼ã¸ãããã¨ãªã¢ã®ãªãµã¤ãºï¼Androidãã©ã¦ã¶å¯¾å¿ç¨ï¼ 438/////////////////////////////////// 439// function adjast_article_like_arrow_box() { 440// var w = jQuery('#main').width(); 441// jQuery('#main .article-like-arrow-box').css('width', (w - 114) + 'px'); 442// w = jQuery('#sidebar').width(); 443// jQuery('#sidebar .article-like-arrow-box').css('width', (w - 114) + 'px'); 444// //console.log(w); 445// } 446// jQuery(window).resize(function() { 447// adjast_article_like_arrow_box() 448// }); 449 450// jQuery(document).ready(function() { 451// adjast_article_like_arrow_box() 452// }); 453 454// /////////////////////////////////// 455// // Twitterã®ãã¤ã¼ãæ°åå¾é¢æ°ãå¼ã³åºã 456// /////////////////////////////////// 457// jQuery(function(){ 458// if (typeof social_count_config !== 'undefined') { 459// //ã·ã§ã¢ãã¿ã³ãå ¨é¨è¡¨ç¤ºãã¦ããã¨ã 460// if ( social_count_config.all_sns_share_btns_visible && 461// social_count_config.all_share_count_visible && 462// social_count_config.twitter_count_visible ) { 463// fetch_twitter_count_from_count_jsoon('http://nelog.jp/google-map-to-amp', '.twitter-count'); 464// } 465// } 466// }); 467 468///////////////////////////////// 469// æãç³ã¿å¼ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ãã 470///////////////////////////////// 471(function($) { 472 $(function() { 473 var wgts = $(".widget_archive");//ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããå ¨ã¦ãåå¾ 474 //ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããã1ã¤ãã¤å¦çãã 475 wgts.each(function(i, el) { 476 var wgt = $(el); 477 478 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 479 var has_date_count = wgt.text().match(/\d+å¹´\d+æ\s\(\d+\)/); 480 //æ¥ä»è¡¨ç¤ºã ãã 481 var has_date_only = wgt.text().match(/\d+å¹´\d+æ/) && !has_date_count; 482 483 //æ¥ä»è¡¨ç¤ºããã¦ããã¨ãï¼ãããããã¦ã³è¡¨ç¤ºã§ãªãæï¼ 484 if ( has_date_count || has_date_only ) { 485 var 486 clone = wgt.clone(),//ã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããã®è¤è£½ã使 487 year = []; 488 //ã¯ãã¼ã³ã¯ã¦ã£ã¸ã§ãããå¾ã«ã«æ¿å ¥ãã¯ãã¼ã³ã¯cssã§é表示 489 wgt.after(clone); 490 clone.attr("class", "archive_clone").addClass('hide'); 491 492 var 493 acv = wgt, //ã¦ã£ã¸ã§ãã 494 acvLi = acv.find("li"); //ã¦ã£ã¸ã§ããå ã®liå ¨ã¦ 495 //ul.yearsãã¢ã¼ã«ã¤ãã¦ã£ã¸ã§ããç´ä¸ã«è¿½å ãã¦ãã®DOMãåå¾ 496 var acv_years = acv.append('<ul class="years"></ul>').find("ul.years"); 497 498 //liã®ããã¹ãããå¹´ãã©ããããããã調ã¹ã 499 acvLi.each(function(i) { 500 var reg = /(\d+)å¹´(\d+)æ/; 501 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 502 if ( has_date_count ) { 503 reg = /(\d+)å¹´(\d+)æ\s\((\d+)\)/; 504 } 505 var dt = $(this).text().match(reg); 506 year.push(dt[1]); 507 508 }); 509 $.unique(year); //éè¤åé¤ 510 511 acvLi.unwrap(); //liã®è¦ªã®ulãè§£é¤ 512 513 //æç¨¿å¹´ãããã ãä¸ã«ãããã¯ãä½ã 514 var 515 yearCount = year.length, 516 ii = 0; 517 while (ii < yearCount) { 518 acv_years.append("<li class='year_" + year[ii] + "'><a class='year'>" + year[ii] + "å¹´</a><ul class='month'></ul></li>"); 519 ii++; 520 } 521 522 //ä½ã£ããããã¯å ã®ulã«å å®¹ãæ´å½¢ãã¦ç§»å 523 //ãªãªã¸ãã«ã®ã¯ãã¼ã³ã¯é çªã«åé¤ 524 var j = 0; 525 acvLi.each(function(i, el) { 526 var reg = /(\d+)å¹´(\d+)æ/; 527 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 528 if ( has_date_count ) { 529 reg = /(\d+)å¹´(\d+)æ\s\((\d+)\)/; 530 } 531 var 532 dt = $(this).text().match(reg), 533 href = $(this).find("a").attr("href"); 534 535 //æã®è¿½å 536 var rTxt = "<li><a href='" + href + "'>" + "" + dt[2] + "æ</a>"; 537 //æ¥ä»è¡¨ç¤ºï¼æç¨¿æ°ã 538 if ( has_date_count ) {
539 rTxt += " (" + dt[3] + ")" + "</li>"; //æç¨¿æ°ã®è¿½å 540 } 541 542 //使ããæã®HTMLã追å ãä¸è¦ãªãã®ã¯åé¤ 543 if (year[j] === dt[1]) { 544 acv_years.find(".year_" + year[j] + " ul").append(rTxt); 545 $(this).remove(); 546 } else { 547 j++; 548 acv_years.find(".year_" + year[j] + " ul").append(rTxt); 549 $(this).remove(); 550 } 551 }); 552 553 //ã¯ãã¼ã³è¦ç´ ãåé¤ 554 clone.remove(); 555 556 //ç´è¿ã®å¹´ã®æå以å¤ã¯.hide 557 acv.find("ul.years ul:not(:first)").addClass("hide"); 558 559 //å¹´ãã¯ãªãã¯ã§ãã°ã«show 560 acv.find("a.year").on("click", function() { 561 $(this).next().toggleClass("hide"); 562 }); 563 }//if has_date_count || has_date_only 564 });//wgts.each 565 566 }); 567 568})(jQuery); 569 570///////////////////////////////// 571//ãã¼ãã«ã«ã¬ã¹ãã³ã·ãç¨ã®ã©ããã追å ãã 572///////////////////////////////// 573// (function($){ 574// $('table:not(.table-wrap table)').wrap('<div class="table-wrap"></div>'); 575// })(jQuery); 576
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.