mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-21 03:44:17 +08:00
1、实现富文本粘贴图片
2、以项目标识组织图片
This commit is contained in:
@@ -20,6 +20,20 @@ $(function () {
|
||||
window.editor.history.redo();
|
||||
});
|
||||
|
||||
uploadImage("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 range = window.editor.getSelection();
|
||||
window.editor.insertEmbed(range.index, 'image', $res.url);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#btnRelease").on("click",function () {
|
||||
if (Object.prototype.toString.call(window.documentCategory) === '[object Array]' && window.documentCategory.length > 0) {
|
||||
if ($("#markdown-save").hasClass('change')) {
|
||||
@@ -72,7 +86,7 @@ $(function () {
|
||||
layer.msg(data.message);
|
||||
}else{
|
||||
var range = window.editor.getSelection();
|
||||
editor.insertEmbed(range.index, 'image', data.url);
|
||||
window.editor.insertEmbed(range.index, 'image', data.url);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user