PageSourceSearch

https://www.masan.ac.kr/resources/_Templet/Layout/layout_kor/Js/layout_sub.js

js masan.ac.kr collected 2026-09-29 12:36:51 UTC 10,578 bytes, 320 lines download raw bytes

1var _isLowBr_ = false, _isMobile_ = false;
2var _thisPage_cfg = {};
3//레이아웃 셋팅(로딩완료된 후에만 1번만 처리)
4function initPageLayout() {
5	resetTabSize(); // 탭메뉴 사용시 주석제거
6	setContAutoWidth();
7	_setLayoutFooter();
8	resetImgZoom();
9}
10//레이아웃 리셋
11function resetPageLayout() {
12	mainNavi._reset();
13	resetTabSize();   // 탭메뉴 사용시 주석제거
14	resetImgZoom();
15	setContAutoWidth();
16	_resetFooterHeight();
17}
18
19
20//레이아웃 높이 리셋
21function resizePageLayoutHeight() {
22}
23////////////////////////////////////////////////////
24//윈도우 회전시 실행할 함수
25function setWindowRotation() {
26	if (typeof (thisPageRotation) == "function" && thisPageRotation != undefined) { thisPageRotation(); }
27	else {
28		//기본 회전시 실행할 함수
29		//resetPageLayout();
30	}
31}
32//document.addEventListener('DOMContentLoaded', loaded, false);
33if ('onorientationchange' in window) {
34	window.addEventListener('onorientationchange', setWindowRotation, false);
35}
36////////////////////////////////////////////////////
37$(document).ready(function () {
38	//console.log("1.Ready");
39
40	try { getWindowSize(); } catch (e) { }
41	try { getPageSize(); } catch (e) { }
42	if (_isMobile_) $alertLoading("Page Loading...");
43	try { setLowBrowser(); } catch (e) { }
44	try { setMediaObjectFunc(); } catch (e) { }
45	try { _thisLayout_style = getPageStyle(); } catch (e) { }
46	try { resetTabSize(); } catch (e) { }
47	initNavigation();
48	docLoading(function () {
49		//console.log("3.docLoad");
50		initImgSizeInfo();
51		initPageLayout();
52		resetImgZoom();
53	});
54	subUtil.hideImg();
55	subUtil.navArrSet();
56	subUtil.tabIsFull();
57	subUtil.titleReset();
58	subUtil.setTelLnk();
59	subUtil.bbsViewRspsvTbl();
60});
61$(window).load(function () {
62	//console.log("2.Load");
63});
64$(window).resize(function (e) {
65	//var resizeTimeGap = (_isLowBr_)?  250 : 10;
66	var resizeTimeGap = 10;
67	if (_isLowBr_) resizeTimeGap = 100;
68	clearTimeout(window.resizeEvt);
69	window.resizeEvt = setTimeout(function () {
70		//console.log("Resize" );
71		getWindowSize(); getPageSize();
72		try {
73			if (old_wsize.win == undefined || wsize.win.w != old_wsize.win.w) {
74				resetPageLayout();
75			} else {
76				resizePageLayoutHeight();
77			}
78		} catch (e) {
79			resetPageLayout();
80		}
81	}, resizeTimeGap);
82});
83$(window).scroll(function () {
84	clearTimeout(window.scrollEvt);
85	window.scrollEvt = setTimeout(function () {
86		////srolling
87	}, 250);
88});
89try {
90	$(window).scrollStopped(function () {
91		//end sroll
92	});
93} catch (e) {
94}
95
96// ** sns 공유
97function snsToggle() {
98	if ($(".cont-ctrl-btns .btn-share").hasClass("is-open")) {
99		$(".sns-list").slideUp(300);
100		$(".cont-ctrl-btns .btn-share").removeClass("is-open").attr("aria-expanded", "false");
101	} else {
102		$(".sns-list").slideDown(300);
103		$(".cont-ctrl-btns .btn-share").addClass("is-open").attr("aria-expanded", "true");
104	}
105}
106
107// ** 서브페이지 공통
108var subUtil = {
109	hideImg: function () {	// ** 이미지 없을때
110		$("img").each(function () {
111			var $this = $(this);
112			var wImgObj = $this.attr("src");
113			if (wImgObj == null || wImgObj == '') {
114				$this.css("display", "none");
115			}
116		});
117	},
118	navArrSet: function () {
119		var arrBtnPkg = $("#contents .prev-cont-tit, #contents .next-cont-tit");
120		var mNavi = $("#mainNavi");
121		var mCodeStr = util.getQueryStr("mCode");	// ** 이전 / 다음 메뉴 검색기준은 uri mCode parameter 기준.
122		var mCodeKey = "mCode=" + mCodeStr;			// ** 검색값 키워드 스트링. ex) mCode=MN049
123		var mCstdNode = $("a", mNavi).filter(function () { if ($(this).attr("href").indexOf(mCodeKey) > 0) return $(this); }).parent("li");	// ** 모든대상(a태그)의 부모 탐색.
124		var mCstdNodeLen = (mCstdNode.length - 1);
125		var mPrev = mNext = mCstdLiNode = mCstdNodeLI = null;
126		mCstdNode.each(function (index) {			// ** 최말단 대상노드 선택.
127			if (index == mCstdNodeLen) {
128				mCstdLiNode = $(this);
129			}
130		});
131		if (util.isNull(mCstdLiNode)) {
132			return false;
133		} else {
134			mCstdLiNode.addClass("node-Stdd")
135		}
136
137		mPrev = this.drillDown("prev", mCstdLiNode);
138		if (util.isNull(mPrev)) {
139		} else {
140			mPrev.addClass("node-Prev");
141			this.setClosestNode("prev", mPrev);
142		}
143
144		mNext = this.drillDown("next", mCstdLiNode);
145		if (util.isNull(mNext)) {
146		} else {
147			mNext.addClass("node-Next");
148			this.setClosestNode("next", mNext);
149		}
150	},
151	drillDown: function (flag, obj) {
152		if (flag == "prev") {
153			if (obj.prev().length >= 1) {			// ** 이전 메뉴가 있을경우.
154				// console.log( "1" );
155				if ($("ul[class^='depth']", obj.prev()).length >= 1) {
156					return $("ul[class^='depth'] li", obj.prev()).last();
157				} else {
158					return obj.prev();
159				}
160			} else {								// ** 이전 메뉴가 없을경우.
161				// console.log( "2" );
162				$new2 = obj.closest("li.mn_li2").prev();
163				if ($new2.length >= 1) {
164					if ($("ul[class^='depth']", $new2).length >= 1) {
165						return $("ul[class^='depth'] li", $new2).last();
166					} else {
167						return $new2;
168					}
169				} else {
170					// console.log( "3" );
171					$new1 = obj.closest("li.mn_li1").prev();
172					if ($new1.length >= 1) {
173						$dep2Final = $("ul[class^='depth2'] li", $new1).last();
174						$dep3Final = $("ul[class^='depth3'] li", $dep2Final).last();
175						if ($dep3Final.length >= 1) {
176							$dep_Final = $dep3Final;
177						} else {
178							$dep_Final = $dep2Final;
179						}
180						return $dep_Final;
181					} else {
182						return false;
183					}
184				}
185			}
186		} else if (flag == "next") {
187			if (obj.next().length >= 1) {			// ** 다음 메뉴가 있을경우.
188				// console.log( "1" );
189				if ($("ul[class^='depth']", obj.next()).length >= 1) {
190					return $("ul[class^='depth'] li", obj.next()).first();
191				} else {
192					return obj.next();
193				}
194			} else {								// ** 다음 메뉴가 없을경우.
195				// console.log( "2" );
196				$new2 = obj.closest("li.mn_li2").next();
197				if ($new2.length >= 1) {
198					if ($("ul[class^='depth']", $new2).length >= 1) {
199						return $("ul[class^='depth'] li", $new2).first();
200					} else {
201						return $new2;
202					}
203				} else {
204					// console.log( "3" );
205					$new1 = obj.closest("li.mn_li1").next();
206					if ($new1.length >= 1) {
207						$dep2Final = $("ul[class^='depth2'] li", $new1).first();
208						$dep3Final = $("ul[class^='depth3'] li", $dep2Final).first();
209						if ($dep3Final.length >= 1) {
210							$dep_Final = $dep3Final;
211						} else {
212							$dep_Final = $dep2Final;
213						}
214						return $dep_Final;
215					} else {
216						return false;
217					}
218				}
219			}
220		}
221	},
222	setClosestNode: function (flag, obj) {
223		var arrPrev = $("#contents .cont-top .prev-cont-tit");
224		var arrNext = $("#svisual-wrap #visImgWrap #visImg .site-util .lnkBox .next-cont-tit");
225		var arrTxt = $(" > a span", obj).text();
226		var arrLnk = $(" > a", obj).attr("href");
227		var arrTar = $(" > a", obj).attr("target");
228		var arrTarStr = "";
229		if (arrTar == "_self" || typeof arrTar == "undefined") {
230			arrTarStr = "_self";
231		} else if (arrTar == "_blank") {
232			arrTarStr = "_blank";
233		}
234		if (flag == "prev") {
235			/* 진주교대 이전메뉴는 사용않함
236			$("span", arrPrev).text( arrTxt );
237			arrPrev.attr({ "href":arrLnk, "target":arrTarStr });
238			*/
239		} else if (flag == "next") {
240			$("span", arrNext).text(arrTxt);
241			arrNext.attr({ "href": arrLnk, "target": arrTarStr });
242		}
243	},
244	tabIsFull: function () {
245		$cTabCore = $("body .c-tab01");
246		$cTabStdL = 5;
247		if ($cTabCore.length > 0) {
248			$cTabLInum = $("> ul > li", $cTabCore).length;
249			if ($cTabLInum >= $cTabStdL) {
250				$cTabCore.addClass("has" + $cTabLInum);
251			}
252		}
253		$("> ul > li", $cTabCore).each(function () {
254			$("span.txt", $(this)).wrap("<span></span>");
255		});
256	},
257	titleReset: function () {
258		$findStd = $("#cont");
259		// ** 게시판 일때만 작동
260		if ($("#board-wrap", $findStd).length > 0) {
261			// ** 게시판 LIST
262			if (($(".board-list-table", $findStd).length > 0 || $(".faq-list-wrap", $findStd).length > 0) && $(".b-tab01", $findStd).length > 0) {
263				$bbsTitleAddStr = $(".b-tab01 li.over a span:not(.blind)", $findStd).text();
264				regenTitle($bbsTitleAddStr);
265			}
266
267			// ** 게시판 VIEW
268			if ($(".board-view-cont", $findStd).length > 0) {
269				$bbsTitleAddStr = util.specialCharRemove($(".board-view-head .cate", $findStd).text());
270				regenTitle($bbsTitleAddStr + " 상세내용");
271			}
272		}
273
274		// ** 연혁 일때만 작동 : https://www.masan.ac.kr/kor/CMS/HistoryMgr/list.do?mCode=MN022
275		if ($(".dpt-histry-type01", $findStd).length > 0 && $(".dptTab01", $findStd).length > 0) {
276			$histTitleAddStr = $(".dptTab01 li.over a > span", $findStd).text();
277			regenTitle($histTitleAddStr);
278		}
279
280		// ** 3차 메뉴가 있을 때만 작동
281		if ($("> .c-tab01", $findStd).length > 0) {
282			$titleTag = $("title");
283			$titleTagStr = $titleTag.text();
284			$thirdMenu = $("> .c-tab01 > ul > li.over > a > span > span", $findStd).text();
285			regenTitle($thirdMenu);
286		}
287
288		function regenTitle(addStr) {
289			$titleTag = $("title");
290			$titleTagStr = $titleTag.text();
291			$titleTagStrArr = $titleTagStr.split(">");
292			$titleTagStrArr1 = $titleTagStrArr[0];
293			$titleTagStrArr2 = $titleTagStrArr[1];
294			console.log($titleTagStrArr1);
295			console.log($titleTagStrArr2);
296			$titleLastStr = $titleTagStrArr1 + " : " + addStr + " < " + $titleTagStrArr2;
297			$titleTag.text($titleLastStr);
298		}
299	},
300	setTelLnk: function () {
301		if (util.getQueryStr("mCode") == "MN038" || util.getQueryStr("mCode") == "MN039" || util.getQueryStr("mCode") == "MN040" || util.getQueryStr("mCode") == "MN140" || util.getQueryStr("mCode") == "MN145") {
302			var telRegExp = /^\d{2,3}-\d{3,4}-\d{4}$/;
303			$(".tbl-type01 td").each(function () {
304				if (telRegExp.test($(this).text())) {
305					var thisTelStr = $(this).text();
306					$(this).html("<span class='tel-Str2'>" + thisTelStr + "</span><a href='tel:" + util.getNumberOnly(thisTelStr) + "' class='tel-Lnk2'>" + thisTelStr + "</a>")
307				}
308			});
309		}
310	},
311	bbsViewRspsvTbl: function () {
312		// ** 게시판 VIEW 페이지에서만 동작
313		if ($("#board-wrap", $findStd).length > 0 && $(".board-view-cont", $findStd).length > 0 && $("#boardContents").length > 0) {
314			$("#boardContents table").each(function () {
315				$tblMinW = $(this).width();
316				$(this).removeAttr("style border cellspacing cellpadding status").css({ "min-width": $tblMinW + "px" }).wrap("<div class='is-wauto-box'></div>");
317			});
318		}
319	}
320}

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.