CKEditor-防止用户粘贴图像 [英] CKEditor - preventing users from pasting images

查看:148
本文介绍了CKEditor-防止用户粘贴图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用出色的CKEditor为用户提供有限的编辑器。

I would like giving my users a limited editor, using the great CKEditor.

我试图阻止人们添加图像,因此我屏蔽了源视图,并禁用粘贴按钮(仅保留粘贴为文本按钮)。

I was trying to prevent people from adding images, therefore I've blocked the "Source" view and disabled the "paste" button (leaving only the Paste as Text button).

但是,仍然可以粘贴图像(从网页复制) 。
有没有办法防止这种情况?

However, it is still possible to paste images (copied from web page). Is there a way to prevent that as well ?

谢谢。

推荐答案

您可以使用粘贴事件,这样就可以删除您不喜欢的任何内容。当然,您还应该在保存之前验证服务器上的内容。

You can use the 'paste' event, that way you can remove anything that you don't like. And of course, you should also verify the content at the server before saving.

这篇关于CKEditor-防止用户粘贴图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