PageSourceSearch

https://munjang.or.kr/js/shareSns.js

js munjang.or.kr collected 2026-09-25 03:54:13 UTC 3,777 bytes, 129 lines download raw bytes

1
2function board_btn_share(sns) {
3	if (!Kakao.isInitialized()) {
4		Kakao.init('99ac657f5b16f033957c8872984f083c');
5		//카카오 공유하기 키 값
6	}
7
8	const urlParams = new URL(location.href).searchParams;
9
10	let url = "";
11	let act = urlParams.get("act");
12	let bid = urlParams.get("bid");
13	let list_no = urlParams.get("list_no");
14	let title = "";
15	let thumNail = "";
16
17
18
19	//자료광장 게시물 정보 가져오기 (상세페이지 일때)
20	let maincategory = urlParams.get("maincategory");
21	let subcategory = urlParams.get("subcategory");
22	let data_id = urlParams.get("data_id");
23
24
25	if (act == "view") {
26		//상세보기
27	} else {
28		//리스트
29		if (data_id) {
30			//자료광장 추후 db에 저장하게 된다면 여기서 작업
31		} else {
32			//일반 게시글 리스트 일때
33			bid = document.querySelector(".modal_share_bid").value;
34			list_no = document.querySelector(".modal_share_list_no").value;
35		}
36	}
37
38	//기본 메타데이터에 저장된 정보들 
39	let thumbImg = $('meta[property="og:image"]').attr('content'); //og이미지 주소
40	let thumbTitle = $('meta[property="og:title"]').attr('content'); //og타이틀
41	//let thumbDesc = $('meta[property="og:description"]').attr('content'); //og설명
42	//let linkUrl = $('meta[property="og:url"]').attr('content'); //url
43
44	//모달에 전달된 값 가져오기
45	title = document.querySelector(".modal_share_title").value == '' ? thumbTitle : document.querySelector(".modal_share_title").value;
46	url = document.querySelector(".modal_share_url").value;
47
48	//공유하기 시 팝업 사이즈 조절
49	let popupSize = "width=500,height=600"
50
51	if (sns == "facebook") {
52		window.open("http://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(url) + "&text=" + encodeURIComponent(), "", popupSize);
53	}
54	if (sns == "twitter") {
55		window.open("http://twitter.com/share?url=" + encodeURIComponent(url), "", popupSize);
56	}
57
58	if (sns == "kakao") {
59		//게시물 썸네일 추가
60		thumNail = `https://munjang.or.kr/boardImgView.es?bid=${bid}&list_no=${list_no}`;
61		Kakao.Link.sendDefault({
62			objectType: "feed",
63			content: {
64				title,
65				imageUrl: thumNail,
66				link: {
67					mobileWebUrl: document.querySelector(".modal_share_url").value,
68					webUrl: document.querySelector(".modal_share_url").value,
69				},
70			},
71			social: {
72			},
73			buttons: [
74				{
75					title: "웹으로 보기",
76					link: {
77						mobileWebUrl: document.querySelector(".modal_share_url").value,
78						webUrl: document.querySelector(".modal_share_url").value,
79					},
80				},
81				{
82					title: "앱으로 보기",
83					link: {
84						mobileWebUrl: document.querySelector(".modal_share_url").value,
85						webUrl: document.querySelector(".modal_share_url").value,
86					},
87				},
88			],
89		});
90	}
91
92
93	//자료광장에서는 업데이트 x
94	if (!data_id || maincategory == "90") {
95		$.ajax({
96			type: "GET",
97			url: "/sharesns",
98			data: {
99				bid,
100				list_no,
101				data_id,
102				maincategory,
103				subcategory,
104			},
105			success: function(response) {
106				document.querySelector("#modal_share").style.display = "none";
107				document.querySelector("#modal_share").classList.remove(".opened_layer");
108
109				//GTE 게시판용
110				let GteNumCount = document.querySelectorAll(".thumb_hover");
111				if (GteNumCount) {
112					GteNumCount.forEach((el) => {
113						if (el.classList.contains(list_no)) {
114							el.querySelector(".shareNum span").innerText = response.shareCount;
115						}
116					});
117				}
118
119				let dbNumCount = document.querySelectorAll(".share");
120				if (dbNumCount) {
121					dbNumCount.forEach((el) => {
122						el.lastChild.innerText = response.shareCount;
123					});
124				}
125			},
126			error: function(error) { },
127		});
128	}
129}

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.