From 082f55756c29e8c2228c989980ff39c235d3a476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Mon, 14 Nov 2022 10:46:04 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=EC=A7=80=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=97=90=EB=94=94=ED=84=B0=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/publicBoard/publicBoard.js | 21 +++++++++++++++++-- .../publicBoard/notice/noticeEditModal.html | 5 +++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/js/publicBoard/publicBoard.js b/src/main/resources/static/js/publicBoard/publicBoard.js index 7c0e1517..9899c7d5 100644 --- a/src/main/resources/static/js/publicBoard/publicBoard.js +++ b/src/main/resources/static/js/publicBoard/publicBoard.js @@ -1,3 +1,4 @@ +var CrossEditor $(document).on('click', '#commentSaveBtn', function (){ if(!$("#comment").val()) { alert("댓글을 입력해주세요.") @@ -94,9 +95,18 @@ function getEditModal(publicKey, publicType){ ] });*/ setUploadDiv(); - var CrossEditor = new NamoSE('editor'); + CrossEditor = new NamoSE('editor'); CrossEditor.params.ParentEditor = document.getElementById("editor"); + CrossEditor.params.Width = "100%"; + CrossEditor.params.UserLang = "auto"; + CrossEditor.params.NewToolbar = true; + + + CrossEditor.params.FullScreen = false; $("#editor").show(); + /*CrossEditor.OnInitCompleted(function (e){ + e.editorTarget.SetBodyValue(document.getElementById("pe_bhr").value); + })*/ CrossEditor.EditorStart(); $("#editModal").modal('show'); @@ -139,6 +149,7 @@ function savePublicBoard(formId, publicType){ if(contentCheck(formId)){ if(confirm("저장하시겠습니까?")){ contentFade("in"); + $("#content").val(""); const formData = new FormData($("#"+formId)[0]); for(const file of files) { if(!file.isDelete) @@ -147,6 +158,7 @@ function savePublicBoard(formId, publicType){ $(".text-decoration-line-through").each(function (idx, el){ formData.append('fileSeq', $(el).attr("data-fileseq")); }) + formData.append('content', CrossEditor.GetBodyValue()); $.ajax({ type : 'POST', data : formData, @@ -182,4 +194,9 @@ function contentCheck(formId){ } flag = fileCheck(flag, files); return flag; -} \ No newline at end of file +} + +function OnInitCompleted(e){ + e.editorTarget.SetBodyValue(document.getElementById("content").value); + +} diff --git a/src/main/resources/templates/publicBoard/notice/noticeEditModal.html b/src/main/resources/templates/publicBoard/notice/noticeEditModal.html index 1b338a61..28eedad3 100644 --- a/src/main/resources/templates/publicBoard/notice/noticeEditModal.html +++ b/src/main/resources/templates/publicBoard/notice/noticeEditModal.html @@ -41,8 +41,9 @@
-
- +
+
+