PageSourceSearch

https://artemuseum.com/js/site_event_check.js?1596495221

js artemuseum.com collected 2026-09-24 09:35:16 UTC 7,424 bytes, 254 lines download raw bytes

1/*
2	페이지에서 일어나는 이벤트(클릭, 이동, 입력 등등)에 대한 체크를 위한 js (추후 사용자의 이벤트 체크 후 데이터 수집을 위해 분리생성)
3 */
4var SECURITY_PRIVACY = function(){ //개인정보 보호 설정 관련 이벤트
5
6	var ONE_MINUTE = 60 * 1000; //1분
7	var TWO_MINUTES = 2 * 60 * 1000; //2분
8	var NEXT_ACTION_TIME_LOCAL_STORAGE_KEY = 'NEXT_ACTION_TIME';
9
10	var event_setting_timer; //마우스, 키보드 이벤트 등록되기까지의 타이머
11	var logout_warning_timer; //로그아웃 경고 출력되기까지의 타이머
12	var auto_logout_timer; //자동 로그아웃 되기까지 타이머
13
14	var setAutoLogoutEvent = function(auto_logout_time){
15
16		if(IS_IE){
17			if(typeof event_setting_timer !== 'undefined'){
18				clearTimeout(event_setting_timer);
19			}
20			if(typeof logout_warning_timer !== 'undefined'){
21				clearTimeout(logout_warning_timer);
22			}
23			if(typeof auto_logout_timer !== 'undefined'){
24				clearTimeout(auto_logout_timer);
25			}
26
27			window.addEventListener('storage', function(e){
28				//IE일 경우 localstorage 동기화 처리를 위해 리스너를 등록 - 등록하면 자동으로 동기화 처리됨
29			});
30		}else{
31			deleteTimeout();
32		}
33
34		removeFocusListner(); //창이 2개이상일경우 새로 타임이 셋팅될때 포커스 리스너 제거
35
36		//같은 브라우저의 창이 여러개일 경우 하나라도 사용중이면 미사용중인 브라우저의 timeout이 동작안되도록 비교하기위한 시간 저장
37		var next_action_time = new Date();
38		next_action_time.setMinutes(next_action_time.getMinutes() + 1);
39
40		LOCAL_STORAGE.setLocalStorage(NEXT_ACTION_TIME_LOCAL_STORAGE_KEY, next_action_time);
41
42		event_setting_timer = setTimeout(function(){
43			setActionEvent(auto_logout_time); // 로그아웃타임 = 1
44		}, ONE_MINUTE);
45	};
46
47	var openChangePasswordNotice = function(month_notice){
48		$.cocoaDialog.close();
49		$.ajax({
50			type : "POST",
51			url : ("/ajax/change_password_notice.cm"),
52			data : {month_notice : month_notice},
53			dataType : "html",
54			async : true,
55			cache : false,
56			success : function(html){
57
58				var $html = $(html);
59				var change_password_btn = $html.find("._change_password_btn"); // 변경하기 버튼
60				var not_change_password_btn = $html.find("._not_change_password_btn"); //다음에 변경하기 버튼
61
62				change_password_btn.off("click").on("click", function(e){
63
64					changePassword();
65					e.preventDefault();
66					return false;
67				});
68
69				not_change_password_btn.off("click").on("click", function(e){
70
71					notChangePassword();
72					e.preventDefault();
73					return false;
74				});
75
76				$.cocoaDialog.open({type : "admin_change_password", custom_popup : $html, "close_block" : true});
77			}
78		});
79	};
80
81	function resetAutoLogoutEvent(auto_logout_time){
82		removeActionEvent();
83		deleteTimeout(logout_warning_timer); //로그아웃 경고 타이머 해제
84		deleteTimeout(auto_logout_timer); //로그아웃 경고 내에서 설정한 자동로그아웃 타이머 해제
85
86		setAutoLogoutEvent(auto_logout_time);
87	}
88
89	//*--------------------------------------------------------------------
90	//** 내부사용 함수
91	//*--------------------------------------------------------------------
92
93	/**
94	 * 마우스, 키보드등 사용자 액션 이벤트 셋팅
95	 * @param auto_logout_time
96	 */
97	function setActionEvent(auto_logout_time){
98
99		var action_time = LOCAL_STORAGE.getLocalStorage(NEXT_ACTION_TIME_LOCAL_STORAGE_KEY); //세팅된 시간으로부터(현재 시간) 1분 뒤
100
101		if(new Date(action_time).getTime() <= new Date().getTime()){ //Time out 후 액션이 발생해야되는 시간이 현재시간보다 작을때만 실행 (액션 발생 시간이 현재 시간보다 크면 다른 탭을 이용중인 경우)
102			//자동로그아웃 1분전 로그아웃 경고 셋팅
103			logout_warning_timer = setTimeout(function(){
104				removeActionEvent();
105				showLogoutWarning(auto_logout_time);
106			}, (auto_logout_time * ONE_MINUTE) - TWO_MINUTES);
107
108			$(document).off("mousemove keydown").on("mousemove keydown", function(){
109
110				removeActionEvent();
111				deleteTimeout(logout_warning_timer); //로그아웃 경고 타이머 해제
112				deleteTimeout(auto_logout_timer); //로그아웃 경고 내에서 설정한 자동로그아웃 타이머 해제
113
114				setAutoLogoutEvent(auto_logout_time);
115			});
116		}else{
117
118			//다른 창에서 다시 돌아올 경우 로그아웃 시간을 다시 셋팅해야함(페이지 이동시에는 자동셋팅하나 창으로 돌아만왓을경우는 셋팅이 필요)
119			$(document).off("focus").on("focus", function(){
120				setAutoLogoutEvent(auto_logout_time);
121			});
122		}
123	}
124
125	/**
126	 * 자동 로그아웃 1분전 경고 출력 이벤트
127	 * @param auto_logout_time
128	 */
129	function showLogoutWarning(auto_logout_time){
130
131		//자동 로그아웃 알림 셋팅
132		auto_logout_timer = setTimeout(function(){
133
134			removeActionEvent();
135			$.cocoaDialog.hide();
136			LOCAL_STORAGE.setLocalStorage("IS_AUTO_LOGOUT", "Y"); //로그아웃 후 자동로그아웃이면 안내 얼럿 띄워주기위해 셋팅
137			location.href = "/logout.cm";
138		}, ONE_MINUTE);
139
140		showAutoLogoutAlert(auto_logout_time);
141	}
142
143	/**
144	 * 자동로그아웃 관련 얼럿창
145	 * @param auto_logout_time
146	 */
147	function showAutoLogoutAlert(auto_logout_time){
148
149		$.ajax({
150			type : "POST",
151			url : ("/ajax/auto_logout_alert.cm"),
152			data : {auto_logout_time : auto_logout_time},
153			dataType : "html",
154			async : false,
155			cache : false,
156			success : function(html){
157				$.cocoaDialog.open({type : "site_alert", custom_popup : html, "close_block" : true});
158			}
159		});
160	}
161
162	/**
163	 * 설정된 타임아웃 제거
164	 * @param timer_id
165	 */
166	function deleteTimeout(timer_id){
167		if(!timer_id){
168			clearTimeout();
169		}else{
170			clearTimeout(timer_id);
171		}
172	}
173
174	/**
175	 * 마우스, 키보드 등 사용자 액션 이벤트 제거
176	 */
177	function removeActionEvent(){
178		$(document).off("mousemove keydown");
179	}
180
181	/**
182	 * 포커스 리스닝 이벤트 제거
183	 */
184	function removeFocusListner(){
185		$(document).off("focus");
186	}
187
188	/**
189	 * 비밀번호 변경 클릭시 동작
190	 */
191	function changePassword(){
192
193		var data = $("#change_password_notice").serializeObject();
194
195		$.ajax({
196			type : "POST",
197			url : ("/ajax/change_password.cm"),
198			data : data,
199			dataType : "json",
200			async : false,
201			cache : false,
202			success : function(res){
203
204				if(res.msg === "SUCCESS"){
205
206					window.location.reload();
207
208				}else{
209
210					var join_form = $("#change_password_notice");
211					var object = join_form.find("._" + res.type);
212
213					join_form.find("._item").toggleClass("triangle", false);
214					join_form.find("._msg").text("");
215					object.toggleClass("triangle", true);
216					object.find("input").focus();
217					object.find("._msg").text(res.msg);
218				}
219			}
220		});
221	}
222
223	/**
224	 * 다음에 변경하기 클릭시 동작
225	 */
226	function notChangePassword(){
227
228		$.ajax({
229			type : "POST",
230			url : ("/ajax/not_change_password.cm"),
231			dataType : "json",
232			async : false,
233			cache : false,
234			success : function(res){
235
236				if(res.msg === "SUCCESS"){
237					$.cocoaDialog.close();
238				}
239			}
240		});
241	}
242
243	return {
244		"setAutoLogoutEvent" : function(auto_logout_time){
245			setAutoLogoutEvent(auto_logout_time);
246		},
247		"openChangePasswordNotice" : function(month_notice){
248			openChangePasswordNotice(month_notice);
249		},
250		"resetAutoLogoutEvent" : function(auto_logout_time){
251			resetAutoLogoutEvent(auto_logout_time);
252		}
253	};
254}();

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.