1///////////////////////////////// 2//TOPã¸æ»ããã¿ã³ 3///////////////////////////////// 4jQuery(function(){ 5 jQuery(window).scroll(function(){ 6 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[now]ã«æ ¼ç´ 7 var now = jQuery(window).scrollTop(); 8 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢(now)ã600ä»¥ä¸ 9 if(now > 600){ 10 //[#page-top]ããã£ãããã§ã¼ãã¤ã³ãã 11 jQuery('#page-top').fadeIn('slow'); 12 //ãã以å¤ã ã£ãããã§ã¼ãã¢ã¦ããã 13 }else{ 14 jQuery('#page-top').fadeOut('slow'); 15 } 16 //console.log(wrapperTop); 17 }); 18 //ãã¿ã³(id:move-page-top)ã®ã¯ãªãã¯ã¤ãã³ã 19 jQuery('#move-page-top').click(function(){ 20 //ãã¼ã¸ãããã¸ç§»åãã 21 jQuery('body,html').animate({ 22 scrollTop: 0 23 }, 800); 24 }); 25}); 26 27///////////////////////////////// 28//ã¹ã¯ãã¼ã«è¿½å¾ 29///////////////////////////////// 30var wrapperTop;//追å¾ã¨ãªã¢ã®ãããä½ç½®ãæ ¼ç´ï¼è¿½å¾éå§ä½ç½® 31var wrapperHeight;//追å¾ã¨ãªã¢ã®é«ããæ ¼ç´ 32var sidebarHeight;//ãµã¤ããã¼ã®é«ããæ ¼ç´ 33// var wrapperHeightAtFirst; 34// var wrapperHeightDiff; 35// var sidebarHeightAtFirst; 36// var sidebarHeightDiff; 37//éåæããã°ãã¼ãããã£ã¦ã追å¾éå§ä½ç½®ããããªãããã«ä¿®æ£ï¼ç¡çããï¼ 38//ã¹ãã¼ããªè¯ãæ¹æ³ãããã°ããææãé¡ããã¾ãã 39function getScrollAreaSettings(){ 40 wrapperHeight = jQuery('#sidebar-scroll').outerHeight(); 41 sidebarHeight = jQuery('#sidebar').outerHeight(); 42 // wrapperHeightDiff = wrapperHeightAtFirst - wrapperHeight; 43 // sidebarHeightDiff = sidebarHeightAtFirst - sidebarHeight; 44 wrapperTop = sidebarHeight - wrapperHeight + 240; 45 // console.log(wrapperTop + ', ' + wrapperHeight + ', ' + sidebarHeight + ', ' + sidebarHeightAtFirst + ', ' + sidebarHeightDiff); 46} 47setInterval('getScrollAreaSettings()',2000); 48 49(function(jquery) { 50 jquery(document).ready(function() { 51 /* 52 Ads Sidewinder 53 by Hamachiya2. http://d.hatena.ne.jp/Hamachiya2/20120820/adsense_sidewinder 54 */ 55 var main = jQuery('#main'); // ã¡ã¤ã³ã«ã©ã ã®ID 56 var side = jQuery('#sidebar'); // ãµã¤ããã¼ã®ID 57 var wrapper = jQuery('#sidebar-scroll'); // ã¹ã¯ãã¼ã«è¿½å¾è¦ç´ ã®ID 58 var side_top_margin = 60; 59 if (!wrapper.size()) {return;}//ã¹ã¯ãã¼ã«è¿½å¾ã¨ãªã¢ã«ã¦ã¤ã¸ã§ãããå ¥ã£ã¦ããªãã¨ãã¯ã¹ã«ã¼ 60 if (side.css('clear') == 'both') {return;}//ã¬ã¹ãã³ã·ãã§ãµã¤ããã¼ããã¼ã¸ä¸ã«è¡¨ç¤ºãã¦ããã¨ãã¯ã¹ã«ã¼ 61 62 if (main.length === 0 || side.length === 0 || wrapper.length === 0) { 63 return; 64 } 65 66 var w = jquery(window); 67 wrapperHeight = wrapper.outerHeight(); 68 // wrapperHeightAtFirst = wrapperHeight; 69 // sidebarHeightAtFirst = side.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 sideHeight = side.outerHeight(); 86 mainHeight = main.outerHeight(); 87 mainAbs = main.offset().top + mainHeight; 88 var winTop = w.scrollTop()+side_top_margin; 89 winLeft = w.scrollLeft(); 90 var winHeight = w.height(); 91 var nf = (winTop > wrapperTop) && (mainHeight > sideHeight) ? true : false; 92 pos = !nf ? 'static' : (winTop + wrapperHeight) > mainAbs ? 'absolute' : 'fixed'; 93 if (pos === 'fixed') { 94 side.css({ 95 position: pos, 96 top: '', 97 bottom: winHeight - wrapperHeight, 98 left: sideLeft - winLeft, 99 margin: 0, 100 marginBottom: '-'+side_top_margin+'px' 101 }); 102 103 } else if (pos === 'absolute') { 104 side.css({ 105 position: pos, 106 top: mainAbs - sideHeight, 107 bottom: '', 108 left: sideLeft, 109 margin: 0, 110 marginBottom: '-'+side_top_margin+'px' 111 }); 112 113 } else { 114 side.css({ 115 position: pos, 116 marginTop: sideMargin.top, 117 marginRight: sideMargin.right, 118 marginBottom: sideMargin.bottom, 119 marginLeft: sideMargin.left 120 }); 121 } 122 }; 123 124 var resizeAdjust = function() { 125 side.css({ 126 position:'static', 127 marginTop: sideMargin.top, 128 marginRight: sideMargin.right, 129 marginBottom: sideMargin.bottom, 130 marginLeft: sideMargin.left 131 }); 132 sideLeft = side.offset().left; 133 winLeft = w.scrollLeft(); 134 if (pos === 'fixed') { 135 side.css({ 136 position: pos, 137 left: sideLeft - winLeft, 138 margin: 0, 139 marginBottom: '-'+side_top_margin+'px' 140 }); 141 142 } else if (pos === 'absolute') { 143 side.css({ 144 position: pos, 145 left: sideLeft, 146 margin: 0, 147 marginBottom: '-'+side_top_margin+'px' 148 }); 149 } 150 }; 151 w.on('load', scrollAdjust); 152 w.on('scroll', scrollAdjust); 153 w.on('resize', resizeAdjust); 154 }); 155})(jQuery); 156 157///////////////////////////////// 158// ã¡ãã¥ã¼ãã¿ã³ã®éé 159///////////////////////////////// 160jQuery(document).ready(function() { 161 jQuery('#mobile-menu-toggle').click(function(){ 162 header_menu = jQuery('#navi ul'); 163 if (header_menu.css('display') == 'none') { 164 header_menu.slideDown(); 165 } else{ 166 header_menu.slideUp(); 167 }; 168 }); 169 170}); 171 172/////////////////////////////////// 173// ã½ã¼ã·ã£ã«ãã¿ã³ã«ã¦ã³ãã®éåæåå¾ 174/////////////////////////////////// 175jQuery(function(){ 176 jQuery(window).scroll(function(){ 177 //console.log(jQuery('#sidebar').css('clear')); 178 //æä¸é¨ããç¾å¨ä½ç½®ã¾ã§ã®è·é¢ãåå¾ãã¦ã夿°[now]ã«æ ¼ç´ 179 var now = jQuery(window).scrollTop(); 180 var sharebar = jQuery('#sharebar'); 181 if (!sharebar.size()) {return;} 182 var main = jQuery('#main'); 183 var sharebar_top = sharebar.offset().top; 184 var sharebar_h = sharebar.outerHeight(); 185 var main_top = main.offset().top; 186 var main_h = main.outerHeight(); 187 188 var bottom_line = main_h-400; 189 if(now < (main_h-sharebar_h)){ 190 if (now > main_top) { 191 //sharebar.fadeIn('fast'); 192 sharebar.css({ 193 position: 'fixed', 194 top: '70px' 195 }); 196 } else{ 197 sharebar.css({ 198 position: 'absolute', 199 top: main_top+70 200 }); 201 }; 202 }else{ 203 //sharebar.fadeOut('fast'); 204 sharebar.css({ 205 position: 'absolute', 206 top: main_h-sharebar_h 207 }); 208 } 209 //console.log(sharebar_h); 210 211 }); 212}); 213 214// Twitterã®ã·ã§ã¢æ°ãåå¾ 215function get_social_count_twitter(url, selcter) { 216 jQuery.ajax({ 217 url:'//urls.api.twitter.com/1/urls/count.json', 218 dataType:'jsonp', 219 data:{ 220 url:url 221 }, 222 success:function(res){
223 jQuery( selcter ).text( res.count || 0 ); 224 }, 225 error:function(){ 226 jQuery( selcter ).text('0'); 227 } 228 }); 229} 230 231//Facebookã®ã·ã§ã¢æ°ãåå¾ 232function get_social_count_facebook(url, selcter) { 233 jQuery.ajax({ 234 url:'https://graph.facebook.com/', 235 dataType:'jsonp', 236 data:{ 237 id:url 238 }, 239 success:function(res){ 240 jQuery( selcter ).text( res.shares || 0 ); 241 }, 242 error:function(){ 243 jQuery( selcter ).text('0'); 244 } 245 }); 246} 247 248//Googleï¼ã®ã·ã§ã¢æ°ãåå¾ 249function get_social_count_googleplus(url, selcter) { 250 jQuery.ajax({ 251 type: "get", dataType: "xml", 252 url: "//query.yahooapis.com/v1/public/yql", 253 data: { 254 q: "SELECT content FROM data.headers WHERE url='https://plusone.google.com/_/+1/fastbutton?hl=ja&url=" + url + "' and ua='#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36'", 255 format: "xml", 256 env: "http://datatables.org/alltables.env" 257 }, 258 success: function (data) { 259 var content = jQuery(data).find("content").text(); 260 var match = content.match(/window\.__SSR[\s*]=[\s*]{c:[\s*](\d+)/i); 261 var count = (match != null) ? match[1] : 0; 262 263 jQuery( selcter ).text(count); 264 } 265 }); 266} 267 268//ã¯ã¦ãªããã¯ãã¼ã¯ã§ã¯ã¦ãåãåå¾ 269function get_social_count_hatebu(url, selcter) { 270 jQuery.ajax({ 271 url:'//api.b.st-hatena.com/entry.count?callback=?', 272 dataType:'jsonp', 273 data:{ 274 url:url 275 }, 276 success:function(res){ 277 jQuery( selcter ).text( res || 0 ); 278 }, 279 error:function(){ 280 jQuery( selcter ).text('0'); 281 } 282 }); 283} 284 285//ãã±ããã®ã¹ããã¯æ°ãåå¾ 286function get_social_count_pocket(url, selcter) { 287 jQuery.ajax({ 288 type: "get", dataType: "xml", 289 url: "//query.yahooapis.com/v1/public/yql", 290 data: { 291 q: "SELECT content FROM data.headers WHERE url='https://widgets.getpocket.com/v1/button?label=pocket&count=vertical&v=1&url=" + url + "' and ua='#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36'", 292 format: "xml", 293 env: "http://datatables.org/alltables.env" 294 }, 295 success: function (data) { 296 var content = jQuery(data).find("content").text(); 297 var match = content.match(/<em id="cnt">(\d+)<\/em>/i); 298 var count = (match != null) ? match[1] : 0; 299 300 jQuery( selcter ).text(count); 301 } 302 }); 303} 304 305//feedlyã®è³¼èªè æ°ãåå¾ 306function get_social_count_feedly(rss_url, selcter) { 307 //console.log('http://cloud.feedly.com/v3/feeds/feed%2F' + encodeURIComponent(rss_url)); 308 jQuery.ajax({ 309 type: "get", dataType: "json", 310 url: "//query.yahooapis.com/v1/public/yql", 311 data: { 312 q: "SELECT content FROM data.headers WHERE url='//cloud.feedly.com/v3/feeds/feed%2F" + encodeURIComponent(rss_url) + "' and ua='#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36'", 313 format: "json", 314 env: "http://datatables.org/alltables.env" 315 }, 316 success: function (data) { 317 //console.log(data); 318 count = data.query.results.resources.content.json['subscribers'] 319 320 jQuery( selcter ).text(count); 321 } 322 }); 323} 324 325function doMasonry() { 326 jQuery('#list').masonry({ //<!-- #listã¯è¨äºä¸è¦§ãå²ãã§ãé¨å --> 327 itemSelector: '.entry', //<!--.entryã¯åè¨äºãå²ãã§ãé¨å--> 328 isAnimated: true //<!--ã¢ãã¡ã¼ã·ã§ã³ON--> 329 }); 330} 331 332jQuery(function(){ 333 if (typeof social_count_config !== 'undefined') { 334 get_social_count_twitter(social_count_config.permalink, '.twitter-count'); 335 get_social_count_facebook(social_count_config.permalink, '.facebook-count'); 336 get_social_count_googleplus(social_count_config.permalink, '.googleplus-count'); 337 get_social_count_hatebu(social_count_config.permalink, '.hatebu-count'); 338 get_social_count_pocket(social_count_config.permalink, '.pocket-count'); 339 //get_social_count_feedly(social_count_config.rss2_url, '.feedly-count'); 340 } 341 342 if (typeof lazyload_config !== 'undefined') { 343 jQuery('img').lazyload(lazyload_config); 344 } 345}); 346 347jQuery(window).load(function(){ 348 if (typeof do_masonry !== 'undefined') { 349 doMasonry() 350 } 351}); 352jQuery(function(){ 353 if (typeof do_masonry !== 'undefined') { 354 doMasonry() 355 } 356}); 357
358/////////////////////////////////// 359// ã¬ã¹ãã³ã¹è¡¨ç¤ºæã®ã¡ãã¥ã¼ã®æå 360// ã¡ãã¥ã¼ã®ã¹ã¿ã¤ã«è¡¨ç¤ºå´©ãã®é²æ¢ 361/////////////////////////////////// 362jQuery(function(){ 363 jQuery(window).resize(function(){ 364 if ( jQuery(window).width() > 1110 ) { 365 jQuery('#navi-in ul').removeAttr('style'); 366 }; 367 }); 368}); 369 370/////////////////////////////////// 371// Facebookãã¼ã¸ãããã¨ãªã¢ã®ãªãµã¤ãºï¼Androidãã©ã¦ã¶å¯¾å¿ç¨ï¼ 372/////////////////////////////////// 373function adjast_article_like_arrow_box() { 374 var w = jQuery('#main').width(); 375 jQuery('#main .article-like-arrow-box').css('width', (w - 114) + 'px'); 376 var w = jQuery('#sidebar').width(); 377 jQuery('#sidebar .article-like-arrow-box').css('width', (w - 114) + 'px'); 378 //console.log(w); 379} 380jQuery(window).resize(function() { 381 adjast_article_like_arrow_box() 382}); 383 384jQuery(document).ready(function() { 385 adjast_article_like_arrow_box() 386});
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.