/* * Name : board.min.js * Version : 2.0.0 * Product : prime series (board pro KR) * Author : 1px studio * Date : 2024-06-19 * Desc : 게시판 쓰기페이지 스타일링, 갤러리+이벤트 게시판 리스트페이지 모든 항목 노출가능하도록 변경. * ------------------------------------------------ */ $(function(){function e(e,t){let a=1,i="contact-form"==t[0].className;e.each(function(e,n){$(n).find("input[type=text], select").length>=3&&$(n).addClass("flex-line");$(n).find(".button-zipcode").length&&$(n).addClass("zipcode-line");let s=$(n).find("input[type=checkbox], input[type=radio]");if(s.length){let l={count:$(n).find("br").eq(0).index()};i&&(l.count=$(n).find("tr").eq(0).find("input").length),s.each(function(e){let t="labelfor"+a;if(this.id=t,this.name.match("_lunar")){let i=$(n).find("select"),s='
';i.each(function(e){0==e?s+=this.outerHTML+"":1==e?s+=this.outerHTML+"":2==e&&(s+=this.outerHTML+"")}),s+=this.outerHTML+``,s+="
",$(n).html(s)}else{let o="label-group";o+=e>0&&e%l.count==0?" end":"",$(this).replaceWith('
'+this.outerHTML+`
`)}a++}),$(n).addClass("flex-line");let o=$(n).find(".label-group, .select-group, input[type=hidden]");$(n).html(o),l.count>-1&&($(n).find(".label-group").each(function(e){if(e%l.count==0){let t=$(this),a=t.nextUntil(".label-group.end");$.merge(t,a).wrapAll('
')}}),$(n).addClass("change-direction"))}let r=$(n).find("input[type=file");if(r.length){let c=$(n).text().split(/[\n\t]+/g).filter(e=>e.length>0&&"삭제"!=e);$(n).addClass("file-desc");let d=0;r.each(function(){let e="labelfor"+a;this.id=e,this.className="upload-hidden";let t=$(this);t.wrap('
');let i=t.closest(".file-upload"),n=``;i.prepend(n),a++,d++});let p=$(n).find(".file_attach_del");p.length&&p.each(function(e){$(this).closest("a").prev(".file-upload").find(".upload-name").addClass("exist").val(c[e])});let f=$(n).children();$(n).html(f);t.find(".file-upload .upload-hidden").on("change",function(){let e=$(this)[0].files[0].name;$(this).siblings(".upload-name").val(e)})}})}function t(e,t){let a=e.find(".gallery_etc font"),i=[],n=[],s=[];return(a.each(function(e,t){let a=$(t).text().split(" : "),l=a[1],o=a[0],r="486px"==t.style.fontSize;if(t.children.length>0)n.push({name:o,text:t.children[0].outerHTML}),s.push({name:o,text:t.children[0].outerHTML});else{let c=RegExp(/^\d{4}년 (0[1-9]|1[012])월 (0[1-9]|[12][0-9]|3[01])일$/),d=RegExp(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/);if(c.test(l)){let p=l;p=p.replace(/[(가-힣)]/g,"").replaceAll(" ","."),o.match("종료")?i.push({name:o,text:" ~ "+p,secret:r}):i.push({name:o,text:p})}else if(d.test(l)){let f=l.replaceAll("-",".");i.push({name:o,text:f,secret:r}),s.push({name:o,text:f,secret:r})}else n.push({name:o,text:l,secret:r}),s.push({name:o,text:l,secret:r})}}),1==t)?s:{dateList:i,etcList:n}}null==document.getElementById("isIndex")&&($("#ext_search select").after(''),function e(){let t="",a=[],i=[],n=window.location.search,s=new URLSearchParams(n);if($("select[name=com_board_category_code]").length){let l=s.get("com_board_category_code"),o=$("select[name=com_board_category_code]").attr("onchange").split("'")[1],r="";o="?"==o.substr(-1)?o+"com_board_category_code=":o+"&&com_board_category_code=",$("select[name=com_board_category_code] option").each(function(){let e=$(this);a.push(e.text()),i.push(e.val())});for(let c=0;c${a[c]}`;$(".category-button-wrapper").empty().append(t)}}(),function e(){let t=$("input[type=image]"),a=$("img"),i=["검색","확인","댓글작성","삭제","이동","복사","이전","목록","다음","스팸신고","수정","삭제","답변","글쓰기","작성완료","취소","다운로드","우편번호검색","삭제"];t.each(function(){let e=$(this).attr("src");e.indexOf("search.gif")>-1&&($(this).before(``),$(document).on("click","#btn-search",function(){$(this).next("input[type=image]").trigger("click")}),$(this).hide()),e.indexOf("confirm.gif")>-1&&($(this).before(``),$(this).hide()),e.indexOf("comment_write.gif")>-1&&($(this).before(``),$(document).on("click","#btn-comment-write",function(){$(this).next("input[type=image]").trigger("click")}),$(this).hide())}),a.each(function(){let e=$(this).attr("src"),t=$(this).attr("onclick");e.indexOf("btn_sdel.gif")>-1&&($(this).before(``),$(this).remove()),e.indexOf("move.gif")>-1&&($(this).before(``),$(this).remove()),e.indexOf("copy.gif")>-1&&($(this).before(``),$(this).remove()),e.indexOf("/prev.gif")>-1&&$(this).parent().addClass("button-b button--default move-page").text(i[6]),e.indexOf("list.gif")>-1&&$(this).parent().addClass("button-b button--dark").text(i[7]),e.indexOf("/next.gif")>-1&&$(this).parent().addClass("button-b button--default move-page").text(i[8]),e.indexOf("spam.gif")>-1&&($(this).before(``),$(this).remove()),e.indexOf("modify.gif")>-1&&$(this).parent().addClass("button-b button--default").text(i[10]),e.indexOf("delete.gif")>-1&&$(this).parent().addClass("button-b button--default").text(i[11]),e.indexOf("reply.gif")>-1&&$(this).parent().addClass("button-b button--default").text(i[12]),e.indexOf("write.gif")>-1&&$(this).parent().addClass("button-b button--dark size--3").text(i[13]),e.indexOf("btn_confirm.gif")>-1&&$(this).parent().addClass("button-b button--primary").text(i[14]),e.indexOf("cancel.gif")>-1&&$(this).parent().addClass("button-b button--default button--lg").text(i[15]),e.indexOf("download.gif")>-1&&$(this).parent().addClass("button-download").text(i[16]),e.indexOf("search_zipcode.gif")>-1&&$(this).parent().addClass("button-zipcode").text(i[17]),e.indexOf("btn_zip.gif")>-1&&$(this).parent().addClass("button-zipcode").text(i[17]),e.indexOf("btn_del.gif")>-1&&$(this).replaceWith(''+i[18]+""),e.indexOf("icon_sct.gif")>-1&&$(this).replaceWith('')})}(),function t(){let a=$("form[name=com_board]");if(!a.length)return!1;e(a.find(".board_desc"),a)}(),function e(){if(!$(".board-gallery").length)return!1;let a=$(".board-gallery .gallery-list").data("column")?$(".board-gallery .gallery-list").data("column"):3,i="";switch(a){case 1:i="col-xl-12";break;case 2:i="col-xl-6";break;case 3:default:i="col-xl-4";break;case 4:i="col-xl-3";break;case 5:i="col-xl-2-5";break;case 6:i="col-xl-2"}let n="",s="",l="",o="",r="",c="";$(".board-gallery").hasClass("type-a")?(c='
',$(".board-gallery .article-wrapper > .photo-article-list > tbody > tr").each(function(){let e=$(this).find(".bbsnewf5"),a=t(e,1);if(a.length>0){let d='';a.forEach(function(e,t){d+=`${e.name}${e.text}`}),d+="",r=d}n=e.find("img").attr("src"),s=e.find(".gallery_subject>a").attr("href"),l=e.find(".gallery_title").text();let p=e.find(".gallery_cont");c+=`
${l}
${r}
${l}
${o=p.length?'

'+p.text()+"

":""}
`}),c+="
",$(".board-gallery .article-wrapper").empty().append(c)):$(".board-gallery").hasClass("type-b")&&(c='
',$(".board-gallery .article-wrapper > .photo-article-list > tbody > tr").each(function(){let e=$(this).find(".bbsnewf5"),a=t(e,1);if(a.length>0){let d='';a.forEach(function(e,t){d+=`${e.name}${e.text}`}),d+="",r=d}n=e.find("img").attr("src"),s=e.find(".gallery_subject>a").attr("href"),l=e.find(".gallery_title").text();let p=e.find(".gallery_cont");c+=`
${l}
${r}
${l}
${o=p.length?'

'+p.text()+"

":""}
`}),c+="
",$(".board-gallery .article-wrapper").empty().append(c))}(),function e(){if(!$(".faq-list .table-article-list .titdesign").length)return!1;let t=`
`;$(".faq-list .table-article-list .bbsnewf5 > a").on("click",e=>{if(!$('input[name="delete_check_notice[]"]').length){e.preventDefault();let a=$(e.currentTarget),i=a.attr("href"),n="";$.ajax({url:i,method:"GET",contentType:"application/x-www-form-urlencoded;charset=euc-kr",dataType:"html",async:!1,success:function(e){n=` ${$(e).find("#post_area").html()} `,a.closest(".titdesign").hasClass("article--open")?(a.parent().siblings(".reply-content").remove(),a.closest(".titdesign").removeClass("article--open")):($(".titdesign").removeClass("article--open"),$(".reply-content").remove(),a.parent().after(n),a.closest(".titdesign").addClass("article--open"))},error:function(e){alert("오류가 발생하였습니다.")},beforeSend:function(e){e.overrideMimeType("application/x-www-form-urlencoded;charset=euc-kr"),$("body").prepend(t)},complete:function(){$("#ajax-loader").remove()}})}})}(),function e(){if(!$(".board-event").length)return!1;let a='
';$(".board-event .article-wrapper > .event-article-list > tbody > tr").each(function(){let e=$(this).find(".bbsnewf5"),i=e.find("img").attr("src"),n=e.find(".gallery_subject>a").attr("href"),s=e.find(".gallery_title").text(),l="",o=e.find(".gallery_cont");o.length&&(l="

"+o.text()+"

");let r="",c="",d=t(e),p=d.dateList,f=d.etcList;if(p.length>0){let b='';p.forEach(function(e,t){b+=`${e.name}${e.text}`}),b+="",r=b}if(f.length>0){let h='';f.forEach(function(e,t){h+=`${e.name}${e.text}`}),h+="",c=h}a+=`
${s}
${c} ${r}

${s}

${l}
`}),a+="
",$(".board-event .article-wrapper").empty().append(a)}(),function e(){if(!$(".board-blog").length)return!1;let t,a,i,n,s,l,o,r="",c='
';$(".board-blog .article-wrapper > .blog-article-list .webzine_type2 > tbody > tr").each(function(){let e=$(this).find(".webzine_type_text_td_left");if(0==e.length)return;let d=$(this).find(".webzine_type_img_td"),p=e.find(".webzine_no .obj_value").text();t=p.length?'NO. '+p+"":"",e.find(".webzine_no").remove(),a=e.find(".webzine_subject .obj_value").text().trim(),e.find(".webzine_subject").remove();let f=e.find(".webzine_dateof_write .obj_value").text();i=f.length?''+f+"":"",e.find(".webzine_dateof_write").remove();let b=e.find(".webzine_category .obj_value").text().trim();n=b.length?'#'+b+"":"",e.find(".webzine_category").remove();let h=e.find(".webzine_description .obj_value").text().trim();s=h.length?"

"+h+"

":"",e.find(".webzine_description").remove(),l=d.find("img").attr("src"),o=d.find("a").attr("href");let u=$(this).find(".webzine_type_text_td_left dd");if(u.length>0){let g='
';u.each(function(e){g+=`${$(this).find(".obj_name").text()}${$(this).find(".obj_value").text().trim()}`}),g+="
",r=g}c+=`
${t} ${n} ${i}

${a}

${s} ${r}
`}),c+="
",$(".board-blog .article-wrapper").empty().append(c)}(),function e(){if(!$(".board-blog #post_area").length)return!1;let t=$(".board-blog .table-article-common tr"),a='
',i='
',n=!1,s,l=!0;t.each(function(e){let t,o;if($(this).find("#post_area").length>0&&(s=$(this).find("#post_area"),l=!1),0==e)a+=`

${o=$(this).find(".board_desc").text().trim()}

`;else{t=$(this).find(".board_bgcolor").text().trim();let r=$(this).find(".board_desc"),c="";if(r.find("div").length&&(c=" download"),0==(o=void 0==(o=r.html())?"":function e(t){for(;;)if(-1!=t.indexOf("");t=t.substring(0,a)+t.substring(i+3,t.length)}else break;return t}(o)).trim().length||0==t.length)return;l?a+=` ${t}${o} `:(i+=` ${t}${o} `,n=!0)}}),a+='
',i+="
",$(".board-blog .table-article-common").replaceWith(a);let o=$(".board-blog").find(".post-body").html(s);n&&o.after(i);let r=$(".board-view-thumbnails").find("a"),c='

Previous posts

';r.each(function(){let e;c+=`
`}),c+="
",$(".board-blog").find(".post-body").append(c),$(".board-view-thumbnails").remove();let d='
',p=$(".board-blog .move-page");p.each(function(){let e=$(this).text().trim();d+=`${"이전"==e?'이전글':'다음글'}`}),d+="
",p.remove(),$(".board-blog").find(".post-wrap").append(d),$(".board-blog").find(".move-btn").on("mouseover",function(){$(this).addClass("on")}),$(".board-blog").find(".move-btn").on("mouseout",function(){$(this).removeClass("on")})}(),function t(){let a=$(".contact-form");if(!a.length)return!1;e($(".contact-form .table-form > tbody > tr .formmail_cell_bgcolor"),a)}())});