2024-09-05 18:15 코드 관리

This commit is contained in:
myname 2024-09-05 18:15:43 +09:00
parent d3664c4b64
commit 5b14cfff36
4 changed files with 501 additions and 343 deletions

View File

@ -1,108 +1,120 @@
package seed.com.user.code;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.psl.dataaccess.util.EgovMap;
import seed.com.gtm.service.BaseService;
import seed.com.gtm.util.JSONView;
import seed.com.gtm.util.JSPUtil;
@Controller
/*@RequestMapping("/gtm/case")*/
public class CodeController {
protected Log log = LogFactory.getLog(this.getClass());
//CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음
@Autowired
private BaseService bservice;
public void setSessionMessageRemove(HttpSession session){
session.removeAttribute("sSiteIdx");
session.removeAttribute("url");
session.removeAttribute("message");
session.removeAttribute("opener");
session.removeAttribute("append");
session.removeAttribute("self");
}
@RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do")
public ModelAndView getManagerPage(HttpServletRequest request,
HttpSession session, Map<String, Object> map,
@PathVariable(value="pageFolder") String pageFolder,
@PathVariable(value="pageName") String pageName,
@PathVariable(value="pageAction") String pageAction
) throws Exception {
EgovMap params;
request.setCharacterEncoding("UTF-8");
ModelAndView mav = new ModelAndView();
ModelAndView mavjson = new ModelAndView(new JSONView());
params = JSPUtil.makeRequestParams(request, session, true);
//시큐어코딩 관련 파라미터는 삭제
params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied");
params.remove("SpringSecuritySessionMgmtFilterApplied");
params.remove("springSecurityContext");
params.remove("SpringSecurityScpfApplied");
params.remove("springSecuritySavedRequest");
String type = "";
if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){
type = (String) params.get("type");
}else{
//type이 없을 경우 default 리스트 출력
type = "L";
}
log.warn(">>>>>>type<<<<<<"+type);
params.put("sql", pageFolder+pageAction);
log.warn(">>>>>>>>params1<<<<<<<<<"+params);
if("L".equals(type)){
//mav.addObject("data", bservice.list(params));
params.put("data", JSPUtil.fixNull(bservice.list(params)));
}else if("S".equals(type)){
//mav.addObject("data", bservice.select(params));
params.put("data", JSPUtil.fixNull(bservice.select(params)));
}else if("I".equals(type)){
params.put("data", JSPUtil.fixNull(bservice.insert(params)));
}else if("U".equals(type)){
//mav.addObject("data", bservice.update(params));
params.put("data", JSPUtil.fixNull(bservice.update(params)).toString());
}else if("D".equals(type)){
//mav.addObject("data", bservice.delete(params));
params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString());
}
log.warn(">>>>>>>>params2<<<<<<<<<"+params);
if("ajax".equals(pageName)){
log.warn("===================[[ ajax! ]]=================");
params.remove("simpleCaptcha");
mavjson.addAllObjects(params);
return mavjson;
}else{
mav.addAllObjects(params);
return mav;
}
}
}
package seed.com.user.code;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.psl.dataaccess.util.EgovMap;
import seed.com.gtm.service.BaseService;
import seed.com.gtm.util.JSONView;
import seed.com.gtm.util.JSPUtil;
@Controller
/*@RequestMapping("/gtm/case")*/
public class CodeController {
protected Log log = LogFactory.getLog(this.getClass());
//CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음
@Autowired
private BaseService bservice;
public void setSessionMessageRemove(HttpSession session){
session.removeAttribute("sSiteIdx");
session.removeAttribute("url");
session.removeAttribute("message");
session.removeAttribute("opener");
session.removeAttribute("append");
session.removeAttribute("self");
}
@RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do")
public ModelAndView getManagerPage(HttpServletRequest request,
HttpSession session, Map<String, Object> map,
@PathVariable(value="pageFolder") String pageFolder,
@PathVariable(value="pageName") String pageName,
@PathVariable(value="pageAction") String pageAction
) throws Exception {
EgovMap params;
request.setCharacterEncoding("UTF-8");
ModelAndView mav = new ModelAndView();
ModelAndView mavjson = new ModelAndView(new JSONView());
params = JSPUtil.makeRequestParams(request, session, true);
//시큐어코딩 관련 파라미터는 삭제
params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied");
params.remove("SpringSecuritySessionMgmtFilterApplied");
params.remove("springSecurityContext");
params.remove("SpringSecurityScpfApplied");
params.remove("springSecuritySavedRequest");
String type = "";
if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){
type = (String) params.get("type");
}else{
//type이 없을 경우 default 리스트 출력
type = "L";
}
log.warn(">>>>>>type<<<<<<"+type);
params.put("sql", pageFolder+pageAction);
log.warn(">>>>>>>>params1<<<<<<<<<"+params);
if("L".equals(type)){
//mav.addObject("data", bservice.list(params));
params.put("data", JSPUtil.fixNull(bservice.list(params)));
}else if("S".equals(type)){
//mav.addObject("data", bservice.select(params));
params.put("data", JSPUtil.fixNull(bservice.select(params)));
}else if("I".equals(type)){
params.put("data", JSPUtil.fixNull(bservice.insert(params)));
}else if("U".equals(type)){
//mav.addObject("data", bservice.update(params));
params.put("data", JSPUtil.fixNull(bservice.update(params)).toString());
}else if("D".equals(type)){
//mav.addObject("data", bservice.delete(params));
params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString());
}
log.warn(">>>>>>>>params2<<<<<<<<<"+params);
if("Exam".equals(pageFolder)
&& "ajax".equals(pageName)
&& "BBsInfo".equals(pageAction)
){
EgovMap params1 = new EgovMap();
params1.put("data", params.get("data"));
mavjson.addAllObjects(params1);
//System.out.println(params);
return mavjson;
}else if("ajax".equals(pageName)){
log.warn("===================[[ ajax! ]]=================");
params.remove("simpleCaptcha");
mavjson.addAllObjects(params);
//System.out.println(params);
return mavjson;
}else{
mav.addAllObjects(params);
return mav;
}
}
}

