From 228c38fdafaa03214f9036e77d3d32316d85a136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Wed, 7 Dec 2022 17:57:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=B8=EC=82=AC=EC=A0=95=EB=B3=B4=EB=B3=B4?= =?UTF-8?q?=EA=B3=A0=20=EB=AA=A8=EB=8B=AC=20=EC=9E=91=EC=97=85=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=99=B8=EC=82=AC=EC=88=98=EC=82=AC=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EB=AA=A8=EB=8B=AC=20=EC=9E=91=EC=97=85=EC=A4=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/js/common.js | 18 ++ src/main/resources/static/js/faRpt/faRpt.js | 21 +-- .../static/js/publicBoard/publicBoard.js | 16 +- .../templates/faRpt/faRptEditModal.html | 5 +- .../templates/faRpt/faRptViewModal.html | 147 +++++++-------- src/main/resources/templates/ivsgt/ivsgt.html | 9 +- .../templates/ivsgt/ivsgtEditModal.html | 130 ++++++------- .../templates/ivsgt/ivsgtViewModal.html | 173 +++++++++--------- 8 files changed, 244 insertions(+), 275 deletions(-) diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index abc67a81..f42700e1 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -1,4 +1,5 @@ let files = []; +let CrossEditor; function contentFade(action){ if(action === "in"){ @@ -184,6 +185,19 @@ function setFileDiv(file, idx){ uploadDiv.append(fileInfo); } +function setEditor(divId, editorHeight){ + CrossEditor = new NamoSE(divId); + CrossEditor.params.ParentEditor = document.getElementById(divId); + CrossEditor.params.Width = "100%"; + CrossEditor.params.Height = editorHeight; + CrossEditor.params.UserLang = "auto"; + CrossEditor.params.NewToolbar = true; + CrossEditor.params.UploadFileExecutePath = "/Crosseditor/uploadImg"; + CrossEditor.params.FullScreen = false; + $("#editor").show(); + CrossEditor.EditorStart(); +} + function fileCheck(flag, files){ let totalSize = 0; for(const file of files) { @@ -288,4 +302,8 @@ function getToday(){ var day = ("0" + date.getDate()).slice(-2); return year + "-" + month + "-" + day; +} + +function OnInitCompleted(e){ + e.editorTarget.SetBodyValue(document.getElementById("content").value); } \ No newline at end of file diff --git a/src/main/resources/static/js/faRpt/faRpt.js b/src/main/resources/static/js/faRpt/faRpt.js index ef0bd847..7217ea03 100644 --- a/src/main/resources/static/js/faRpt/faRpt.js +++ b/src/main/resources/static/js/faRpt/faRpt.js @@ -116,25 +116,9 @@ function getFaRptEditModal(faRpt){ dataType:"html", success: function(html){ $("#faRptEditModalContent").empty().append(html) - $("#faRptEditModal").modal('show'); - $("#faRptDt").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); - $("#content").summernote({ - lang:'ko-KR', - height: 300, - disableDragAndDrop: true, - toolbar: [ - ['style', ['style']], - ['font', ['bold', 'underline', 'clear']], - ['color', ['color']], - ['para', ['ul', 'ol', 'paragraph']], - ['table', ['table']] - ] - }); setUploadDiv(); + setEditor('editor', '500'); + $("#faRptEditModal").modal('show'); }, error:function(){ @@ -161,6 +145,7 @@ function saveFaRpt(faRptState){ $(".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, diff --git a/src/main/resources/static/js/publicBoard/publicBoard.js b/src/main/resources/static/js/publicBoard/publicBoard.js index be216632..7a6d7b75 100644 --- a/src/main/resources/static/js/publicBoard/publicBoard.js +++ b/src/main/resources/static/js/publicBoard/publicBoard.js @@ -1,4 +1,3 @@ -var CrossEditor $(function(){ $("#dateSelectorDiv").datepicker({ @@ -89,16 +88,7 @@ function getEditModal(publicKey, publicType){ success: function(html){ $("#editContent").empty().append(html) setUploadDiv(); - CrossEditor = new NamoSE('editor'); - CrossEditor.params.ParentEditor = document.getElementById("editor"); - CrossEditor.params.Width = "100%"; - CrossEditor.params.Height = "570"; - CrossEditor.params.UserLang = "auto"; - CrossEditor.params.NewToolbar = true; - CrossEditor.params.UploadFileExecutePath = "/Crosseditor/uploadImg"; - CrossEditor.params.FullScreen = false; - $("#editor").show(); - CrossEditor.EditorStart(); + setEditor('editor', '570'); $("#editModal").modal('show'); }, error:function(){ @@ -181,7 +171,3 @@ function commentFormReset(){ $("#parentComment").val(''); $("#commentFormHome").append(commentForm) } - -function OnInitCompleted(e){ - e.editorTarget.SetBodyValue(document.getElementById("content").value); -} \ No newline at end of file diff --git a/src/main/resources/templates/faRpt/faRptEditModal.html b/src/main/resources/templates/faRpt/faRptEditModal.html index d5115b16..b6dc094b 100644 --- a/src/main/resources/templates/faRpt/faRptEditModal.html +++ b/src/main/resources/templates/faRpt/faRptEditModal.html @@ -47,7 +47,8 @@
- +
+
@@ -75,7 +76,7 @@
-
+
diff --git a/src/main/resources/templates/faRpt/faRptViewModal.html b/src/main/resources/templates/faRpt/faRptViewModal.html index 7e589657..b35ce0a2 100644 --- a/src/main/resources/templates/faRpt/faRptViewModal.html +++ b/src/main/resources/templates/faRpt/faRptViewModal.html @@ -5,98 +5,48 @@
+ +
+ +
+
+ +
+ +
+
+
+
+
+