1document.addEventListener('DOMContentLoaded', ()=>{ 2 //console.log("common_ui_front start"); 3 4 // nav ì href를 ì¸í íë¤. 5/* document.querySelectorAll('.moveMenuContsUrl').forEach(menu => { 6 const menuNo = menu.dataset.menuNo; 7 8 if(isNull(menuNo)) return; 9 if(menu.href !== 'javascript:void(0);' || isNull(menu.href)) return; //hrefì ê°ì´ ìì¼ë©´ ì ì§ 10 11 // í´ë¦í tobNavìì ê°ì¥ ê°ê¹ì´ urlë§¤ì¹ ë©ë´ë¥¼ ì°¾ëë¤. 12 let childMenu = findChildMenu(menuNo); 13 if(isNull(childMenu)) return; 14 while (isNull(childMenu.contsUrl)) { 15 childMenu = findChildMenu(childMenu.menuNo); 16 if(isNull(childMenu)) return; 17 } 18 menu.href = childMenu.contsUrl; 19 })*/ 20 21 22 // post urlì´ë 23 document.querySelectorAll('.moveUrlDo, .moveUrlDo2').forEach(e => e.addEventListener('click', (event)=>{ 24 event.stopPropagation(); 25 const target = event.currentTarget; 26 const data = target.dataset; 27 const url = data.url; 28 Reflect.deleteProperty(data, 'url'); 29 submitForm(url,{data : data, method : "POST"}); 30 })); 31 32 // jquery datepickerì¸í 33 if($(".datepicker").length > 0){ 34 $(".datepicker").datepicker({ 35 dateFormat: "yy-mm-dd", // ë ì§ íì (yyyy-MM-dd) 36 changeMonth: true, // ì ì í ê°ë¥ 37 changeYear: true, // ì°ë ì í ê°ë¥ 38 yearRange: "2000:2030", // ì í ê°ë¥ ì°ë ë²ì 39 dayNames: ["ì¼ìì¼", "ììì¼", "íìì¼", "ììì¼", "목ìì¼", "ê¸ìì¼", "í ìì¼"], // ìì¼ ì ì²´ ì´ë¦ 40 dayNamesMin: ["ì¼", "ì", "í", "ì", "목", "ê¸", "í "], // ìì¼ ì¶ì½ ì´ë¦ 41 monthNames: ["1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì"], // ì ì ì²´ ì´ë¦ 42 monthNamesShort: ["1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì"], // ì ì¶ì½ ì´ë¦ 43 prevText: "ì´ì ", 44 nextText: "ë¤ì", 45 currentText: "ì¤ë", 46 closeText: "ë«ê¸°", 47 showOn : "both", 48 buttonImage : "/images/front/ico_calendar.svg", 49 buttonImageOnly : false, 50 }); 51 } 52 53 // loading-link í´ëì¤ë¥¼ ì ë ¥íë©´ ë¡ë©ë°ë¥¼ ë³´ì¬ì¤ë¤. 54 document.querySelectorAll(".loading-link").forEach((link) => { 55 link.addEventListener("click", () => { 56 console.log("aíê·¸ í´ë¦ì¼ë¡ íë©´ ì´ëì ë¡ë©ë° ë³´ì¬ì£¼ê¸°") 57 showLoading(); 58 }); 59 }); 60 61 // ëì ì´ë²¤í¸ ë°ì¸ë©, íì ì°½ ë«ê¸° 62 document.body.addEventListener('click',(event)=>{ 63 if(!event.target.closest("button.js_close_pop")) return; 64 if(!isNull(document.querySelector('.dim'))){ 65 document.querySelector('.dim').style.display = 'none'; 66 } 67 event.target.closest('.basic_pop').style.display='none'; 68 }); 69 70 // ëì ì´ë²¤í¸ ë°ì¸ë©, side nav를 ì´ê³ ë«ê¸° 71 document.querySelectorAll('.snb').forEach(e => e.addEventListener('click',(event)=>{ 72 if(!event.target.matches('.btn-toggle-side-nav')) return; 73 event.preventDefault(); 74 const target = event.target; 75 const targetParent = event.target.parentNode; 76 77 if(target.classList.contains("active")){ 78 target.classList.remove("active"); 79 } else { 80 target.classList.add("active"); 81 } 82 })); 83 84 // url ê³µì ë²í¼ 85 document.querySelectorAll('.urlShareBtn').forEach(e=> e.addEventListener('click', ()=>{ 86 copyCurrentUrlToClipboard(); 87 })); 88 89 // íë¦°í¸ ë²í¼ 90 document.querySelectorAll('.printBtn').forEach(e=> e.addEventListener('click', ()=>{ 91 window.print(); 92 })); 93 94 // ì기ìí©ë³ ëì²ë§¤ë´ì¼ 95 if(window.location.pathname === '/bbs/contsPst/MST0000000000125/25/detail'){ 96 const hash = window.location.hash; 97 setTimeout(() => { 98 handleHashNavigation(); 99 }, 10); 100 101 102 // í´ì ë³ê²½ ì (ë¤ë¡ê°ê¸°/ìì¼ë¡ê°ê¸°, ìë hash ë³ê²½) 103 window.addEventListener("hashchange", handleHashNavigation); 104 105 function handleHashNavigation() { 106 const hash = window.location.hash; 107 if (!hash) return; 108 109 const anchor = document.querySelector(`a[href="${hash}"]`); 110 if (anchor){ 111 anchor.click(); 112 } 113 } 114 } 115 116 // ë¨ê³ë³ ì¬í경보 117 if(window.location.pathname === '/travelAlert/apntStatus/stepTravelAlert'){ 118 const hash = window.location.hash; 119 if (hash) { 120 const anchor = document.querySelector(`a[href="${hash}"]`); // <a href="#someId"> 찾기 121 if (anchor) { 122 setTimeout(()=>{ 123 anchor.click(); 124 },50) 125 } 126 //if (anchor)anchor.click(); 127 } 128 } 129 130 131 // ë¤ë¡ê°ê¸°ë¥¼ ê°ì§íì¬ ë¡ë©ë°ë¥¼ ì§ì´ë¤. (ë¤ë¡ê°ê¸°ì ë¡ë©ë°ê° ë¨ììë ê²½ì°ê° ìì) 132 window.addEventListener("pageshow", (event) => { 133 if (event.persisted) { 134 console.log('pageshow ë¤ë¡ê°ê¸° ê°ì§') 135 showLoading(false); 136 } 137 });
138 window.addEventListener("popstate", (event) => { 139 console.log('popstate ë¤ë¡ê°ê¸° ê°ì§') 140 showLoading(false); 141 }); 142 document.addEventListener("visibilitychange", () => { 143 console.log('visibilitychange ë¤ë¡ê°ê¸° ê°ì§') 144 showLoading(false); 145 }); 146 //"íì´ì§ë¥¼ ë ë기 ì§ì " ì´ë²¤í¸ë¥¼ ê°ì§ 147 window.addEventListener("beforeunload", () => { 148 console.log('beforeunload íì´ì§ ë ë¨ ê°ì§') 149 isUnloading = true; 150 }); 151}); 152//"íì´ì§ë¥¼ ë ë기 ì§ì " ì´ë²¤í¸ ì¬ë¶ 153let isUnloading = false; 154 155/* 156function findChildMenu(menuNo){ 157 const allMenuListCheck = allMenuList.filter(menu => menu.upMenuNo == menuNo); 158 if(Array.isArray(allMenuListCheck) && allMenuListCheck.length > 0){ 159 return allMenuListCheck[0] 160 } 161 return null; 162} 163*/ 164 165/* 166let menuAuthList = null; 167 168document.addEventListener('DOMContentLoaded', ()=>{ 169 const headerGnb = document.querySelector('#header_gnb'); 170 if(headerGnb === null) return; 171 setMenuAuthList(); 172}); 173 174 175function callMenuAuthList(){ 176 return fetchWrapper("/cmm/menu/authList"); 177} 178 179function setMenuAuthList(){ 180 fetchWrapper("/cmm/menu/authList") 181 .then(data=>{ 182 if (isNull(data)) { 183 console.error("ë©ë´ ë°ì´í° í¸ì¶ ì¤í¨"); 184 return; 185 } 186 187 menuAuthList = data; 188 189 const menuLvl1List = menuAuthList.filter(menu => menu.menuLvl === "1"); 190 const menuLvl2List = menuAuthList.filter(menu => menu.menuLvl === "2"); 191 const menuLvl3List = menuAuthList.filter(menu => menu.menuLvl === "3"); 192 193 const headerGnb = document.querySelector('#header_gnb'); 194 if(headerGnb === null) return; 195 headerGnb.innerHTML = null; 196 headerGnb.insertAdjacentElement('beforeend', document.createElement('ul')) 197 198 const gnbLvl1 = headerGnb.querySelector('ul') 199 gnbLvl1.innerHTML = null; 200 201 // 202 menuLvl1List.forEach((menu,index) => { 203 const liEl = document.createElement('li'); 204 const url = isNull(menu.menuUrl) ? "javascript:void(0);" : menu.menuUrl; 205 liEl.innerHTML = `<a href="${url}" data-menu-no="${menu.menuNo}">${menu.menuNm}</a>`; 206 gnbLvl1.insertAdjacentElement('beforeend', liEl); 207 }); 208 209 const lnbLvl2 = document.querySelector('#left_lnb'); 210 211 const menuLvl2ListSelect = menuLvl2List.filter(menu => menu.upMenuNo == "20"); 212 menuLvl2ListSelect.forEach((menu, index)=>{
213 const menuUrl = menu.menuUrl; 214 const menuNo = menu.menuNo; 215 const menuNm = menu.menuNm; 216 217 const liEl = document.createElement('li'); 218 liEl.setAttribute("class", "on"); 219 220 const url = isNull(menuUrl) ? "javascript:void(0);" : menuUrl; 221 liEl.innerHTML = `<a href="${url}" data-menu-no="${menuNo}">${menuNm}</a>`; 222 if(isNull(menuUrl)){ 223 liEl.innerHTML += `<ul class="depth2 menu_depth2" data-menu-no="${menuNo}"></ul>`; 224 } 225 226 lnbLvl2.insertAdjacentElement('beforeend', liEl); 227 }); 228 229 const lnbLvl3 = document.querySelectorAll('.menu_depth2'); 230 lnbLvl3.forEach((upMenu,index)=>{ 231 const upMenuNo = upMenu.dataset.menuNo 232 const menuLvl3ListSelect = menuLvl3List.filter(menu => menu.upMenuNo == upMenuNo); 233 menuLvl3ListSelect.forEach((menu3, index)=> { 234 const menu
234Url = menu3.menuUrl; 235 const menuNo = menu3.menuNo; 236 const menuNm = menu3.menuNm; 237 const url = urlNullCheck(menuUrl); 238 239 upMenu.innerHTML += `<li><a href="${url}" data-menu-no="${menuNo}">${menuNm}</a></li>`; 240 }) 241 }); 242 }).catch(error => { 243 console.error("setMenuAuthList error"); 244 }); 245 246 function urlNullCheck(menuUrl) { 247 return isNull(menuUrl) ? "javascript:void(0);" : menuUrl; 248 } 249} 250 251console.log("common_ui.js on!")*/ 252// nav í´ë¦íì¬ ë©ë´ ì´ë 253/*document.querySelectorAll('.moveMenuContsUrl').forEach(menu => { 254 menu.addEventListener('click', (e) => { 255 256 const target = e.currentTarget; 257 const menuNo = target.dataset.menuNo; 258 const contsUrl = target.dataset.contsUrl; 259 260 if(isNull(menuNo)){ 261 return; 262 } 263 264 showLoading(); // ë¡ë©ë° 265 if(!isNull(contsUrl)){ 266 location.href = contsUrl; 267 return; 268 } 269 270 // í´ë¦í tobNavìì ê°ì¥ ê°ê¹ì´ urlë§¤ì¹ ë©ë´ë¥¼ ì°¾ìì ì´ëíë¤. 271 let childMenu = findChildMenu(menuNo); 272 while (isNull(childMenu.contsUrl)) { 273 childMenu = findChildMenu(childMenu.menuNo); 274 if(isNull(childMenu)){ 275 showLoading(false); 276 return; // childMenuê° nullì´ë©´ ì ì§ 277 } 278 } 279 //console.log(childMenu); 280 281 location.href = childMenu.contsUrl; 282 }); 283})*/
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.