1/*ë¤êµì´ ê°ì²´*/ 2var i18n_Prop; 3 4//replaceAll prototype ì ì¸ 5String.prototype.replaceAll = function(org, dest) { 6 return this.split(org).join(dest); 7} 8 9$(function() { 10 $.ajax({ 11 async:false, 12 type:'GET', 13 dataType: "json", 14 url: "getLangDictionary_home", 15 suppressErrors:true, 16 success: function(data, status, xhr){ 17 i18n_Prop = data; 18 }, 19 error: function(jqxhr, status, thrownError){ 20 var message = thrownError 21 if(jqxhr.responseJSON){ 22 message = jqxhr.responseJSON.message; 23 } 24 alert(message); 25 } 26 }); 27 28 29 //ëë°ì´ì¤ì ë°ë¥¸ ë§ì°ì¤ ì´ë²¤í¸ 30 (window.matchMedia("(max-width: 1024px)").matches) ? MEvnt() : PCEvnt(); 31 $(window).resize(function(){ 32 (window.matchMedia("(max-width: 1024px)").matches) ? MEvnt() : PCEvnt(); 33 }); 34}); 35 36var commUtil = { 37 /**ì¤ë ë ì*/ 38 today: new Date(), 39 40 /**주ì´ì§ ë³ìì ë´ì©ì´ ìëì§ íì¸*/ 41 isEmpty: function (value) { 42 return value === undefined || value === null || value === "" || value.length == 0; 43 }, 44 45 /**주ì´ì§ ë³ìì ë´ì©ì´ ìëì§ íì¸*/ 46 isNotEmpty: function (value) { 47 return !isEmpty(value); 48 }, 49 /**IE ì¬ë¶ íì¸*/ 50 isIE :function(){ 51 return navigator.appVersion.indexOf('Trident/') > -1; //IE 9:Trident/5.0, 10:Trident/6.0, 11:Trident/7.0 52 }, 53 /** ajax를 í¸ì¶íê³ ê²°ê³¼ë promiseë¡ ì ë¬ 54 * method : GET/POST(default : GET) 55 * .done(), .fail(), .always() = complete 56 */ 57 sendRequest: function (url, data, method, suppressErrors) { 58 var defer = $.Deferred(); 59 60 var param; 61 if(typeof data === "function") 62 param = data(); 63 else if (data){ 64 param = data; 65 } else{ 66 param ="" 67 } 68 69 $.ajax(url, { 70 cache: false, 71 dataType: "json", 72 data: param, 73 method: method || "GET", 74 contentType: "application/json;charset=UTF-8", 75 xhrFields: { withCredentials: true }, 76 suppressErrors: suppressErrors 77 }).done(function(resultData) { 78 defer.resolve(resultData); 79 }).fail(function(jqXHR, textStatus, errorThrown) { 80 defer.reject(jqXHR.responseJSON ? jqXHR.responseJSON : {code: jqXHR.status, message:errorThrown}); 81 }); 82 83 return defer.promise(); 84 }, 85 /** ajax를 syncë¡í¸ì¶íê³ ê²°ê³¼ë promiseë¡ ì ë¬ 86 * method : GET/POST(default : GET) 87 * .done(), .fail(), .always() = complete 88 */ 89 sendRequestSync: function (url, data, method, suppressErrors) { 90 var param; 91 if(typeof data === "function") 92 param = data(); 93 else if (data){ 94 param = data; 95 } else{ 96 param ="" 97 } 98 99 return $.ajax(url, { 100 async: false, 101 cache: false, 102 dataType: "json", 103 data: param, 104 method: method || "GET", 105 contentType: "application/json", 106 xhrFields: { withCredentials: true }, 107 suppressErrors: suppressErrors 108 }); 109 }, 110 /** ë¤êµì´ ì²ë¦¬ Dictionary ì ì ìë ì¸ì´ì 문ìë¡ ì¹í */ 111 i18n: function(keyword){ 112 if(!keyword || !i18n_Prop) return keyword; 113 114 var temp = i18n_Prop[keyword]; 115 if(temp) return temp; 116 117 return keyword; 118 }, 119 getParameter: function(paramName, defaultValue){ 120 121 var result = (defaultValue === undefined || defaultValue == null)? "" : defaultValue;
122 // íì¬ URL ê°ì ¸ì¤ê¸° 123 var url = location.href; 124 /* 125 if(appURL != undefined && appURL != "") 126 url = appURL; 127*/ 128 // get íë¼ë¯¸í° ê°ì ê°ì ¸ì¬ ì ìë ? 를 기ì ì¼ë¡ slice í í split ì¼ë¡ ëë 129 var idx = url.indexOf('?'); 130 if(idx<0) return defaultValue; 131 132 var parameters = (url.substr(idx+1)).split('&'); 133 134 parameters.forEach(function(param){ 135 var arrayParam = param.split('='); 136 137 if (arrayParam[0].toUpperCase() == paramName.toUpperCase()) { 138 defaultValue = decodeURIComponent(arrayParam[1]); 139 return false; 140 } 141 }); 142 143 return defaultValue; 144 }, 145 /** 146 * ìì°½ ì´ê¸° 147 */ 148 openPopupWindow : function (url, windowsName, w, h){ 149 var width = w || 1200; 150 var height = h || 700; 151 var px = (screen.availWidth-width)/2; 152 var py = (screen.availHeight-height)/2; 153 154 155 var specs='left='+px+', top='+py+', width=' +width+ ', height=' + height+", location=yes, resizable=yes"; 156 var p = window.open(url, windowsName || "wbjPopWindows" , specs); 157 158 if(p === undefined){ 159 commUtil.error("fail open new window"); 160 } else { 161 p.focus(); 162 } 163 return p; 164 }, 165 166 /** 167 * ë ë ìì ì°¨ì´ë¥¼êµ¬íë í¨ì 168 */ 169 diffDateCheck : function (str1, str2) { 170 var strdate = commUtil.strToDate(str1); 171 var enddate = commUtil.strToDate(str2); 172 173 return (strdate.getTime() <= enddate.getTime()); 174 }, 175 176 /** 177 * ì¼ë° ì¤í¸ë§í ë ì§ë¥¼ new Dateë¡ ë³í 178 */ 179 strToDate : function(str){ 180 if(str instanceof Date){ 181 return str; 182 183 } else { 184 if((str.length > 10) && (str.indexOf("-") > 0)){ 185 //2020-09-22 12:34:56 ì íìì´ë¼ë©´ , ieìì date parseí ë '-' 구ë¶ì를 ì¬ì©íì§ ìì 186 str = str.trim().replace(/\s/gi, 'T'); 187 } 188 189 return new Date(str); 190 } 191 }, 192 193 /** 194 * ê³µíµ ì림 íì (type : confirm-ëëí, alert-ì²´í¬, fail) 195 */ 196 alert: function(type, title, msg, showCancelBtn){ 197 var defer = $.Deferred(); 198 199 var alertType = type || "confirm"; //confirm, alert, fail 200 if(showCancelBtn == undefined) showCancelBtn = false; 201 202 var alertHtml = []; 203 alertHtml.push('<div class="ui_wbj_layer_wrap" id="commLayer">'); 204 alertHtml.push('<div class="ui_wbj_layer_inner">'); 205 alertHtml.push('<div class="ui_wbj_layer_alert type_' + type + '">'); 206 alertHtml.push('<div class="ui_wbj_alert_box">'); 207 alertHtml.push('<div class="ui_wbj_alert_title">'); 208 if(title) alertHtml.push(commUtil.i18n(title)); 209 alertHtml.push('</div>'); 210 alertHtml.push('<div class="ui_wbj_alert_message">'); 211 if(msg) alertHtml.push(commUtil.i18n(msg)); 212 alertHtml.push('</div>'); 213 alertHtml.push('</div>'); 214 alertHtml.push('<div class="ui_wbj_edit_btns">'); 215 alertHtml.push('<button class="ui_wbj_btn point">' + commUtil.i18n("íì¸") + '</button>'); 216 if(showCancelBtn) 217 alertHtml.push('<button class="ui_wbj_btn ui_wbj_btn_close">' + commUtil.i18n("ì·¨ì") + '</button>'); 218 alertHtml.push('</div>'); 219 alertHtml.push('</div>'); 220 alertHtml.push('</div>'); 221 alertHtml.push('</div>'); 222 223 $("body").append(alertHtml.join("")); 224 225 $("#commLayer button.point").click(function(){ 226 defer.resolve("ok"); 227 $("#commLayer").removeClass('active'); 228 $("#commLayer").remove(); 229 }); 230 231 $("#commLayer button.ui_wbj_btn_close").click(function(){ 232 defer.reject("cancel"); 233 $("#commLayer").removeClass('active'); 234 $("#commLayer").remove(); 235 }); 236 237 //ì¼ë¿ëì°ê¸° 238 $("#commLayer").addClass("active"); 239 240 return defer.promise(); 241 }, 242 /** 243 * ë´ì©ìì URLì¶ì¶íì¬ aíê·¸ë¡ ë³ê²½í기 244 **/ 245 chgLink : function(originalData){ 246 var expUrl =  /(((http(s)?:\/\/)\S+(\.[^(\n|\t|\s,)]+)+)|((http(s)?:\/\/)?(([a-zA-z\-_]+[0-9]*)|([0-9]*[a-zA-z\-_]+)){2,}(\.[^(\n|\t|\s,)]+)+))+/gi; 247 return originalData.replace(expUrl, '<a href="$&">$&</a>'); 248 }, 249 /** 250 * ìë¨¸ë ¸í¸ ê¸ê¼´ 리ì¤í¸ 251 **/ 252 editFontList : function(){ 253 var fontList = ['ê¶ì', 'ë°í', 'ëì', '굴림', 'ë§ì ê³ ë', 'ëëê³ ë', 'ëëëª ì¡°', 'ëëí', 'ëëì¤íì´']; 254 255 if(g_langCode == 1){ 256 fontList = ['Arial', 'Verdana','Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Tahoma', 'Times New Roman']; 257 } else if(g_langCode == 2){
258 fontList = ['Meiryo','LINESeedJP']; 259 } 260 261 return fontList; 262 } 263}; 264 265//ì¿ í¤ ìì± 266function setCookie(cName, cValue, cDay){ 267 var expire = new Date(); 268 expire.setDate(expire.getDate() + cDay); 269 cookies = cName + '=' + escape(cValue) + '; path=/ '; // íê¸ ê¹¨ì§ì ë§ê¸°ìí´ escape(cValue)를 í©ëë¤. 270 if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';'; 271 document.cookie = cookies; 272} 273 274// ì¿ í¤ ê°ì ¸ì¤ê¸° 275function getCookie(cName) { 276 cName = cName + '='; 277 var cookieData = document.cookie; 278 var start = cookieData.indexOf(cName); 279 var cValue = ''; 280 if(start != -1){ 281 start += cName.length; 282 var end = cookieData.indexOf(';', start); 283 if(end == -1)end = cookieData.length; 284 cValue = cookieData.substring(start, end); 285 } 286 return unescape(cValue); 287} 288 289//ì¿ í¤ ìì 290function deleteCookie(name, path, domain) { 291 if (getCookie(name)) 292 document.cookie = name + '=' 293 + ((path) ? ';path=' + path : '') 294 + ((domain) ? ';domain=' + domain : '') 295 + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; 296} 297 298//모ë°ì¼ í¤ë ë©ë´ ë§ì°ì¤ ì´ë²¤í¸ 299function MEvnt() { 300 $('.ui_wbj_btn_menu').on('click', function () { 301 $('.ui_wbj_nav_area').addClass('active'); 302 }); 303 304 $('.ui_wbj_nav_area .ui_wbj_btn_close').on('click', function () { 305 $('.ui_wbj_nav_area').removeClass('active'); 306 }); 307 $('.ui_wbj_nav_area .ui_wbj_nav_item').on('click', function () { 308 $('.ui_wbj_nav_area .ui_wbj_nav_item').removeClass('active'); 309 $(this).addClass('active'); 310 }); 311} 312 313// pc í¤ë ë©ë´ ë§ì°ì¤ ì´ë²¤í¸ 314function PCEvnt() { 315 $('.ui_wbj_nav .ui_wbj_nav_item').on('mouseenter', function () { 316 $(this).addClass('active'); 317 }).on('mouseleave', function () { 318 $(this).removeClass('active'); 319 }); 320 321 $('.ui_wbj_nav .ui_wbj_sub_list .ui_wbj_sub_item').on('click', function () { 322 $('.ui_wbj_nav .ui_wbj_sub_list .ui_wbj_sub_item').removeClass('active'); 323 $(this).addClass('active'); 324 }); 325}; 326 327function goSubMenu(menuId) { 328 var href = $("#" + menuId + " li:first-child a:first-child")[0].href 329 330 if (href.length != "") { 331 var func = href.substring(11, href.length); 332 333 if (func.substring(0, 6) == "goMenu") { 334 var key = func.substring(7, func.length - 1).replace(/\'/g, ""); 335 goMenu(key); 336 } else { 337 var key = func.substring(12, func.length - 1).replace(/\'/g, ""); 338 goDirectMenu(key); 339 } 340 } 341} 342 343function goMenu(subMenuKey) { 344 var menu = subMenuKey.split("_"); 345 346 if (menu.length > 1) { 347 location.href = menu[0] + "?pageCode=" + menu[1]; 348 } 349} 350 351function goDirectMenu(subMenuKey) { 352 var menu = subMenuKey.split("_"); 353 354 if (menu.length > 1) { 355 location.href = menu[1]; 356 } 357} 358 359function goPage(url, pages, lines, keyword, category, pageCode, simply) { 360 url += "?pageCode=" + pageCode + "&pages=" + pages + "&line=" + lines 361 + "&keyword=" + urlencode(keyword) + "&category=" + category + "&simply=" + simply; 362 location.href = url; 363} 364 365function goMailPage(url, pages, lines, listType) { 366 url += "?pages=" + pages + "&lines=" + lines + "&listType=" + listType; 367 location.href = url; 368} 369 370function urlencode(str) { 371 str = (str + '').toString(); 372 return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27') 373 .replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A') 374 .replace(/%20/g, '+'); 375} 376 377function urldecode(str) { 378 return decodeURIComponent((str + '').replace(/%(?![\da-f]{2})/gi, 379 function() { 380 return '%25'; 381 }).replace(/\+/g, '%20')); 382} 383 384function rawurlencode(str) { 385 str = (str + '').toString(); 386 return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27') 387 .replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A'); 388 389} 390 391function rawurldecode(str) { 392 return decodeURIComponent((str + '').replace(/%(?![\da-f]{2})/gi, 393 function() { 394 return '%25'; 395 }) 396 ); 397} 398 399function sqlFilter(str) { 400 // sql filter 401 str = str.replace(/;/gi, ""); 402 str = str.replace(/#/gi, ""); 403 str = str.replace(/--/gi, ""); 404 str = str.replace(/\'/gi, "'"); 405 str = str.replace(/\"/g, """); 406 str = str.replace(/\\/gi, "\"); 407 // str = str.replace(" ",""); 408 409 // xss filter 410 str = str.replace(/</gi, "<"); 411 str = str.replace(/>/gi, ">"); 412 return (str); 413} 414 415function xssFilter(str) { 416 str = str.replace(/</gi, "<"); 417 str = str.replace(/>/gi, ">"); 418 return (str); 419} 420 421function validationEmail(strValue) { 422 var regExp = /[0-9a-zA-Z][_0-9a-zA-Z-]*@[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+){1,2}$/; 423 424 if (strValue != "" && !strValue.match(regExp)) { 425 return false; 426 } 427 428 return true; 429} 430 431function validationTel(strValue) { 432 var regExp = /^(01[016789]{1}|070|02|0[3-9]{1}[0-9]{1})-[0-9]{3,4}-[0-9]{4}$/; 433 434 if (!strValue.match(regExp)) { 435 return false; 436 } 437 438 return true; 439} 440 441function validationId(strValue) { 442 var regExp = /^[A-Za-z0-9]*$/; 443 444 if (!strValue.match(regExp)) { 445 return false; 446 } 447 if (strValue.length == 0) { 448 return false; 449 } 450 451 return true; 452} 453 454// //////////////////// File Upload /////////////////// 455$(document).ready(function() { 456 var fileTarget = $('.filebox .upload-hidden'); 457 458 fileTarget.on('change', function() { 459 if (window.FileReader) { 460 // íì¼ëª ì¶ì¶ 461 var filename = $(this)[0].files[0].name; 462 } else { 463 // Old IE íì¼ëª ì¶ì¶ 464 var filename = $(this).val().split('/').pop().split('\\').pop(); 465 }; 466 467 $(this).siblings('.upload-name').val(filename); 468 }); 469}); 470
471// ///////////////////// Comment /////////////////////// 472 473function drawComments(obj, usid, isid) { 474 475 var comWidth = 300; 476 477 if(obj.length > 0){ 478 for (var i = 0; i < obj.length; i++) { 479 // deptì width 구í기 480 if (obj[i].pimdid == "0" || obj[i].pimdid == null || obj[i].pimdid == "") { 481 dept = 0; 482 } else { 483 dept = 1; 484 } 485 486 // /// commentStr ë§ë¤ê¸° 487 // start------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 488 var visible = true; 489 if (!obj[i].usid && (Number(obj[i].usid) == 0)) { // ìì ë ëê¸ 490 visible = false; 491 }; 492 493 494 var cmtItemBox = []; 495 cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_box" id="commentBox_' + obj[i].imdid + '">'; 496 cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_info">'; 497 if(visible){ 498 cmtItemBox[cmtItemBox.length] = '<span class="ui_wbj_info_name">' + obj[i].realname + '</span>'; 499 cmtItemBox[cmtItemBox.length] = '<span class="ui_wbj_info_date">' + obj[i].mdate + '</span>'; 500 } 501 502 if (obj[i].usid == usid) { 503 cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_write" style="display: none;">'; 504 cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_textarea">'; 505 cmtItemBox[cmtItemBox.length] = '<textarea id="commentMsg_' + obj[i].imdid + '">'; 506 cmtItemBox[cmtItemBox.length] = obj[i].idmsg; 507 cmtItemBox[cmtItemBox.length] = '</textarea>'; 508 cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn" id="updateBtn_' + obj[i].imdid + '" onclick="saveComment(' + isid + ','+ obj[i].imdid + ', \'U\')">' 509 + commUtil.i18n("ì ì¥") + '</button>'; 510 cmtItemBox[cmtItemBox.length] = '</div></div>'; 511 } 512 513 cmtItemBox[cmtItemBox.length] = '<p class="ui_wbj_comment_content">' + obj[i].idmsg + '</p>'; 514 515 516 517 cmtItemBox[cmtItemBox.length] = '</div>'; //ui_wbj_comment_info 518 cmtItemBox[cmtItemBox.length] = '</div>'; //ui_wbj_comment_box 519 520 cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_edit">'; 521 if (visible && (obj[i].usid == usid)) { // ìì±ìë§ ìì , ìì í ì ìì 522 cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn type_edit" onclick="updateComment(' + obj[i].imdid + ', ' + isid + ');">' + commUtil.i18n("ìì ") + '</button>'; 523 cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn type_delete" onclick="deleteAlert(' + obj[i].imdid + ', ' + isid + ');">' + commUtil.i18n("ìì ") + '</button>'; 524 } 525 if(visible){ 526 cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn" onclick="leaveComment(' + obj[i].imdid + ',' + comWidth + ')">' + commUtil.i18n("ëµê¸ì°ê¸°") + '</button>'; 527 } 528 cmtItemBox[cmtItemBox.length] = '</div>'; 529 530 cmtItemBox[cmtItemBox.length] = '<div id="IMDID_' + obj[i].imdid + '_re" level="' + dept + '" pimdid="' + obj[i].pimdid + '" class="ui_wbj_comment_reply"></div>'; 531 532 // /// commentStr ë§ë¤ê¸° 533 // end------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 534 535 $("#IMDID_" + (obj[i].pimdid == "" ? 0 : obj[i].pimdid) + "_re").append('<div id="IMDID_' + obj[i].imdid + '" class="ui_wbj_comment_item">' + cmtItemBox.join("")); 536 537 // ëê¸ìì height ìë ì¡°ì 538// $("#commentMsg_" + obj[i].imdid).height($("#commentMsg_" + obj[i].imdid).prop("scrollHeight") + 10); 539 } 540 541 } else { 542 $("#commentArea").height(80); 543 } 544 545} 546 547function insertComment(isid, imdid) { 548 if ($("#commentText_" + imdid).val() == "") { 549 commUtil.alert("fail", "ë´ì©ì ì ë ¥í´ì£¼ì¸ì.", ""); 550 return; 551 } 552 553 saveComment(isid, imdid, "I"); 554} 555 556function saveComment(isid, imdid, type) { 557 558 var idmsg = ""; 559 var pimdid = ""; 560 if (type == "U") 561 idmsg = $("#commentMsg_" + imdid).val(); 562 else if (type == "D") 563 idmsg = "ìì ë ì½ë©í¸ì ëë¤."; 564 else
565 idmsg = $("#commentText_" + imdid).val(); 566 567 // ë³´ì íí°ë§ 568 idmsg = sqlFilter(idmsg); 569 570 if ($("#IMDID_" + imdid + "_re").attr('level') == "0") { 571 pimdid = imdid; 572 } else if ($("#IMDID_" + imdid + "_re").attr('level') == "1") { 573 pimdid = $("#IMDID_" + imdid + "_re").attr('pimdid'); 574 } 575 576 $.post("home_saveComment", { 577 isid : isid, 578 imdid : imdid, 579 pimdid : pimdid, 580 idmsg : idmsg, 581 type : type, 582 wfdid : wfdid 583 }, function(comResult) { 584 // ì±ê³µ 585 if (comResult != "") { 586 587 // ëê¸ë¦¬ì¤í¸ ë¤ì ê°ì§ê³ ìì ë¤ì 그리기 588 $("#IMDID_0_re").empty(); 589 $("#commentText_0").val(""); 590 drawComments(comResult, usid, isid); 591 592 $("#commentArea").height($("#IMDID_0_re").height()); 593 594 } else { // ì¤í¨ 595 commUtil.alert("fail", "ëê¸ ëª©ë¡ì ë¶ë¬ì¤ì§ 못íìµëë¤.", ""); 596 return; 597 } 598 }); 599} 600 601function leaveComment(imdid, comWidth) { 602 603 var replyArea = []; 604 replyArea[replyArea.length] = '<div class="ui_wbj_comment_reply">'; 605 replyArea[replyArea.length] = '<div class="ui_wbj_comment_write">'; 606 replyArea[replyArea.length] = '<div class="ui_wbj_textarea">'; 607 replyArea[replyArea.length] = '<textarea id="commentText_' + imdid + '" placeholder="' + commUtil.i18n("ëê¸ ì ë ¥") + '"></textarea>'; 608 replyArea[replyArea.length] = '<button class="ui_wbj_btn" onclick="insertComment(' + isid + ', ' + imdid + ')">' + commUtil.i18n("ì ì¥") + '</button>'; 609 replyArea[replyArea.length] = '</div>'; 610 replyArea[replyArea.length] = '</div>'; 611 replyArea[replyArea.length] = '</div>'; 612 613 $("#commentBox_" + imdid).append(replyArea.join("")); 614} 615 616 617function updateComment(imdid, isid) { 618 var commtBox = $("#commentBox_" + imdid); 619 620 commtBox.find("div.ui_wbj_comment_write").css("display", "") 621 commtBox.find("p.ui_wbj_comment_content").css("display", "none") 622} 623 624function deleteComment(imdid, isid) { 625 saveComment(isid, imdid, "D"); 626} 627 628function deleteAlert(imdid, isid) { 629 commUtil.alert("confirm", "ìì íìê² ìµëê¹?", "íì¸ ë²í¼ì ë르면 ìì±íì ë´ì©ì´ ì¬ë¼ì§ëë¤.", true).done(function(){ 630 deleteComment(imdid, isid); 631 }); 632} 633 634// ////////////////////////////////////////////////////////////////////////////////////////////////// 635 636function cancelBtn(url) { 637 commUtil.alert("confirm", "ì·¨ìíìê² ìµëê¹?", "íì¸ ë²í¼ì ë르면 ìì±íì ë´ì©ì´ ì¬ë¼ì§ëë¤.", true).done(function(){ 638 location.href = url; 639 }); 640} 641 642function deleteBtn(url) { 643 commUtil.alert("confirm", "ìì íìê² ìµëê¹?", "íì¸ ë²í¼ì ë르면 ìì±íì ë´ì©ì´ ì¬ë¼ì§ëë¤.", true).done(function(){ 644 location.href = url; 645 }); 646} 647 648// ////////////////////////////////////////////////////////////////////////////////////////////////// 649// ///////////////////////////// íì¼ ì²¨ë¶ ê´ë ¨ 650// ////////////////////////////////////////////////// 651function getFileBtn(inputFileIndex) { 652 $("#addFileTd") 653 .append( 654 '<span class="ui_wbj_input_file">' 655 + '<label for="uploadFile_' + inputFileIndex + '" class="ui_wbj_btn">' + commUtil.i18n("ì ë¡ë") + '</label>' 656 + '<input type="file" id="uploadFile_' + inputFileIndex + '" name="uploadFile_' + inputFileIndex + '" onchange="changeFileValue(' + inputFileIndex + ')">' 657 + '<span id="upload-name-' + inputFileIndex + '" class="ui_wbj_file_name">'+commUtil.i18n("íì¼ì í")+'</span>' 658 +'</span>'); 659} 660 661function changeFileValue(fileindex) { 662 var fileTarget = $("#uploadFile_" + fileindex); 663 664 if (window.FileReader) { 665 // íì¼ëª ì¶ì¶ 666 var filename = fileTarget[0].files[0].name; 667 } else { 668 // Old IE íì¼ëª ì¶ì¶ 669 var filename = fileTarget.val().split('/').pop().split('\\').pop(); 670 } 671 ; 672 673 $("#upload-name-" + fileindex).text(filename); 674} 675 676function deleteFielBtn(isid, filename, iftdid) { 677 commUtil.alert("confirm", "ìì íìê² ìµëê¹?", "íì¸ ë²í¼ì ë르면 ë°ë¡ ìì ë©ëë¤.", true).done(function(){ 678 $.post("homeFileDelete", { 679 isid : isid, 680 filename : urlencode(filename) 681 }, function(result) { 682 // ì±ê³µ 683 if (result == 0) { 684 commUtil.alert("alert", "ìì íììµëë¤.", ""); 685 $("#file_" + iftdid).remove(); 686 687 } else { // ì¤í¨ 688 commUtil.alert("fail", "ì£ì¡í©ëë¤", "ì¼ìì ì¸ ì¤ë¥ë¡ ì¸í
688ì¬ ìì íì§ ëª»íìµëë¤."); 689 return; 690 } 691 }); 692 }); 693} 694 695function changeLanguage(type){ 696 document.changeLanguageForm.languageType.value = type; 697 document.changeLanguageForm.submit(); 698} 699 700function movePageSupport(pageType, pageCode, isid, simply){ 701 $.ajax({ 702 type:'post', 703 url:'support_pageMovement', 704 data : { 705 pageType : pageType, 706 pageCode : pageCode, 707 isid : isid, 708 simply : simply 709 }, 710 success:function(data){ 711 if(data == "fail"){ 712 commUtil.alert("fail", commUtil.i18n("ì£ì¡í©ëë¤"), commUtil.i18n("ì¼ìì ì¸ ì¤ë¥ë¡ ì¸íì¬ ìì íì§ ëª»íìµëë¤.")) 713 714 } else if(data == "last"){ 715 if(pageType == 1) commUtil.alert("confirm", commUtil.i18n("ì´ì íì´ì§ê° ììµëë¤."), ""); 716 if(pageType == 2) commUtil.alert("confirm", commUtil.i18n("ë¤ì íì´ì§ê° ììµëë¤."), ""); 717 718 } else { 719 location.href='pwd_check_form?isid=' + data +'&type=v&pageCode=' + pageCode + '&simply=' + simply; 720 } 721 } 722 }); 723} 724 725function movePageRecruit(pageType, pageCode, isid){ 726 $.ajax({ 727 type:'post', 728 url:'recruit_pageMovement', 729 data : { 730 pageType : pageType, 731 pageCode : pageCode, 732 isid: isid 733 }, 734 success:function(data){ 735 if(data == "fail"){ 736 commUtil.alert("fail", "ì£ì¡í©ëë¤", "ì¼ìì ì¸ ì¤ë¥ë¡ ì¸íì¬ ìì íì§ ëª»íìµëë¤."); 737 738 } else if(data == "last"){ 739 if(pageType == 1) commUtil.alert("confirm", commUtil.i18n("ì´ì íì´ì§ê° ììµëë¤."), ""); 740 if(pageType == 2) commUtil.alert("confirm", commUtil.i18n("ë¤ì íì´ì§ê° ììµë)ë¤."), ""); 741 742 } else { 743 location.href='recruit_detail?isid=' + data +'&type=v&pageCode=' + pageCode; 744 } 745 } 746 }); 747} 748 749$("#ScrollTopBtn").click(function(){ 750 $('html, body').scrollTop(0); 751 752}); 753 754//ê²ìí - ìì¸ë´ì ìë¨¸ë ¸í¸ ì ì© 755function fnGen_DetailSummernote(divId){ 756 var fontLists = commUtil.editFontList(); 757 758 $("#" + divId).summernote({ 759 lang: 'ko-KR' , 760 focus: true, 761 height : 200, 762 maxHeight : null, 763 disableDragAndDrop:true, 764 toolbar: [ 765 ['style', ['style']], 766 ['font', ['bold', 'underline', 'clear']], 767 ['fontname', ['fontname', 'fontsize']], 768 ['color', ['color']], 769 ['para', ['ul', 'ol', 'paragraph']], 770 ['table', ['table']], 771 ['insert', ['picture']], 772 ['view', ['codeview', 'help']] 773 ], 774 fontNames: fontLists, 775 fontNamesIgnoreCheck: fontLists, 776 callbacks: { 777 onImageUpload: function(files, editor, welEditable) { 778 for (var i = files.length - 1; i >= 0; i--) { 779 sendFile(files[i], this); 780 } 781 } 782 } 783 }); 784 785 $("#" + divId).summernote('fontName', fontLists[0]); //기본í°í¸ ì¤ì 786} 787 788function sendFile(file, el) { 789 var form_data = new FormData(); 790 form_data.append('file', file); 791 $.ajax({ 792 data: form_data, 793 type: "POST", 794 url: 'summernote_fileupload', 795 cache: false, 796 contentType: false, 797 enctype: 'multipart/form-data', 798 processData: false, 799 success: function(url) { 800 $(el).summernote('editor.insertImage', url); 801 $('#imageBoard > ul').append('<li><img src="'+url+'" /></li>'); 802 } 803 }); 804} 805 806 807 808//editor ìì 모ë 809// type 0: titleìì, 1 : ìì 810function editorEdit(type, hmid){ 811 $('#content_' + hmid).toggleClass("ui_wbj_view ui_wbj_editor"); 812 var height = Number($('#content_' + hmid).height()) + 150; 813 814 var fontLists = commUtil.editFontList(); 815 $('#content_' + hmid).summernote({ 816 lang: 'ko-KR' , 817 focus: true, 818 height : height, 819 minHeight : height, 820 maxHeight : null, 821 disableDragAndDrop:true, 822 toolbar: [ 823 ['style', ['style']], 824 ['font', ['bold', 'underline', 'clear']], 825 ['fontname', ['fontname', 'fontsize']], 826 ['color', ['color']], 827 ['para', ['ul', 'ol', 'paragraph']], 828 ['table', ['table']], 829 ['insert', ['link', 'picture', 'video']], 830 ['view', ['codeview', 'help']] 831 ], 832 fontNames: fontLists, 833 fontNamesIgnoreCheck: fontLists, 834 callbacks: { 835 onImageUpload: function(files, editor, welEditable) { 836 for (var i = files.length - 1; i >= 0; i--) { 837 sendFile(files[i], this); 838 } 839 } 840 } 841 }); 842 843 $('#content_' + hmid).summernote('fontName', fontLists[0]); //기본í°í¸ ì¤ì 844 845 //íì´í ìì 모ë 846 if(type == 0){ 847 $("#contentTitleInput_" + hmid).val($("#contentTitle_" + hmid)[0].innerText); 848 $("#contentTitleArea h3.ui_wbj_title_text").hide(); 849 $("#contentTitleArea span.ui_wbj_input").show(); 850 } 851 852 //ë²í¼ 853 $("#editorSaveBtn_" + hmid).css("display", "inline-block"); 854 $("#editorPreviewBtn_" + hmid).css("display", "inline-block"); 855 $("#editorEditBtn_" + hmid).css("display", "none"); 856} 857 858//editor 미리보기모ë 859function editorPreview(type, hmid){ 860 $('#content_' + hmid).summernote('destroy'); 861 $('#content_' + hmid).toggleClass("ui_wbj_view ui_wbj_editor"); 862 863 //íì´í 미리보기 모ë 864 if(type == 0){ 865 $("#contentTitle_" + hmid).text($("#contentTitleInput_" + hmid).val()); 866 867 $("#contentTitleArea h3.ui_wbj_title_text").show(); 868 $("#contentTitleArea span.ui_wbj_input").hide(); 869 } 870 871 //ë²í¼ 872 $("#editorPreviewBtn_" + hmid).css("display", "none"); 873 $("#editorEditBtn_" + hmid).css("display", "inline-block"); 874} 875 876function saveEditorData(type, hmid, url){ 877 var editTitle = ""; 878 if(type == 0){ 879 editTitle = $("#contentTitleInput_" + hmid).val(); 880 } 881 var editData = $('#content_' + hmid).summernote('code'); 882 editData = editData 883 .replace(/\uFEFF/g, '') 884 .replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>'); 885 $('#content_' + hmid).summernote('destroy'); 886 887 $.ajax({
888 url: url, 889 data: { 890 hmid : Number(hmid), 891 customContentTitle : editTitle, 892 customContentData : editData 893 }, 894 type: 'POST', 895 success: function(data){ 896 if(data == "error"){ 897 commUtil.alert("fail", "ì ì¥ì ì¤í¨ íììµëë¤.", ""); 898 899 } else { 900 commUtil.alert("alert", "ì ì¥íììµëë¤.", "").done(function(){ 901 window.location.href = data; 902 }); 903 } 904 } 905 }); 906} 907 908function saveDynamicEditorData(hmid, url){ 909 var editTitle = ""; 910 var editData = $('#content_' + hmid).summernote('code'); 911 editData = editData 912 .replace(/\uFEFF/g, '') 913 .replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>'); 914 $('#content_' + hmid).summernote('destroy'); 915 916 $.ajax({ 917 url: url, 918 data: { 919 hmid : hmid, 920 customContentTitle : editTitle, 921 customContentData : editData, 922 pageUrl : pageUrl 923 }, 924 type: 'POST', 925 success: function(data){ 926 commUtil.alert("alert", "ì ì¥íììµëë¤.", "").done(function(){ 927 window.location.href = data; 928 }); 929 } 930 }); 931} 932 933function downloadBoardFile(isid, iftdid){ 934 if(isid == 0 && iftdid == 0){ 935 commUtil.alert("fail", "ë¤ì´ë¡ë í ì ììµëë¤.", ""); 936 937 } else { 938 //íì¼ ë¤ì´ë¡ë 939 document.getElementById("fileDownFrame").src = "downloadBoardFile?isid=" + isid + "&iftdid=" + iftdid;
940 941 var timer = setInterval(function () { 942 var iframe = document.getElementById('fileDownFrame'); 943 var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; 944 945 var cookie = getCookie("fileDownload"); 946 if(cookie != null && cookie != "") { 947 clearInterval(timer); 948 949 //íì¼ì ë¤ì´ë¡ë ë°ì íì ì¿ í¤ë¥¼ ìì 950 deleteCookie("fileDownload", '/'); 951 return; 952 } 953 }, 500); 954 } 955} 956 957/** FOOTER PRIVACY POLICY **/ 958function openPrivacyPolicy(){ 959 var langOpt = $("#fLangOpt").val() || "0"; 960 $.ajax({ 961 type : 'POST', 962 url : 'getPrivacyPolicy', 963 async : false, 964 success : function(data) { 965 if (data) { 966 $('#divPrivacyPolicyContent').html(data); 967 } 968 969 //íì 970 $('#dlgPrivacyPolicy').addClass('active'); 971 }, 972 error : function(request, status, error) { 973 console.log("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error); 974 } 975 }); 976 977 //ìì 978 $("#btnEditPrivPolicy").off().click(function(e){ 979 $("#btnEditPrivPolicy").hide(); 980 $("#btnSavePrivPolicy").show(); 981 $("#btnCancelPrivPolicy").show(); 982 privacyPolicyEdit(); 983 }); 984 985 $("#btnSavePrivPolicy").off().click(function(e){ 986 privacyPolicySave(); 987 }); 988 989 $("#btnCancelPrivPolicy").off().click(function(e){ 990 $("#btnEditPrivPolicy").show(); 991 $("#btnSavePrivPolicy").hide(); 992 $("#btnCancelPrivPolicy").hide(); 993 $('#divPrivacyPolicyContent').summernote('destroy'); 994 995 //기존 ë´ì©ì¼ë¡ ë³ê²½ 996 }); 997 998 //ë«ê¸° 999 $('#dlgPrivacyPolicy button.type_delete').off().on('click', function(e){ 1000 //ì´ê¸°í 1001 $("#btnEditPrivPolicy").show(); 1002 $("#btnSavePrivPolicy").hide(); 1003 $("#btnCancelPrivPolicy").hide(); 1004 1005 $('#divPrivacyPolicyContent').summernote('destroy'); 1006 $('#dlgPrivacyPolicy').removeClass('active'); 1007 }); 1008} 1009 1010//ê°ì¸ì ë³´ ì·¨ê¸ ë°©ì¹¨ ë³ê²½ 1011function privacyPolicyEdit(){ 1012 $('#divPrivacyPolicyContent').summernote({ 1013 lang: 'ko-KR' , 1014 focus: true, 1015 minWidth : 500, 1016 minHeight : 400, 1017// maxHeight : 400, 1018 disableDragAndDrop:true, 1019 toolbar: [ 1020 ['style', ['style']], 1021 ['font', ['bold', 'underline']], 1022 ['fontname', ['fontname', 'fontsize']], 1023 ['color', ['color']], 1024 ['para', ['ul', 'ol', 'paragraph']], 1025 ['table', ['table']], 1026// ['insert', ['link']] 1027 ], 1028 fontNames: [ 1029 'ê¶ì', 'ë°í', 'ëì', '굴림', 'ë§ì ê³ ë', 'Serif', 'Arial', 'Verdana', 1030 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Tahoma', 'Times New Roman' 1031 ], 1032 fontNamesIgnoreCheck: [ 1033 'ê¶ì', 'ë°í', 'ëì', '굴림', 'ë§ì ê³ ë' 1034 ] 1035 }); 1036} 1037 1038function privacyPolicySave(){ 1039 var langOpt = $("#fLangOpt").val(); 1040 var editData = $('#divPrivacyPolicyContent').summernote('code'); 1041 editData = editData 1042 .replace(/\uFEFF/g, '') 1043 .replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>'); 1044 1045 $.ajax({ 1046 type:"POST", 1047 url : 'updatePrivacyPolicyData', 1048 data :{ 1049 langopt : langOpt, 1050 ppData : editData 1051 }, 1052 success : function(data) { 1053 if(!data || Number(data) < 0){ 1054 commUtil.alert("fail", "ì ì¥ì ì¤í¨íììµëë¤.", "", false); 1055 1056 } else { 1057 commUtil.alert("alert", "ì ì¥íììµëë¤.", "", false).done(function(){ 1058 $("#btnEditPrivPolicy").show(); 1059 $("#btnSavePrivPolicy").hide(); 1060 $("#btnCancelPrivPolicy").hide(); 1061 1062 $('#divPrivacyPolicyContent').summernote('destroy'); 1063 }); 1064 } 1065 }, 1066 error : function(request, status, error) { 1067 console.log("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error); 1068 } 1069 }); 1070} 1071/** FOOTER PRIVACY POLICY **/
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.