PageSourceSearch

https://www.sewu.ac.kr/_res/sewc/_share/js/cms-common.js?88082

js sewu.ac.kr collected 2026-10-03 00:27:10 UTC 12,052 bytes, 408 lines download raw bytes

1$(document).ready(function(){
2
3	$("#go_main").find("a").attr("href","#cms-print");
4
5
6	setTimeout(function(){
7		$('html').removeClass('no-js')
8	}, 500);	
9
10	// scrollert 실행
11	if($(document).find('.scrollert').length > 0){
12		setTimeout(function(){
13			$('.scrollert').scrollert({
14				//axes: ['y'], 
15				preventOuterScroll: false,
16				cssPrefix: 'scrollert',
17				eventNamespace: 'scrollert',
18				contentSelector: null
19			});
20		}, 20);
21
22		$(window).resize(function () {
23			setTimeout(function () {
24				$('.scrollert').scrollert('update');
25			}, 50);
26		});
27	}
28
29	// AOS
30	if($('body').hasClass('aos')){
31		AOS.init();
32	}
33
34	// 공통 common
35	App.ShareCommon.init();
36
37	// 메뉴 연동 tab 모바일 select box
38	App.TabMenu.init();
39
40	// 관련 사이트
41	App.SelectBox2.init();
42
43	// table scroll 실행
44	if($(document).find('.scrollbox').length > 0){
45		App.TableScroll.init('sewc');
46	}
47
48	/* 이미지 확대축소 */
49	if($(document).find('.zoom').length > 0){
50		App.imgZoom.init('sewc');
51	}
52
53	//클립보드 url 복사
54	if($(document).find('.share').length > 0){
55		App.clipBoardCopy.init();
56	}
57
58	// 메인페이지 내 탭 박스
59	if($(document).has('.mini-tab-box').length > 0){
60		App.mainTab.init();
61	}
62
63});
64
65
66//-----------------------------------------------------------------------------------------
67//Common
68//-----------------------------------------------------------------------------------------
69App.ShareCommon = function () {
70	var self, $this;
71	var scrollTop
72	return {
73		init: function () {
74
75			self = this;
76
77			// top 버튼 클릭
78			if($(document).has('.btn-top').length > 0){
79				$('.btn-top').click(function(e){
80					e.preventDefault();
81					$(window).off('scroll');
82					$('html, body').stop().animate({
83						scrollTop : 0
84					}, 300);
85				});
86			}
87
88			// cms 레이어팝업
89			if($(document).has('.layer-popup-wrap').length > 0){
90
91				// if($('.layer-popup-outer').find('.layer-popup-wrap.hide-important').length > 0){
92				// 	$('.layer-popup-outer').removeClass('on');
93				// }else{
94				// 	$('.layer-popup-outer').addClass('on');
95				// }
96
97				$('.btn-layer-close').click(function(){
98					var layerLeng = $('.layer-popup-outer').find('.layer-popup-wrap:visible').length;
99
100					if(layerLeng === 0){
101						$('.layer-popup-outer').removeClass('on');
102						$('.layer-popup-outer').hide();
103					}
104				});
105			}
106
107			// 컨텐츠 내 레이어팝업			
108			$('.layer-popup-btn').click(self.conLayerPopupOpen);
109			$(document).on("click", '.con-popup-close-btn, .con-popup-chk-btn', self.conLayerPopupClose);
110
111			//윈도우 팝업(PC)
112			if($(document).has('.window-popup').length > 0){
113				self.windowPop;
114				$(window).resize(function(){
115					self.windowPop;
116				});
117			}
118
119		},
120		tabSelect: function() {
121			// 서브페이지 접근성 탭 title="선택됨" 구분
122			if($(document).has('.tab-outer').length > 0){
123				$('.tab-box ul li').each(function() {
124					if($(this).hasClass('active')){
125						$(this).find('a').attr('title','선택됨');
126					}
127				});
128			}
129		}(),
130
131
132		windowPop: function() {
133			// 윈도우 팝업(pc) / 디바이스에서는 새창열림
134			$(document).on('click', '.window-popup', function(e){
135				if($('body').hasClass('pc')){
136					e.preventDefault();
137					var popUrl = $(this).attr('href');
138					$(this).attr('target', '');
139					window.open(popUrl, 'popup', 'width=1400,height=780,scrollbars=yes');
140				}else{					
141					$(this).attr('target', '_blank');
142				}
143			});
144		}(),
145		conLayerPopupOpen: function() {
146			var popupId = $(this).attr('href');
147
148			$(this).addClass('lp-open'); // 레이어팝업 닫은 후 버튼에 포커싱 유지 위한 클래스
149
150			$('.con-layer-popup-wrap' + popupId).addClass('on');
151			$('.con-layer-popup-wrap' + popupId).children('div').attr('tabindex', 0).focus();
152
153			$('body').addClass('over-hidden');
154		},
155		conLayerPopupClose: function() {
156			$(this).parents('.con-layer-popup-wrap').removeClass('on');			
157			$(this).parents('.con-layer-popup-wrap').children('div').removeAttr('tabindex');
158			$('body').removeClass('over-hidden');
159
160			$('.layer-popup-btn.lp-open').focus().removeClass('lp-open'); // 레이어팝업 버튼으로 다시 포커스
161		}
162	}
163}();
164
165//-----------------------------------------------------------------------------------------
166//select box(related site box)
167//-----------------------------------------------------------------------------------------
168App.SelectBox2 = function(){
169	var self;
170	var $relatedTitle, $relatedList;
171	return {
172		init: function(){
173			self = this;
174			$relatedTitle = $(".related-site-title");
175			$relatedList = $(".related-site");
176			$relatedTitle.click(self.onClick);
177
178			$(".related-site-wrap").each(function(){
179				var $thisBox = $(this);
180
181				$thisBox.find(".related-site-title").attr('title', '축소됨');
182
183
184				$(document).mouseup(function(e){
185					if($thisBox.has(e.target).length === 0){
186
187
188						$thisBox.find(".related-site-title").removeClass("active");
189						$thisBox.find(".related-site-box").hide();
190					}
191				});
192
193			});
194
195		},
196		onClick: function(e){
197			e.preventDefault();
198			$(".related-site-title").attr('title', '축소됨');
199			$(this).attr('title', '확장됨');
200			$(this).siblings('.related-site-box').toggle();
201			$(this).toggleClass("active", "");
202		}
203	}
204}();
205
206//------------------------------------------------------
207//object-fit(IE)
208//------------------------------------------------------  
209App.ObjectFit = function () {
210	var self;
211	return {
212		init: function (param) {
213			if ('objectFit' in document.documentElement.style === false) {
214				var container = document.querySelectorAll(param);
215				for (var i = 0; i < container.length; i++) {
216					var imageSource = container[i].querySelector('img').src;
217					container[i].querySelector('img').style.display = 'none';
218					container[i].style.backgroundSize = 'cover';
219					container[i].style.backgroundImage = 'url(' + imageSource + ')';	
220					container[i].style.backgroundPosition = '50% 0';
221				}
222			}
223		}
224	}
225};
226
227//------------------------------------------------------
228//table scroll
229//------------------------------------------------------  
230App.TableScroll = function(){
231	return {
232		init: function(cmsId){			
233			// 테이블에 .scrollbox 클래스 사용 시 스크롤 이미지 적용
234			if($(document).has('.table-wrap.scrollbox').length > 0){
235				var tableScrollImg = '<div class="msg-touch-help"><img src="/_res/' + cmsId + '/_share/img/common/ico-table-scroll.png" alt=""></div>';
236				$('.table-wrap.scrollbox').append(tableScrollImg); // 새로 추가(마크업 작성 시 스크롤이미지가 없었던 테이블까지 모두 추가하기 위함.)
237			}
238
239			$(".scrollbox").scroll(function() {
240				$(this).find(".msg-touch-help").fadeOut();
241			});
242		}
243	}
244}();
245
246//------------------------------------------------------
247//image zoom
248//------------------------------------------------------  
249App.imgZoom = function(){
250	return {
251		init: function(cmsId){            
252			// 이미지 박스에 .zoom 클래스 사용 시 확대 이미지 적용
253			if($(document).has('.img-box.zoom').length > 0){
254				$('.img-box.zoom').each(function(){
255					var imgSrc = $(this).find('img').attr('src');
256					var imgZoomIn = '<a href="'+ imgSrc +'" class="zoom-in pc-hide" title="새창열림" target="_blank"><img src="/_res/' + cmsId + '/_share/img/common/btn-enlargement.gif" alt=""></a>';
257					$(this).append(imgZoomIn);
258				});
259			}
260
261		}
262	}
263}();
264
265//-----------------------------------------------------------------------------------------
266//클립보드 url 복사  
267//-----------------------------------------------------------------------------------------
268App.clipBoardCopy = function () {
269	var self;
270	return {
271		init: function () {
272
273			// 클립보드 객체 생성
274			$('a#url-copy').click(function(){
275				//
276				var url = '';
277				var textarea = document.createElement("textarea");
278				document.body.appendChild(textarea);
279				url = window.document.location.href;
280				textarea.value = url;
281				textarea.select();
282				document.execCommand("copy");
283				document.body.removeChild(textarea);
284				alert("URL이 복사되었습니다.")
285			});
286
287		},
288		// URL 복사 
289		urlCopy : function(){
290
291			if( $('.url-copy').length > 0 ) {
292				loadJavascript ( '/_custom/ewha/resource/js/clipboard.min.js');
293				var $this = $('.url-copy');
294				//e.preventDefault();
295
296				$this.attr('data-clipboard-text', window.document.location.href);
297
298				var clipboard = new ClipboardJS('.url-copy');
299				clipboard.on('success', function(e){
300					alert('URL이 복사되었습니다.');
301					e.clearSelection();
302				});
303
304				clipboard.on('error', function(e){
305					alert($m('해당 기능을 지원하지 않는 브라우저입니다.'));
306				});
307			}
308		}
309	}
310}();
311
312//-----------------------------------------------------------------------------------------
313// 메인페이지 탭(공통)
314//-----------------------------------------------------------------------------------------
315App.mainTab = function(){
316	var self;
317	return {
318		init: function(){
319			self = this;
320			$('.mini-tab-box').find('ul > li > a.mini-board-tab').attr('title', '축소됨');
321			$('.mini-tab-box').find('ul > li.active > a.mini-board-tab').attr('title', '확장됨');
322			$('.mini-board-tab').on('click', function (e) {
323				if(!$(this).hasClass('link')){
324					e.preventDefault();
325					$(this).parent().siblings().removeClass('active');
326					$(this).parent().addClass('active');
327					$(this).parent().siblings().find('.mini-board-tab').attr('title','축소됨');
328					$(this).attr('title', '확장됨');
329				}
330			});
331		}
332	}
333}();
334
335//------------------------------------------------------
336// 메뉴 연동 tab 모바일 select box
337//------------------------------------------------------
338App.TabMenu = function () {
339	var self;
340	var $tabSel, $mTab;
341	return {
342		init: function () {
343			self = this;
344			$tabSel = $('.tab-sel');
345			$mTab = $(".m-tab-box");
346
347			var select_name = $tabSel.children('option:selected').text();
348			$tabSel.siblings('label').text(select_name);
349
350			$tabSel.on('change', function () {
351				var url = $(this).val();
352				if (url) {
353					window.location = url; // redirect
354				}
355
356				return false;
357			});
358
359			$mTab.click(self.onClick);
360		},
361		onClick: function(){
362			$mTab.toggleClass("active");
363			$tabSel.blur(function(){
364				$mTab.removeClass("active");
365			});
366		}
367	}
368}();
369
370//-----------------------------------------------------------------------------------------
371// 레이어팝업 포커싱 관련 접근성 - 실행문은 레이어팝업이 필요한 컨텐츠 내에 작성
372//-----------------------------------------------------------------------------------------
373App.layerWai = function () {
374	var self;
375	var layerBox, layerBoxTabbable, layerBoxTabbableFirst, layerBoxTabbableLast;
376	return {
377		init: function (param) {
378
379			layerBox = param;
380			layerBoxTabbable = layerBox.find("button, input:not([type='hidden']), select, iframe, textarea, [href], [tabindex]:not([tabindex='-1'])");
381			layerBoxTabbableFirst = layerBoxTabbable && layerBoxTabbable.first();
382			layerBoxTabbableLast = layerBoxTabbable && layerBoxTabbable.last();
383
384			var tabDisable;
385
386			layerBoxTabbable.length ? layerBoxTabbableFirst.focus().on("keydown", function(event) { 
387				// 레이어 열리자마자 초점 받을 수 있는 첫번째 요소로 초점 이동
388				if (event.shiftKey && (event.keyCode || event.which) === 9) {
389					// Shift + Tab키 : 초점 받을 수 있는 첫번째 요소에서 마지막 요소로 초점 이동
390					event.preventDefault();
391					layerBoxTabbableLast.focus();
392				}
393			}) : layerBox.attr("tabindex", "0").focus().on("keydown", function(event){
394				tabDisable = true;
395				if ((event.keyCode || event.which) === 9) event.preventDefault();
396				// Tab키 / Shift + Tab키 : 초점 받을 수 있는 요소가 없을 경우 레이어 밖으로 초점 이동 안되게
397			});
398
399			layerBoxTabbableLast.on("keydown", function(event) {
400				if (!event.shiftKey && (event.keyCode || event.which) === 9) {
401					// Tab키 : 초점 받을 수 있는 마지막 요소에서 첫번째 요소으로 초점 이동
402					event.preventDefault();
403					layerBoxTabbableFirst.focus();
404				}
405			});
406		}
407	}
408}();

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.