View File

@ -90,7 +90,7 @@
<script src="/js/jquery.form.js"></script>
<script src="/js/commonFileUtil.js"></script>
<script src="/js/common_XHR.js"></script>
<script src="/js/common_XHR.js?3"></script>
<script src="/js/common.js"></script>
<script src="/js/DateTimePicker.js"></script>
<script src="/js/jquery.selectboxes.js"></script>

View File

@ -1,234 +1,239 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!doctype html>
<html lang="ko">
<head>
<title>정보 관리</title>
<link href='/css/space.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/>
<link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/>
<script src="/editor/webnote.js"></script>
</head>
<body>
<div class="page-title-wrap clear">
<div class="page-title-inner">
<h3 class="page-title">분쟁조정 사례(${menuName})</h3>
<div class="tooltipBox type01">
<button type="button" class="page-tip">페이지안내</button>
<div class="tooltipText">
<p>분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.</p>
</div>
</div>
</div>
</div>
<form:form name="frm" id="frm" action="" method="post">
<input type="hidden" name="boardIdxx" id="boardIdxx" value="">
<input type="hidden" name="medBig" id="medBig" value="">
</form:form>
<%-- <form:form name="writeFrm" id="writeFrm" action="${pageType}/${siteIdx}/${boardIdx}/write.do" method="post"> --%>
<form:form name="writeFrm" id="writeFrm" action="/gtm/case/exam/${boardIdx}/write.do" method="post">
<fieldset>
<div class="bbs-view-layout">
<div class="bbs-view-item">
<p class="item-title">제목</p>
<div class="item-box">
<input type="text" name="examSubj" id="examSubj" maxlength="250">
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">작성자</p>
<div class="item-box">
${memberName}
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">첨부자료</p>
<div class="item-box">
<div class="temp-file-area">
<label for="upFile" class="temp-file-button">첨부파일</label>
</div>
<ul class="upFileHtml" id="upFileHtml">
</ul>
<input type="hidden" name="fileFuncType" value="exam" />
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">사건 유형 및 분류 선택</p>
<div class="item-box">
<select name="examTypeSell" id="examTypeSell" class="sel_default">
</select>
<span> / </span>
<select name="mediationBigType" id="mediationBigType" class="sch-select" onchange="mediationSmall()">
<option value="">대분류 선택</option>
<option value="big1" >불성립</option>
<option value="big2" >성립</option>
<option value="big4" >심의</option>
<option value="big5" >종결</option>
<option value="big3" >중지</option>
</select>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">사건의 개요</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">분쟁사실 및 당사자 주장</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont2" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">검토</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont3" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">조정결과</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont4" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
</div>
<input type="hidden" name="medBig2" id="medBig2" value="">
<input type="hidden" name="medSmall2" id="medSmall2" value="">
<input type="hidden" name="examType" id="examType" value="">
<div class="btn-area">
<button type="submit" class="btn-normal violet mb10">저장</button>
<a href="javascript:goList()" class="btn-normal lightgray">목록</a>
</div>
</fieldset>
</form:form>
<!-- 파일 입시저장을 위한 폼 -->
<form id="fileTempUpFrm" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
<input type="hidden" name="fileFuncType" value="exam" />
<div class="temp-file-area">
<input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="fileTempUp();" required title="첨부파일" value="" style="ime-mode: disabled;" >
</div>
</form>
<form name="paramFrm" id="paramFrm" action="/gtm/case/exam/${boardIdx}/list.do" method="get">
<input type="hidden" name="searchType" value="${param.searchType}">
<input type="hidden" name="searchTilte" value="${param.searchTilte}">
<input type="hidden" name="page" id="page" value="${param.page}">
</form>
<%-- <form:form name="frm" id="frm" action="" method="post">
<input type="hidden" name="medBig" id="medBig" value="">
</form:form> --%>
<script type="text/javascript">
webnote.setConfig({
auto_start: true, //페이지로딩시 페이지에 웹노트 에디터를 자동으로 생성할것인지(true: 자동생성, false: 생성안함)
lang: "UTF-8", //언어셋(lang 디렉토리내에 언어셋.txt 파일이 있어야 함(ex: ko.txt)
base_dir: "/editor", //웹노트 설치디렉토리를 직접 지정
css_url: "/editor/webnote.css", //기본 css 파일을 직접 지정
icon_dir: "/editor/icon", //기본 아이콘 디렉토리를 직접 지정
emoticon_dir: "/editor/emoticon", //기본 이모티콘 디렉토리를 직접 지정
attach_proc: "/common/proc/case/editor/editorFileReg.do", //에디터에 이미지 즉시 업로드를 처리하는 서버스크립트를 직접 지정
delete_proc: "/common/proc/case/editor/editorFileDel.do", //에디터에 즉시 업로드된 이미지 삭제를 처리하는 서버스크립트를 직접 지정(attach_proc 과 같을경우 설정 불필요)
use_blind: true, //팝업메뉴 출력 시 반투명 배경 스크린 사용여부(true:사용(기본), false: 미사용)
allow_dndupload: false, //드래그&드롭을 통한 이미지 파일 업로드 허용 여부
allow_dndresize: false, //드래그&드롭을 통한 에디터 사이즈(높이) 조절 허용 여부
//fonts: ["굴림체","궁서체"], //선택할 수 있는 폰트종류를 직접 정의
//fontsizes: ["9pt","10pt"], //선택할 수 있는 폰트사이즈를 직접 정의(단위포함)
lineheights: ["120%","150%","180%"], //선택할 수 있는 줄간격을 직접 정의(단위포함)
//emoticons: ["Nerd"], //선택할 수 있는 이모티콘들을 직접 정의(png파일은 확장자 생략 가능하며, 그외에는 확장자까지 입력 : PNG, GIF, JPG 만 가능)
//specialchars: ["§","☆"], //선택할 수 있는 특수문자를 직접 정의
code_highlight: true,
fade_popup: true, //팝업 열리기/닫히기 시 fade in/out 기능 적용 여부(사용pc 사용이 낮은경우 false로 )
attach_list_view: false
});
$(window).load(function(){
$("#idx_toolbar_webnote_content_imagecenter").hide();
$("#idx_toolbarcontainer_webnote_content img").each(function(index, item) {
if($(item).attr("class") != "webnote_seperator"){
var event = $(item).attr("onclick");
$(item).wrap("<a href='javascript:;' onclick="+event+">");
$(item).attr("onclick", "");
}
});
});
$(document).ready(function(){
loadexamGubun();
$("#writeFrm").submit(function(){
if($("#examSubj").val().trim() == ""){
alert("제목을 입력해 주세요.");
$("#examSubj").focus();
return false;
}
$("#examType").val($("#examTypeSell option:selected").text());
$("#medBig2").val($("#mediationBigType option:selected").text());
$("#medSmall2").val($("#mediationSmallType option:selected").text());
/* if($("#regMberNm").val().trim() == ""){
alert("작성자를 입력해 주세요.");
$("#regMberNm").focus();
return false;
} */
/* if($("#content").val() == ""){
alert("내용을 입력해 주세요.");
$("#content").focus();
return false;
} */
});
});
function goList(){
$("#paramFrm").submit();
}
function loadexamGubun(){
var url = "";
$("#type").val("L");
$("#boardIdxx").val(${boardIdx});
var param = jQuery('#frm').serialize();
url = "/user/case/Exam/ajax/BBsInfo.do";
XHR2(url, param, function(r){
var html2 = "";
if(r.data.length != 0){
$("#examTypeSell").empty();
$.each(r.data, function(k,v){
html2 += '<option name=search value='+v.value+'>'+v.value+'</option>';
})
$("#examTypeSell").append(html2);
}
})
}
</script>
<script src="/js/jquery.form.js"></script>
<script src="/js/seedFileUtil.js"></script>
</body>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!doctype html>
<html lang="ko">
<head>
<title>정보 관리</title>
<link href='/css/space.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/>
<link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/>
<script src="/editor/webnote.js"></script>
</head>
<body>
<div class="page-title-wrap clear">
<div class="page-title-inner">
<h3 class="page-title">분쟁조정 사례(${menuName})</h3>
<div class="tooltipBox type01">
<button type="button" class="page-tip">페이지안내</button>
<div class="tooltipText">
<p>분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.</p>
</div>
</div>
</div>
</div>
<form:form name="frm" id="frm" action="" method="post">
<input type="hidden" name="boardIdxx" id="boardIdxx" value="">
<input type="hidden" name="medBig" id="medBig" value="">
</form:form>
<%-- <form:form name="writeFrm" id="writeFrm" action="${pageType}/${siteIdx}/${boardIdx}/write.do" method="post"> --%>
<form:form name="writeFrm" id="writeFrm" action="/gtm/case/exam/${boardIdx}/write.do" method="post">
<fieldset>
<div class="bbs-view-layout">
<div class="bbs-view-item">
<p class="item-title">제목</p>
<div class="item-box">
<input type="text" name="examSubj" id="examSubj" maxlength="250">
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">작성자</p>
<div class="item-box">
${memberName}
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">첨부자료</p>
<div class="item-box">
<div class="temp-file-area">
<label for="upFile" class="temp-file-button">첨부파일</label>
</div>
<ul class="upFileHtml" id="upFileHtml">
</ul>
<input type="hidden" name="fileFuncType" value="exam" />
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">사건 유형 및 분류 선택</p>
<div class="item-box">
<select name="examTypeSell" id="examTypeSell" class="sel_default">
</select>
<span> / </span>
<select name="mediationBigType" id="mediationBigType" class="sch-select" onchange="mediationSmall()">
<option value="">대분류 선택</option>
<option value="big1" >불성립</option>
<option value="big2" >성립</option>
<option value="big4" >심의</option>
<option value="big5" >종결</option>
<option value="big3" >중지</option>
</select>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">사건의 개요</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">분쟁사실 및 당사자 주장</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont2" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">검토</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont3" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
<div class="bbs-view-item">
<p class="item-title">조정결과</p>
<div class="item-box">
<textarea class="bg_essential " name="editorParam_examCont4" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</textarea>
</div>
</div>
</div>
<input type="hidden" name="medBig2" id="medBig2" value="">
<input type="hidden" name="medSmall2" id="medSmall2" value="">
<input type="hidden" name="examType" id="examType" value="">
<div class="btn-area">
<button type="submit" class="btn-normal violet mb10">저장</button>
<a href="javascript:goList()" class="btn-normal lightgray">목록</a>
</div>
</fieldset>
</form:form>
<!-- 파일 입시저장을 위한 폼 -->
<form id="fileTempUpFrm" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
<input type="hidden" name="fileFuncType" value="exam" />
<div class="temp-file-area">
<input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="fileTempUp();" required title="첨부파일" value="" style="ime-mode: disabled;" >
</div>
</form>
<form name="paramFrm" id="paramFrm" action="/gtm/case/exam/${boardIdx}/list.do" method="get">
<input type="hidden" name="searchType" value="${param.searchType}">
<input type="hidden" name="searchTilte" value="${param.searchTilte}">
<input type="hidden" name="page" id="page" value="${param.page}">
</form>
<%-- <form:form name="frm" id="frm" action="" method="post">
<input type="hidden" name="medBig" id="medBig" value="">
</form:form> --%>
<script type="text/javascript">
webnote.setConfig({
auto_start: true, //페이지로딩시 페이지에 웹노트 에디터를 자동으로 생성할것인지(true: 자동생성, false: 생성안함)
lang: "UTF-8", //언어셋(lang 디렉토리내에 언어셋.txt 파일이 있어야 함(ex: ko.txt)
base_dir: "/editor", //웹노트 설치디렉토리를 직접 지정
css_url: "/editor/webnote.css", //기본 css 파일을 직접 지정
icon_dir: "/editor/icon", //기본 아이콘 디렉토리를 직접 지정
emoticon_dir: "/editor/emoticon", //기본 이모티콘 디렉토리를 직접 지정
attach_proc: "/common/proc/case/editor/editorFileReg.do", //에디터에 이미지 즉시 업로드를 처리하는 서버스크립트를 직접 지정
delete_proc: "/common/proc/case/editor/editorFileDel.do", //에디터에 즉시 업로드된 이미지 삭제를 처리하는 서버스크립트를 직접 지정(attach_proc 과 같을경우 설정 불필요)
use_blind: true, //팝업메뉴 출력 시 반투명 배경 스크린 사용여부(true:사용(기본), false: 미사용)
allow_dndupload: false, //드래그&드롭을 통한 이미지 파일 업로드 허용 여부
allow_dndresize: false, //드래그&드롭을 통한 에디터 사이즈(높이) 조절 허용 여부
//fonts: ["굴림체","궁서체"], //선택할 수 있는 폰트종류를 직접 정의
//fontsizes: ["9pt","10pt"], //선택할 수 있는 폰트사이즈를 직접 정의(단위포함)
lineheights: ["120%","150%","180%"], //선택할 수 있는 줄간격을 직접 정의(단위포함)
//emoticons: ["Nerd"], //선택할 수 있는 이모티콘들을 직접 정의(png파일은 확장자 생략 가능하며, 그외에는 확장자까지 입력 : PNG, GIF, JPG 만 가능)
//specialchars: ["§","☆"], //선택할 수 있는 특수문자를 직접 정의
code_highlight: true,
fade_popup: true, //팝업 열리기/닫히기 시 fade in/out 기능 적용 여부(사용pc 사용이 낮은경우 false로 )
attach_list_view: false
});
$(window).load(function(){
$("#idx_toolbar_webnote_content_imagecenter").hide();
$("#idx_toolbarcontainer_webnote_content img").each(function(index, item) {
if($(item).attr("class") != "webnote_seperator"){
var event = $(item).attr("onclick");
$(item).wrap("<a href='javascript:;' onclick="+event+">");
$(item).attr("onclick", "");
}
});
});
$(document).ready(function(){
loadexamGubun();
$("#writeFrm").submit(function(){
if($("#examSubj").val().trim() == ""){
alert("제목을 입력해 주세요.");
$("#examSubj").focus();
return false;
}
$("#examType").val($("#examTypeSell option:selected").text());
$("#medBig2").val($("#mediationBigType option:selected").text());
$("#medSmall2").val($("#mediationSmallType option:selected").text());
/* if($("#regMberNm").val().trim() == ""){
alert("작성자를 입력해 주세요.");
$("#regMberNm").focus();
return false;
} */
/* if($("#content").val() == ""){
alert("내용을 입력해 주세요.");
$("#content").focus();
return false;
} */
});
});
function goList(){
$("#paramFrm").submit();
}
function loadexamGubun(){
var url = "";
$("#type").val("L");
$("#boardIdxx").val(${boardIdx});
var param = jQuery('#frm').serialize();
url = "/user/case/Exam/ajax/BBsInfo.do";
XHR2(url, param, function(r){
var html2 = "";
if(r.data.length != 0){
$("#examTypeSell").empty();
$.each(r.data, function(k,v){
html2 += '<option name=search value='+v.value+'>'+v.value+'</option>';
})
$("#examTypeSell").append(html2);
}
})
}
</script>
<script src="/js/jquery.form.js"></script>
<script src="/js/seedFileUtil.js"></script>
</body>
</html>

