File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<%--
Class Name : EgovNoticeRegist.jsp
Description : 게시물 생성 화면
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2009.03.24 이삼섭 최초 생성
2011.08.31 JJY 경량환경 버전 생성
author : 공통서비스 개발팀 이삼섭
since : 2009.03.24
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ 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"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="ko">
<script src="<c:url value='/js/EgovBBSMng.js' />"></script>
<script src="<c:url value='/js/EgovMultiFile.js'/>"></script>
<script src="<c:url value='/js/EgovCalPopup.js'/>"></script>
<script src="<c:url value="/validator.do"/>"></script>
<script src="<c:url value='/js/jquery.js' />"></script>
<script type="text/javascript" src="<c:url value='/js/EgovCalPopup.js' />"></script>
<validator:javascript formName="board" staticJavascript="false" xhtml="true" cdata="false" />
<script>
$(document).ready(function() {
//console.log($("#cke_nttCn iframe").contents().find("img").attr("alt"));
});
// 웹에디터 이미지 대체텍스트 내용 복사
function imgAltC(obj, src) {
/*
// 웹에디터 모드가 기본이어야함. 소스 모드 안됨.
if (!($(".cke_button__source").attr("class").indexOf("cke_button_off") > 0)) {
$(".cke_button__source").click();
}
$("#cke_nttCn iframe").contents().find("img").each(function() {
if ($(this).attr("src") == src) {
$(this).attr("alt", $(obj).val());
//console.log($(this).attr("alt"));
}
});
*/
}
// 웹에디터 이미지 대체텍스트 입력 텍스트area 조회
function nttCnImgAltInp() {
// 웹에디터 모드가 기본이어야함. 소스 모드 안됨.
if (!($(".cke_button__source").attr("class").indexOf("cke_button_off") > 0)) {
//$(".cke_button__source").click();
alert("웹에디터 상단에 '소스' 버튼을 클릭하여 모드를 해제 후 재시도 해주십시오."); return;
}
$("#imgAltTextArea").html("");
$("#cke_nttCn iframe").contents().find("img").each(function() {
var src = $(this).attr("src");
var alt = $(this).attr("alt");
var ta = "<textarea rows='10' cols='50' id='"+src+"' onkeyup='imgAltC(this, \""+src+"\");'>"+alt+"</textarea>";
$("#imgAltTextArea").append(ta);
});
}
// 대체텍스트 입력 버튼
function nttCnImgAltSave() {
// 웹에디터 모드가 기본이어야함. 소스 모드 안됨.
if (!($(".cke_button__source").attr("class").indexOf("cke_button_off") > 0)) {
//$(".cke_button__source").click();
alert("웹에디터 상단에 '소스' 버튼을 클릭하여 모드를 해제 후 재시도 해주십시오."); return;
}
$("#imgAltTextArea textarea").each(function() {
var taSrc = $(this).attr("id");
var taVal = $(this).val();
$("#cke_nttCn iframe").contents().find("img").each(function() {
if (taSrc == $(this).attr("src")) {
$(this).attr("alt", taVal);
}
});
});
}
function fn_egov_regist_notice() {
CKEDITOR.instances.nttCn.updateElement();
if (!validateBoard(document.board))
return;
<%-- <c:if test="${not empty bdMstr and bdMstr.passwordYn == 'Y' }" >
if(document.board.password.value != document.board.password2.value){
alert("비밀번호와 비밀번호 확인이 일치하지 않습니다.");
return false;
}
</c:if> --%>
/* <c:if test="${bdMstr.bbsTyCode =='BBST05' or bdMstr.bbsTyCode == 'BBST06'}">
// EgovMultiFile.js - 첨부파일 개수: _base.count default 1 | 수정 시 기첨부파일 개수: _base.update_count default 0
if (_base.count < 2) {
alert("이미지 게시판의 경우 이미지 파일 첨부 필수입니다.");
return false;
}
</c:if> */
/* <c:if test="${bdMstr.noticeYn == 'Y' && bdMstr.openYn == 'Y' }">
if (document.board.noticeAt.checked && document.board.secretAt.checked) {
alert("공지 글 등록 시 비밀글로 등록할 수 없습니다.");
return false;
}
</c:if> */
if(document.board.day.value == ''){
alert("등록일은 필수입니다.")
return false;
}
if (confirm('<spring:message code="common.regist.msg" />')) {
document.board.frstRegisterPnttm.value = document.board.day.value + '-' + document.board.hour.value + '-' + document.board.min.value;
document.board.action = "<c:url value='/cop/bbs/insertBoardArticle.do'/>";
document.board.target = "_self";
document.board.submit();
}
}
function fn_egov_select_noticeList() {
document.searchForm.action = "<c:url value='/cop/bbs/selectBoardList.do'/>";
document.searchForm.submit();
}
function fn_egov_regist_preview() {
var PCC_window = window.open('', 'PCCV3Window', 'width=1200, height=700, resizable=1, scrollbars=yes, status=0, titlebar=0, toolbar=0, left=350, top=50' );
var previewImgs = "";
var i = 0;
$("#DIV_IMG_VIEW").find("img").each(function() {
previewImgs += $(this).get(0).src + "^";
i++;
});
document.board.previewImgs.value = previewImgs;
document.board.action = "<c:url value='/cop/bbs/bbsPreview.do'/>";
document.board.target = "PCCV3Window";
document.board.submit();
}
</script>
<title><c:out value='${bdMstr.bbsNm}' /> - 글 등록</title>
</head>
<body>
<div class="ad_content">
<div class="ad_con_head">
<div class="ad_head_text">
<p class="today_txt">
<c:out value='${bdMstr.bbsNm}' />
- 글 등록
</p>
<div class="ad_head_ment">
<p class="today_last_txt"><span id="cnt_cate_list"></span></p>
</div>
</div>
</div>
<div class="ad_subcon">
<form:form commandName="searchForm" name="searchForm" method="get" action="">
<input type="hidden" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>" />
<input type="hidden" name="searchCnd" value="<c:out value='${searchVO.searchCnd}'/>" />
<input type="hidden" name="searchWrd" value="<c:out value='${searchVO.searchWrd}'/>" />
<input type="hidden" name="bbsId" value="<c:out value='${searchVO.bbsId}'/>" />
</form:form>
<form:form commandName="board" name="board" method="post" enctype="multipart/form-data">
<input type="hidden" name="bbsId" value="<c:out value='${bdMstr.bbsId}'/>" />
<input type="hidden" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>" />
<input type="hidden" name="searchCnd" value="<c:out value='${searchVO.searchCnd}'/>" />
<input type="hidden" name="searchWrd" value="<c:out value='${searchVO.searchWrd}'/>" />
<input type="hidden" name="frstRegisterPnttm" value="<c:out value='${searchVO.frstRegisterPnttm}'/>" />
<input type="hidden" name="previewImgs" value="" />
<div class="main1_div2">
<table class="main1_table">
<tr>
<th>
<spring:message code="cop.nttSj" var="msgNttSj" />
<span class="star_t">* </span>
<c:out value="${msgNttSj}" />
</th>
<td colspan="3">
<form:input path="nttSj" title="${msgNttSj}" />
<form:errors path="nttSj" />
</td>
</tr>
<%-- <!-- 비밀번호 -->
<c:if test="${bdMstr.passwordYn == 'Y' }">
<c:set var="title"></c:set>
<tr>
<th>
<label for="password">비밀번호 <span class="pilsu"></span></label>
</th>
<td class="left">
<form:password path="password" title="비밀번호" size="30" maxlength="30" />
<div>
<form:errors path="password" cssClass="error" />
</div>
</td>
<th>
<label for="password1">비밀번호 확인</label>
</th>
<td class="left">
<form:password path="password2" title="비밀번호" size="30" maxlength="30" />
<div>
<form:errors path="password2" cssClass="error" />
</div>
</td>
</tr>
</c:if>
<!-- 비밀번호 --> --%>
<!-- 등록일 -->
<tr>
<th>
<span class="star_t">* </span>등록일
</th>
<td colspan="3">
<input type="hidden" name="cal_url" id="cal_url" value="<c:url value='/sym/cmm/EgovNormalCalPopup.do'/>" >
<input type="text" class="date_format" name="day" id="day" maxlength="10" class="readOnlyClass" readonly>
<a href="#" onClick="javascript:fn_egov_NormalCalendar(document.forms.board, document.forms.board.day);">
<img src="<c:url value='/images/egovframework/com/cmm/icon/bu_icon_carlendar.gif' />" align="middle" style="border:0px" alt="달력창팝업버튼이미지">
</a>
<select name="hour" id="hour" required="required">
<c:forEach var="hour" begin="0" end="23">
<option value="<c:if test='${hour < 10}'>0</c:if>${hour}"><c:if test='${hour < 10}'>0</c:if>${hour}</option>
</c:forEach>
</select>
시
<select name="min" id="min" required="required">
<c:forEach var="min" begin="0" end="59">
<option value="<c:if test='${min < 10}'>0</c:if>${min}"><c:if test='${min < 10}'>0</c:if>${min}</option>
</c:forEach>
</select>
분
</td>
</tr>
<!-- 등록일 -->
<!-- 글내용 -->
<tr>
<th>
<span class="star_t">* </span><spring:message code="cop.nttCn" />
</th>
<td colspan="3">
<form:textarea path="nttCn" class="textarea" cols="500" rows="20" />
<ckeditor:replace replace="nttCn" basePath="${pageContext.request.contextPath}/html/egovframework/com/cmm/utl/ckeditor/" />
<form:errors path="nttCn" />
</td>
</tr>
<!-- 글내용 -->
<!-- 대체텍스트 -->
<tr>
<th>대체텍스트</th>
<td colspan="3">
<button class="main1_btn main1_save_btn" id="main1_save_btn" onclick="javascript:nttCnImgAltInp(); return false;">대체텍스트 조회</button>
<button class="main1_btn main1_save_btn" id="main1_save_btn" onclick="javascript:nttCnImgAltSave(); return false;">대체텍스트 저장</button>
<br>* 웹에디터에 이미지가 있어야 조회/저장 가능합니다.
<br>* 웹에디터가 '소스' 모드 일시 해제 후 조회/저장 가능합니다.(웹에디터 상단 '소스' 버튼 비활성화)
<br>* 이미지가 여러개일 시 순차적으로 입력박스가 조회 되기는 하지만 HTML태그 순으로 정렬됨으로 눈으로 보이는 정확한 정렬은 안될수 있고,
<br> 구분할 수단이 없음으로, 웹에디터 이미지에 우클릭>이미지설정>대체텍스트 입력 후 대체텍스트 조회 버튼 클릭 시 구분을 쉽게 할 수 있습니다.
<br><br><font color="red">* 최종 게시글 등록/수정 버튼 클릭 시 저장되는 대체텍스트는 마지막에 등록 하신 방법(웹에디터 이미지설정 또는 대체텍스트 조회/저장)으로 저장됩니다.</font>
<div id="imgAltTextArea"></div>
</td>
</tr>
<!-- 대체텍스트 -->
<!-- 파일첨부 -->
<c:if test="${bdMstr.fileAtchPosblAt == 'Y'}">
<c:if test="${bdMstr.bbsTyCode == 'BBST05' || bdMstr.bbsTyCode == 'BBST06'}">
<tr>
<th>이미지</th>
<td>
<div id="DIV_IMG_VIEW"></div>
</td>
</tr>
</c:if>
<tr>
<th>
<label for="egovComFileUploader"><spring:message code="cop.atchFile" /></label>
</th>
<td colspan="3">
<input name="file_1" id="egovComFileUploader" type="file" />
<div id="egovComFileList"></div>
</td>
</tr>
</c:if>
<!-- 파일첨부 -->
<!-- 공지신청 여부 -->
<c:choose>
<c:when test="${bdMstr.noticeYn == 'Y' }">
<c:set var="title">공지여부 </c:set>
<tr>
<th>
<label for="noticeAt">${title}</label>
</th>
<td class="left" colspan="3">
<form:checkbox path="noticeAt" class="cb1" value="Y" />
<form:errors path="noticeAt" cssClass="error" />
</td>
</tr>
</c:when>
<c:otherwise>
<form:hidden path="noticeAt" value="N" />
</c:otherwise>
</c:choose>
<!-- 공지신청 여부 -->
<!-- 비밀글 여부 -->
<c:choose>
<c:when test="${bdMstr.openYn == 'Y' && bdMstr.bbsTyCode != 'BBST02' && bdMstr.bbsTyCode != 'BBST03'}">
<c:set var="title">공개여부</c:set>
<tr>
<th>
<label for="secretAt">${title}</label>
</th>
<td colspan="3">
<form:checkbox path="secretAt" class="cb1" value="Y" />
<form:errors path="secretAt" cssClass="error" />
</td>
</tr>
</c:when>
<c:otherwise>
<form:hidden path="secretAt" value="N" />
</c:otherwise>
</c:choose>
<!-- 비밀글 여부 -->
<%-- <!-- 캡차 -->
<tr>
<th>
<label for="secretAt">캡차</label>
</th>
<td class="left" colspan="3">
<form name="frmSubmit" method="post" action="/">
<div class="form-group">
<div class="captcha">
<div class="form-group">
<img id="captchaImg" title="캡차 이미지" src="/captchaImg.do" alt="캡차 이미지" />
<div id="captchaAudio" style="display: none;"></div>
</div>
<div class="form-group">
<a onclick="javascript:refreshBtn()" class="refreshBtn"> <input type="button" value="새로고침" />
</a> <a onclick="javascript:audio()" class="refreshBtn"> <input type="button" value="음성듣기" />
</a>
</div>
<div class="form-group">
<input type="text" name="answer" id="answer" class="form-control" /> <input type="button" id="frmSubmit" value="확인" />
</div>
</div>
</div>
</form>
</td>
</tr>
<!-- 캡차 --> --%>
</table>
<c:if test="${bdMstr.fileAtchPosblAt == 'Y'}">
<c:set var="isImgView" value="false" />
<c:set var="isImgBbs" value="false" />
<c:if test="${bdMstr.bbsTyCode == 'BBST05' || bdMstr.bbsTyCode == 'BBST06'}">
<c:set var="isImgView" value="true" />
<c:set var="isImgBbs" value="true" />
</c:if>
<script type="text/javascript">
var maxFileNum = "<c:out value='${bdMstr.posblAtchFileNumber}'/>";
var maxFileSize = "<c:out value='${bdMstr.posblAtchFileSize}'/>";
if (maxFileNum == null || maxFileNum == "") {
maxFileNum = 0;
}
var multi_selector = new MultiSelector(document
.getElementById('egovComFileList'),
maxFileNum, null,
<c:out value="${isImgView}" />,
maxFileSize, <c:out value="${isImgBbs}" />);
multi_selector.addElement(document
.getElementById('egovComFileUploader'));
</script>
</c:if>
</div>
<!-- 버튼 시작(상세지정 style로 div에 지정) -->
<div class="main1_btn_div">
<button class="main1_btn" onclick="javascript:fn_egov_select_noticeList(); return false;">목 록</button>
<button class="main1_btn" onclick="javascript:fn_egov_regist_preview(); return false;">미리보기</button>
<button class="main1_btn main1_save_btn" id="main1_save_btn" onclick="javascript:fn_egov_regist_notice(); return false;">등 록</button>
</div>
<!-- 버튼 끝 -->
</form:form>
</div>
</div>
<!-- //content 끝 -->
</body>
</html>