CKEditor中的不可删除元素 [英] Undeletable element in CKEditor
问题描述
我想知道CKEditor 4中是否有一种使元素不可删除的方法。
I'm wondering if there's a way to make an element 'undeletable' in CKEditor 4.
我可能有一些类似这样的HTML:
I might have some HTML like so:
<div class='content' contenteditable='true'>
<div class='gallery'>...</div>
</div>
在这种情况下, .gallery
不应该可以通过退格或选择并按Delete键从 .content
中删除。
In this case .gallery
shouldn't be able to be deleted from .content
, either by backspacing or selecting and pressing delete.
更新:似乎小部件无法删除,或者至少从我的判断中无法删除。
看看 http://ckeditor.com/demo#widgets ,则可以删除这些小部件。还有其他想法吗?
UPDATE: It seems widgets can not be undeletable, or at least from what I can tell. Take a look at http://ckeditor.com/demo#widgets, the widgets can be deleted. Any other ideas?
谢谢
推荐答案
您正在寻找的是小部件。 它们将在CKEditor 4.3中实现,并提供此类功能。请耐心;)
What you are looking for are widgets. They will be implemented in CKEditor 4.3 and provide this kind of features. Be patient ;)
目前只有 placeholder 做类似事情的插件,但我想这对您来说还不够。
At the moment there's only placeholder plugin that does "similar" thing, but I guess this is not enough for you.
这篇关于CKEditor中的不可删除元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!