1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-25 04:07:17 +08:00
This commit is contained in:
koogua 2022-08-08 17:11:28 +08:00
parent 5d2a4b8b11
commit 107c54dba9
9 changed files with 14 additions and 259 deletions

View File

@ -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 - 增加应用内命令行migrations
- 移除群组和微聊模块 - 移除群组和微聊模块
- kindeditor替换vditor - markdown转html
### [v1.5.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.5)(2022-07-27) ### [v1.5.5](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.5)(2022-07-27)

View File

@ -38,16 +38,11 @@
{% endblock %} {% endblock %}
{% block link_css %}
{{ css_link('lib/vditor/dist/index.css') }}
{% endblock %}
{% block include_js %} {% 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/answer.edit.js') }}
{{ js_include('home/js/vditor.js') }}
{% endblock %} {% endblock %}

View File

@ -33,16 +33,11 @@
{% endblock %} {% endblock %}
{% block link_css %}
{{ css_link('lib/vditor/dist/index.css') }}
{% endblock %}
{% block include_js %} {% 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/answer.edit.js') }}
{{ js_include('home/js/vditor.js') }}
{% endblock %} {% endblock %}

View File

@ -73,17 +73,12 @@
{% endblock %} {% endblock %}
{% block link_css %}
{{ css_link('lib/vditor/dist/index.css') }}
{% endblock %}
{% block include_js %} {% block include_js %}
{{ js_include('lib/vditor/dist/index.min.js') }}
{{ js_include('lib/xm-select.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/article.edit.js') }}
{{ js_include('home/js/vditor.js') }}
{% endblock %} {% endblock %}

View File

@ -53,17 +53,12 @@
{% endblock %} {% endblock %}
{% block link_css %}
{{ css_link('lib/vditor/dist/index.css') }}
{% endblock %}
{% block include_js %} {% block include_js %}
{{ js_include('lib/vditor/dist/index.min.js') }}
{{ js_include('lib/xm-select.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/question.edit.js') }}
{{ js_include('home/js/vditor.js') }}
{% endblock %} {% endblock %}

View File

@ -29,19 +29,6 @@
color: rgba(255, 255, 255, .7); 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 { .red {
color: red; color: red;
} }

View File

@ -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());
});
});

View File

@ -120,18 +120,6 @@
width: 320px; 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 { .writer-sidebar {
padding: 20px; padding: 20px;
} }

View File

@ -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');
});
});