PageSourceSearch

https://www.nmc.or.kr/common/js/common.js

js nmc.or.kr collected 2026-10-01 11:49:20 UTC 5,793 bytes, 196 lines download raw bytes

1const regex = /\([^)]*\)/;
2const regId = /^[a-z0-9]{6,20}$/;
3const regIdChck = /[^a-z|^0-9]/;
4const regPswd = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,16}$/;
5const regPswdChck = /[^A-Za-z\d@$!%*#?&]/;
6const regTel = /[^0-9]/gi;
7const regEmailDomain = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,4}$/i;
8const regEmail = /[^0-9a-zA-Z\.]/gi;
9const regEmailId = /[^0-9a-zA-Z\._-]/gi;
10
11$(document).ready(function() {
12	$('.sideMenu .sideButton').click(function(){
13        $('.sideMenu').toggleClass('active');
14    })
15    $('.sitemap .shortcut').click(function(){
16        $('.sitemap .shortcut').toggleClass('active');
17    });
18    $('.sitemap .related').click(function(){
19        $('.sitemap .related').toggleClass('active');
20    });
21});
22
23
24/**
25 * 헤더 > 로그인클릭시 현재 url 저장
26 * @returns
27 */
28function getLoginForm(){
29	
30	const url = encodeURIComponent(window.location.pathname + (window.location.search != '' ? window.location.search : ''));
31	
32	if(url != null){
33		location.href="/nmc/user/login?url=" + url;
34	}else{
35		location.href="/nmc/user/login";
36	}
37}
38
39/**
40 * 스크롤 막기
41 * 
42 * @param scroll boolean
43 * @returns
44 */
45let scrollPosition = 0;
46function toggleBodyScoll(scroll) {
47	const body = document.querySelector('body');
48	
49	if(scroll) {
50		scrollPosition = window.pageYOffset;
51		body.style.overflow = 'hidden';
52		body.style.position = 'fixed';
53		body.style.width = '100%'
54		body.style.top = `-${scrollPosition}px`;
55	} else {
56		body.style.removeProperty('overflow');
57		body.style.removeProperty('position');
58		body.style.removeProperty('top');
59		body.style.removeProperty('width');
60		window.scrollTo(0, scrollPosition);
61	}
62}
63
64/**
65 * 클립보드에 복사
66 * 
67 * @param text
68 * @param itemName
69 * @returns
70 */
71function copyToClipboard(text, itemName, obj) {
72	let copyElement = document.createElement('textarea');
73	document.body.appendChild(copyElement);
74	copyElement.setAttribute('display', 'none');
75	copyElement.value = text;
76	copyElement.select();
77	copyElement.setSelectionRange(0, 9999);
78	document.execCommand('copy');
79	copyElement.setSelectionRange(0, 0);
80	document.body.removeChild(copyElement);
81	
82	let alertMsg = '클립보드에 ' + ((itemName != undefined && itemName != '') ? itemName + (checkName(itemName) == 0 ? '가 ' : '이 ') : '') + '복사되었습니다.';
83	
84	if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) != true && $('#toastMessage').length < 1) {
85		let toastElement = '';
86		toastElement += '<div id="toastMessage" style="display: none; position: fixed; top: 20px; left: 50%; transform: translate(-50%, 0); z-index: 9999; width: 100%;">';
87		toastElement += '	<div style="display:flex; justify-content: center;">';
88		toastElement += '			<span style="padding: 16px 24px; border-radius: 8px; background: rgba(0,0,0,0.7); color:#fff;">' + alertMsg + '</span>';
89		toastElement += '	</div>';
90		toastElement += '</div>';
91		$('body').prepend(toastElement);
92		$('#toastMessage').fadeIn(500);
93		setTimeout(function(){
94			$('#toastMessage').fadeOut(500);
95			setTimeout(function() {
96				$('#toastMessage').remove();
97			}, 1000);
98		}, 2000);
99	}
100	
101	if(obj != undefined || obj != null){
102		$(obj).focus();
103	}
104	
105}
106
107/** 파일 다운로드
108 * 
109 * @param atchFileId
110 * @param atchFileSn
111 * @returns
112 */
113function downloadFile(atchFileId , atchFileSn) {
114	window.open('/common'+ '/file/download?atchFileId=' + atchFileId + '&atchFileSn=' + atchFileSn , 'hiddenFrame');
115}
116
117function cancelJoin(siteId){
118	if(confirm("회원가입을 취소하시겠습니까? 현재 정보는 저장되지 않습니다.")){
119		location.href='/' + siteId + '/main';
120	}
121}
122
123/**
124 * 쿠키 설정
125 * 
126 * @param name		쿠키 이름
127 * @param value		쿠키 값
128 * @param expire	만료일시
129 * @returns
130 */
131function setCookie(name, value, expire) {
132	document.cookie = name + '=' + value + ';expires=' + expire + ';';
133}
134
135/**
136 * 쿠키 조회
137 * 
138 * @param name	쿠키 이름
139 * @returns
140 */
141function getCookie(name) {
142	let cookieString = document.cookie.split(";");
143	let cookieValue = null;
144	$.each(cookieString, function(idx, item) {
145		let cookieName = item.split("=")[0].trim();
146		if(cookieName == name) {
147			cookieValue = item.split("=")[1].trim();
148			return;
149		}
150	});
151    return cookieValue;
152}
153
154/**
155 * 지도 표출하기
156 * 
157 * @param id	태그 아이디
158 * @param name	위치명(빠른길찾기용)
159 * @param lat	위도
160 * @param lot	경도
161 * @param telno	전화번호
162 * @returns
163 */
164function getKakaoMap(id, name, lat, lot, telno) {
165	var mapContainer = document.getElementById('mapModal');
166	var mapOption = { 
167			center: new kakao.maps.LatLng(lat, lot), // 지도 중심좌표
168			level: 4 // 지도의 확대 레벨
169		}; 
170
171	var map = new kakao.maps.Map(mapContainer, mapOption); // 지도 생성
172
173	var content = '';
174	content += '<div class="map_info">';
175	content += '	<div class="map_pin"></div>';
176	content += '	<div class="map_infoWrap">';
177	content += '		<div class="map_link">';
178	content += '			<a href="https://map.kakao.com/link/to/' + name + ',' + lat + ',' + lot + '" target="_blank">빠른길 찾기<i></i></a>';
179	content += '		</div>';
180	if(telno != undefined && telno != null && telno.trim() != '') {
181		content += '		<div class="map_call">';
182		content += '			<i></i>' + telno;
183		content += '		</div>';
184	}
185	content += '	</div>';
186	content += '</div>';
187	
188	// 커스텀 오버레이가 표시될 위치입니다 
189	var position = new kakao.maps.LatLng(lat, lot);
190	var customOverlay = new kakao.maps.CustomOverlay({
191	    position: position,
192	    content: content
193	});
194
195	customOverlay.setMap(map); // 오버레이 지도 표시
196}

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.