50 lines
2.1 KiB
HTML
Raw Normal View History

2024-10-05 19:42:29 +09:00
<!DOCTYPE html>
2024-10-23 10:07:45 +09:00
<html
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/default_layout}">
2024-10-05 19:42:29 +09:00
<th:block layout:fragment="head">
2024-10-25 18:28:25 +09:00
<script type="text/javascript" th:src="@{/js/blog.js}"></script>
<link th:href="@{/css/blog.css}" rel="stylesheet" />
<script type="text/javascript" th:src="@{/js/toast-ui-view.js}"></script>
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
let editor
document.addEventListener("DOMContentLoaded", onLoaded);
function onLoaded() {
var els = document.getElementsByClassName('content')
for (i=0;i<els.length;i++) {
var item = $(els[i])
console.log(item[0])
2024-10-05 19:42:29 +09:00
2024-10-25 18:28:25 +09:00
console.log(item.attr("data"))
new toastui.Editor({
el: item[0],
width : (item[0].getBoundingClientRect().width * 0.8) + 'px',
height : (item[0].getBoundingClientRect().width * 0.8) + 'px',
viewer: true,
usageStatistics : false,
initialValue: item.attr("data"),
theme:"dark",
});
}
}
</script>
2024-10-05 19:42:29 +09:00
</th:block>
2024-10-23 10:07:45 +09:00
<th:block layout:fragment="content" id="content">
2024-10-25 18:28:25 +09:00
<div id="main_layer">
<div class="post_layer">
<th:block class="posts_layer" id="posts" th:each="post : ${Posts}">
<div class="post_item" th:onclick="goToView([[${path}]],[[${post.id}]])" >
<span id="postTitle" class="post_attr" th:text="${post.title}"></span>
<div id="content" class="post_attr content" th:attr="data=${post.content}"></div>
<span id="writeDate" class="post_attr" th:text="${#dates.format(post.writeTime, 'yyyy.MM.dd HH:mm:ss')}"></span>
<span id="postId" class="post_attr" th:text="${post.id}"></span>
</div>
</th:block>
</div>
</div>
2024-10-23 10:07:45 +09:00
</th:block>
</html>