新增代码高亮,完善文章浏览体验

This commit is contained in:
augushong
2020-08-14 13:08:59 +08:00
parent cae557ac0c
commit 2a04ff970c
115 changed files with 10996 additions and 1294 deletions

View File

@@ -9,6 +9,7 @@
{include file="common/_require"}
<link rel="stylesheet" href="/static/lib/quill/quill.snow.css">
<script src="/static/lib/quill/quill.min.js"></script>
<script>
var currentHeaderNavItem = 'Post-{$Request.param.type|default="1"}';
var currentLeftNavItem = 'post-{$Request.param.type|default="1"}';
@@ -249,6 +250,7 @@
</div>
<script>
var categoryList = JSON.parse('{:json_encode($post->categorys->column("category_id"))}')
var tagList = JSON.parse('{:json_encode($post->tags->column("tag_id"))}')
layui.use(['form', 'upload', 'laydate'], function () {
@@ -274,8 +276,9 @@
});
quill.setContents(JSON.parse($('#content').text()))
console.log(JSON.parse($('#content').text()));
quill.setContents(JSON.parse($('#content').text()))
quill.on('selection-change', function (range, oldRange, source) {
if (range) {
@@ -299,7 +302,10 @@
console.log("An API call triggered this change.");
} else if (source == 'user') {
console.log("A user action triggered this change.");
}
});
upload.render({
@@ -380,7 +386,7 @@
function loadTags() {
$.get('{:url("Tag/index")}', {
page: tagPage,
type:'{$Request.param.type}'
type: '{$Request.param.type}'
}, function (result) {
tagPage++;
result.data.data.forEach(tag => {
@@ -427,8 +433,8 @@
function loadCategory() {
$.get('{:url("Category/index")}', {
type:'{$Request.param.type}'
},function (result) {
type: '{$Request.param.type}'
}, function (result) {
result.data.forEach(category => {
var prefix = '';