代码INIT
This commit is contained in:
118
src/main/resources/templates/blog/editor.html
Normal file
118
src/main/resources/templates/blog/editor.html
Normal file
@@ -0,0 +1,118 @@
|
||||
<!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='blog')}"></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="@{/blog/editor}" method="post">
|
||||
<!-- 隐藏域 -->
|
||||
<input type="hidden" name="bid" th:value="${blog.getBid()}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 mb-3">
|
||||
<label for="firstName">博客标题</label>
|
||||
<input required th:value="${blog.getTitle()}" name="title" type="text" class="form-control" id="firstName">
|
||||
</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="${blog.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 required name="content" th:text="${blog.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="@{/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>
|
||||
123
src/main/resources/templates/blog/list.html
Normal file
123
src/main/resources/templates/blog/list.html
Normal file
@@ -0,0 +1,123 @@
|
||||
<!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}">
|
||||
</head>
|
||||
<body style="background: #f2f2f2;">
|
||||
|
||||
<div th:replace="~{common/header::header(activeUrl='blog')}"></div>
|
||||
|
||||
<main role="main" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9 blog-main">
|
||||
|
||||
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
||||
|
||||
<h6 class="border-bottom border-gray pb-2 mb-0">
|
||||
Q&A 累计:
|
||||
<span th:text="${pageParam.getTotal()}"></span>
|
||||
<span class="float-right" th:if="${!#strings.isEmpty(thisCategoryName)}">
|
||||
<a th:href="@{/blog}">全部</a>
|
||||
/
|
||||
<span th:text="${thisCategoryName}"></span>
|
||||
</span>
|
||||
</h6>
|
||||
|
||||
<div th:each="blog:${blogList}" class="media text-muted pt-3">
|
||||
<!-- 头像 -->
|
||||
<img th:src="${blog.getAuthorAvatar()}" style="border-radius: 5px " width="32" height="32">
|
||||
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
|
||||
<!-- 标题 -->
|
||||
<a th:text="${blog.getTitle()}"
|
||||
th:href="@{'/blog/read/'+${blog.getBid()}}"
|
||||
class="text-dark font-weight-bold text-decoration-none d-block">
|
||||
</a>
|
||||
<!-- 浏览量 -->
|
||||
<span>
|
||||
<svg class="bi bi-eye-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
|
||||
<path fill-rule="evenodd" d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
|
||||
</svg>
|
||||
[[${blog.getViews()}]]
|
||||
</span>
|
||||
<!-- 时间 -->
|
||||
<span th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd')}"
|
||||
class="badge badge-light float-right">
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!--分页-->
|
||||
<nav aria-label="Page navigation example" class="mt-4">
|
||||
<ul class="pagination justify-content-center pagination-sm">
|
||||
<li th:class="${pageParam.hasPrevious()==true?'page-item':'page-item disabled'}">
|
||||
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()-1}+'/10'}" tabindex="">Previous</a>
|
||||
</li>
|
||||
<li class="page-item" th:if="${pageParam.hasPrevious()}">
|
||||
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()-1}+'/10'}" th:text="${pageParam.getCurrent()-1}"></a>
|
||||
</li>
|
||||
<li class="page-item active">
|
||||
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()}+'/10'}" th:text="${pageParam.getCurrent()}"></a>
|
||||
</li>
|
||||
<li class="page-item" th:if="${pageParam.hasNext()}">
|
||||
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()+1}+'/10'}" th:text="${pageParam.getCurrent()+1}"></a>
|
||||
</li>
|
||||
<li th:class="${pageParam.hasNext()==true?'page-item':'page-item disabled'}">
|
||||
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()+1}+'/10'}" >Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<aside class="col-md-3 blog-sidebar">
|
||||
|
||||
<div class="my-3 rounded">
|
||||
<p class="mb-0">
|
||||
<a th:href="@{/blog/write}" class="btn btn-primary btn-sm btn-block" style="color: white">写文章</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="p-4 my-3 bg-white rounded">
|
||||
<p class="mb-0"> 社区公约: <br> 禁止瞎水博客,内容尽量有实际意义,禁止任何形式的广告,违者暂停账号使用! 申请分类可以在Q群@小狂神 </p>
|
||||
</div>
|
||||
|
||||
<div class="p-4 my-3 bg-white rounded">
|
||||
<a th:href="@{'/blog/category/'+${category.getId()}+'/1/10'}"
|
||||
th:each="category:${categoryList}" th:text="${category.getCategory()}"
|
||||
class="badge badge-pill badge-primary mr-1"></a>
|
||||
</div>
|
||||
|
||||
<div class="p-4 my-3 bg-white rounded">
|
||||
<h4 class="font-italic">友情链接</h4>
|
||||
<ol class="list-unstyled">
|
||||
<li><a href="https://gitee.com/quinn">Gitee</a></li>
|
||||
<li><a href="https://space.bilibili.com/95256449">Bilibili</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
</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>
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
148
src/main/resources/templates/blog/read.html
Normal file
148
src/main/resources/templates/blog/read.html
Normal file
@@ -0,0 +1,148 @@
|
||||
<!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}">
|
||||
<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='blog')}"></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="blog-post">
|
||||
<h2 class="blog-post-title" th:text="${blog.getTitle()}"></h2>
|
||||
<p class="blog-post-meta">
|
||||
<span th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd')}"></span>
|
||||
by
|
||||
<a href="#" th:text="${blog.getAuthorName()}"></a>
|
||||
<span>
|
||||
<svg class="bi bi-eye-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
|
||||
<path fill-rule="evenodd" d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
|
||||
</svg>
|
||||
[[${blog.getViews()}]]
|
||||
</span>
|
||||
<!-- 自己写的文章可以编辑和删除 -->
|
||||
<a th:if="${session.loginUser.getUid()==blog.getAuthorId()}"
|
||||
class="float-right" style="color: red"
|
||||
th:href="@{'/blog/delete/'+${session.loginUser.getUid()}+'/'+${blog.getBid()}}"
|
||||
onclick="if(!confirm('你确认要删除吗?')) return false;">
|
||||
<svg class="bi bi-x-square" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
|
||||
<path fill-rule="evenodd" d="M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z"/>
|
||||
<path fill-rule="evenodd" d="M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z"/>
|
||||
</svg>
|
||||
删除
|
||||
</a>
|
||||
<a th:if="${session.loginUser.getUid()==blog.getAuthorId()}"
|
||||
class="float-right mr-3"
|
||||
th:href="@{'/blog/editor/'+${session.loginUser.getUid()}+'/'+${blog.getBid()}}">
|
||||
<svg class="bi bi-pencil-square" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456l-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
|
||||
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/>
|
||||
</svg>
|
||||
编辑
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<hr style="margin-top: 18px">
|
||||
|
||||
<!--文章主体内容-->
|
||||
<div id="doc-content">
|
||||
<textarea th:text="${blog.getContent()}" style="display:none;" placeholder="markdown"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 blog-main" style="margin-top: 20px">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 blog-main" style="margin-top: 20px">
|
||||
<form th:action="@{'/blog/comment/'+${blog.getBid()}}" method="post">
|
||||
<input type="hidden" name="userId" th:value="${session.loginUser.getUid()}">
|
||||
<input type="hidden" name="userName" th:value="${session.loginUser.getUsername()}">
|
||||
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
|
||||
<input type="hidden" name="topicId" th:value="${blog.getBid()}">
|
||||
<div class="form-group">
|
||||
<textarea name="content" class="form-control" rows="3" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary float-right">提交评论</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div th:if="${commentList.size()!=0}" class="col-md-12 blog-main" style="margin-top: 20px">
|
||||
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
||||
<h6 class="border-bottom border-gray pb-2 mb-0">评论列表</h6>
|
||||
|
||||
<div th:each="comment:${commentList}" class="media text-muted pt-3">
|
||||
<img th:src="${comment.getUserAvatar()}" style="border-radius: 5px;margin-right: 5px " width="32" height="32">
|
||||
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
|
||||
<strong class="d-block text-gray-dark" th:text="${comment.getUserName()}"></strong>
|
||||
<span th:text="${comment.getContent()}"></span>
|
||||
<span th:text="${#dates.format(comment.getGmtCreate(),'yyyy-MM-dd')}" class="badge badge-light float-right"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:if="${commentList.size()==0}" class="col-md-12 blog-main" style="margin-top: 20px">
|
||||
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
||||
<h6 class="pb-2 mb-0 text-center">emmm... 这里暂时还没有评论....</h6>
|
||||
</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>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/editormd/css/editormd.preview.css}" />
|
||||
<script th:src="@{/editormd/lib/marked.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/prettify.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/raphael.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/underscore.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/sequence-diagram.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/flowchart.min.js}"></script>
|
||||
<script th:src="@{/editormd/lib/jquery.flowchart.min.js}"></script>
|
||||
<script th:src="@{/editormd/editormd.js}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var testEditor;
|
||||
$(function () {
|
||||
testEditor = editormd.markdownToHTML("doc-content", {//注意:这里是上面DIV的id
|
||||
htmlDecode: "style,script,iframe",
|
||||
emoji: true,
|
||||
taskList: true,
|
||||
tocm: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true, // 默认不解析
|
||||
codeFold: true
|
||||
});});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
121
src/main/resources/templates/blog/write.html
Normal file
121
src/main/resources/templates/blog/write.html
Normal file
@@ -0,0 +1,121 @@
|
||||
<!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='blog')}"></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="@{/blog/write}" method="post">
|
||||
<!-- 隐藏域 -->
|
||||
<input type="hidden" name="authorId" th:value="${session.loginUser.getUid()}">
|
||||
<input type="hidden" name="authorName" th:value="${session.loginUser.getUsername()}">
|
||||
<input type="hidden" name="authorAvatar" th:value="${session.loginUser.getAvatar()}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 mb-3">
|
||||
<label for="firstName">文章标题</label>
|
||||
<input type="text" name="title" 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:value="${category.getId()}" th:text="${category.getCategory()}">
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mb-3">
|
||||
<p>文章内容</p>
|
||||
<div id="blog-content">
|
||||
<textarea required name="content" 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="@{/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] 自动生成目录
|
||||
tocm : true,
|
||||
tocContainer : "",
|
||||
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>
|
||||
Reference in New Issue
Block a user