This commit is contained in:
lunaticbum
2024-10-11 17:17:57 +09:00
parent a810db5d25
commit 23ed2e43cc
6 changed files with 428 additions and 94 deletions
@@ -7,20 +7,33 @@
<head>
<script type="text/javascript" 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>
<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" />
<!-- <link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor-dark.css" />-->
<!-- <link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor-dark.css" />-->
<script th:inline="javascript">
let editor
var editor
let onChange = () => {console.log(editor.getMarkdown())}
document.addEventListener("DOMContentLoaded", onLoaded);
function onLoaded() {
var h = document.querySelector('#content').getBoundingClientRect().height + 'px'
var style = getComputedStyle(document.body)
console.log(style.getPropertyValue('--ContentVerticalMargin'))
console.log(window.c)
console.log(style.getPropertyValue('--FooterHeight'))
console.log(style.getPropertyValue('--TopHeight'))
var editorHeght = (
document.querySelector('#content').getBoundingClientRect().height -
(
Number(style.getPropertyValue('--ButtonHegit').replace("px","") * 3)
+ Number(style.getPropertyValue('--TopHeight').replace("px",""))
)
)
editor = new toastui.Editor({
el: document.querySelector('#editor'),
previewStyle: 'tab',
height: '500px',
width:'100%',
height: editorHeght+ 'px',
width:'95%',
theme:'dark',
usageStatistics : false,
toolbar:null,
@@ -80,14 +93,16 @@
</script>
</head>
<div layout:fragment="content" id="content">
<input id="title_layer" />
<div class="layer">
<input id="title_layer" />
</div>
<div id="editor" ></div>
<div id="hashtag_layer">
<div class="layer">
<select > </select>
<input id="hashtag" />
</div>
<div id="controll_layer" >
<button onclick="save()">asdsad</button>
<div id="layer" >
<button id="save" onclick="save()">asdsad</button>
</div>
</div>
</html>