Removing the context menu in TinyMCE

TinyMCE has a built-in context menu that is activated when you right-click in the content editor area. I need to delete this menu due to copy / cut / paste in the menu. This is for the specific reason of the application, and not for the technical reason.

enter image description here

I tried to remove the contextmenu plugin, and also tried to catch the contextmenu event and intercept it without luck.

+10
source share
4 answers

A simple solution is to remove the contextmenu plugin in your tinymce initialization:

 plugins : "inlinepopups,insertdatetime,fullscreen,contextmenu",

becomes

 plugins : "inlinepopups,insertdatetime,fullscreen",
+23
source

script /contextmenu/editor.plugin.js ( , ).

, .

0

The comment of this line in /plugins/contextmenu/editor_plugin.jsworked for me:

f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});

If for any reason you are using invalid js, comment this:

m.addSeparator();
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
0
source

In version 5, the context menu is built into the kernel. It helps me:

tinymce.init({
    ...
    contextmenu: false,
    ...
});
0
source

All Articles