[Spring][쇼핑몰 프로젝트][18] 상품 등록 - 위지윅(wysiwyg) 에디터 적용

https://kimvampa.tistory.com/193
This commit is contained in:
SeoJin Kim
2021-03-23 13:30:12 +09:00
parent 136e1c9ef9
commit 804616c615
6 changed files with 50 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/26.0.0/classic/ckeditor.js"></script>
</head>
</head>
<body>
@@ -90,7 +91,7 @@
<label>책 소개</label>
</div>
<div class="form_section_content">
<input name="bookIntro">
<textarea name="bookIntro" id="bookIntro_textarea"></textarea>
</div>
</div>
<div class="form_section">
@@ -98,7 +99,7 @@
<label>책 목차</label>
</div>
<div class="form_section_content">
<input name="bookContents">
<textarea name="bookContents" id="bookContents_textarea"></textarea>
</div>
</div>
</form>
@@ -131,6 +132,24 @@ $("#enrollBtn").on("click",function(e){
});
/* 위지윅 적용 */
/* 책 소개 */
ClassicEditor
.create(document.querySelector('#bookIntro_textarea'))
.catch(error=>{
console.error(error);
});
/* 책 목차 */
ClassicEditor
.create(document.querySelector('#bookContents_textarea'))
.catch(error=>{
console.error(error);
});
</script>
</body>

View File

@@ -139,6 +139,9 @@ ul{
text-align-last: center;
}
.ck-content { /* ckeditor 높이 */
height: 170px;
}
/* 버튼 영역 */
.btn_section{

View File

@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Mon Mar 22 16:56:34 KST 2021
#Tue Mar 23 08:56:29 KST 2021
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa
m2e.projectName=VamPa
groupId=com.vam

View File

@@ -11,6 +11,7 @@
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/26.0.0/classic/ckeditor.js"></script>
</head>
</head>
<body>
@@ -90,7 +91,7 @@
<label>책 소개</label>
</div>
<div class="form_section_content">
<input name="bookIntro">
<textarea name="bookIntro" id="bookIntro_textarea"></textarea>
</div>
</div>
<div class="form_section">
@@ -98,7 +99,7 @@
<label>책 목차</label>
</div>
<div class="form_section_content">
<input name="bookContents">
<textarea name="bookContents" id="bookContents_textarea"></textarea>
</div>
</div>
</form>
@@ -131,6 +132,24 @@ $("#enrollBtn").on("click",function(e){
});
/* 위지윅 적용 */
/* 책 소개 */
ClassicEditor
.create(document.querySelector('#bookIntro_textarea'))
.catch(error=>{
console.error(error);
});
/* 책 목차 */
ClassicEditor
.create(document.querySelector('#bookContents_textarea'))
.catch(error=>{
console.error(error);
});
</script>
</body>

View File

@@ -139,6 +139,9 @@ ul{
text-align-last: center;
}
.ck-content { /* ckeditor 높이 */
height: 170px;
}
/* 버튼 영역 */
.btn_section{

View File

@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Mon Mar 22 16:56:35 KST 2021
#Tue Mar 23 08:56:29 KST 2021
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa_MySQL
m2e.projectName=VamPa_MySQL
groupId=com.vam