View File

@ -2,6 +2,70 @@
* jQuery AJAX
*/
function XHR(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
$.ajax({
url: url,
type: "POST",
dataType: "html",
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
data: data,
async: true,
cache: false,
success: function (data, textStatus) {
var result;
try{
console.log(data);
result = eval('(' + data + ')');
}catch(ex){
$.unblockUI();
alert(ex);
}
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
if(result._EXCEPTION_){
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
$.unblockUI();
exceptionFunc(result._EXCEPTION_);
}else{
$.unblockUI();
_processException(result._EXCEPTION_);
}
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
alert(result._SESSION_OUT_.message);
if(result._SESSION_OUT_.redirectUrl !=""){
$.unblockUI();
parent.location.href= redirectUrl;
}
}else{
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(result);
}
}
}else{
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(data);
}
}
},
beforeSend : function(){ // 로컬 이벤트 , 시작
if(localStartFunc){
$.unblockUI();
localStartFunc();
}
},
complete: function(){ // 로컬 이벤트 , 끝
if(localEndFunc){
$.unblockUI();
localEndFunc();
}
}
});
}
function XHR_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
jQuery.ajax({
url: url,
@ -64,9 +128,86 @@
}
});
}
//비동기 false
function XHR2(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
$.ajax({
url: url,
type: "POST",
dataType: "html",
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
data: data,
async: false,
cache: false,
success: function (data, textStatus) {
var result;
try{
//시큐어코딩 관련 session이 들어가 있으면 신텍스 에러나기 떄문에 삭제
/* data = data.replace('"SpringSecurityFiltersecurityinterceptorFilterapplied":true,','');
data = data.replace('"SpringSecuritySessionMgmtFilterApplied":true,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@689a8480: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@689a8480: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@b15278a; Granted Authorities: ROLE_USER,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@7ef97b48: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@7ef97b48: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@1d76d842; Granted Authorities: ROLE_USER,','');
data = data.replace('"SpringSecurityScpfApplied":true,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@e3239a3: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@e3239a3: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@6dbd9aa9; Granted Authorities: ROLE_USER,','');
*/
//20191004 주석.
//console.log(data);
result = eval('(' + data + ')');
}catch(ex){
$.unblockUI();
alert(ex);
}
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
if(result._EXCEPTION_){
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
exceptionFunc(result._EXCEPTION_);
$.unblockUI();
}else{
_processException(result._EXCEPTION_);
$.unblockUI();
}
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
alert(result._SESSION_OUT_.message);
if(result._SESSION_OUT_.redirectUrl !=""){
$.unblockUI();
parent.location.href= redirectUrl;
}
}else{
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(result);
}
}
}else{
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을 때.
$.unblockUI();
callbackFunc(data);
}
}
},
beforeSend : function(){ // 로컬 이벤트, 시작
if(localStartFunc){
$.unblockUI();
localStartFunc();
}
},
complete: function(){ // 로컬 이벤트, 끝
if(localEndFunc){
$.unblockUI();
localEndFunc();
}
}
});
}
//비동기 false
function XHR2_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
// $.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
jQuery.ajax({
url: url,