Vanessa219 / vditor

♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
https://b3log.org/vditor
MIT License
8.44k stars 867 forks source link

类似UEditor的多图上传功能,上传时可以选择已在服务器中的图片 #576

Closed ElderJames closed 2 years ago

ElderJames commented 4 years ago

你在什么场景下需要该功能?

在管理图片时很需要,同一张图片可以重复使用。而且还不需要再从本地找已经有的图片

描述可能的解决方案

参考UEditor的多图上传功能,分两个模块

Seanxwy commented 4 years ago

非常需要这个功能。同问如何实现。

88250 commented 4 years ago

感谢反馈,估计需要拉取服务端用户空间已上传的文件作为候选列表,接口形式需要定义好,大家有什么建议吗?

Seanxwy commented 4 years ago

1、vditor自动集成图库功能,服务器接口提供数据 数据可以包含文件数据编号,上传文件名,路径,大小之类的,同时可以支持查询筛选。这个是最方便的,毕竟大量的开发并不会制作自定义插件 2、提供自定义按钮和插入图片接口,这样方便有自定义扩展需求的人,也可以自己做这个部分,调用对应的接口实现插入。

ElderJames commented 4 years ago

组件可以指定接口格式,接口提供响应即可。

88250 commented 4 years ago

组件可以指定接口格式,接口提供响应即可。

能帮忙考虑一下具体接口定义吗?不然我怕我们 YY 出来的接口不好用哦。

herbert888 commented 4 years ago

其实只要: 1、自定义工具 2、插入插入代码的函数

jakekwak commented 4 years ago

module based?

Users can develop their own modules.

So that users can use the modules only what we want

  module: {
    wysiwyg,
    ir,
    sv,
    mermaid,
    abcjs,
    katex,
    mindmap,
    echarts,
    graphviz,
    user_defined1,
    user_defined2,
    ...
  },
ElderJames commented 4 years ago

@88250 @Vanessa219 按照 ueditor 的协议应该就可以了,这里有一个node.js的版本 https://github.com/netpi/ueditor

如果用了这个协议,很多用了 ueditor 的项目就能很方便地迁移过来了。

Seanxwy commented 4 years ago

有计划什么时候实现该功能特性吗?

Vanessa219 commented 4 years ago

要先把 https://github.com/Vanessa219/vditor/milestone/10 这些和新提的 bug 弄完。这个还没有计划的。

Seanxwy commented 4 years ago

@Vanessa219 下一个版本能实现这个功能特性吗?很需要也

Vanessa219 commented 4 years ago

@yuanxiongwei 目前在做 https://b3log.org/siyuan ,可能只会对 bug 进行修复。

Seanxwy commented 4 years ago

@Vanessa219 是否意味着短时间内改特性无法获得支持?

在有需要自己做图库的时候情况下,是否可以自定义增加工具栏按钮,并且通过insertValue的方式把图库中图片地址插入来临时满足

Vanessa219 commented 4 years ago

@yuanxiongwei 可以的

zuozuomu-z commented 2 years ago

@Vanessa219是否有迹象改变特性无法获得支持?

在有需要自己做图库的时候情况下,是否可以自定义增加工具栏按钮,并且可以通过插入值的方式把图库中图片插入来临时满足

您好,我现在也需要一个相同的功能。我现在有自定义的一个图片管理器,并用vditor自定义扩展工具关联起来,它可以返回给我已存在服务器的图片路径,我该怎么样实现它在文本框里展示出来

Vanessa219 commented 2 years ago

用 insertValue 插入 ![](图片地址) 试试

zuozuomu-z commented 2 years ago

用 insertValue 插入 ![](图片地址) 试试

是的。我已经用这个插入方法实现想要的效果了,谢谢。

88250 commented 2 years ago

抱歉各位,我们没有时间精力改进这里了,所以暂时不考了,感谢各位讨论。