PageSourceSearch

https://mportal.cau.ac.kr/common/js/itsu.common.js?20220315

js cau.ac.kr collected 2026-09-24 08:43:55 UTC 16,038 bytes, 565 lines download raw bytes

1//Common Code 선언
2var mCommon = {}; 
3mCommon.newCode = function(pId,record,defaultValue) {
4    var option = { 
5    	id:pId, 		
6    	record:record,  
7    	defaultValue:defaultValue
8    };	
9    mCommon[pId] = option;
10	return option;  
11};
12
13/****************************************************************************************************
14 * const */
15var __USER_DATE_FRM = 'yyyy/MM/dd';
16var gfnc_positionSize = function(obj,axisX,axisY) { 
17	var MIN_WIDTH = 520;
18	var MIN_HEIGHT = 500;
19	var BOTTOM_HEIGHT = 100;
20	// 기본 여백
21	var MARGIN_TOP = 10;
22	var MARGIN_LEFT = parseInt($('.ux-content-wrap').css('paddingLeft'), 10);
23	var MARGIN_RIGHT = parseInt($('.ux-content-wrap').css('paddingRight'), 10);
24	var MARGIN_BOTTOM = parseInt($('.ux-content-wrap').css('paddingBottom'), 10) + 5;
25	  
26	var width  = $(window).width() >1813 ? 1813 : $(window).width()  ;
27	var height = $(window).height();
28	/*
29	var middleHeight = height - MARGIN_TOP - MARGIN_BOTTOM - $('#layout-top').outerHeight() -328;
30	var defaultWidth = width - MARGIN_LEFT - MARGIN_RIGHT +2;
31	var defaultHeight = middleHeight - $('#layout-middle .ux-grid-title').outerHeight() - $('#layout-middle .ux-grid-btm').outerHeight() - $('#layout-search .ux-search-no').outerHeight();
32	*/
33	var middleHeight = height - MARGIN_TOP - MARGIN_BOTTOM -328;
34	var defaultWidth = width - MARGIN_LEFT - MARGIN_RIGHT +2;
35	var defaultHeight = middleHeight - $('.search_area').outerHeight() ;
36	
37	if(obj){
38		if (axisX) defaultWidth = $('#'+obj).width(); 
39		if (axisY) defaultHeight = $('#'+obj).height() < defaultHeight ?  defaultHeight :$('#'+obj).height() ; 
40	}  
41	
42	var position = new Object;
43	position.x = defaultWidth;
44	position.y = defaultHeight;
45	return position;
46} ; 
47
48var gfnc_gotourl = function (action, method, params, target) {
49    var builder = [];
50    builder.push('<form method="' + method + '" action="' + action + '" target="'+target+'">');
51    for (var key in params) {
52        builder.push('<input type="text" name="' + key + '" value="' + params[key] + '" />');
53    }
54    builder.push('<input type="submit" />');
55    builder.push('</form>');
56    $(builder.join('')).appendTo(document.body).submit().remove();
57};
58
59var gfnc_iframePopup = function(obj){
60	
61	var popupId     = obj.popupId;   	// 아이디
62	var popupUrl    = obj.popupUrl;     // URL
63	var popupParams = obj.popupParams;  // 패러미터
64	var popupWidth  = obj.popupWidth;	// 가로사이즈
65	var popupHeight = obj.popupHeight;	// 세로사이즈 
66	var popupStyle  = obj.popupStyle;	// 
67	var popupTitle  = obj.popupTitle;
68	var popupZIndex = obj.popupZIndex;
69	
70	var popupTop    = obj.popupTop;
71	var popupLeft   = obj.popupLeft;
72	var isUseOffset = obj.isUseOffset;
73	
74	var _popupIframe;
75	var width	= (popupWidth?popupWidth:500);
76	var height	= (popupHeight?popupHeight:300);
77	var title	= (popupTitle?popupTitle:'');
78	var params	= "";
79	var popupZIndex = (popupZIndex?popupZIndex:1500);
80	
81	for(var key in popupParams) {
82		if(params.length>0) params += "&"+key+"="+popupParams[key];
83		else params += "?"+key+"="+popupParams[key];
84    } 
85	_popupIframe =  $('<div class="ux-layer-plan" id="layer_'+popupId+'" style="'+popupStyle+'"></div>')
86	.append($('<iframe  id="ifrm_'+popupId+'" width="100%" height="'+height+'" style="'+popupStyle+'" src="'+popupUrl+params+'" name="ifrm_'+popupId+'"  scrolling="no" ></iframe>)'))
87	.popup({title: title, top:popupTop,left:popupLeft, width:width, height:height, zIndex:popupZIndex });
88	_popupIframe.popup('open');
89	
90	return _popupIframe; 
91}; 
92
93var gfnc_gridResize = function(obj,axisX,axisY) {
94	var position = gfnc_positionSize(obj,axisX,axisY); 
95	 
96	$('#'+obj).width(position.x).height(position.y);
97	$('#'+obj).grid('size', position.x, position.y);
98	
99};
100
101var showLoading = function (msg) { 
102    if (typeof (msg) === 'undefined') {
103        msg = Globalize.localize('loading');
104    }
105    $('#loadingMsg').text(msg); 
106    $('#loading').show();
107    
108};
109
110function isLessLength(obj, len) {
111	return !(obj.val().length < len);
112}
113
114function isGreater(obj, num) {
115	return obj.val() > num;
116}
117
118function isLessness(obj, num){
119	return obj.val() < num;
120}
121
122function isEqual(obj,val) {
123	return obj.val() == val;
124}
125
126function isNotEqual(obj,val) {
127	return obj.val() != val;
128}
129
130function isEmpty(obj) {
131	return obj.val() != "";
132}
133
134function eqVal(obj1 , obj2){
135	return obj1.val() == obj2.val();
136}
137
138function isNumber(obj){
139	var reg = /^\d+$/;
140	return reg.test(obj.val());
141}
142function isNumber2(obj) {
143	return !isNaN(obj.val());
144}
145
146function isAlphaAndDigit(obj) {
147	var rtn = isAlphaOrDigit(obj);
148	if(rtn) {
149		var reg = /([A-Za-z]+)/;
150		return reg.test(obj.val());
151	} else {
152		return false;
153	}
154}
155
156function isAlphaOrDigit(obj) {
157	var reg = /^[A-Za-z0-9]+$/;
158	return reg.test(obj.val());
159}
160
161function validateForm(rule,message) {
162	var rule_line = rule.split("@");
163	var validate = true;
164	$.each(rule_line, function(index1, line) {
165		if(validate == false) {
166			return false;
167		}
168		var element = line.split(":");
169		var obj = $("#"+element[0]);
170		var fn_list = element[1].split(",");
171
172		obj.val(jQuery.trim(obj.val()));
173		
174		$.each(fn_list, function(index2, fn) {
175			if(fn.indexOf("#") > -1) {
176				var args = fn.split("#");
177				var func = args[0];
178				var ar = args[1].split("$");
179				var params = [];
180				params.push(obj);
181
182				for(var i=0;i<ar.length;++i) {
183					if(document.getElementById(ar[i])) {
184						params.push($("#"+ar[i]));
185					} else {
186						params.push(ar[i]);
187					}
188				}
189
190				validate = eval(args[0]).apply(null,params);
191			} else {
192				validate = eval(fn)(obj);
193			}
194			if(validate == false) {
195				alert(message[index1][index2]);
196				obj.select();
197				obj.focus();
198				return false;
199			}
200		});
201	});
202
203	return validate;
204}
205
206function trim(str) {
207	return jQuery.trim(str);
208}
209
210function getCookie(name) {
211
212	var nameOfCookie = name + "=";
213	var x = 0;
214	while (x <= document.cookie.length) {
215		var y = (x+nameOfCookie.length);
216		if(document.cookie.substring(x,y) == nameOfCookie) {
217			if ((endOfCookie = document.cookie.indexOf(";",y)) == -1) {
218				endOfCookie = document.cookie.length;
219			}
220			return unescape(document.cookie.substring(y,endOfCookie));
221		}
222
223		x = document.cookie.indexOf(" ", x) + 1;
224		if(x == 0) {
225			break;
226		}
227	}
228
229	return "";
230}
231
232function getDayOfMonth(yyyy,mm) {
233
234	var lastDay = new Array();
235	lastDay[0] = 31;
236	lastDay[1] = 28;
237	lastDay[2] = 31;
238	lastDay[3] = 30;
239	lastDay[4] = 31;
240	lastDay[5] = 30;
241	lastDay[6] = 31;
242	lastDay[7] = 31;
243	lastDay[8] = 30;
244	lastDay[9] = 31;
245	lastDay[10] = 30;
246	lastDay[11] = 31;
247
248	var year = yyyy;
249	var month = mm;
250
251	if(month != 1) {
252		return lastDay[month];
253	}
254
255	if(year % 4 == 0) {
256		if(year % 100 == 0) {
257			if(year % 400 == 0) {
258				lastDay[1] = 29;
259			} else {
260				lastDay[1] = 28;
261			}
262		} else {
263			lastDay[1] = 29;
264		}
265	} else {
266		lastDay[1] = 28;
267	}
268
269	return lastDay[month];
270}
271
272function numberFormat(str) {
273	str = str.toString();
274	var tmp = "", numb = "";
275	for(var i=str.length-1,j=0;i>=0;--i,++j) {
276		com = "";
277		if(j % 4 == 3) {
278			com = ",";
279		}
280		tmp = str.substring(i,i+1) + com;
281		numb = tmp + numb;
282	}
283	return numb;
284}
285
286function imageFileExtCheck(obj) {
287	var obj = $("#"+obj).val();
288	var pathpoint = obj.lastIndexOf('.');
289	var filepoint = obj.substring(pathpoint+1,obj.length);
290	var filetype = filepoint.toLowerCase();
291	if(filetype=='jpg' || filetype=='gif' || filetype=='png' || filetype=='jpeg') {
292		return true;
293	} else {
294		return false;
295    }
296}
297
298function excelFileExtCheck(obj) {
299	var obj = $("#"+obj).val();
300	var pathpoint = obj.lastIndexOf('.');
301	var filepoint = obj.substring(pathpoint+1,obj.length);
302	var filetype = filepoint.toLowerCase();
303	if(filetype=='xls') {
304		return true;
305	} else {
306		return false;
307    }
308}
309
310function excelFileExtCheckValue(obj) {
311	var pathpoint = obj.lastIndexOf('.');
312	var filepoint = obj.substring(pathpoint+1,obj.length);
313	var filetype = filepoint.toLowerCase();
314	if(filetype=='xls') {
315		return true;
316	} else {
317		return false;
318    }
319}
320
321function inputTrim(formid) {
322	$("#"+formid).find("input").each(function(idx) {
323		if($(this).attr("type") == "text" || $(this).attr("type") == undefined || $(this).attr("type") == "") {
324			$(this).val($.trim($(this).val()));
325		}
326	});
327	$("#"+formid).find("textarea").each(function(idx) {
328		$(this).val($.trim($(this).val()));
329	});
330}
331
332function inputFormReset(formid) {
333	$("#"+formid).find("input").each(function(idx) {
334		if($(this).attr("type") == "text" || $(this).attr("type") == undefined || $(this).attr("type") == "hidden") {
335			$(this).val("");
336		} else if($(this).attr("type") == "radio") {
337			$(this).attr("checked",false);
338		} else if($(this).attr("type") == "checkbox") {
339			$(this).attr("checked",false);
340		}
341	});
342	$("#"+formid).find("select").each(function(idx) {
343		var id = $(this).attr("id");
344		$("#"+id+" option:eq(0)").attr("selected","selected");
345	});
346}
347
348function gfncGetAbsPosition(object) {
349	var position = new Object;
350	position.x = object[0].offsetWidth;
351	position.y = object[0].offsetHeight; 
352
353	return position;
354}
355
356function gfncNotice(textMessage,position) { 
357		dnDom = document.createElement("div");
358		dnDom.className = "ux_notice";
359		document.body.appendChild(dnDom);
360		document.body.duNotice = dnDom; 
361		dnDom.style.position = "absolute";  
362		if(position){  
363			dnDom.style.top = (+position.y *0.5 ) +'px';
364			dnDom.style.left = ($(window).outerWidth()*0.5 - 50) +'px'; 
365		} else{ 
366			dnDom.style.top = ($(window).scrollTop()+100) +'px';
367			dnDom.style.left = ($(window).outerWidth()*0.5 - 50) +'px'; 	
368		}
369		dnDom.style.zIndex = 10000;
370		dnDom.style.backgroundColor = "";
371		dnDom.style.border = ""; 
372	 	dnDom.style.fontWeight = "lighter"; 
373		dnDom.innerHTML = textMessage;
374		dnDom.style.display = "";
375		
376	 	var browser = new BrowserInfo(); 
377	 	
378		setTimeout(function() {
379			if(browser.isMSIE ==true)
380				dnDom.style.display = "none";
381			else
382				dnDom.remove();
383			
384		}, 3000); 
385}
386
387//숫자 콤마(,) 넣기
388var number_format = function( number ){
389	var numberStr="", nArr="";
390	if (typeof number === 'number') {
391		number = number+'';
392	}
393	if(number){
394		numberStr=number.replace(/\,/g,"");
395		nArr = String(numberStr).split('').join(',').split('');
396		for( var i=nArr.length-1, j=1; i>=0; i--, j++)  if( j%6 != 0 && j%2 == 0) nArr[i] = '';
397		return nArr.join('');
398	}else{
399		return nArr;
400	}
401};
402
403function BrowserInfo() 
404{
405  this.isMSIE = false;
406  this.isFirefox = false;
407  this.isChrome = false;
408  this.isSafari = false;
409  this.etc = false; 
410	this.isMSIEx64 = false;   
411	var userAgentString = navigator.userAgent.toLowerCase();
412  if (userAgentString.indexOf("msie") > -1) this.isMSIE = true;
413  if (userAgentString.indexOf("chrome") > -1) this.isChrome = true;
414  if (userAgentString.indexOf("firefox") > -1) this.isFirefox = true;
415  if (userAgentString.indexOf("safari") > -1) this.isSafari = true;
416  if (this.isFirefox) this.isWindowlessSupported = "true";
417  if (userAgentString.indexOf("trident") > -1) { 
418  	 if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName =='Netscape')        
419  		 this.isMSIE = true; 
420  }
421  if (!this.isMSIE && !this.isFirefox) this.etc = true;
422}
423
424/*--------------------------------------------------
425기능   :  Common Object Data Return
426----------------------------------------------------*/
427var gfnc_getCommonObjDataRecord = function(JSONObject, objId, allSelected) {
428	gfnc_getCommonObjData(JSONObject, objId, allSelected);
429	
430	return JSONObjectData;
431};
432
433/*--------------------------------------------------
434기능   :  Common Object Data 생성
435----------------------------------------------------*/
436var gfnc_getCommonObjData = function(obj, objId, allSelected) {
437	
438	var url = '/common/common/retrieveCommonCodeInfo.ajax';
439	var params;
440	
441	for(var i=0; i<obj.commonObjList.length; i++) {
442		if(objId == obj.commonObjList[i].objId) {
443			params = {objId:obj.commonObjList[i].objId,objType:obj.commonObjList[i].objType,storage:obj.commonObjList[i].storage,sqlId:obj.commonObjList[i].sqlId,defaultSelected:obj.commonObjList[i].defaultSelected,width:obj.commonObjList[i].width,param:obj.commonObjList[i].param};
444		}
445	} 
446	if(allSelected == true) {
447		gfnc_dataTransaction(url,params,null,fncCallbackInitCommonObjSelectbox,true);
448	} else {
449		gfnc_dataTransaction(url,params,null,fncCallbackInitCommonObjData,true);
450	}
451
452};
453
454/*--------------------------------------------------
455기능   :  Common Object 생성 Callback 함수
456----------------------------------------------------*/
457var fncCallbackInitCommonObjData = function(status, fulldata) {
458	JSONObjectData = fulldata;
459};
460
461/*--------------------------------------------------
462기능   :  Common Object Selectbox 생성 Callback 함수
463----------------------------------------------------*/
464var fncCallbackInitCommonObjSelectbox = function(status, fulldata) {
465	var record = [];
466	
467	for(var i=0; i<fulldata.length; i++) {
468		if(i == 0) {
469			record.push({code:'',name:'',value:''});
470		}
471		record.push(fulldata[i]);
472	}
473	
474	JSONObjectData = record;
475};
476
477/*--------------------------------------------------
478기능   :  Common Object 생성
479----------------------------------------------------*/
480var gfnc_initCommonObj = function(obj) { 
481	var url = '/common/retrieveCommonCodeList.ajax';
482	var params = {};
483	params.params=obj;
484	gfnc_transaction(url,params,fncCallbackInitCommonObjList,false); 
485};
486 
487/*--------------------------------------------------
488기능   :  Common Object 생성 Callback 함수
489----------------------------------------------------*/
490
491var fncCallbackInitCommonObjList = function(code, fulldata) { 
492	if(status>-1 ){
493		var params     = fulldata.params;
494		var codeList   = fulldata.codeList;
495		
496		for(idx=0;idx<params.length;idx++){
497			var comboObj,tmpObj,defaultSelected,propRec;  
498			tmpObj = params[idx];
499			if(tmpObj){ 
500				if(tmpObj.defaultSelected){
501					if(tmpObj.defaultSelected=='blank')
502						codeList[idx].splice(0,0,{'code':'','name':'선택'}); 
503					if(tmpObj.defaultSelected=='ALL')
504						codeList[idx].splice(0,0,{'code':'','name':'전체'}); 
505				} 
506				
507				defaultSelected = tmpObj.defaultValue; 
508				comboObj ="#"+tmpObj.objId;
509				if(tmpObj.objType == 'selectbox') { 
510					if($(comboObj)) {
511						$(comboObj).selectbox({title:(tmpObj.title ? tmpObj.title:'' ), width:parseInt(tmpObj.width), codeProperty:'code', nameProperty:'name'});
512						$(comboObj).selectbox('applyData',codeList[idx],defaultSelected ); 
513					}  	
514				}
515				if(tmpObj.objType == 'selectWithCheckbox') {  
516					$(comboObj).selectWithCheckbox({title:(tmpObj.title ? tmpObj.title:'' ) , width:parseInt(tmpObj.width), codeProperty:'code', nameProperty:'name'});
517					$(comboObj).selectWithCheckbox('applyData',codeList[idx],defaultSelected); 
518				}
519				mCommon.newCode(tmpObj.objId,codeList[idx],defaultSelected);
520			}  
521		}
522	}	
523}; 
524var bulidComboBox = function(comboObj){ 
525	for(var idx=0;idx<comboObj.length;idx++ ){ 
526		if(comboObj[idx].objType == "selectWithCheckbox"){ 
527			$("#"+comboObj[idx].objId).selectWithCheckbox({title:'', width:parseInt(comboObj[idx].width), codeProperty:'code', nameProperty:'name'});
528			$("#"+comboObj[idx].objId).selectWithCheckbox('applyData',mCommon[comboObj[idx].record].record,mCommon[comboObj[idx].record].defaultValue);
529		}else{	
530			$("#"+comboObj[idx].objId).selectbox({title:'', width:parseInt(comboObj.width), codeProperty:'code', nameProperty:'name'});
531			$("#"+comboObj[idx].objId).selectbox('applyData',mCommon[comboObj[idx].record].record,mCommon[comboObj[idx].record].defaultValue);
532		}
533	}	
534}; 
535
536//글자수 체크
537function gfnc_maxlength(obj){
538	var maxLength = parseInt(obj.getAttribute("maxlength"));
539		if(obj.value.length>maxLength) {
540			alert('글자수가 '+(obj.value.length-1)+'자 이내로 제한됩니다');
541			obj.value=obj.value.substring(0,maxLength);
542		}
543}
544
545var gfnc_getCommonDesc = function(codeList, code ) {
546	var result ="";
547	$.each(codeList,function(idx,ele ) {
548		if (ele.code == code){
549			result = ele.name; 
550		}	
551	}); 
552	return result;
553};
554
555
556function fn_getPortletTitle(pId,msgTitle){
557	var result = msgTitle;
558	try{
559		var portlets = JSON.parse(sessionStorage.getItem('portlets'));
560		result = portlets[pId].title == null?msgTitle:portlets[pId].title;
561	}catch(e){
562		console.log('error');
563	}
564	return result
565}

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.