From 107c54dba969b3dd64a6d31720d95f001d4888c5 Mon Sep 17 00:00:00 2001 From: koogua Date: Mon, 8 Aug 2022 17:11:28 +0800 Subject: [PATCH] v1.5.6 --- CHANGELOG.md | 3 +- app/Http/Home/Views/answer/add.volt | 11 +-- app/Http/Home/Views/answer/edit.volt | 11 +-- app/Http/Home/Views/article/edit.volt | 11 +-- app/Http/Home/Views/question/edit.volt | 11 +-- public/static/admin/css/common.css | 13 ---- public/static/admin/js/vditor.js | 98 ----------------------- public/static/home/css/common.css | 12 --- public/static/home/js/vditor.js | 103 ------------------------- 9 files changed, 14 insertions(+), 259 deletions(-) delete mode 100644 public/static/admin/js/vditor.js delete mode 100644 public/static/home/js/vditor.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d72e33cc..1a422486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -### [v1.5.6](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.6)(2022-08-17) +### [v1.5.6](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.6)(2022-08-08) - 增加应用内命令行migrations - 移除群组和微聊模块 +- kindeditor替换vditor - markdown转html ### [v1.5.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.5)(2022-07-27) diff --git a/app/Http/Home/Views/answer/add.volt b/app/Http/Home/Views/answer/add.volt index 2aebaaa1..879532b4 100644 --- a/app/Http/Home/Views/answer/add.volt +++ b/app/Http/Home/Views/answer/add.volt @@ -38,16 +38,11 @@ {% endblock %} -{% block link_css %} - - {{ css_link('lib/vditor/dist/index.css') }} - -{% endblock %} - {% block include_js %} - {{ js_include('lib/vditor/dist/index.min.js') }} + {{ js_include('lib/kindeditor/kindeditor.min.js') }} + {{ js_include('lib/kindeditor/lang/zh-CN.js') }} + {{ js_include('home/js/content.editor.js') }} {{ js_include('home/js/answer.edit.js') }} - {{ js_include('home/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/answer/edit.volt b/app/Http/Home/Views/answer/edit.volt index 0dcd465f..bf4e2c7f 100644 --- a/app/Http/Home/Views/answer/edit.volt +++ b/app/Http/Home/Views/answer/edit.volt @@ -33,16 +33,11 @@ {% endblock %} -{% block link_css %} - - {{ css_link('lib/vditor/dist/index.css') }} - -{% endblock %} - {% block include_js %} - {{ js_include('lib/vditor/dist/index.min.js') }} + {{ js_include('lib/kindeditor/kindeditor.min.js') }} + {{ js_include('lib/kindeditor/lang/zh-CN.js') }} + {{ js_include('home/js/content.editor.js') }} {{ js_include('home/js/answer.edit.js') }} - {{ js_include('home/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/article/edit.volt b/app/Http/Home/Views/article/edit.volt index c6a42f58..c4954799 100644 --- a/app/Http/Home/Views/article/edit.volt +++ b/app/Http/Home/Views/article/edit.volt @@ -73,17 +73,12 @@ {% endblock %} -{% block link_css %} - - {{ css_link('lib/vditor/dist/index.css') }} - -{% endblock %} - {% block include_js %} - {{ js_include('lib/vditor/dist/index.min.js') }} {{ js_include('lib/xm-select.js') }} + {{ js_include('lib/kindeditor/kindeditor.min.js') }} + {{ js_include('lib/kindeditor/lang/zh-CN.js') }} + {{ js_include('home/js/content.editor.js') }} {{ js_include('home/js/article.edit.js') }} - {{ js_include('home/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Home/Views/question/edit.volt b/app/Http/Home/Views/question/edit.volt index a2fe464a..14818f59 100644 --- a/app/Http/Home/Views/question/edit.volt +++ b/app/Http/Home/Views/question/edit.volt @@ -53,17 +53,12 @@ {% endblock %} -{% block link_css %} - - {{ css_link('lib/vditor/dist/index.css') }} - -{% endblock %} - {% block include_js %} - {{ js_include('lib/vditor/dist/index.min.js') }} {{ js_include('lib/xm-select.js') }} + {{ js_include('lib/kindeditor/kindeditor.min.js') }} + {{ js_include('lib/kindeditor/lang/zh-CN.js') }} + {{ js_include('home/js/content.editor.js') }} {{ js_include('home/js/question.edit.js') }} - {{ js_include('home/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/public/static/admin/css/common.css b/public/static/admin/css/common.css index 3308e2bb..7ce26329 100644 --- a/public/static/admin/css/common.css +++ b/public/static/admin/css/common.css @@ -29,19 +29,6 @@ color: rgba(255, 255, 255, .7); } -.layui-main .vditor-reset { - font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif; - color: #666; -} - -.vditor-reset ul > li { - list-style: disc; -} - -.vditor-reset ol > li { - list-style: decimal; -} - .red { color: red; } diff --git a/public/static/admin/js/vditor.js b/public/static/admin/js/vditor.js deleted file mode 100644 index 0cdd31fd..00000000 --- a/public/static/admin/js/vditor.js +++ /dev/null @@ -1,98 +0,0 @@ -layui.use(['jquery'], function () { - - var $ = layui.jquery; - - var $textarea = $('#vditor-textarea'); - - var toolbar = [ - 'emoji', - 'headings', - 'bold', - 'italic', - 'strike', - 'link', - '|', - 'list', - 'ordered-list', - 'check', - 'outdent', - 'indent', - '|', - 'quote', - 'line', - 'code', - 'inline-code', - 'insert-before', - 'insert-after', - '|', - 'upload', - 'table', - '|', - 'undo', - 'redo', - '|', - 'fullscreen', - 'edit-mode', - { - name: 'more', - toolbar: [ - 'both', - 'export', - 'preview', - 'info', - 'help', - ], - }]; - - var vditor = new Vditor('vditor', { - mode: 'sv', - minHeight: 300, - outline: false, - toolbar: toolbar, - resize: { - enable: true - }, - cache: { - enable: false - }, - preview: { - markdown: { - chinesePunct: true, - autoSpace: true - }, - actions: [] - }, - fullscreen: { - index: 9999 - }, - counter: { - enable: true, - max: 30000 - }, - upload: { - url: '/admin/upload/content/img', - linkToImgUrl: '/admin/upload/remote/img', - max: 10 * 1024 * 1024, - accept: 'image/*', - headers: { - 'X-Csrf-Token': $('meta[name="csrf-token"]').attr('content'), - 'X-Requested-With': 'XMLHttpRequest' - }, - success: function (editor, responseText) { - var json = JSON.parse(responseText); - var img = '![](' + json.data.src + ')'; - vditor.insertValue(img); - } - }, - value: $textarea.val(), - placeholder: '请输入描述内容' - }); - - /** - * 同步编辑器内容到表单 - */ - $('.kg-submit').on('click', function () { - $textarea.val(vditor.getValue()); - }); - -}); \ No newline at end of file diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css index 9c03ee8d..f962a5b4 100644 --- a/public/static/home/css/common.css +++ b/public/static/home/css/common.css @@ -120,18 +120,6 @@ width: 320px; } -.layui-main .vditor-reset { - font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif; -} - -.vditor-reset ul > li { - list-style: disc; -} - -.vditor-reset ol > li { - list-style: decimal; -} - .writer-sidebar { padding: 20px; } diff --git a/public/static/home/js/vditor.js b/public/static/home/js/vditor.js deleted file mode 100644 index 6704f3a7..00000000 --- a/public/static/home/js/vditor.js +++ /dev/null @@ -1,103 +0,0 @@ -layui.use(['jquery'], function () { - - var $ = layui.jquery; - - var $textarea = $('#vditor-textarea'); - - var toolbar = [ - 'emoji', - 'headings', - 'bold', - 'italic', - 'strike', - 'link', - '|', - 'list', - 'ordered-list', - 'check', - 'outdent', - 'indent', - '|', - 'quote', - 'line', - 'code', - 'inline-code', - 'insert-before', - 'insert-after', - '|', - 'upload', - 'table', - '|', - 'undo', - 'redo', - '|', - 'fullscreen', - 'edit-mode', - { - name: 'more', - toolbar: [ - 'both', - 'export', - 'preview', - 'info', - 'help', - ], - }]; - - var vditor = new Vditor('vditor', { - mode: 'sv', - minHeight: 450, - outline: false, - toolbar: toolbar, - resize: { - enable: true - }, - cache: { - enable: false - }, - preview: { - markdown: { - chinesePunct: true, - autoSpace: true - }, - actions: [] - }, - fullscreen: { - index: 9999 - }, - counter: { - enable: true, - max: 30000 - }, - upload: { - url: '/upload/content/img', - linkToImgUrl: '/upload/remote/img', - max: 10 * 1024 * 1024, - accept: 'image/*', - headers: { - 'X-Csrf-Token': $('meta[name="csrf-token"]').attr('content'), - 'X-Requested-With': 'XMLHttpRequest' - }, - success: function (editor, responseText) { - var json = JSON.parse(responseText); - var img = '![](' + json.data.src + ')'; - vditor.insertValue(img); - } - }, - value: $textarea.val(), - placeholder: '请输入内容描述' - }); - - $(window).bind('beforeunload', function () { - return '内容尚未保存,确定离开此页面吗?'; - }); - - /** - * 同步编辑器内容到表单 - */ - $('.kg-submit').on('click', function () { - $textarea.val(vditor.getValue()); - $(window).unbind('beforeunload'); - }); - -}); \ No newline at end of file