PageSourceSearch

https://edu.kpanet.or.kr/js/cmm/cmm.js;jsessionid=AC9CDC9B43AFC5AE279823E1A228680A

js kpanet.or.kr collected 2026-09-24 22:37:44 UTC 10,617 bytes, 311 lines download raw bytes

1/**
2 * getStr(data, defaultVal) : null or undefined 체크 후 string data 또는 디폴트값 리턴
3 * getNum(data, defaultVal) : null or undefined 체크 후 number data 또는 디폴트값 리턴
4 * getCurrency(data) : 콤마가 있는 화폐 포멧으로 변경
5 * callAjax(url, param, 성공시 실행될 callback function, 실패시 실행될 callback function, ajax 옵션) : ajax 호출
6 * 		ajax 옵션 : type, dataType, contentType
7 * createPagingArea(페이징 html 생성될 영역 ID, 페이징 데이터, 페이지 선택시 실행될 function) : 페이징
8 * showLecturerProFile(강사 코드) : 강사 프로필 팝업
9 * pop: 팝업 관련 함수
10 *     alert(내용, 확인버튼 클릭시 실행될 콜백 function, 옵션) : 알림팝업
11 *         option(confirmBtnNm : 확인 버튼 text 변경시 설정, cancelBtnNm : 취소 버튼 text 변경시 설정, callbackData : 콜백 function 실행시 인자로 리턴 받을 데이터)
12 *         ex) cmmUtil.pop.confirm("내용", function(){}, {confirmBtnNm:"완료",cancelBtnNm:"취소합니다",callbackData:"data"})
13 *     confirm(상단 타이블, 내용, 확인버튼 클릭시 실행될 콜백 function, 옵션) : 확인팝업
14 **/
15
16const cmmUtil = {
17	getStr : function(data, dafaulVal){
18		return data == undefined || data == null || data == "" ? dafaulVal == undefined ? "" : dafaulVal : data.toString();
19	},
20	getNum : function(data, dafaulVal){
21		return data == undefined || data == null || data == "" || isNaN(data) ? dafaulVal == undefined ? 0 : dafaulVal : Number(data);
22	},
23	getCurrency : function(data){
24		return cmmUtil.getNum(data).toLocaleString("ko-KR");
25	},
26	callAjax : function(url, param, successCallBack, errorCallBack, option){
27
28		$.ajax({
29			url : url,
30			type : option?.type || "POST",
31			data : param,
32			dataType: option?.dataType || "JSON",
33			contentType : option?.contentType || "application/x-www-form-urlencoded; charset=UTF-8" ,
34			traditional : true,
35			success : function(res, status, xhr) {
36
37				if(successCallBack){
38					res.statusCode = xhr.status;
39					successCallBack(res);
40				}
41			},
42			error: function(xhr) {
43				if(errorCallBack){
44					errorCallBack(xhr.responseJSON);
45				}
46			}
47		});
48	},
49	createPagingArea : function(pageAreaId, pageData, callFnc){
50		let pagingArea = document.querySelector("#"+pageAreaId);
51		pagingArea.innerHTML = "";
52		let ulNode = document.createElement("ul");
53		ulNode.classList.add("pagination");
54		pagingArea.appendChild(ulNode);
55		if (pageData.prev) {
56			let liNode1 = document.createElement("li");
57			liNode1.classList.add("page-first");
58			let aNode1 = document.createElement("a");
59			liNode1.onclick = function(){
60				callFnc(1);
61			}
62			liNode1.appendChild(aNode1);
63			ulNode.appendChild(liNode1);
64
65			let liNode2 = document.createElement("li");
66			liNode2.classList.add("page-prev");
67			let aNode2 = document.createElement("a");
68
69			liNode2.onclick = function(){
70				callFnc(pageData.currentPage - 1);
71			}
72			liNode2.appendChild(aNode2);
73			ulNode.appendChild(liNode2);
74		}
75
76		for (let i = pageData.startPage; i <= pageData.endPage; i++) {
77			let liNode = document.createElement("li");
78			let aNode = document.createElement("a");
79			if (pageData.currentPage === i) {
80			    liNode.classList.add("active");
81			}
82			liNode.classList.add("page-num");
83			aNode.innerText = i;
84			aNode.onclick = (function () {
85				callFnc(this.innerText);
86			})
87			liNode.appendChild(aNode);
88			ulNode.appendChild(liNode);
89		}
90
91		if (pageData.next) {
92			let liNode1 = document.createElement("li");
93			liNode1.classList.add("page-next");
94			let aNode1 = document.createElement("a");
95
96			liNode1.onclick = function(){
97				callFnc(pageData.currentPage +1);
98			}
99			liNode1.appendChild(aNode1);
100			ulNode.appendChild(liNode1);
101			let liNode2 = document.createElement("li");
102			let aNode2 = document.createElement("a");
103			liNode2.classList.add("page-last");
104
105			liNode2.onclick = function () {
106				callFnc(pageData.totalPage);
107			}
108			liNode2.appendChild(aNode2);
109			ulNode.appendChild(liNode2);
110		}
111	},
112	showLecturerProFile : function(instrctrNo){
113		cmmUtil.callAjax("/cyberedu/classregist/searchInstrctrVodListApi.cm", {"instrctrNo":instrctrNo} , function(rtn){
114			let item = rtn.list;
115			let vodList = item.vodList;
116
117			let vodListHtml = vodList.reduce((tot, data)=>{
118				let title = cmmUtil.getStr(data.title);
119				let categoryCd = data.categoryCd;
120				let tagName = "";
121				if(categoryCd == 1 || categoryCd == 3){
122					tagName = '<span class="bg-red whiter">정기</span>'
123				}else if(categoryCd == 2){
124					tagName = '<span class="bg-blue whiter">법정</span>'
125				}
126				let html = `<div class="match-video">${tagName}${title}</div>`;
127				return tot + html
128			}, "");
129
130			let imageUrl = 'https://www.kpanet.or.kr/' // TODO : 추후 수정 요망
131			// let imageUrl = "";
132			let popupHtml = `
133				<div class="modal-popup fade profile fulllayer" id="teacher-profile">
134					<div class="modal-dialog">
135						<div class="modal-content">
136							<div class="modal-header">
137								<div class="title-header">
138									<h2 class="title_modal"><span class="tit_circle"></span>강사프로필</h2>
139									<span class="close-btn incyber"></span>
140								</div>
141							</div>
142							<div class="modal-body">
143								<div class="body-frame">
144									<div class="profile-wrap">
145										<div class="profile-img-wrap">
146											<div class="profile-img">												
147											 <img src="${imageUrl}${item.photoUrl}" alt="" onerror="this.src='/images/sub/teacher_profile.png'">
148											</div>
149											<div class="profile-name">${item.instrctrNm}</div>
150										</div>
151										<div class="profile-infor">
152											<div class="profile-infor-tit">근무처</div>
153											<div class="profile-infor-cont">${item.wrkplc}</div>
154										</div>
155										<div class="profile-infor">
156											<div class="profile-infor-tit">소개 및 경력</div>
157											<div class="profile-infor-cont">
158												${item.career}
159											</div>
160										</div>
161										<div class="profile-infor">
162											<div class="profile-infor-tit">관련 동영상</div>
163											<div class="profile-infor-cont">
164												${vodListHtml}
165											</div>
166										</div>
167									</div>
168								</div>
169							</div>
170						</div>            
171					</div>
172				</div>
173			`;
174			$("body").append(popupHtml);
175			$(".close-btn", "#teacher-profile").on("click", function(){
176				$(".modal-popup").fadeOut(0);
177				$('body').removeClass('scrolloff');
178				$("#teacher-profile").remove();
179			});
180			openModal('teacher-profile');
181		})
182	},
183	pop : {
184		alert : function(msg, callbackFnc, option = {}){
185    		this.show(msg, callbackFnc, option);
186		},
187		confirm : function(msg, callbackFnc, option = {}){
188			option.popupType = "confirm";
189			this.show(msg, callbackFnc, option);
190		},
191		noOrYes : function(msg, callbackFncNo, callbackFncYes, option = {}){
192			option.popupType = "noOrYes";
193			this.showNoOrYes(msg, callbackFncNo, callbackFncYes, option);
194		},
195		show : function(msg, callbackFnc, option){
196			let popupHtml = (msg, option)=>{
197				let rtn = `
198				<div class="modal-popup fade" id="integrated-member-write">
199					<div class="modal-dialog alert">
200						<div class="modal-content">
201							<div class="modal-header">
202								<div class="title-header">
203									<span class="close-btn incyber"></span>
204								</div>
205							</div>
206							<div class="modal-body">
207								<div class="alert-frame">
208									<div class="alert-img">
209										<img src="/images/pop/alert-icon.svg" alt="">
210									</div>
211									<div class="alert-content">
212									${msg}
213									</div>
214								</div>
215							</div>
216							<div class="modal-footer">
217								${option?.popupType == "confirm" ? `
218								<button type="button" class="close-btn btn-frame middle cancel">${option?.cancelBtnNm ?? "취소"}</button>
219								` : ``}
220								<button type="button" data-id="confirm" class="btn-frame middle check bg-black ${option.popupType == 'confirm' ? 'ml10' : ''}">${option?.confirmBtnNm ?? '확인'}</button>
221							</div>
222						</div>            
223					</div>
224				</div>
225				`;
226				return rtn;
227			}
228
229			let html = popupHtml(msg, option);
230			let popupEl = $(html);
231			$("body").append(popupEl);
232			$(".modal-dim").show(0);
233			popupEl.show(0);
234			popupEl.addClass('show');
235			$('body').addClass('scrolloff');
236
237			popupEl.find(".close-btn, .btn-pop-close").off("click").on("click", function(){
238				cmmUtil.pop.close(popupEl);
239			});
240
241			popupEl.find("button[data-id=confirm]").off("click").on("click", function(){
242				if(callbackFnc){
243					callbackFnc(option?.callbackData);
244				}
245				cmmUtil.pop.close(popupEl);
246			});
247
248		},
249		showNoOrYes : function(msg, callbackFncNo, callbackFncYes, option){
250			let popupHtml = (msg, option)=>{
251				let rtn = `
252				<div class="modal-popup fade" id="integrated-member-write">
253					<div class="modal-dialog alert">
254						<div class="modal-content">
255							<div class="modal-header">
256								<div class="title-header">
257									<span class="close-btn incyber"></span>
258								</div>
259							</div>
260							<div class="modal-body">
261								<div class="alert-frame">
262									<div class="alert-img">
263										<img src="/images/pop/alert-icon.svg" alt="">
264									</div>
265									<div class="alert-content">
266									${msg}
267									</div>
268								</div>
269							</div>
270							<div class="modal-footer">
271								<button type="button" class="close-btn btn-frame middle cancel ${option?.defaultNo ? 'bg-black' : ''}" ${option?.defaultNo ? 'style="color:#fff;"' : ''}>${option?.cancelBtnNm ?? "아니오"}</button>
272								&nbsp;&nbsp;
273								<button type="button" data-id="confirm" class="btn-frame middle check ${option?.defaultNo ? '' : 'bg-black'} ${option.popupType == 'confirm' ? 'ml10' : ''}" ${option?.defaultNo ? 'style="color:#000;"' : ''}>${option?.confirmBtnNm ?? '예'}</button>
274							</div>
275						</div>            
276					</div>
277				</div>
278				`;
279				return rtn;
280			}
281
282			let html = popupHtml(msg, option);
283			let popupEl = $(html);
284			$("body").append(popupEl);
285			$(".modal-dim").show(0);
286			popupEl.show(0);
287			popupEl.addClass('show');
288			$('body').addClass('scrolloff');
289
290			popupEl.find(".close-btn, .btn-pop-close").off("click").on("click", function(){
291				if(callbackFncNo){
292					callbackFncNo(option?.callbackData);
293				}
294				cmmUtil.pop.close(popupEl);
295			});
296
297			popupEl.find("button[data-id=confirm]").off("click").on("click", function(){
298				if(callbackFncYes){
299					callbackFncYes(option?.callbackData);
300				}
301				cmmUtil.pop.close(popupEl);
302			});
303
304		},
305		close : function(popupEl){
306			popupEl.fadeOut(0);
307			popupEl.remove();
308			$('body').removeClass('scrolloff');
309		}
310	}
311};

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.