13

TinyMCE has a built-in contextmenu which activates when you right-click in the content editor area. I need to remove this menu due to the copy/cut/paste in the menu. It for an application specific reason and less of a technical reason.

enter image description here

I have attempted to remove the contextmenu plugin as well as attempt to catch the contextmenu event and trap it without luck.

j08691
  • 204,283
  • 31
  • 260
  • 272
Chris Schuld
  • 279
  • 1
  • 3
  • 11

4 Answers4

30

The easy solution is to remove the contextmenu plugin in your tinymce init:

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

becomes

 plugins : "inlinepopups,insertdatetime,fullscreen",
Thariama
  • 50,002
  • 13
  • 138
  • 166
  • 1
    I tried this previously; tried it again based on your comment and it worked - browser cache must have been beating on me. Thanks! – Chris Schuld Mar 05 '12 at 18:51
  • glad to have been able to help – Thariama Mar 06 '12 at 09:59
  • 1
    I did this with the but it initially didn't work, whenever I right-clicked I get a LINK in the contextual menu, so I went into my plugin and removed LINK from it and then it worked. – Jay Smoke Apr 26 '21 at 12:19
15

In version 5, context menu is built in the core. This has helped me:

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

Commenting this line in /plugins/contextmenu/editor_plugin.js worked 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 use the non-minified js, comment this:

m.addSeparator();
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
Jules
  • 14,200
  • 13
  • 56
  • 101
SkarXa
  • 1,184
  • 1
  • 12
  • 24
0

Try to remove the complete script in plugins/contextmenu/editor.plugin.js (It's only 1 line so it's sufficient to put 2 slashes at the start).

It works for me, the contextmenu no longer appears.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • this would work, but it is very ugly because there is a way to configure the contextmenu (which will be no longer possible cause you fiddled with the source code!) – Thariama Mar 01 '12 at 08:21