PageSourceSearch

https://www.anipen.com/wp-content/themes/anipen/assets/js/site_function.js?ver=6.0.2

js anipen.com collected 2026-09-24 09:45:04 UTC 9,893 bytes, 295 lines download raw bytes

1//MOBILE MENU
2jQuery("header .nav .nav-icon").click(function() {
3	jQuery(this).toggleClass("active");
4	jQuery("header .navbar").toggleClass("active");
5	jQuery("html, body").toggleClass("hidden");
6});
7jQuery(document).on("click",".nav .navbar.active>li.menu-item-has-children > a", function() {
8	jQuery(this).removeAttr('href');
9	var is_display = jQuery(this).next(".sub-menu").css("display");
10	if (is_display == "block") {
11		jQuery(this).next(".sub-menu").stop().slideUp();
12		jQuery(this).parent('li').removeClass('active');
13	} else {
14		jQuery(".sub-menu").stop().slideUp();
15		jQuery(this).next(".sub-menu").stop().slideDown();
16		jQuery(".nav .navbar.active>li.menu-item-has-children").removeClass('active');
17		jQuery(this).parent('li').addClass('active');
18	}
19	return false;
20});
21
22//팝업
23// function layer_open(no) {
24// 	jQuery(".pop_wrap").fadeIn();
25// 	$(".pop_wrap .pop[layer=" + no + "]").fadeIn();
26// 	jQuery("body, html").addClass("on");
27// };
28// function layer_close() {
29// 	jQuery(".pop_wrap, .pop_wrap .pop").fadeOut();
30// 	jQuery("body, html").removeClass("on");
31// };
32//
33// //해당 버튼 클릭시 해당 레이어팝업 호출
34// jQuery(".open_pop").click(function() {
35// 	var no = jQuery(this).attr("layer");
36// 	layer_open(no);
37// 	jQuery("body, html").addClass("on");
38// });
39// jQuery(".pop .close").click(function() {
40// 	layer_close();
41// });
42
43//Top 버튼
44jQuery('.to-top').click(function() {
45	jQuery('html, body').animate({
46		scrollTop: 0
47	}, 400);
48	return false;
49});
50
51jQuery("textarea").change(function(){
52	var current_val = jQuery(this).val();
53
54	current_val = current_val.replace(/</g, "&lt;").replace(/>/g, "&gt;");
55	current_val = current_val.replace(/'/g, "&quot;").replace(/"/g, '&#39;');
56	current_val = current_val.replace(/(<([^>]+)>)/ig,"");
57	jQuery(this).val(current_val);
58});
59
60//게시판 검색
61jQuery("#keyword").keydown(function(key) {
62	if (key.keyCode == 13) {
63		jQuery('#keyword_btn').trigger('click');
64	}
65});
66jQuery("#keyword_btn").click(function(){
67	if(document.location.hash && document.location.hash != "#1") {
68		document.location.hash = "#1";
69	}
70	jQuery(this).parents('form').submit();
71});
72
73//xss 방지
74jQuery('input[type=text],input[type=tel], textarea').on("propertychange change keyup paste input", function() {
75	var current_value = jQuery(this).val();
76	current_value = current_value.replace(/</gi, '');
77	current_value = current_value.replace(/>/gi, '');
78	current_value = current_value.replace('\'', '');
79	current_value = current_value.replace('"', '');
80	jQuery(this).val(current_value);
81});
82
83// get 파리미터 가져오기
84function getUrlParam(name) {
85
86	// 한글 파리미터 인코딩
87	var search = unescape(encodeURIComponent(location.search));
88	search = decodeURIComponent(search);
89
90	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
91	var r = search.substr(1).match(reg);
92	if (r != null) return unescape(r[2]); return null;
93}
94
95var isEmpty = function(value){
96  if( value == "false" || value == 0 || value == "" || value == null || value == undefined || ( value != null && typeof value == "object" && !Object.keys(value).length ) ){
97	return true
98  }else{
99	return false
100  }
101};
102
103// 배열 내 모든값 변경
104function updateArray(myArray, oldValue, newValue) {
105  if (!myArray instanceof Array) return;
106  myArray.forEach(function() {
107      const index = myArray.indexOf(oldValue);
108      if (index !== -1) myArray[index] = newValue;
109  });
110}
111
112function deleteArray(myArray, value) {
113  if (!myArray instanceof Array) return;
114  // myArray.forEach(function(element, index, array) { // 파라미터 : 현재아이템, 인덱스, 배열
115  //     if(element==value) myArray.splice(index, 1);
116  // });
117  for(var i = 0; i < myArray.length; i++){
118    if (myArray[i] === value) {
119      myArray.splice(i, 1);
120      i--; //forEach를 안쓰고 for를 쓰면서 i--;를 하는 이유는 배열 삭제 후 길이가 -1이 되기 때문
121    }
122  }
123}
124
125//좋아요 버튼
126// jQuery(document).on("click", ".btn_like", function(event) {
127//     jQuery(this).addClass("on")
128// });
129// jQuery(document).on("click", ".btn_like.on", function(event) {
130//     jQuery(this).removeClass("on")
131// });
132
133//관심매장 버튼
134// jQuery(document).on("click", ".bookmark", function(event) {
135//     jQuery(this).addClass("on")
136// });
137// jQuery(document).on("click", ".bookmark.on", function(event) {
138//     jQuery(this).removeClass("on")
139// });
140
141
142// 이메일 형식 체크
143function check_email(user_email) {                                                 
144     var reg = /^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/;
145     if(!reg.test(user_email)) {                            
146          return false;         
147     } else {                       
148          return true;         
149     }                            
150} 
151
152// 비밀번호체크 8~20 대소문자,숫자,특수문자
153function check_password(user_password) {
154    var reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,20}$/;
155    if(!reg.test(user_password)) {
156        return false; // 부적절한 조합
157    } else {
158        return true;
159    }
160}
161
162// 휴대폰번호 체크
163function check_phone_cell(user_phone_cell) {
164    // var reg = /^01([0|1|6|7|8|9])-?([0-9]{3,4})-?([0-9]{4})$/; // "-"가 있던 없던 무시
165    var reg = /^010-?([0-9]{4})-?([0-9]{4})$/; // "-"가 있던 없던 무시
166    if (!reg.test(user_phone_cell)) {
167        return false; // 부적절한 조합
168    } else {
169        return true;
170    }
171}
172
173// 인증번호 체크
174function check_phone_cell_auth_number(user_phone_cell_auth_number) {
175    // var reg = /^01([0|1|6|7|8|9])-?([0-9]{3,4})-?([0-9]{4})$/; // "-"가 있던 없던 무시
176    var reg = /^([0-9]{6})$/; // "-"가 있던 없던 무시
177    if (!reg.test(user_phone_cell_auth_number)) {
178        return false; // 부적절한 조합
179    } else {
180        return true;
181    }
182}
183
184function replace_phone_cell(phone) { // 두번째 하이픈이 표시되지 않음
185    if(phone) return phone.replace(/^(\d{0,3})(\d{0,4})(\d{0,4})$/g, "$1-$2-$3").replace(/\-{1,2}$/g, ""); // xxx-xxxx-xxxx
186    // if(phone) return phone.replace(/^(\d{0,2})(\d{0,3})(\d{0,4})$/g, "$1-$2-$3").replace(/\-{1,2}$/g, ""); // xx-xxxx-xxxx
187    // return false;
188}
189
190function replace_phone(value) {
191    if (!value) {
192        return "";
193    }
194
195    value = value.replace(/[^0-9]/g, "");
196
197    let result = [];
198    let restNumber = "";
199
200    // 지역번호와 나머지 번호로 나누기
201    if (value.startsWith("02")) {
202        // 서울 02 지역번호
203        result.push(value.substr(0, 2));
204        restNumber = value.substring(2);
205    } else if (value.startsWith("1")) {
206        // 지역 번호가 없는 경우
207        // 1xxx-yyyy
208        restNumber = value;
209    } else {
210        // 나머지 3자리 지역번호
211        // 0xx-yyyy-zzzz
212        result.push(value.substr(0, 3));
213        restNumber = value.substring(3);
214    }
215
216    if (restNumber.length === 7) {
217        // 7자리만 남았을 때는 xxx-yyyy
218        result.push(restNumber.substring(0, 3));
219        result.push(restNumber.substring(3));
220    } else {
221        result.push(restNumber.substring(0, 4));
222        result.push(restNumber.substring(4));
223    }
224
225    return result.filter((val) => val).join("-");
226}
227
228
229// 날짜체크
230function check_date(date) {
231    var regex = RegExp(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/);
232    if(regex.text(date)) return true;
233    return false;
234}
235
236function replace_date(date) { // 두번째 하이픈이 표시되지 않음
237    date = date.replace(/[^0-9]/g, '');
238    if(date.length>8) return date.substring(0, date.length - 1).replace(/^(\d{0,4})(\d{0,2})(\d{0,2})$/g, "$1-$2-$3").replace(/\-{1,2}$/g, "");
239    // console.log(date);
240    // console.log(date.length);
241    // if(date) return date.replace(/^(\d{0,4})(\d{0,2})(\d{0,2})$/g, "$1-$2-$3").replace(/\-{1,2}$/g, ""); // xxx-xxxx-xxxx
242    // if(date) return date.replace(/(\d{4})(\d{2})(\d{2})/g, '$1-$2-$3');
243    if(date) return date.replace(/^(\d{0,4})(\d{0,2})(\d{0,2})$/g, "$1-$2-$3").replace(/\-{1,2}$/g, ""); // xx-xxxx-xxxx
244    // return false;
245}
246
247
248// 모바일확인
249function isMobile(){
250	return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);}
251
252
253
254// 받침이 있는 문자인지 확인 함수
255const isSingleCharacter = function(text) {
256    var strGa = 44032; // 가
257    var strHih = 55203; // 힣
258
259    var lastStrCode = text.charCodeAt(text.length-1);
260
261    if(lastStrCode < strGa || lastStrCode > strHih) {
262        return false; //한글이 아닐 경우 false 반환
263    }
264	return (( lastStrCode - strGa ) % 28 == 0)
265}
266
267
268// '로' 가 붙어야 하는지 '으로'가 붙어야 하는지 체크해주는 함수
269const roChecker = function(text){
270	return text + (isSingleCharacter(text)? '로' : '으로');
271}
272// '를' 이 붙어야 하는지 '을'이 붙어야 하는지를 체크해주는 함수
273const rulChecker = function(text){
274	return text + (isSingleCharacter(text)? '를' : '을');
275}
276
277const gaChecker = function(text){
278	return text + (isSingleCharacter(text)? '가' : '이');
279}
280
281
282var getCookie = function(name) {
283	 var value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
284	 return value? value[2] : null;
285 };
286
287 var setCookie = function(name, value, exp) {
288	var date = new Date();
289	date.setTime(date.getTime() + exp*24*60*60*1000);
290	document.cookie = name + '=' + value + ';expires=' + date.toUTCString() + ';path=/';
291};
292
293var deleteCookie = function(name) {
294	document.cookie = name + '=; expires=Thu, 01 Jan 1999 00:00:10 GMT;path=/';
295}

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.