충돌해결
This commit is contained in:
parent
0c2e66fcf1
commit
154957b081
@ -42,11 +42,11 @@
|
||||
</c:if>
|
||||
|
||||
<!-- File Upload : 시작-->
|
||||
<script src="${pageContext.request.contextPath}/js/fileupload/dropzone.js"></script>
|
||||
<script src="<c:out value='${pageContext.request.contextPath}' />/js/fileupload/dropzone.js"></script>
|
||||
<!-- File Upload : 종료 -->
|
||||
|
||||
<!-- SmartEditor : 시작 -->
|
||||
<script src="${pageContext.request.contextPath}/js/smartEditor/js/service/HuskyEZCreator.js"></script>
|
||||
<script src="<c:out value='${pageContext.request.contextPath}' />/js/smartEditor/js/service/HuskyEZCreator.js"></script>
|
||||
<!-- SmartEditor : 종료 -->
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ $(window.document).ready(function() {
|
||||
nhn.husky.EZCreator.createInIFrame({
|
||||
oAppRef: oEditors,
|
||||
elPlaceHolder: "content",
|
||||
sSkinURI: "${pageContext.request.contextPath}/js/smartEditor/SmartEditor2Skin.html",
|
||||
sSkinURI: "<c:out value='${pageContext.request.contextPath}' />/js/smartEditor/SmartEditor2Skin.html",
|
||||
fCreator: "createSEditor2"
|
||||
});
|
||||
|
||||
@ -82,20 +82,24 @@ $(window.document).ready(function() {
|
||||
//--------------------------------------------------------------------
|
||||
// 파일업로드 객체 생성
|
||||
myDropzone = new Dropzone("form#myDropzone", {
|
||||
url: "${pageContext.request.contextPath}/fileupload/uploadFilesAjax.do?subPathKey=fileupload.bbs.qna.subpath&attachFileId=<c:out value='${searchArticle.bdAttachFileId}'/>"
|
||||
});
|
||||
url: "<c:out value='${pageContext.request.contextPath}' />/fileupload/uploadFilesAjax.do?subPathKey=fileupload.bbs.qna.subpath&attachFileId=<c:out value='${searchArticle.bdAttachFileId}'/>",
|
||||
maxFilesize: <c:out value="${maxFilesize}" />,
|
||||
maxFiles: <c:out value="${maxFiles}" />,
|
||||
parallelUploads: <c:out value="${maxFiles}" />,
|
||||
acceptedFiles: "<c:out value="${acceptedFiles}" />"
|
||||
});
|
||||
|
||||
// 기존 첨부파일 출력
|
||||
<c:if test="${searchArticle.attachFileCnt > 0}">
|
||||
var re = /(?:\.([^.]+))?$/;
|
||||
<c:forEach var="attachFile" items="${searchArticle.attachFiles }" varStatus="status">
|
||||
myDropzone.addFile({
|
||||
name: '${attachFile.orignlFileNm}',
|
||||
size:${attachFile.fileSize},
|
||||
type:re.exec('${attachFile.orignlFileNm}')[1],
|
||||
attachFileId: '${attachFile.attachFileId}',
|
||||
streFileNm: '${attachFile.streFileNm}',
|
||||
fileSn: '${attachFile.fileSn}',
|
||||
name: '<c:out value="${attachFile.orignlFileNm}" />',
|
||||
size: <c:out value="${attachFile.fileSize}" />,
|
||||
type:re.exec('<c:out value="${attachFile.orignlFileNm}" />')[1],
|
||||
attachFileId: '<c:out value="${attachFile.attachFileId}" />',
|
||||
streFileNm: '<c:out value="${attachFile.streFileNm}" />',
|
||||
fileSn: '<c:out value="${attachFile.fileSn}" />',
|
||||
fileUploadType: 'uploaded'
|
||||
});
|
||||
</c:forEach>
|
||||
@ -104,8 +108,14 @@ $(window.document).ready(function() {
|
||||
// 각 파일별 업로드 성공시 호출됨 (1th called)
|
||||
myDropzone.on("success", function(file, responseText) {
|
||||
var jobj = JSON.parse(responseText);
|
||||
console.log("file upload success : responseText = " + responseText);
|
||||
console.log("fileUpDone count : " + fileList.length);
|
||||
|
||||
//console.log("file upload success : responseText = " + responseText);
|
||||
//console.log("fileUpDone count : " + fileList.length);
|
||||
|
||||
if(jobj.length < 1) {
|
||||
alert("[" + file.name + "] 첨부파일 업로드 처리가 취소되었습니다. \n\n다음에 해당하는 경우, 업로드가 취소됩니다.\n- 최대 파일수 초과 \n- 파일용량 초과 \n- 첨부가능한 파일 종류가 아닌 경우");
|
||||
return;
|
||||
}
|
||||
var idx = fileList.length;
|
||||
fileList[idx++] = {
|
||||
"attachFileId" : jobj[0].attachFileId,
|
||||
@ -118,12 +128,10 @@ $(window.document).ready(function() {
|
||||
console.log("success : " + file.name + " -> " + "data > " + jobj[0].streFileNm);
|
||||
});
|
||||
|
||||
/*
|
||||
myDropzone.on("error", function(file, message) {
|
||||
myDropzone.removeFile(file);
|
||||
alert(message);
|
||||
});
|
||||
*/
|
||||
});
|
||||
|
||||
myDropzone.on("removedfile", function(file) {
|
||||
var idx = delFileList.length;
|
||||
@ -138,25 +146,28 @@ $(window.document).ready(function() {
|
||||
|
||||
// 각 파일별 업로드 처리 완료 시 호출됨 (2th called)
|
||||
myDropzone.on("complete", function(file) {
|
||||
console.log("개별 파일 처리 완료 > file = " + JSON.stringify(file));
|
||||
//alert("개별 파일 처리 완료 > file = " + JSON.stringify(file));
|
||||
});
|
||||
|
||||
|
||||
// 모든 업로드 처리 완료 시 호출됨
|
||||
myDropzone.on("queuecomplete", function() {
|
||||
var targetCnt = this.getAcceptedFiles().length;
|
||||
var uploadCnt = fileList.length;
|
||||
var queuedCnt = this.getQueuedFiles();
|
||||
|
||||
console.log(targetCnt + " > " + uploadCnt);
|
||||
|
||||
if(uploadCnt > 0) {
|
||||
$("#fileList").val(JSON.stringify(JSON.stringify(fileList)));
|
||||
}
|
||||
if(IN_PROC) {
|
||||
if(queuedCnt > 0 && targetCnt > 0 && targetCnt != uploadCnt) {
|
||||
if(targetCnt > 0 && targetCnt != uploadCnt) {
|
||||
alert("일부 첨부파일 등록이 실패하였습니다.\n총 " + targetCnt + "건의 첨부파일 중 " + uploadCnt + "건이 정상적으로 업로드 되었습니다.\n글 등록을 계속 진행합니다.");
|
||||
}
|
||||
|
||||
fn_saveSubmit();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@ -180,7 +191,7 @@ function fn_list() {
|
||||
|
||||
$('#articleForm').removeAttr('onsubmit');
|
||||
|
||||
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/listQnas.do");
|
||||
$("#articleForm").attr("action", "<c:out value='${pageContext.request.contextPath}' />/bbs/listQnas.do");
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
@ -253,7 +264,6 @@ function fn_saveSubmit() {
|
||||
$("#articleForm").submit();
|
||||
}
|
||||
|
||||
|
||||
//파일 다운로드
|
||||
function fn_downloadFile(attachFileId, fileSn) {
|
||||
|
||||
@ -272,6 +282,7 @@ function fn_downloadFile(attachFileId, fileSn) {
|
||||
$("#downloadFileForm").submit();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -376,9 +387,11 @@ function fn_downloadFile(attachFileId, fileSn) {
|
||||
<form name="downloadFileForm" id="downloadFileForm"
|
||||
action="${pageContext.request.contextPath}/fileupload/downloadAttachFile.do"
|
||||
method="post">
|
||||
<input type="hidden" name="bdType" id="bdType" value="ANCMNT" />
|
||||
<input type="hidden" name="bdType" id="bdType" value="QNA" />
|
||||
<input type="hidden" name="attachFileId" id="attachFileId" value="" />
|
||||
<input type="hidden" name="streFileNm" id="streFileNm" value="" />
|
||||
<input type="hidden" name="fileSn" id="fileSn" value="" />
|
||||
<input type="hidden" name="orignlFileNm" id="orignlFileNm" value="" />
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
fn_setPageTitle("<c:out value='${pageTitle}'/>");
|
||||
fn_setPageTitle("Q&A");
|
||||
|
||||
// 검색 수행 이벤트
|
||||
$("#btnSearch").on("click", function(e) {
|
||||
@ -51,10 +51,10 @@
|
||||
});
|
||||
|
||||
// 메시지 표출
|
||||
if(!gfn_isEmpty("<c:out value='${message}'/>")) {
|
||||
if(!gfn_isEmpty("<c:out value='${message}'/>") || !gfn_isEmpty("<c:out value='${searchArticle.resultMessage}'/>")) {
|
||||
setTimeout(function() {
|
||||
alert("<c:out value='${message}'/>");
|
||||
}, 1000); // 화면 표출되도록 딜레이 줌
|
||||
alert("<c:out value='${message}'/>" + " <c:out value='${searchArticle.resultMessage}'/>");
|
||||
}, 700); // 화면 표출되도록 딜레이 줌
|
||||
}
|
||||
|
||||
//초기 자료 조회
|
||||
|
||||
Loading…
Reference in New Issue
Block a user