This commit is contained in:
lunaticbum
2024-10-10 17:37:22 +09:00
parent 86060d7471
commit a810db5d25
20 changed files with 40374 additions and 107 deletions
@@ -1,24 +1,19 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/default_layout}">
<th:block layout:fragment="head">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TOAST UI Editor CDN(JS) -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>-->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>-->
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>-->
<html
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/default_layout}"
>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"></script>
<!-- TOAST UI Editor CDN(CSS) -->
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.min.css" />
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor-dark.css" />
<title>Spring Boot</title>
<script type="text/javascript" th:src="@{/js/toast-ui.js}"></script>
<link th:href="@{/css/toast-ui.css}" rel="stylesheet" />
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<!-- <link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor-dark.css" />-->
<script th:inline="javascript">
let editor
let onChange = () => {console.log(editor.getMarkdown())}
document.addEventListener("DOMContentLoaded", onLoaded);
function onLoaded() {
var h = document.querySelector('#content').getBoundingClientRect().height + 'px'
editor = new toastui.Editor({
@@ -49,20 +44,18 @@
"let test= = 'real test'\n" +
"```"
,
theme:"dark",
initialEditType:"wysiwyg",
// events : {
// change : this.onChange
// },
hooks: {
addImageBlobHook: (blob, callback) => {
const formData = new FormData();
formData.append('file', blob);
let url = 'blog/post/images/';
let url = 'post/images/';
$.ajax({
type: 'POST',
enctype: 'multipart/form-data',
url: 'blog/post/imageUpload',
url: 'post/imageUpload',
data: formData,
dataType: 'json',
processData: false,
@@ -82,26 +75,19 @@
});
}
function save() {
console.log(editor.getMarkdown())
console.log(editor.getHTML())
}
</script>
<link th:href="@{/css/common.css}" rel="stylesheet" />
<script type="text/javascript" th:src="@{/js/common.js}"></script>
<script type="text/javascript" th:src="@{/js/user.js}"></script>
</th:block>
<body onload="onLoaded()">
<th:block layout:fragment="header" th:include="@{/fragments/header}"></th:block>
<div layout:fragment='content' class='content' id='content' style="padding: 10px">
<input id="title_layer" style="width:100%; height:50px; font-size:30px; border-width: 1px; align-content: center; margin: 10px"/>
<div id="editor" style="width:90%; font-size:15px; border-width: 0px; align-content: center"></div>
</head>
<div layout:fragment="content" id="content">
<input id="title_layer" />
<div id="editor" ></div>
<div id="hashtag_layer">
<select style="width:40%; height:30px; font-size:15px; border-width: 0px"> </select>
<input id="hashtag" style="width:40%; height:30px; font-size:15px; border-width: 0px"/>
<select > </select>
<input id="hashtag" />
</div>
<div id="controll_layer" style="width: 100%">
<div id="controll_layer" >
<button onclick="save()">asdsad</button>
</div>
</div>
<th:block layout:fragment="footer" th:include="@{/fragments/footer}"></th:block>
</body>
</html>
</html>