PageSourceSearch

https://www.daimyou-hete.com/yakitori/shared/js/socials.js

js daimyou-hete.com collected 2026-10-07 23:07:12 UTC 9,324 bytes, 151 lines download raw bytes

1function appendSocials() {
2	// Link script LineIT  https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js
3	let lineScript = document.createElement('script')
4	lineScript.innerHTML = `window.LineIt=window.LineIt||{},function(){function t(){}function e(t,e){this.entry=t,this.buttonType=e,this.elIframe=document.createElement("iframe"),this.params=[],this.lang="en",this.env="REAL",this.ver="1"}function i(t){e.call(this,t,s.BUTTON_TYPES.SHARE),this.init()}function a(t){e.call(this,t,s.BUTTON_TYPES.FRIEND),this.init()}function n(t){e.call(this,t,s.BUTTON_TYPES.LIKE),this.init()}function r(t,e,i){t&&(i&&(t=t.toLowerCase()),this.params.push(e+"="+encodeURIComponent(t)))}var s={BUTTON_TYPES:{SHARE:"SHARE",FRIEND:"FRIEND",LIKE:"LIKE"},IMG_SIZE:{},BUTTON_URL:{HOST:{REAL:"https://social-plugins.line.me"}}};s.BUTTON_URL[s.BUTTON_TYPES.SHARE]="/widget/share?",s.BUTTON_URL[s.BUTTON_TYPES.FRIEND]="/widget/friend?",s.BUTTON_URL[s.BUTTON_TYPES.LIKE]="/widget/like?";var o=[],l=function(){var e=document.querySelectorAll(".line-it-button"),i=new t;Array.prototype.forEach.call(e,function(t){if("div"===t.tagName.toLowerCase()){var e=i.makeButton(t);o.push(e)}})},h=document.readyState;"interactive"===h||"complete"===h?window.addEventListener("load",l,!1):document.addEventListener("DOMContentLoaded",l,!1),t.prototype.makeButton=function(t){var e=t.getAttribute("data-type");if(e){switch(e.split("-")[0].toUpperCase()){case s.BUTTON_TYPES.SHARE:return new i(t);case s.BUTTON_TYPES.FRIEND:return new a(t);case s.BUTTON_TYPES.LIKE:return new n(t)}}},e.prototype.initDefaultAttributes=function(){Array.prototype.forEach.call(this.entry.attributes,function(t){var e=t.name.match(/^data\-(.+)$/);if(null!=e){switch(e[1]){case"lang":this.lang=t.value,this.params.push(e[1]+"="+encodeURIComponent(t.value));break;case"type":var i=t.value.split("-");this.params.push(e[1]+"="+encodeURIComponent(i[0]));break;case"ver":this.ver=t.value,this.params.push(e[1]+"="+encodeURIComponent(this.ver))}this.elIframe.setAttribute(t.name,t.value)}}.bind(this)),this.elIframe.setAttribute("data-line-it-id",o.length),this.elIframe.setAttribute("scrolling","no"),this.elIframe.setAttribute("frameborder","0"),this.elIframe.setAttribute("allowtransparency","true"),this.params.push("id="+o.length),this.params.push("origin="+encodeURIComponent(location.href)),this.params.push("title="+encodeURIComponent(document.title)),this.params.push("env="+encodeURIComponent(this.env))},e.prototype.setIframeStyle=function(){this.elIframe.setAttribute("style","width: 0px; height: 0px; visibility: visible; position:static !important; opacity:1 !important"),this.elIframe.className="line-it-button"},e.prototype.setIframeSrc=function(){this.elIframe.src=s.BUTTON_URL.HOST[this.env]+s.BUTTON_URL[this.buttonType]+this.params.join("&")},e.prototype.validateParam=function(t){for(var e=0;e<this.params.length;e++){if(this.params[e].split("=")[0]==t)return!0}return!1},e.prototype.attach=function(){this.initDefaultAttributes(),this.setIframeStyle(),this.setIframeSrc(),this.entry.parentNode.replaceChild(this.elIframe,this.entry)},i.prototype=new e,i.prototype.constructor=i,i.prototype.setAdditionalParams=function(){r.call(this,this.entry.getAttribute("data-url"),"url"),r.call(this,this.entry.getAttribute("data-type"),"buttonType",!0),r.call(this,this.entry.getAttribute("data-size"),"size",!0),r.call(this,this.entry.getAttribute("data-count"),"count"),r.call(this,this.entry.getAttribute("data-color"),"color",!0),r.call(this,this.entry.getAttribute("data-dummyCount"),"dummyCount")},i.prototype.init=function(){this.setAdditionalParams(),this.attach()},a.prototype=new e,a.prototype.constructor=a,a.prototype.setAdditionalParams=function(){r.call(this,this.entry.getAttribute("data-lineId"),"lineId"),r.call(this,this.entry.getAttribute("data-count"),"count"),r.call(this,this.entry.getAttribute("data-home"),"home")},a.prototype.init=function(){this.setAdditionalParams(),this.validateParam("lineId")&&this.attach()},n.prototype=new e,n.prototype.constructor=n,n.prototype.setAdditionalParams=function(){r.call(this,this.entry.getAttribute("data-url"),"url"),r.call(this,this.entry.getAttribute("data-share"),"includeShare"),r.call(this,this.entry.getAttribute("data-lineId"),"lineId")},n.prototype.init=function(){this.setAdditionalParams(),this.validateParam("url")&&this.attach()},null==window.LineIt.loadButton&&(window.LineIt.loadButton=l,window.addEventListener("message",function(t){var e=t.data,i=!1;for(var a in s.BUTTON_URL.HOST)t.origin===s.BUTTON_URL.HOST[a]&&(i=!0);if("https://timeline.line.me"===t.origin&&(i=!0),i&&/^\{.+\}$/.test(e)){var n=JSON.parse(e),r=o[n.buttonId];if("setTitle"==n.type&&(r.elIframe.title=n.title),"resize"===n.type&&(r.elIframe.style.width=n.width+"px",r.elIframe.style.height=n.height+"px",r=null),"refresh"===n.type)for(var l=0;l<o.length;l++){var h=o[l].elIframe;h&&l!=n.buttonId&&(h.src=h.src)}}}))}();`
5	document.body.appendChild(lineScript)
6
7	// facebook
8	var fbRoot = document.getElementById('fb-root')
9	if (fbRoot) {
10		var fbScript = document.createElement('script'),
11			fbScriptContent = '',
12			fbVersion = fbRoot.getAttribute('data-version')
13				? fbRoot.getAttribute('data-version')
14				: 'v2.12',
15			fbLanguage = fbRoot.getAttribute('data-language')
16				? fbRoot.getAttribute('data-language')
17				: 'ja_JP'
18
19		fbVersion =
20			fbVersion.substr(0, 1).toLowerCase() == 'v'
21				? fbVersion.substr(1)
22				: fbVersion
23
24		fbScriptContent += '(function(d, s, id) {'
25		fbScriptContent += 'var js, fjs = d.getElementsByTagName(s)[0];'
26		fbScriptContent += 'if (d.getElementById(id)) return;'
27		fbScriptContent += 'js = d.createElement(s);'
28		fbScriptContent += 'js.id = id;'
29		fbScriptContent += 'js.async = true;'
30		fbScriptContent +=
31			'js.src = "https://connect.facebook.net/' +
32			fbLanguage +
33			'/sdk.js#xfbml=1&version=v' +
34			fbVersion +
35			'";'
36		fbScriptContent += 'fjs.parentNode.insertBefore(js, fjs);'
37		fbScriptContent += '}(document, "script", "facebook-jssdk"));'
38
39		fbScript.innerHTML = fbScriptContent
40		document.body.appendChild(fbScript)
41	}
42
43	var __socialsHTML__ = '',
44		__socialsLang =
45			$('html').attr('lang') !== undefined &&
46			$.trim($('html').attr('lang')).length == 2
47				? $.trim($('html').attr('lang')).toLowerCase()
48				: 'ja',
49		$socialsLine = '',
50		$socialsTwitter = '',
51		$socialsFacebook = '',
52		locationURL = window.location.href || location.href
53
54	$socialsTwitter += '<div class="social-twitter">'
55	$socialsTwitter +=
56		'<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>'
57	$socialsTwitter +=
58		'<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>'
59	$socialsTwitter += '</div>'
60
61	$socialsFacebook += '<div class="social-facebook">'
62	$socialsFacebook +=
63		'<div class="fb-like" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>'
64	$socialsFacebook += '</div>'
65
66	$socialsLine += '<div class="social-line">'
67	$socialsLine +=
68		'<div class="line-it-button" data-lang="' +
69		__socialsLang +
70		'" data-type="like" data-url="' +
71		locationURL +
72		'" data-share="true" style="display: none;">'
73	$socialsLine += '</div>'
74	$socialsLine += '</div>'
75
76	if ($('#socialbuttons').length) {
77		var $socialsOrder =
78			typeof $('#socialbuttons').attr('data') != 'undefined'
79				? $('#socialbuttons').attr('data').split('')
80				: false
81
82		if (typeof $socialsOrder == 'object' && $socialsOrder.length) {
83			for (var socialsType in $socialsOrder) {
84				if ($.trim(socialsType).length > 0) {
85					socialsType = socialsType.toLowerCase()
86
87					if ($socialsOrder[socialsType].toLocaleLowerCase() === 'f')
88						__socialsHTML__ += $socialsFacebook
89					else if ($socialsOrder[socialsType].toLocaleLowerCase() === 't')
90						__socialsHTML__ += $socialsTwitter
91					else if ($socialsOrder[socialsType].toLocaleLowerCase() === 'l')
92						__socialsHTML__ += $socialsLine
93				}
94			}
95		} else {
96			__socialsHTML__ += $socialsTwitter
97			__socialsHTML__ += $socialsFacebook
98			__socialsHTML__ += $socialsLine
99		}
100
101		$('#socialbuttons').html(__socialsHTML__)
102
103		LineIt.loadButton()
104	}
105}
106
107// Check browser support observer
108if (typeof window.IntersectionObserver === 'function') {
109	// Create observer
110	var observer = new IntersectionObserver(
111		function (entries) {
112			entries.forEach(function (entry) {
113				if (entry.isIntersecting) {
114					appendSocials()
115					observer.unobserve(entry.target)
116				}
117			})
118		},
119		{
120			rootMargin: '0px',
121			threshold: 0.5,
122		}
123	)
124
125	// Start observer
126	observer.observe(document.querySelector('#socialbuttons'))
127} else {
128	// Check element in viewport
129	$(window).scroll(function () {
130		if (isElementInViewport($('#socialbuttons'))) {
131			appendSocials()
132			$(window).unbind('scroll')
133		}
134	})
135
136	function isElementInViewport(el) {
137		if (typeof jQuery === 'function' && el instanceof jQuery) {
138			el = el[0]
139		}
140
141		var rect = el.getBoundingClientRect()
142
143		return (
144			rect.top >= 0 &&
145			rect.left >= 0 &&
146			rect.bottom <=
147				(window.innerHeight || document.documentElement.clientHeight) &&
148			rect.right <= (window.innerWidth || document.documentElement.clientWidth)
149		)
150	}
151}

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.