PageSourceSearch

https://tripackage.net/wp-content/plugins/cosmosfarm-share-buttons/js/cosmosfarm-share-buttons.js?ver=1.9

js tripackage.net collected 2026-10-07 14:45:58 UTC 3,743 bytes, 93 lines download raw bytes

1/**
2 * @author https://www.cosmosfarm.com
3 */
4
5function cosmosfarm_share_is_mobile(){
6	var mobile = new Array('iPhone', 'iPad', 'iPod', 'BlackBerry', 'Android', 'Windows CE', 'LG', 'MOT', 'SAMSUNG', 'SonyEricsson', 'Opera Mini', 'IEMobile');
7	for(var word in mobile){
8		if(navigator.userAgent.match(mobile[word]) != null) return true;
9	}
10	return false;
11}
12function cosmosfarm_share_naver(url, text){
13	var w = 720;
14	var h = 720;
15	var popup = window.open("http://share.naver.com/web/shareView.nhn?url="+encodeURIComponent(url)+"&title="+encodeURIComponent(text), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
16	return false;
17}
18function cosmosfarm_share_facebook(url){
19	var w = 720;
20	var h = 350;
21	jQuery.post('https://graph.facebook.com', {id:encodeURI(url),scrape:true});
22	window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(url), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
23	return false;
24}
25function cosmosfarm_share_twitter(url, text){
26	var w = 720;
27	var h = 350;
28	window.open('https://twitter.com/intent/tweet?text='+encodeURIComponent(text)+'&url='+encodeURIComponent(url), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
29	return false;
30}
31function cosmosfarm_share_band(url, text){
32	var w = 410;
33	var h = 540;
34	window.open('http://www.band.us/plugin/share?body='+encodeURIComponent(text)+encodeURIComponent("\n")+encodeURIComponent(url)+'&route='+encodeURIComponent(url), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
35	return false;
36}
37function cosmosfarm_share_kakaostory(url, text){
38	Kakao.Story.share({
39		url: encodeURI(url),
40		text: text
41	});
42	return false;
43}
44function cosmosfarm_share_kakaotalk(url, text){
45	var share_img_src = jQuery('meta[property="og:image"]').last().attr('content') || cosmosfarm_share_settings.default_img_src;
46	if(share_img_src){
47		Kakao.Link.sendDefault({
48			objectType: 'feed',
49			content: {
50				title: text,
51				imageUrl: share_img_src,
52				link: {
53					mobileWebUrl: url,
54					webUrl: url
55				}
56			}
57		});
58	}
59	else{
60		alert('소셜 공유 버튼 설정에서 공유하기 기본 이미지를 선택해주세요.');
61	}
62	return false;
63}
64function cosmosfarm_share_google(url){
65	var w = 600;
66	var h = 600;
67	window.open('https://plus.google.com/share?url='+encodeURIComponent(url), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
68	return false;
69}
70function cosmosfarm_share_line(url, text){
71	if(cosmosfarm_share_is_mobile()){
72		var w = 410;
73		var h = 540;
74		window.open('http://line.me/R/msg/text/?'+encodeURIComponent(text)+encodeURIComponent("\n")+encodeURIComponent(url), 'cosmosfarm_share', 'width='+w+',height='+h+',left='+(screen.availWidth-w)*0.5+',top='+(screen.availHeight-h)*0.5);
75	}
76	else{
77		alert('라인이 설치된 모바일에서만 가능합니다.');
78	}
79	return false;
80}
81function cosmosfarm_share(sns, url, title){
82	switch(sns){
83		case 'naver': cosmosfarm_share_naver(url, title); break;
84		case 'facebook': cosmosfarm_share_facebook(url); break;
85		case 'twitter': cosmosfarm_share_twitter(url, title); break;
86		case 'band': cosmosfarm_share_band(url, title); break;
87		case 'kakaostory': cosmosfarm_share_kakaostory(url, title); break;
88		case 'kakaotalk': cosmosfarm_share_kakaotalk(url, title); break;
89		case 'google': cosmosfarm_share_google(url); break;
90		case 'line': cosmosfarm_share_line(url, title); break;
91	}
92	return false;
93}

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.