1/*! 2 * SmartSnsBox.js v1.1.5 3 * This plugins is create original SNS button. 4 * support SNS: Twitter, Facebook(share only), LINE, Hatebu 5 * Author: Hiroki Ishiwatari 6 * Licensed under the MIT license 7 */ 8!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t,t.document)}):"object"==typeof exports?module.exports=e(t,t.document):t.SmartSnsBox=e(t,t.document)}(this,function(t,e){"use strict";function n(t){if(this.shareAPI={twitter:{Android:"intent://post?message={{text}} {{url}} {{#hashtag}}#Intent;scheme=twitter;package=com.twitter.android;end;",iOS:"twitter://post?message={{text}} {{url}} {{#hashtag}}",Web:"http://twitter.com/share?url={{url}}&text={{text}}&hashtags={{hashtag}}"},line:{Android:"intent://msg/text/{{text}} {{url}}/#Intent;scheme=line;package=jp.naver.line.android;end;",iOS:"line://msg/text/{{text}} {{url}}",Web:"http://line.naver.jp/R/msg/text/?{{text}} {{url}}"},itmss:{twitter:"itmss://itunes.apple.com/jp/app/twitter/id333903271?mt=8",line:"itmss://itunes.apple.com/jp/app/line/id443904275?mt=8"},facebook:"http://www.facebook.com/sharer.php?u={{url}}",hatebu:"https://b.hatena.ne.jp/add?url={{url}}"},this.countAPI={twitter:"http://urls.api.twitter.com/1/urls/count.json",facebook:"https://graph.facebook.com/",hatebu:"http://api.b.st-hatena.com/entry.count"},this.searchAPI={twitter:"https://twitter.com/search?q={{url}}&mode=realtime",hatebu:"http://b.hatena.ne.jp/entry/{{url}}"},this.settings={text:e.title,url:location.href,service:"twitter line facebook hatebu",count:!0,app:!0,fallback:!0},"string"==typeof t)this.settings.selector=t;else if("object"==typeof t)for(var n in t)t.hasOwnProperty(n)&&(this.settings[n]=t[n]);this.init()}function i(n,i){var o;"string"==typeof n?o=n:"object"==typeof n&&(o=n.url+r(n.data));var a="jsonp_callback_"+Math.round(1e5*Math.random()),s=e.createElement("script");t[a]=function(n){try{delete t[a]}catch(r){t[a]=null}e.body.removeChild(s),i(n)},s.src=o+(o.indexOf("?")<0?"?":"&")+"callback="+a,e.body.appendChild(s)}function r(t){var e="";for(var n in t)e+=(e.indexOf("?")<0?"?":"&")+n+"="+t[n];return e}return n.prototype.init=function(){this.checkUA(),this.configureService(),this.build()},n.prototype.checkUA=function(){var t=navigator.userAgent.toLowerCase();this.UA=-1!==t.indexOf("iphone")||-1!==t.indexOf("ipad")||-1!==t.indexOf("ipod")?"iOS":-1!==t.indexOf("android")?"Android":"Web"},n.prototype.configureService=function(){for(var t=this.settings.service.split(" ")||{},e={},n=0,i=t.length;i>n;n++)e[t[n]]=!0;this.settings.service=e},n.prototype.build=function(){var t=this.settings,n=t.service,i=t.selector,r=i?e.querySelectorAll(""+i):e.body,o=e.createDocumentFragment();if(n.twitter&&o.appendChild(this.createButton("twitter")),n.facebook&&o.appendChild(this.createButton("facebook")),n.hatebu&&o.appendChild(this.createButton("hatebu")),n.line&&o.appendChild(this.createButton("line")),null!==r)for(var a=0,s=r.length;s>a;a++)r[a].appendChild(o),this.bindEvents(),t.count&&this.getCount()},n.prototype.createButton=function(t){var n,i,r,o,a=e.createElement("div"),s=e.createElement("a"),c=e.createElement("a"),h=this.settings,l=this.UA,u=this.shareAPI[t],d=this.countAPI[t],p=this.shareAPI.itmss[t];return"Web"!==l&&h.app?"Android"===l?n=u.Android||u:"iOS"===l&&(n=u.iOS||u,h.fallback&&void 0!==p&&(s.onclick=function(){location.href=p})):n=u.Web||u,a.className="share-item share-item--"+t,i=encodeURIComponent(h.text),r=encodeURIComponent(h.url),o=h.hashtag||"",n=n.replace("{{text}}",i),n=n.replace("{{url}}",r),n=n.replace("{{hashtag}}",encodeURIComponent(o)),n=n.replace("{{#hashtag}}",encodeURIComponent("#"+o)),s.className="share-btn",s.setAttribute("href",n),void 0!==s.textContent?s.textContent=t:s.innerText=t,s.elemClass=t,a.appendChild(s),h.count&&void 0!==d&&(c.className="share-count",void 0!==c.textContent?c.textContent=0:c.innerText=0,a.appendChild(c)),a},n.prototype.bindEvents=function(){var t,n=e.querySelectorAll(this.settings.selector+" .share-btn"),i=0,r=n.length;if(this.settings.app&&"Web"===this.UA)for(;r>i;i++)t=n[i],t.addEventListener?t.addEventListener("click",this.launchWindow,!1):t.setAttribute("target","_blank");else n[1].addEventListener("click",this.launchWindow,!1),n[2].addEventListener("click",this.launchWindow,!1)},n.prototype.launchWindow=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1;var n=e.target.getAttribute("href");
8t.open(n,"","width=650, height=450, menubar=no, toolbar=no, scrollbars=yes")},n.prototype.getCount=function(){var t=this,n=this.settings.service,r=this.settings.url;n.twitter&&i({url:this.countAPI.twitter,data:{url:r}},function(n){var i=e.querySelector(t.settings.selector+" .share-item--twitter"),o=t.searchAPI.twitter.replace("{{url}}",r);i=i.children[1],void 0!==i.textContent?i.textContent=n.count||0:i.innerText=n.count||0,i.setAttribute("href",o),i.setAttribute("target","_blank")}),n.facebook&&i({url:this.countAPI.facebook,data:{id:r}},function(n){var i=e.querySelector(t.settings.selector+" .share-item--facebook");i=i.children[1],void 0!==i.textContent?i.textContent=n.shares||0:i.innerText=n.shares||0}),n.hatebu&&i({url:this.countAPI.hatebu,data:{url:r}},function(n){var i=e.querySelector(t.settings.selector+" .share-item--hatebu"),o=t.searchAPI.hatebu.replace("{{url}}",r);i=i.children[1],void 0!==i.textContent?i.textContent=n||0:i.innerText=n||0,i.setAttribute("href",o),i.setAttribute("target","_blank")})},n}); 9 10$(function() { 11 $('a[href^=#]').click(function() { 12 var speed = 400; 13 var href= $(this).attr("href"); 14 var target = $(href == "#" || href == "" ? 'html' : href); 15 var position = target.offset().top; 16 $('body,html').animate({scrollTop:position}, speed); 17 return false; 18 }); 19 20$('a').click(function(e){ 21 ãval = $(this).attr("href"); 22if ( val.indexOf('#keyword') != -1) { 23 e.preventDefault(); 24 var result = val.replace( /#keyword/g , "" ) ; 25 window.location.href = (result +"#keyword"); 26 } 27}); 28 29 shareText = $(this).find('h3.ttl span').text().slice(0,33) + '...' + ' - | ãOcculticï¼Nine -ãªã«ã«ãã£ãã¯ã»ãã¤ã³-ãã¢ãã¡å ¬å¼ãµã¤ã '; 30 new SmartSnsBox({ 31 selector:'.sharebox', 32 service: 'twitter facebook', 33 text: shareText, 34 count: false, 35 hashtag: 'ãªã«ã³' 36 }); 37 38 39 if($.cookie("reaccess")){ 40 $("#YtbMain").remove(); 41 } else { 42var date=new Date(); 43date.setTime(date.getTime() + (2*60*1000)); 44$.cookie("reaccess", "2min", {expires: date}); 45 } 46return false; 47});
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.