mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-12-19 19:57:09 +08:00
功能优化和新增 (#956)
* feat: 首页项目拖拽排序功能 * feat: 增加首页项目拖拽排序增加只能管理员进行, 排序失败元素回到原本位置 * perf: 新建文章以后直接进入到编辑文章页面 * perf: 优化文档打开时或刷新时样式闪动问题 * perf: 优化表格样式 * feat: 支持上传视频功能 * feat: 视频样式调整 * feat: 直接粘贴视频上传功能 * perf: 优化markdown目录显示
This commit is contained in:
@@ -245,18 +245,22 @@ $(function () {
|
||||
|
||||
//如果没有选中节点则选中默认节点
|
||||
openLastSelectedNode();
|
||||
uploadImage("docEditor", function ($state, $res) {
|
||||
uploadResource("docEditor", function ($state, $res) {
|
||||
if ($state === "before") {
|
||||
return layer.load(1, {
|
||||
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
|
||||
});
|
||||
} else if ($state === "success") {
|
||||
// if ($res.errcode === 0) {
|
||||
// var value = '';
|
||||
// 3xxx 20240602
|
||||
if ($res[0].errcode === 0) {
|
||||
var value = '';
|
||||
window.editor.insertValue(value);
|
||||
if ($res.errcode === 0) {
|
||||
if ($res.resource_type === 'video') {
|
||||
let value = `<video controls><source src="${$res.url}" type="video/mp4"></video>`;
|
||||
window.editor.insertValue(value);
|
||||
} else {
|
||||
let value = '';
|
||||
window.editor.insertValue(value);
|
||||
}
|
||||
} else {
|
||||
layer.msg("上传失败:" + $res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user