PageSourceSearch

https://ipsi.dst.ac.kr/resources/_Js/common.simple.js

js dst.ac.kr collected 2026-10-02 19:22:39 UTC 14,348 bytes, 436 lines download raw bytes

1/* https://jscompress.com/ */
2var console = window.console || { log: function() {} };
3var browser = (function() {
4	var userAgent = navigator.userAgent, s = userAgent.toLowerCase();
5	var match = /(webkit)[ \/](\w.]+)/.exec(s) || 		  /(opera)(?:.*version)?[ \/](\w.]+)/.exec(s) || 		  /(msie) ([\w.]+)/.exec(s) ||                		  /(mozilla)(?:.*? rv:([\w.]+))?/.exec(s) ||		 [];
6	function matchMediaQuery(query) {		return "matchMedia" in window ? matchMedia(query).matches : false; 	}
7	opera = window.opera && window.opera.buildNumber;	android = /Android/.test(userAgent);	webkit = /WebKit/.test(userAgent);
8	ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(navigator.appName);
9	ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
10	ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || navigator.appName.indexOf('Netscape') != -1) ? 11 : false;
11	ie12 = (userAgent.indexOf('Edge/') != -1 && !ie && !ie11) ? 12 : false;
12	ie = ie || ie11 || ie12;
13	gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
14	mac = userAgent.indexOf('Mac') != -1;
15	iDevice = /(iPad|iPhone)/.test(userAgent);
16	fileApi = "FormData" in window && "FileReader" in window && "URL" in window && !!URL.createObjectURL;
17	phone = matchMediaQuery("only screen and (max-device-width: 480px)") && (android || iDevice);
18	tablet = matchMediaQuery("only screen and (min-width: 800px)") && (android || iDevice);
19	windowsPhone = userAgent.indexOf('Windows Phone') != -1;
20	if ( ie12 ) {
21		webkit = false;
22	}
23	return {
24		name: match[1] || "", version: match[2] || "0",
25		opera: opera,	webkit: webkit,		ie: ie,		gecko: gecko,		mac: mac,		iOS: iDevice,		android: android,
26		documentMode: ie && !ie12 ? (document.documentMode || 7) : 10, fileApi: fileApi, desktop: !phone && !tablet,	windowsPhone: windowsPhone
27	};
28}());
29
30/*
31Object.create = function (o) {
32	function F() {
33	}
34	F.prototype = o;
35	return new F();
36}
37// */
38
39function isMobile(){
40	var mobileKeyWords = new Array('Android', 'iPhone', 'iPod', 'BlackBerry', 'Windows CE', 'SAMSUNG', 'LG', 'MOT', 'SonyEricsson');
41	for (var info in mobileKeyWords) {
42		if(navigator.userAgent.match(mobileKeyWords[info]) != null) {
43			return true;
44		}
45	}
46	return false;
47}
48
49var latestFocus = null;var fcsChk = true;
50function callLatestFocus() {
51	latestFocus =(event.srcElement.tagName=="A" || event.srcElement.tagName=="BUTTON")? $(event.srcElement) : $($(event.srcElement).parents("a,button").get(0)) ;
52}
53
54var _userAgent_ = navigator.userAgent;var isIe6 = (/msie 6/i).test(_userAgent_);var isIe7 = (/msie 7/i).test(_userAgent_);var isIe9 = (/msie 9/i).test(_userAgent_); var isComptMode = (/compatible/i).test(_userAgent_);
55var docChkTimer = null;var DOC_COMPLET = null;
56function docLoading(loadFunc) {
57	clearTimeout(docChkTimer);
58	if(document.readyState=="loaded" || document.readyState=="complete"){
59		DOC_COMPLET = true;
60		if(loadFunc!=undefined) loadFunc();
61	}
62	else{
63		docChkTimer = setTimeout(function(){docLoading(loadFunc);},500);
64	}
65}
66
67// 낮은 브라우저 사이즈 계산오류 보정
68function lowReloadCheck(func,load_obj) {
69	clearTimeout( load_obj.Timer );
70	if (!_isLowBr_) return  true;
71	try {
72		if ( _isLowBr_ && load_obj.cnt < load_obj.limit ) {
73			if ( $("body").width() > wsize.win.w ) {
74				load_obj.cnt++;
75				load_obj.Timer = setTimeout(func,250);
76				return false;
77			} else {
78				load_obj.cnt = 0;
79				return true;
80			}
81		}
82		if(load_obj.cnt== load_obj.limit) {
83			load_obj.cnt = 0;
84		}
85		return true;
86	} catch(e) {
87	}
88	return true;
89}
90
91// 이메일 주소 선택
92function email_domain( email_domain, value ) {
93	var f_obj = document.getElementById( email_domain );
94	f_obj.value = value;
95	if ( value == "" ) {
96		f_obj.style.display = "";
97		$(f_obj).next().removeClass("expand");
98	} else {
99		f_obj.style.display = "none";
100		$(f_obj).next().addClass("expand");
101	}
102}
103
104function add_option( obj, t_name,t_value ) {
105	var idx = obj.length;
106	obj.length= idx + 1;
107	obj.options[idx].text = t_name;
108	obj.options[idx].value= t_value;
109}
110
111function getBrowsertInfo() {
112	var $agent = navigator.userAgent;
113	var $s = "";
114	var $br = {browser:"",browserType:"",browserVer:[]};
115    if((/msie 5.0[0-9]*/i).test($agent))			{ $s = "MSIE 5.0"; }
116    else if((/msie 5.5[0-9]*/i).test($agent))		{ $s = "MSIE 5.5"; }
117    else if((/msie 6.0[0-9]*/i).test($agent))		{ $s = "MSIE 6.0"; }
118    else if((/msie 7.0[0-9]*/i).test($agent))		{ $s = "MSIE 7.0"; }
119    else if((/msie 8.0[0-9]*/i).test($agent))		{ $s = "MSIE 8.0"; }
120    else if((/msie 9.0[0-9]*/i).test($agent))		{ $s = "MSIE 9.0"; }
121	else if((/msie 10.0[0-9]*/i).test($agent))		{ $s = "MSIE 10.0"; }
122	else if((/windows*/i).test($agent) && (/rv:11.0[0-9]*/i).test($agent))	{ $s = "MSIE 11.0"; }
123    else if((/msie 4.[0-9]*/i).test($agent))		{ $s = "MSIE 4.x"; }
124    else if((/firefox/i).test($agent))				{ $s = "FireFox"; }
125    else if((/safari/i).test($agent))				{ $s = "FireFox"; }
126    else if((/x11/i).test($agent))					{ $s = "Netscape"; }
127    else if((/opera/i).test($agent))				{ $s = "Opera"; }
128    else if((/gec/i).test($agent))					{ $s = "Gecko"; }
129    else if((/bot|slurp/i).test($agent))			{ $s = "Robot"; }
130    else if((/internet explorer/i).test($agent))	{ $s = "IE"; }
131    else if((/mozilla/i).test($agent))				{ $s = "Mozilla"; }
132    else { $s = ""; }
133	$br.browser = $s;
134	if ( (/msie/i).test($s) ) {
135		$br.browserType = "IE";
136		$br.browserVer =  $s.replace("MSIE ","").split(".");
137	}
138	return $br;
139}
140
141var $wbr =getBrowsertInfo();
142var wsize = null;	//윈도우 사이즈 정보
143var psize = null;	//컨텐츠 사이즈 정보
144var lowIeChk = {	old_w:0,old_h:0 }
145function getWindowSizeObj() {
146	var sizeObj = {
147	scr : {w:screen.width,h:screen.height},
148	availscr : {w:screen.availWidth,h:screen.availHeight},
149	win : (_isLowBr_)? {w:$(window).width(),h:$(window).height()}	: {w:window.innerWidth,h:window.innerHeight}	//스크롤사이즈 제외(윈도우 8부터 아래버전에서 확인안됨.ㅠㅠ)
150	}
151	return sizeObj;
152}
153
154function getPageSizeObj() {
155	var sizeObj = {
156		doc : { w:document.documentElement.scrollWidth,h:document.documentElement.scrollHeight }
157		, scroll : {
158			x:document.documentElement.scrollLeft
159			, y:document.documentElement.scrollTop
160			, top:$(window).scrollTop()
161			, left:$(window).scrollLeft()
162		}	////모바일에서는 안잡힘..
163		, header : { h:$("#header-wrap").height() }
164		, footer : { h:$("#footer-wrap").height() + 1 }
165	};
166	return sizeObj;
167}
168
169function getWindowSize() {
170	wsize =getWindowSizeObj();
171}
172
173function getPageSize() {
174	psize = getPageSizeObj();
175	printWinSizeInfo();
176}
177
178function printWinSizeInfo() {
179	var str = "";
180	// str +="screen [w : "+wsize.scr.w+", h:"+wsize.scr.h+"]<br/>";
181	// str +="availscr [w : "+wsize.availscr.w+", h:"+wsize.availscr.h+"]<br/>";
182	str +="window [w : "+wsize.win.w+", h:"+wsize.win.h+"] ";		//스크롤바 포함한 브라우저 윈도우  높이
183	str +="doc [w : "+psize.doc.w+", h:"+psize.doc.h+"]<br/>";
184	// str +="scrollpos [w : "+psize.scroll.x+", h:"+psize.scroll.y+"]<br/>";
185	// str +="scrollpos2 [left : "+psize.scroll.x+", top:"+psize.scroll.y+"]<br/>";
186	$("#testBox").html("[" + $wbr.browser +"]" + str +" /" + $(".div-conts").width());
187}
188
189function setLowBrowser() {
190	$("body").removeClass("isIE7");
191	try {
192		if ( $wbr.browserType=="IE" && $wbr.browserVer[0] <= 8 ) {
193			_isLowBr_ = true;
194			$("body").addClass("isIE7");
195			$("li").each(function(){
196				if($(this).index() ==0) $(this).addClass("is-first");
197				if($(this).index() ==($(" > li",$(this).parent()).length -1)) $(this).addClass("is-last");
198			});
199			/*
200			$("a > span").each(function(){
201				if($(this).attr("onclick")==undefined || $(this).attr("onclick")==""){
202					$(this).bind("click",function(){
203						$($(this).parents("a").get(0)).click();
204					});
205				}
206			});
207			*/
208		}
209	}catch(e){
210	}
211}
212
213// 문자열 길이 구하기
214function calByte(msg) {
215	var t;
216	var msgLen = 0;
217	for ( var i=0; i<msg.length; i++ ) {
218		t = msg.charAt(i);
219		if(escape(t).length > 4) {
220			msgLen += 2;
221		} else if(t != "\r") {
222			msgLen++;
223		}
224	}
225	return msgLen;
226}
227
228function trim(v) {
229	return	$.trim(v);
230}
231
232function addBookmarkProgram(obj) {
233	title = $(document).attr("title");
234	url = location.href;
235	var _isMobile_ = false;
236	if ( _isMobile_ ) {
237		return true;
238	} else {
239		try {
240			window.external.AddFavorite(url,title);
241		} catch(e) {
242			alert('이 브라우저에서는 즐겨찾기 기능을 사용할 수 없습니다.\n크롬에서는 Ctrl 키와 D 키를 동시에 눌러서 즐겨찾기에 추가할 수 있습니다.');
243		}
244		return false;
245	}
246}
247
248function pagePrint(site_code,cont_id) {
249	try{
250		var forPrint = window.open("/"+site_code+"/CMS/forPrint.do?cont_id="+cont_id,'forPrintPage','resizable=yes,menubar=yes,scrollbars=yes,width=760,height=700,left=10,top=10,toolbar=no');
251	//	window.print();
252	}catch(e){
253		alert("미지원 브라우저입니다.\n웹 브라우저의 인쇄 기능을 이용해주시기 바랍니다.");
254	}
255}
256
257// 검색시 데이터 로딩 화면
258function $alert( msg, options ) {
259	var options = $.extend({},{w:300,h:120,"btn_label":"확인","btn":false},options);
260	var printMsg = msg.replace(/\b\n\b/i,'<br/>');
261	if ( options.btn ) {
262		var msgHTML = "<div class='popErrorBox'><div class='popErrorMsg'><div class=''>"+printMsg+"</div><div class='popErrorBtns mg10t'><button type='buttom' class='sp-btn closeBtn'><span>확인</span></button></div></div>";
263	} else {
264		var msgHTML = printMsg;
265	}
266	$("body").layerPopup({"message":msgHTML,"width":options.w,"height":options.h});
267}
268
269function $alertLoading( msg ) {
270	if(msg==undefined) var msg = "데이터 처리중입니다.";
271	var printMsg = msg.replace(/\b\n\b/i,'<br/>');
272	var msgHTML = "<div class='popErrorBox'><div class='popErrorMsg'><div class=''><img src='/_Img/Common/loading_img01.gif' alt=''/> "+printMsg+"</div></div><div class='popErrorBtns'></div></div>";
273	$("body").layerPopup({"message":msgHTML,"width":300,"height":120});
274}
275
276function $alertLoadingClose() {
277	try {
278		$("body").layerPopup("closeLayerPopup");
279	} catch(e){
280	}
281}
282
283var util = {
284	init : function() {
285	},
286	alertWsize : function() {
287		alert($(window).width() + " / " + $(window).height());
288		// 갤탭 768 * 896
289	},
290	isPC : function() {
291		var filter = "win16|win32|win64|mac|macintel";
292		if(navigator.platform){
293			if(filter.indexOf(navigator.platform.toLowerCase())< 0){
294				return false;
295			} else {
296				return true;
297			}
298		}
299	},
300	isIOS : function() {
301		var varUA = navigator.userAgent.toLowerCase();
302		if(varUA.indexOf("iphone")>-1||varUA.indexOf("ipad")>-1||varUA.indexOf("ipod")>-1) {
303			return true;
304		} else {
305			return false;
306		}
307	},
308	isAND : function() {
309		var varUA = navigator.userAgent.toLowerCase();
310		if(varUA.match('android') != null) {
311			return true;
312		} else {
313			return false;
314		}
315	},
316	isNull : function($obj){
317		if(typeof $obj != "undefined" && $obj != null && $obj != ""){
318			return false;
319		} else {
320			return true;
321		}
322	},
323	Eraser : function($obj, type){
324		if(type == "hide"){
325			$obj.hide();
326		} else if(type != "hide"){
327			$obj.addClass(type);
328		}
329	},
330	conBottomEraser : function($obj){
331		$obj.css({ "padding-bottom":0, "margin-bottom":0 });
332	},
333	getQueryStr : function(paramName){
334		var _tempUrl = window.location.search.substring(1);	// ** url에서 처음부터 ? 제외 uri
335		var returnVal = "";
336		if(_tempUrl == ""){
337			returnVal = "fail";
338		} else if(_tempUrl.indexOf("&") >= 0 || _tempUrl.indexOf("?") >= 0){
339			var _tempArray = _tempUrl.split("&");
340			for (var i=0; i<_tempArray.length; i++){
341				var _keyValuePair = _tempArray[i].split("=");
342				if(_keyValuePair[0] == paramName){
343					returnVal = _keyValuePair[1];
344				}
345			}
346		} else {
347			var _tempArray = _tempUrl.split("=");
348			if(_tempArray[0] == paramName)	returnVal = _tempArray[1];
349		}
350		return returnVal;
351	},
352	isLang : function() {
353		$pageUri = location.href;
354		if($pageUri.indexOf("/kor/") > 0)return "kor";
355		else if($pageUri.indexOf("/eng/") > 0)return "eng";
356	},
357	getNumberOnly : function(str_txt) {
358		val = new String(str_txt);
359		var regex = /[^0-9]/g;
360		val = val.replace(regex, '');
361		return val;
362	},
363	getHash : function() {
364		if(window.location.hash) {
365			var hashVal = "";
366			var hash = window.location.hash.substring(1);
367			if(hash.length === 0) {
368				return false;
369			} else {
370				if(hash.indexOf("&") >=0){
371					hashVal = hash.split("&")[0];
372				} else {
373					hashVal = hash;
374				}
375				return hashVal;
376			}
377		} else {
378			return false;
379		}
380	},
381	frontEndTrimming : function(s){
382		s += ''; // 숫자라도 문자열로 변환
383		return s.replace(/^\s*|\s*$/g, '');
384	},
385	convertTimestamp : function($obj){	// ** 타임스탬프 형식으로 변경.
386		var dateTmp;
387		var convertTimeStamp;
388		if(typeof $obj == "object"){
389			var cArrayIdx = 0;
390			var convertResult = new Array();
391			$.each($obj, function(index, item){
392				if(item != null){
393					dateTmp = item.split("-");
394					convertTimeStamp = dateTmp[1] + "/" + dateTmp[2] + "/" + dateTmp[0];
395					convertResult[cArrayIdx] = new Date(convertTimeStamp).getTime();
396					cArrayIdx++;
397				}
398			});
399		} else if(typeof $obj == "string"){
400			var convertResult = "";
401			dateTmp = $obj.split("-");
402			convertTimeStamp = dateTmp[1] + "/" + dateTmp[2] + "/" + dateTmp[0];
403			convertResult = new Date(convertTimeStamp).getTime();
404		}
405		return convertResult;
406	},
407	convertDatestring : function($str){	// ** 2019-10-21 형식으로 변경.
408		var d = new Date($str);
409		var s = util.leadingZeros(d.getFullYear(), 4) + "-" + util.leadingZeros(d.getMonth() + 1, 2) + "-" + util.leadingZeros(d.getDate(), 2);
410		return s;
411	},
412	leadingZeros : function(n, digits){	// ** 리딩제로 형식으로 변경.
413		var zero = '';
414		n = n.toString();
415		if(n.length < digits){
416			for (i=0; i<digits-n.length; i++)	zero += '0';
417		}
418		return zero + n;
419	},
420	setCss : function( href ) {
421		$linkTags = $('<link/>',
422			{
423				rel : "stylesheet",
424				type : "text/css",
425				href : href
426			}
427		).appendTo( "head" );
428	},
429	setJs : function( src ) {
430		$scriptTags = $('<script/>',
431			{
432				src : src
433			}
434		).appendTo( "head" );
435	}
436}

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.