开发者

CKEditor: Is there a way to remove FORM properties option from the context menu

开发者 https://www.devze.com 2023-03-06 01:37 出处:网络
I want to remove or开发者_StackOverflow中文版 disable the Form Properties option in the context menu in CKEditor.I still want the context menu, but I do not want the form properties option.

I want to remove or开发者_StackOverflow中文版 disable the Form Properties option in the context menu in CKEditor. I still want the context menu, but I do not want the form properties option.

I can keep the forms property dialog from popping up by removing the code in the plugins/forms/form.js, but this causes a javascript error when they click form properties, and it requires modifying the CKEditor source code (which is obviously bad).

I am even fine with overriding the event on the context menu so I can pop up a message saying this feature is not available.


You can modify a lot of these settings in config.js.

[Edited]

Context menu items (aside from the traditional Cut, Copy and Paste operations) are generally defined in a particular plugin that implements the advanced feature. In your case, the desired menu items would be defined in plugins/forms/plugin.js (the most recent version starts on line 62, YMMV):

// If the "menu" plugin is loaded, register the menu items.
if ( editor.addMenuItems )
{
  ...

You could edit this file to not add menu items - which you allude to, or you could simply not load the forms plugin in your config.js file, under the "plugins" section. The most recent version start on line 271, again YMMV:

plugins :
  'about,' +
  'a11yhelp,' +
  'basicstyles,' +
  'bidi,' +
  'blockquote,' +
  'button,' +
  ...
  'format,' +
  'forms,'

I believe this to be the easiest approach.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号