Files
quinn-bbc/src/main/resources/templates/question/editor.html
2022-05-02 22:11:21 +08:00

122 lines
5.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>问答-Quinn</title>
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
<link rel="stylesheet" th:href="@{/editormd/css/editormd.css}"/>
<style>
.nav-underline .nav-link {
padding-top: .75rem;
padding-bottom: .75rem;
font-size: .875rem;
color: #6c757d;
}
</style>
</head>
<body style="background: #f2f2f2;">
<!-- 导航栏 -->
<div th:replace="~{common/header::header(activeUrl='question')}"></div>
<main role="main" class="container mt-3 p-3 bg-white rounded">
<div class="row">
<div class="col-md-12 blog-main">
<div class="col-md-12 order-md-1">
<h4 class="mb-3">编辑问题</h4>
<form class="needs-validation" th:action="@{/question/editor}" method="post">
<!-- 隐藏域 -->
<input type="hidden" name="qid" th:value="${question.getQid()}">
<div class="row">
<div class="col-md-10 mb-3">
<label for="firstName">问题标题</label>
<input th:value="${question.getTitle()}" name="title" type="text" class="form-control" id="firstName" value="" required>
</div>
<div class="col-md-2 mb-3">
<label for="country">标签</label>
<select name="categoryId" class="custom-select d-block w-100" id="country">
<option th:each="category:${categoryList}"
th:selected="${question.getCategoryId() == category.getId()}"
th:value="${category.getId()}" th:text="${category.getCategory()}">
</option>
</select>
</div>
<div class="col-md-12 mb-3">
<p>问题详情</p>
<div id="blog-content">
<textarea name="content" required th:text="${question.getContent()}" id="content" style="display:none;" rows="3" class="form-control"> </textarea>
</div>
</div>
</div>
<button class="btn btn-primary btn-lg btn-block" type="submit">提交修改</button>
</form>
</div>
</div>
</div>
</main>
<div th:replace="~{common/footer::footer}"></div>
<a class="to-top">返回顶部</a>
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/js/toTop.js}"></script>
<script th:src="@{/js/jquery-ui.min.js}"></script>
<script th:src="@{/live/js/addlive2d.js}"></script>
<script th:src="@{/editormd/editormd.js}"></script>
<script type="text/javascript">
var testEditor;
$(function() {
testEditor = editormd("blog-content", {
width : "100%",
height : 500,
syncScrolling : "single",
path : "/editormd/lib/",
saveHTMLToTextarea : true, // 保存 HTML 到 Textarea
// [TOCM] [TOC] 自动生成目录
tocDropdown : false,
tocStartLevel : 1, // Parse beginning of H2, Default value 1
emoji: true,
tex : true, // 开启科学公式TeX语言支持默认关闭
flowChart : true, // 开启流程图支持,默认关闭
sequenceDiagram : true, // 开启时序/序列图支持,默认关闭,
//图片上传
imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "/question/write/file/upload",
onload : function() {
console.log('onload', this);
},
/*指定需要显示的功能按钮*/
toolbarIcons : function() {
return ["undo","redo","|",
"bold","del","italic","quote","ucwords","uppercase","lowercase","|",
"list-ul","list-ol","hr","|",
"link","reference-link","image",
"code-block","table","datetime","emoji","html-entities","|",
"search","watch","preview","fullscreen"]
},
onfullscreen : function() {
console.log("onfullscreen");
document.getElementsByClassName("navbar")[0].style.display="none";
},
onfullscreenExit : function() {
console.log("onfullscreenExit");
document.getElementsByClassName("navbar")[0].style.display="";
}
});
});
</script>
</body>
</html>