Hi,
I'm trying to make a plugin that inserts tags which users are not able to edit by deleting/changing text directly through the viewer menu (instead they will click a button and be shown a dialog). Is there a way to make an element non-editable?
I'm trying to make a plugin that inserts tags which users are not able to edit by deleting/changing text directly through the viewer menu (instead they will click a button and be shown a dialog). Is there a way to make an element non-editable?
Re: Make an element uneditable
Re: Make an element uneditable
I have done some preliminary work on a plugin to allow uneditable comments to be added using a toolbar button. The comment consists of a span containing a smilie image, and a span containing the comment text. Both spans are elements with the element.unselectable() run on them so that the user cannot click on them. The two spans are then added to a third parent span which is selectable. I had to also append a nbsp to the parent span so that when the user clicks on the unselectable spans, the cursor can still land within the parent span. This is important for the context menus to show (see below).
The plugin adds menu items that only display if the selection is within a span that has the class I add to the parent span. The context menu items allow editing and removing of the comment. The context menu items and the toolbar button can be disabled via a custom flag in the editor.config, so you can control if a user can add new comments and edit existing ones.
Re: Make an element uneditable
You might be interested in this.