简体   繁体   English

如何在网络应用上构建内嵌评论功能?

[英]How to build inline comments feature on web app?

I want to add an inline commenting feature to a simple webapp that I have. 我想向我拥有的简单Web应用程序添加内嵌评论功能。 Think Medium's inline comment system. 思考中型的内联评论系统。

What is the right approach to building this, especially the "in-context" part? 什么是构建此主题的正确方法,尤其是“上下文”部分? Eg should I edit the primary document, adding a "comment" div in the document, and save the whole document every time a comment is added? 例如,我应该编辑主文档,在文档中添加一个“ comment” div,并在每次添加注释时保存整个文档吗? Is there a better approach? 有没有更好的方法?

So far, I found that TinyMCE and CKEditor5 both have premium plugins for this. 到目前为止,我发现TinyMCECKEditor5都具有高级插件。 Since my product will be open, consumer (as opposed to SaaS) and free for now, I cannot afford to pay per active user (I'll be broke before my product gets reasonable traction). 由于我的产品现在是开放的,面向消费者(而不是SaaS)并且现在是免费的,因此我无力为每个活跃用户付费(在我的产品得到合理的吸引之前,我会破产的)。 Are there any open source inline-comment plugins for the 2 editors above? 上面的2个编辑器有开源的嵌入式注释插件吗? Or any other open source editors that support this use case? 还是任何其他支持此用例的开源编辑器?

You could create an array of all of the comments on that page, and then loop through and add elements using javascript. 您可以在该页面上创建所有评论的数组,然后使用javascript循环并添加元素。

As for the free open source editors, all of the free ones I could find were pretty broken. 至于免费的开源编辑器,我所能找到的所有免费编辑器都坏了。 You could try editing one you find to make it more efficient. 您可以尝试编辑发现的内容以使其更有效。

I was also looking for tool like this and I found this on github. 我也在寻找这样的工具,我在github上找到了这个。

https://github.com/openannotation/annotator/ https://github.com/openannotation/annotator/

I do not claim it's developed by me, but this can be helpful. 我不声称它是我开发的,但这可能会有所帮助。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM