공지사항 에디터 수정.
parent
08cf38065f
commit
082f55756c
|
|
@ -1,3 +1,4 @@
|
||||||
|
var CrossEditor
|
||||||
$(document).on('click', '#commentSaveBtn', function (){
|
$(document).on('click', '#commentSaveBtn', function (){
|
||||||
if(!$("#comment").val()) {
|
if(!$("#comment").val()) {
|
||||||
alert("댓글을 입력해주세요.")
|
alert("댓글을 입력해주세요.")
|
||||||
|
|
@ -94,9 +95,18 @@ function getEditModal(publicKey, publicType){
|
||||||
]
|
]
|
||||||
});*/
|
});*/
|
||||||
setUploadDiv();
|
setUploadDiv();
|
||||||
var CrossEditor = new NamoSE('editor');
|
CrossEditor = new NamoSE('editor');
|
||||||
CrossEditor.params.ParentEditor = document.getElementById("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();
|
$("#editor").show();
|
||||||
|
/*CrossEditor.OnInitCompleted(function (e){
|
||||||
|
e.editorTarget.SetBodyValue(document.getElementById("pe_bhr").value);
|
||||||
|
})*/
|
||||||
CrossEditor.EditorStart();
|
CrossEditor.EditorStart();
|
||||||
|
|
||||||
$("#editModal").modal('show');
|
$("#editModal").modal('show');
|
||||||
|
|
@ -139,6 +149,7 @@ function savePublicBoard(formId, publicType){
|
||||||
if(contentCheck(formId)){
|
if(contentCheck(formId)){
|
||||||
if(confirm("저장하시겠습니까?")){
|
if(confirm("저장하시겠습니까?")){
|
||||||
contentFade("in");
|
contentFade("in");
|
||||||
|
$("#content").val("");
|
||||||
const formData = new FormData($("#"+formId)[0]);
|
const formData = new FormData($("#"+formId)[0]);
|
||||||
for(const file of files) {
|
for(const file of files) {
|
||||||
if(!file.isDelete)
|
if(!file.isDelete)
|
||||||
|
|
@ -147,6 +158,7 @@ function savePublicBoard(formId, publicType){
|
||||||
$(".text-decoration-line-through").each(function (idx, el){
|
$(".text-decoration-line-through").each(function (idx, el){
|
||||||
formData.append('fileSeq', $(el).attr("data-fileseq"));
|
formData.append('fileSeq', $(el).attr("data-fileseq"));
|
||||||
})
|
})
|
||||||
|
formData.append('content', CrossEditor.GetBodyValue());
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'POST',
|
type : 'POST',
|
||||||
data : formData,
|
data : formData,
|
||||||
|
|
@ -183,3 +195,8 @@ function contentCheck(formId){
|
||||||
flag = fileCheck(flag, files);
|
flag = fileCheck(flag, files);
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function OnInitCompleted(e){
|
||||||
|
e.editorTarget.SetBodyValue(document.getElementById("content").value);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3 row justify-content-center">
|
<div class="mb-3 row justify-content-center">
|
||||||
<label for="editor" class="col-sm-2 col-form-label text-center">내용</label>
|
<label for="editor" class="col-sm-2 col-form-label text-center">내용</label>
|
||||||
<div class="col-sm-10" id="editor" name='editor'>
|
<div class="col-sm-10">
|
||||||
<!--<textarea type='hidden' id="content" name='content' th:utext="${info.content}"></textarea>-->
|
<div id="editor" name='editor'></div>
|
||||||
|
<textarea id="content" class="d-none" th:utext="${info.content}"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue