jhleem / egov star

이다솜 이다솜 2022-02-16 @57

[20220216 이다솜] 게시판 수정 페이지 에디터 추가
Index: base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cop/bbs/EgovArticleUpdt.jsp =================================================================== --- base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cop/bbs/EgovArticleUpdt.jsp (revision 56) +++ base3.10/src/main/webapp/WEB-INF/jsp/egovframework/com/cop/bbs/EgovArticleUpdt.jsp (revision 57) @@ -9,11 +9,11 @@ * @ ------- -------- --------------------------- * @ 2009.02.01 박정규 최초 생성 * 2016.06.13 김연호 표준프레임워크 v3.6 개선 - * @author 공통서비스팀 + * @author 공통서비스팀 * @since 2009.02.01 * @version 1.0 * @see - * + * */ %> <%@ page language="java" contentType="text/html; charset=UTF-8"%> @@ -22,20 +22,30 @@ <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%> -<%@ taglib prefix="ckeditor" uri="http://ckeditor.com" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<c:set var="reBbsId" value="${fn:replace(boardMasterVO.bbsId, \"BBSMSTR_\", \"\")}" /> <c:set var="pageTitle"><spring:message code="comCopBbs.articleVO.title" /></c:set> - -<link type="text/css" rel="stylesheet" href="<c:url value='/css/egovframework/com/com.css' />"> -<%-- <link type="text/css" rel="stylesheet" href="<c:url value='/css/egovframework/com/cmm/jqueryui.css' />"> --%> -<%-- <script type="text/javascript" src="<c:url value='/js/egovframework/com/cmm/fms/EgovMultiFile.js'/>" ></script> --%> -<%-- <script type="text/javascript" src="<c:url value='/js/egovframework/com/cmm/fms/EgovMultiFiles.js'/>" ></script> --%> -<%-- <script type="text/javascript" src="<c:url value='/js/egovframework/com/cmm/utl/EgovCmmUtl.js'/>" ></script> --%> -<script type="text/javascript" src="<c:url value='/html/egovframework/com/cmm/utl/ckeditor/ckeditor.js?t=B37D54V'/>" ></script> +<!-- 에디터 관련 추가 CSS, Javascript 추가 --> +<jsp:useBean id="today" class="java.util.Date" /> +<fmt:formatDate value="${today}" pattern="yyyyMMddHHmm" var="nowDate" scope="application"/> +<!-- Include Editor style. --> +<link rel="stylesheet" type="text/css" href="<c:url value='/resource/editor/css/froala_editor.pkgd.min.css'><c:param name="dt" value="${nowDate}"/></c:url>"> +<link rel="stylesheet" type="text/css" href="<c:url value='/resource/editor/css/froala_style.min.css'><c:param name="dt" value="${nowDate}"/></c:url>"> +<link rel="stylesheet" type="text/css" href="<c:url value='/resource/font-awesome/css/font-awesome.css'><c:param name="dt" value="${nowDate}"/></c:url>"> +<link rel="stylesheet" type="text/css" href="<c:url value='/resource/editor/codemirror/lib/codemirror.css'><c:param name="dt" value="${nowDate}"/></c:url>" /> +<!-- Include Editor JS files. --> +<script type="text/javascript" src="<c:url value='/resource/editor/js/froala_editor.pkgd.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<script type="text/javascript" src="<c:url value='/resource/editor/js/languages/ko.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<script type="text/javascript" src="<c:url value='/resource/editor/js/froala_editor_script_custom.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<script type="text/javascript" src="<c:url value='/resource/editor/codemirror/lib/codemirror.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<script type="text/javascript" src="<c:url value='/resource/editor/codemirror/lib/xml.js'><c:param name="dt" value="${nowDate}"/></c:url>"></script> +<!-- 에디터 관련 추가 CSS, Javascript 종료 --> <script type="text/javascript" src="<c:url value="/validator.do"/>"></script> + +<title>${pageTitle }<spring:message code="title.update" /></title> <%-- <script src="<c:url value='/js/egovframework/com/cmm/jquery.js' />"></script> --%> <%-- <script src="<c:url value='/js/egovframework/com/cmm/jqueryui.js' />"></script> --%> -<c:set var="reBbsId" value="${fn:replace(boardMasterVO.bbsId, \"BBSMSTR_\", \"\")}" /> <validator:javascript formName="articleVO" staticJavascript="false" xhtml="true" cdata="false" /> <script type="text/javascript"> $(function() { @@ -70,10 +80,10 @@ * 초기화 ******************************************************** */ function fn_egov_init() { - var ckeditor_config = { - filebrowserImageUploadUrl: '${pageContext.request.contextPath}/utl/wed/insertImageCk.do', // 파일 업로드를 처리 할 경로 설정. - }; - CKEDITOR.replace('nttCn',ckeditor_config); +// var ckeditor_config = { +// filebrowserImageUploadUrl: '${pageContext.request.contextPath}/utl/wed/insertImageCk.do', // 파일 업로드를 처리 할 경로 설정. +// }; +// CKEDITOR.replace('nttCn',ckeditor_config); // 첫 입력란에 포커스.. document.getElementById("articleVO").nttSj.focus(); @@ -82,7 +92,15 @@ * 저장처리화면 ******************************************************** */ function fn_egov_updt_article(form) { - CKEDITOR.instances.nttCn.updateElement(); +// CKEDITOR.instances.nttCn.updateElement(); + + // 개인정보입력 체크. + if (!fnPrivacyCheck(form.nttSj.value)) { // 제목 + return false; + } + if (!fnPrivacyCheck(form.nttCn.value)) { // 내용 + return false; + } if (!validateArticleVO(form)) { return false; @@ -133,7 +151,7 @@ * 목록 으로 가기 ******************************************************** */ function fn_egov_inqire_articlelist() { - articleVO.action = "<c:url value='/cop/bbs/selectArticleList.do'/>"; + articleVO.action = "<c:url value='/cop/bbs/${reBbsId}/selectArticleList.do'/>"; articleVO.submit(); } @@ -144,116 +162,91 @@ <!-- 상단타이틀 --> <form:form commandName="articleVO" action="${pageContext.request.contextPath}/cop/bbs/${reBbsId }/updateArticle.do" method="post" onSubmit="fn_egov_updt_article(document.forms[0]); return false;" enctype="multipart/form-data"> - <div class="wTableFrm"> - <h2>${pageTitle} <spring:message code="title.update" /></h2><!-- 게시글 답글 수정--> + <!-- 입력 --> + <c:set var="inputTxt"><spring:message code="input.input" /></c:set> - <!-- 수정폼 --> - <table class="wTable" summary="<spring:message code="common.summary.update" arguments="${pageTitle}" />"> - <caption>${pageTitle} <spring:message code="title.update" /></caption> - <colgroup> - <col style="width: 20%;"> - <col style="width:;"> - <col style="width:;"> - <col style="width:;"> - </colgroup> - <tbody> - <!-- 입력 --> - <c:set var="inputTxt"><spring:message code="input.input" /></c:set> + <div class="inner"> + <div class="caption alignR"><p class="must"><em>*</em> 는 필수항목입니다</p></div> + <div class="board_write"> + <ul> <!-- 글 제목 --> <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.nttSj" /></c:set> - <tr> - <th><label for="nttSj">${title}<span class="pilsu">*</span></label></th> - <td class="left"> - <form:input path="nttSj" title="${title} ${inputTxt }" size="70" maxlength="70" /> - <div> <form:errors path="nttSj" cssClass="error" /></div> - </td> - <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.sjBoldAt" /></c:set> - <th><label for="sjBoldAt">${title}</label></th> - <td class="left"> - <form:checkbox path="sjBoldAt" value="Y" /> - <div> <form:errors path="sjBoldAt" cssClass="error" /></div> - </td> - </tr> - + <li class="must"><strong class="title">${title}</strong> + <div class="input_wrap"> + <div class="text_show"> + <label for="nttSj">${title} ${inputTxt }해주세요</label> + <form:input path="nttSj" title="${title} ${inputTxt }" class="inputText width100p" /> + </div> + </div> + </li> <!-- 글 내용 --> <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.nttCn" /></c:set> - <tr> - <th><label for="nttCn">${title}<span class="pilsu">*</span></label></th> - <td class="nopd" colspan="3"> - <form:textarea path="nttCn" title="${title} ${inputTxt}" cols="300" rows="20" /> - - <div> <form:errors path="nttCn" cssClass="error" /></div> - </td> - </tr> - + <li><strong class="title">${title}</strong> + <div class="input_wrap"> +<!-- <div class="text_show"> --> +<%-- <label for="nttCn">${title} ${inputTxt }해주세요</label> --%> +<%-- <form:textarea class="textArea width100p height400" path="nttCn" title="내용을 입력해주세요"></form:textarea> --%> +<!-- </div> --> + <div class="text_show"> + <textarea id="nttCn" name="nttCn" title="내용 입력" > + <c:if test="${not empty articleVO.nttCn}">${articleVO.nttCn}</c:if> + </textarea> + </div> + </div> + </li> <!-- 공지신청 여부 --> <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.noticeAt" /></c:set> - <tr> - <th><label for="noticeAt">${title}</label></th> - <td class="left" colspan="3"> - <form:checkbox path="noticeAt" value="Y" /> - <div> <form:errors path="noticeAt" cssClass="error" /></div> - </td> - </tr> - + <li> + <strong class="board_label"><label for="noticeAt">${title}</label></strong> + <div class="content_type"> + <div class="option"> + <form:checkbox path="noticeAt" value="Y" /> + <div> <form:errors path="noticeAt" cssClass="error" /></div> + </div> + </div> + </li> <!-- 비밀글 여부 --> <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.secretAt" /></c:set> - <tr> - <th><label for="secretAt">${title}</label></th> - <td class="left" colspan="3"> - <form:checkbox path="secretAt" value="Y" /> - <div> <form:errors path="secretAt" cssClass="error" /></div> - </td> - </tr> - - <!-- 유효기간 설정 --> - <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.ntceDe"/> </c:set> - <tr> - <th><label for="ntceBgnde">${title}</label></th> - <td class="left" colspan="3"> - <form:input path="ntceBgnde" title="${title} ${inputTxt}" size="70" maxlength="70" style="width:70px;" readonly="true" /> - &nbsp;~&nbsp;<form:input path="ntceEndde" title="${title} ${inputTxt}" size="70" maxlength="70" style="width:70px;" readonly="true" /> - <div><form:errors path="ntceBgnde" cssClass="error" /></div> - <div><form:errors path="ntceEndde" cssClass="error" /></div> - </td> - </tr> - + <li> + <strong class="board_label"><label for="secretAt">${title}</label></strong> + <div class="content_type"> + <div class="option"> + <form:checkbox path="secretAt" value="Y" /> + <div> <form:errors path="secretAt" cssClass="error" /></div> + </div> + <div class="option blind" id="pwDiv"> + <div class="text_show"> + <input type="password" class="inputText width200" id="password" title="비밀글 확인 시 입력할 password를 입력하세요" > + <label for="password">password</label> + </div> + </div> + </div> + </li> <c:if test="${boardMasterVO.fileAtchPosblAt == 'Y'}"> - <!-- 첨부파일 시작 --> - <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.atchFile"/></c:set> - <tr> - <th>${title}</th> - <td class="nopd" colspan="3"> - <c:import url="/cmm/fms/selectFileInfsForUpdate.do" charEncoding="utf-8"> - <c:param name="param_atchFileId" value="${articleVO.atchFileId}" /> - </c:import> - </td> - </tr> - <!-- 첨부파일 끝 --> - <!-- 첨부파일 추가 시작 --> - <c:set var="title"><spring:message code="comCopBbs.articleVO.updt.atchFileAdd"/></c:set> - <tr> - <th><label for="file_1">${title}</label> </th> - <td class="nopd" colspan="3"> - <input name="file_1" id="egovComFileUploader" type="file" title="<spring:message code="comCopBbs.articleVO.updt.atchFile"/>" multiple/><!-- 첨부파일 --> - <div id="egovComFileList"></div> - </td> - </tr> - <!-- 첨부파일 추가 끝 --> + <li> + <strong class="board_label">첨부파일</strong> + <div class="file_up"> + <div> + <input name="file_1" id="egovComFileUploader" type="file" class="blind userUpload" title="<spring:message code="comCopBbs.articleVO.regist.atchFile"/>" multiple/><!-- 첨부파일 --> + <input type="hidden" id="atchFileId" name="atchFileId" value="${articleVO.atchFileId}" /> + <label for="egovComFileUploader" class="inputFile" title="업로드 할 파일을 선택해주세요">파일업로드</label> + </div> + <em class="exp filenote">※ 파일당 10MB까지 첨부 가능합니다.</em> + <div class="file_list" id="egovComFileList"></div> + </div> + </li> </c:if> - - </tbody> - </table> - - <!-- 하단 버튼 --> - <div class="btn"> - <input type="submit" class="s_submit" value="<spring:message code="button.update" />" title="<spring:message code="button.update" /> <spring:message code="input.button" />" /><!-- 수정 --> - <span class="btn_s"><a href="<c:url value='/cop/bbs/${reBbsId}/selectArticleList.do' />?bbsId=${boardMasterVO.bbsId}" title="<spring:message code="button.list" /> <spring:message code="input.button" />"><spring:message code="button.list" /></a></span><!-- 목록 --> + </ul> </div> - + <div class="bottom_wrap between"> + <div class="left"><button type="button" class="btn_l bg_basic" onclick="fn_egov_inqire_articlelist(); return false;">목록</button></div> + <div class="right"><button type="submit" class="btn_l bg_basic" >저장</button></div> + </div> </div> <input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>" /> + <input name="searchKeyword" type="hidden" value="${searchVO.searchKeyword}" /> + <input name="searchCondition" type="hidden" value="${searchVO.searchCondition}" /> <input type="hidden" name="bbsTyCode" value="<c:out value='${boardMasterVO.bbsTyCode}'/>" /> <input type="hidden" name="replyPosblAt" value="<c:out value='${boardMasterVO.replyPosblAt}'/>" /> <input type="hidden" name="fileAtchPosblAt" value="<c:out value='${boardMasterVO.fileAtchPosblAt}'/>" /> @@ -263,13 +256,40 @@ <input name="bbsId" type="hidden" value="${boardMasterVO.bbsId}"> </form:form> -<!-- 첨부파일 업로드 가능화일 설정 Start..--> +<!-- 첨부파일 업로드 가능화일 설정 Start..--> <script type="text/javascript"> -var maxFileNum = document.getElementById('atchPosblFileNumber').value; -if(maxFileNum==null || maxFileNum==""){ - maxFileNum = 3; -} -var multi_selector = new MultiSelector( document.getElementById( 'egovComFileList' ), maxFileNum ); -multi_selector.addElement( document.getElementById( 'egovComFileUploader' ) ); -</script> +$(function() { + var atchPosblFileNumber = $('#atchPosblFileNumber').val(); + var atchPosblFileSize = $('#atchPosblFileSize').val(); + var options = { + fileListDivId : 'egovComFileList', + inputFileId : 'egovComFileUploader', + hiddenFileName : 'atchFileId', + txtAreaId : 'nttCn', + authorType : 'user', + maxSize: atchPosblFileNumber, + fileMaxSize: atchPosblFileSize + } + $('#nttCn').initEditor(options); + + /* 비밀글 설정시 비밀번호입력창 show */ + var $pwDiv = $('#pwDiv'); + $pwDiv.hide(function() { + if ($pwDiv.hasClass('blind')) { + $pwDiv.removeClass('blind'); + } + }); + $('#secretAt').on('change', function() { + var isChecked = $(this).is(":checked"); + + if (isChecked) { + $pwDiv.show(); + $('#password').focus(); + } else { + $pwDiv.hide(); + } + }); +}); + +</script> <!-- 첨부파일 업로드 가능화일 설정 End.-->
Add a comment
List