50 lines
2.2 KiB
HTML
Raw Normal View History

2024-10-10 17:37:22 +09:00
<!DOCTYPE html>
<html
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/default_layout}"
>
2024-10-21 17:25:49 +09:00
<th:block layout:fragment="head">
2024-10-10 17:37:22 +09:00
<script type="text/javascript" th:src="@{/js/toast-ui-view.js}"></script>
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
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" />
2024-10-10 17:37:22 +09:00
<script th:inline="javascript">
let editor
let onChange = () => {console.log(editor.getMarkdown())}
document.addEventListener("DOMContentLoaded", onLoaded);
function onLoaded() {
2024-11-07 14:01:21 +09:00
baseData.title = [[${srcPost.title}]];
baseData.content = [[${srcPost.content}]];
baseData.firstPostLon = [[${srcPost.firstPostLon}]];
baseData.firstPostLat = [[${srcPost.firstPostLat}]];
document.getElementById('location_field').textContent = "Lat: " + baseData.firstPostLat + ", Lon: " + baseData.firstPostLon;
$('#title_layer').text(baseData.title)
var h = document.querySelector('#main_layer').getBoundingClientRect().height * 0.7
2024-10-10 17:37:22 +09:00
editor = new toastui.Editor({
el: document.querySelector('#editor'),
2024-11-07 14:01:21 +09:00
height: h+ 'px',
2024-10-10 17:37:22 +09:00
width:'100%',
viewer: true,
usageStatistics : false,
2024-10-25 18:28:25 +09:00
initialValue:baseData.content,
2024-10-10 17:37:22 +09:00
theme:"dark",
});
}
</script>
2024-10-21 17:25:49 +09:00
</th:block>
<th:block layout:fragment="content" id="content">
2024-10-23 10:07:45 +09:00
<div id="main_layer">
2024-11-07 14:01:21 +09:00
<label id="title_layer" class="write_option" ></label>
2024-10-23 10:07:45 +09:00
<div id="editor" ></div>
2024-11-07 14:01:21 +09:00
<div class="write_controllbox">
<div class="write_option btn-example" to="#popLayer1" onclick="openPopup(this)" ></div>
<div style="width: 15px" ></div>
<div class="write_option btn-example" to="#popLayer2" onclick="openPopup(this)" id="hashtag_field"></div>
<div style="width: 15px" ></div>
<label class="write_option" readonly id="location_field"></label>
2024-10-23 10:07:45 +09:00
</div>
2024-10-10 17:37:22 +09:00
</div>
2024-10-21 17:25:49 +09:00
</th:block>
2024-10-10 17:37:22 +09:00
</html>