Disable tinyMCE context menu?

Disable tinyMCE context menu?

by Dan Rapoza -
Number of replies: 4

As a number of folks have already mentioned, we've run into the tinyMCE spell check going dark due to Google Spell being supported.

That's fine on our campus and we don't mind going to browser-based spell check. We're currently on 2.4+ and are testing 2.5. On 2.5, we see in the context menu the note that folks can do a CTRL + Right Click to get spell check options, but we're finding that adding CTRL isn't very intuitive for a number of students / faculty.

Is there a tested way to simply disable the tinyMCE right click menu? I've already removed "contextmenu," from \lib\editor\tinymce\lib.php in our 2.5 installation, but the menu remains. I must be editing the wrong file / line

Average of ratings: -
In reply to Dan Rapoza

Re: Disable tinyMCE context menu?

by Dan Rapoza -

We found it on our end, so I'll post here for posterity:

Open up:

lib\editor\tinymce\tiny_mce\3.x.x\ tiny_mce.js

 

Search for:

case"contextmenu":e.bind(i,n,c)

 

Just need to remove:

e.bind(i,n,c)

 

We tried it on 2.4+ and 2.5, and it worked on both.

In reply to Dan Rapoza

Re: Disable tinyMCE context menu?

by Doug Moody -

The TinyMCE menu is a black box to me.

Can anyone give some links to ALL the places someone has to go to edit this menu? In other words, if I want to customize the TINYMCE menu, how many files have to be edited, and where are they?

Perhaps an example would help. An example I would like to see would be something like "How to change the default font in the TinyMCE menu?

In reply to Dan Rapoza

Re: Disable tinyMCE context menu?

by Mathew Hillier -

I would like to remove the context menu for the same reason (enabling browser spell check), but i would like to know if there is a way to do this by not editing any code files.

Can this be done via Moodle admin settings area ?

Specificity via : Site administration > Plugins > Text editors > TinyMCE HTML editor > General settings - in the "Custom configuration editor_tinymce | customconfig" field.

For example for the spell check in Firefox to show the red squiggly lines under errors, this was inserted into the field:

gecko_spellcheck : true

So, to avoid the CTRL click messiness, is there a similar setting to remove the TinyMCE right-click context menu and thus have the standard Firefox right-click menu appear?

thanks smile

In reply to Dan Rapoza

Re: Disable tinyMCE context menu?

by Dan Rapoza -

Sorry, I don't have info on the above replies. But I tested this in 2.6 and it works as well.

So to prevent the default tinymce context menu, you want to:

  1. Go to: \lib\editor\tinymce\lib.php 
  2. Remove: contextmenu

 AND 

  1. Go to: lib\editor\tinymce\tiny_mce\3.x.x\ tiny_mce.js
  2. Search for: case"contextmenu":e.bind(i,n,c)
  3. Just remove just: e.bind(i,n,c)