This commit is contained in:
lunaticbum
2024-10-23 10:07:45 +09:00
parent c4001848fc
commit 69d2df4ac4
19 changed files with 513 additions and 81 deletions
@@ -51,14 +51,16 @@
</script>
</th:block>
<th:block layout:fragment="content" id="content">
<input id="title_layer" />
<div id="editor" ></div>
<div id="hashtag_layer">
<select > </select>
<input id="hashtag" />
</div>
<div id="controll_layer" >
<button onclick="save()">asdsad</button>
<div id="main_layer">
<input id="title_layer" />
<div id="editor" ></div>
<div id="hashtag_layer">
<select > </select>
<input id="hashtag" />
</div>
<div id="controll_layer" >
<button onclick="save()">asdsad</button>
</div>
</div>
</th:block>
</html>
@@ -7,6 +7,7 @@
<th:block layout:fragment="head" id="head">
<script type="text/javascript" th:src="@{https://code.jquery.com/jquery-3.5.1.min.js}" crossorigin="anonymous"></script>
<script type="text/javascript" th:src="@{/js/toast-ui.js}"></script>
<script type="text/javascript" th:src="@{/js/blog.js}"></script>
<link th:href="@{/css/blog.css}" rel="stylesheet" />
<link th:href="@{/css/toast-ui.css}" rel="stylesheet" />
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
@@ -63,12 +64,12 @@
addImageBlobHook: (blob, callback) => {
const formData = new FormData();
formData.append('file', blob);
let url = 'post/images/';
let uploadUrl = location.protocol + "//" + location.hostname + "/blog/post/imageUpload";
let imageUrl = location.protocol + "//" + location.hostname + '/blog/post/images/';
$.ajax({
type: 'POST',
enctype: 'multipart/form-data',
url: 'post/imageUpload',
url: uploadUrl,
data: formData,
dataType: 'json',
processData: false,
@@ -76,8 +77,8 @@
cache: false,
timeout: 600000,
success: function (data) {
url += data.fileName;
callback(url, '사진 대체 텍스트 입력');
imageUrl += data.fileName;
callback(imageUrl, '사진 대체 텍스트 입력');
},
error: function (e) {
callback('image_load_fail', '사진 대체 텍스트 입력');
@@ -89,20 +90,27 @@
}
function save() {
console.log(editor.getHTML())
console.log(editor.getMarkdown())
onclickWrite([[${enc}]],[[${keyword}]],editor.getMarkdown())
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">
<div id="main_layer">
<div class="layer">
<input id="title_layer" />
</div>
<div id="editor" ></div>
<div class="layer">
<select > </select>
<input id="hashtag" />
<button id="save" onclick="save()">asdsad</button>
</div>
<th:block th:if="${PERMISSION != 'OK'}">
<h1>권한이 없는 뎁쇼?!</h1>
</th:block>
<th:block th:if="${PERMISSION == 'OK'}">
<div class="layer">
<input id="title_field" />
</div>
<div id="editor" ></div>
<div class="layer">
<select > </select>
<input id="hashtag_field" />
<button id="save" onclick="save()">asdsad</button>
</div>
</th:block>
</div>
</th:block>
</html>