Moodle
  1. Moodle
  2. MDL-34674

TinyMCE spellchecker should be disabled completely (or only active for old versions of IE)

    Details

    • Testing Instructions:
      Hide

      1/ make sure the legacy spell checker plugin is enabled (it was renamed to indicate it is for ancient browsers from Redmond)
      2/ test built-in spell checking in all decent browsers including IE10 (fully automatic - CTRL+right click for hints, details, language selection if present)
      3/ test legacy tinymce spellchecker plugin in IE8, IE9 (button in the tinymce toolbar)
      4/ review the right click hint

      Show
      1/ make sure the legacy spell checker plugin is enabled (it was renamed to indicate it is for ancient browsers from Redmond) 2/ test built-in spell checking in all decent browsers including IE10 (fully automatic - CTRL+right click for hints, details, language selection if present) 3/ test legacy tinymce spellchecker plugin in IE8, IE9 (button in the tinymce toolbar) 4/ review the right click hint
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w15_MDL-34674_m25_spell
    • Rank:
      43130

      Description

      TinyMCE has a built in spellchecker. I'm suggesting that it be removed in favour of the built in browser spellcheckers.

      Currently in Firefox and Chrome and Moodle 2.3, the browser's built in spellchecker is disabled by default and so is TinyMCE's. You can click on the ABC(tick) button to activate the TinyMCE spellchecker. Normally, you'd be able to right click in the textbox and use the browser's spellechecker, but TinyMCE overrides the right click with it's own menu. You can bypass this by holding down control and right clicking, but that's not something you'd expect end users to know.

      I'm currently investigating how to a) complety remove the spellchecking UI from TinyMCE (perhaps leaving it for IE 8 & 9), b) make sure the user's preference for browser spellchecking applies to the TinyMCE edit window and c) how to turn off the TinyMCE right-click menu so that it doesn't interfere with the browser spellchecker. If anyone else already knows how to do this I'd like to propose as the default for core Moodle.

        Issue Links

          Activity

          Hide
          David Scotson added a comment -

          I meant to add: this is from the perspective of an english speaker. The built in spellchecker is better since it learns words that I use across many sites and so doesn't underline my surname etc. It's possible that the situation is different in other languages.

          Show
          David Scotson added a comment - I meant to add: this is from the perspective of an english speaker. The built in spellchecker is better since it learns words that I use across many sites and so doesn't underline my surname etc. It's possible that the situation is different in other languages.
          Hide
          Michael de Raadt added a comment -

          I'd be in favour of this. Browser spell-checkers are far superior to the TinyMCE spell-checker and we are constantly running into problems with this.

          A user profile setting that defaults to off for the TinyMCE spell-checker would be great. As far as I have been told, this is possible.

          If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.

          Show
          Michael de Raadt added a comment - I'd be in favour of this. Browser spell-checkers are far superior to the TinyMCE spell-checker and we are constantly running into problems with this. A user profile setting that defaults to off for the TinyMCE spell-checker would be great. As far as I have been told, this is possible. If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.
          Hide
          Sara Arjona added a comment - - edited

          We've enabled the browser spell-checker adding the following line into the lib/editor/tinymce/tiny_mce/XXXXX/tiny_mce_src.js file:

          self.onPreInit.dispatch(self);

          //ADDED - To enable browser check spelling
          settings.gecko_spellcheck = true;
          //************ END
          if (!settings.gecko_spellcheck)
          doc.body.spellcheck = false;

          It works with Chrome and Firefox.

          Besides, if needed:

          • It's possible to disable the Spell-checker button removing the content of the editor_tinymce | spelllanguagelist parameter.
          • It could be nice to add a parameter for enabling/disabling the context menu inside the tiny_mce editor (it's possible to get it removing the contextmenu in the plugins params in editor/tinymce/lib.php file).
          Show
          Sara Arjona added a comment - - edited We've enabled the browser spell-checker adding the following line into the lib/editor/tinymce/tiny_mce/XXXXX/tiny_mce_src.js file: self.onPreInit.dispatch(self); //ADDED - To enable browser check spelling settings.gecko_spellcheck = true; //************ END if (!settings.gecko_spellcheck) doc.body.spellcheck = false; It works with Chrome and Firefox. Besides, if needed: It's possible to disable the Spell-checker button removing the content of the editor_tinymce | spelllanguagelist parameter. It could be nice to add a parameter for enabling/disabling the context menu inside the tiny_mce editor (it's possible to get it removing the contextmenu in the plugins params in editor/tinymce/lib.php file).
          Hide
          Pau Ferrer Ocaña (crazyserver) added a comment -

          Hi,

          I've made a patch on lib/editor/tinymce/lib.php

          Adding a function

              //Check if the spellchecker is supported by the browser (to disable the tinymce's)
              private function spellcheck_supported_by_browser(){
                  if (check_browser_version('MSIE', 10)) {
                      return true;
                  }
                  if (check_browser_version('Gecko', 20030516)) {
                      return true;
                  }
                  if (check_browser_version('Safari', 412)) {
                      return true;
                  }
                  if (check_browser_version('Chrome', 6)) {
                      return true;
                  }
                  if (check_browser_version('Opera', 9)) {
                      return true;
                  }
                  if (check_browser_version('Safari iOS', 534)) {
                      return true;
                  }
                  if (check_browser_version('WebUI', 534)) {
                      return true;
                  }
                  return false;
              }
          

          On function get_init_params on the same file to modify the params of the editor:

          //If the browser has spellcheker, disable the tinymce's
          if($this->spellcheck_supported_by_browser()){
                //All but spellchecker
               $params['plugins'] = "{$xmedia}advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,{$xemoticon}{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak";
          }
          

          This modification worked for me but has some problems:
          1) On firefox, the contextual menu of the browser (including the spellchecker) appears above the contextual menu of the tinymce. The tinymce's can be used by clicking outside the browser menu
          2) On chrome, the right click only enables the tinymce menu to make browsers menu appear you have to (right)click again, but you cannot click on the text, so you cannot correct the marked word.

          The function spellcheck_supported_by_browser can be modified to disable this feature on chrome.

          Show
          Pau Ferrer Ocaña (crazyserver) added a comment - Hi, I've made a patch on lib/editor/tinymce/lib.php Adding a function //Check if the spellchecker is supported by the browser (to disable the tinymce's) private function spellcheck_supported_by_browser(){ if (check_browser_version('MSIE', 10)) { return true ; } if (check_browser_version('Gecko', 20030516)) { return true ; } if (check_browser_version('Safari', 412)) { return true ; } if (check_browser_version('Chrome', 6)) { return true ; } if (check_browser_version('Opera', 9)) { return true ; } if (check_browser_version('Safari iOS', 534)) { return true ; } if (check_browser_version('WebUI', 534)) { return true ; } return false ; } On function get_init_params on the same file to modify the params of the editor: //If the browser has spellcheker, disable the tinymce's if ($ this ->spellcheck_supported_by_browser()){ //All but spellchecker $params['plugins'] = "{$xmedia}advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,{$xemoticon}{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak" ; } This modification worked for me but has some problems: 1) On firefox, the contextual menu of the browser (including the spellchecker) appears above the contextual menu of the tinymce. The tinymce's can be used by clicking outside the browser menu 2) On chrome, the right click only enables the tinymce menu to make browsers menu appear you have to (right)click again, but you cannot click on the text, so you cannot correct the marked word. The function spellcheck_supported_by_browser can be modified to disable this feature on chrome.
          Hide
          Dan Poltawski added a comment -

          I'd be in favour of this but without the browser sniffing as much as possible.

          Show
          Dan Poltawski added a comment - I'd be in favour of this but without the browser sniffing as much as possible.
          Hide
          Eric Merrill added a comment -

          Note that Google Spell seems to be dead (MDL-38867), which makes this a much much bigger issue (as PSpell and PSpellShell are much less universal).

          Show
          Eric Merrill added a comment - Note that Google Spell seems to be dead ( MDL-38867 ), which makes this a much much bigger issue (as PSpell and PSpellShell are much less universal).
          Hide
          Charles Fulton added a comment -

          I've written up a proof-of-concept for 2.3.6+ which simply adds "None - in browser" as an option for TinyMCE spellchecking. It doesn't do any browser sniffing or anything like that. Worked in Chrome and Firefox; doesn't work in IE 8. I don't have access to newer versions of IE. Code here: https://github.com/mackensen/moodle/compare/MOODLE_23_STABLE...MDL-34674-23.

          Show
          Charles Fulton added a comment - I've written up a proof-of-concept for 2.3.6+ which simply adds "None - in browser" as an option for TinyMCE spellchecking. It doesn't do any browser sniffing or anything like that. Worked in Chrome and Firefox; doesn't work in IE 8. I don't have access to newer versions of IE. Code here: https://github.com/mackensen/moodle/compare/MOODLE_23_STABLE...MDL-34674-23 .
          Hide
          David Scotson added a comment -

          There's a fair few new admin options for TinyMCE in 2.4 and 2.5, which include turning off the spellchecker. When I do so, the squiggly red underline appears (in Firefox/Ubuntu at least), but I still can't right click as normal, I need to hold down control at the same time.

          I think you might be able to disable the right-click menu via the advanced configuration settings, though obviously you lose the easy access to certain features that gives you.

          Show
          David Scotson added a comment - There's a fair few new admin options for TinyMCE in 2.4 and 2.5, which include turning off the spellchecker. When I do so, the squiggly red underline appears (in Firefox/Ubuntu at least), but I still can't right click as normal, I need to hold down control at the same time. I think you might be able to disable the right-click menu via the advanced configuration settings, though obviously you lose the easy access to certain features that gives you.
          Hide
          Michael de Raadt added a comment -

          As there are problems with the default Google spell checker, I'm promoting this issue (in line with the discussion from MDL-34674).

          Show
          Michael de Raadt added a comment - As there are problems with the default Google spell checker, I'm promoting this issue (in line with the discussion from MDL-34674 ).
          Hide
          Petr Škoda added a comment -

          It should work again, lowering priority for now.

          Show
          Petr Škoda added a comment - It should work again, lowering priority for now.
          Hide
          Petr Škoda added a comment -

          Hmm, I did not know about the CTRL+right click trick, where could we document it so that our users know??

          Show
          Petr Škoda added a comment - Hmm, I did not know about the CTRL+right click trick, where could we document it so that our users know??
          Hide
          Dan Poltawski added a comment -

          This gets my complete support, bug trying to get some more +1's for it to land.

          Show
          Dan Poltawski added a comment - This gets my complete support, bug trying to get some more +1's for it to land.
          Hide
          God added a comment -

          +1 from me.

          Show
          God added a comment - +1 from me.
          Hide
          Damyon Wiese added a comment -

          This only gets my luke warm support until there is a clear solution for the right click menu.

          Show
          Damyon Wiese added a comment - This only gets my luke warm support until there is a clear solution for the right click menu.
          Hide
          Petr Škoda added a comment -

          Hmm, what if we added a plugin that injects help into the TinyMCE right-click menu? The last command would be "CTRL+right click to see browser commands and spellchecker options" and it could even pop up help...

          Show
          Petr Škoda added a comment - Hmm, what if we added a plugin that injects help into the TinyMCE right-click menu? The last command would be "CTRL+right click to see browser commands and spellchecker options" and it could even pop up help...
          Hide
          Damyon Wiese added a comment -

          That sounds ok to me Petr - if users right click expecting the spelling suggestions at least they would get the instructions they needed right then and there. Just needs confirming that it works in all browsers (that support spelling). Also not sure if we have to do anything about about ie9.

          Show
          Damyon Wiese added a comment - That sounds ok to me Petr - if users right click expecting the spelling suggestions at least they would get the instructions they needed right then and there. Just needs confirming that it works in all browsers (that support spelling). Also not sure if we have to do anything about about ie9.
          Hide
          Damyon Wiese added a comment -

          Except that testing this with chrome now - control right click gives you the browser menu with no spelling suggestions.

          Show
          Damyon Wiese added a comment - Except that testing this with chrome now - control right click gives you the browser menu with no spelling suggestions.
          Hide
          Petr Škoda added a comment -

          Chrome suggestions work fine for me in dev channel on OSX, maybe you need to enable "Use a web service to help resolve spelling errors" in Chrome or maybe chrome takes the suggestions form some OS component...

          Show
          Petr Škoda added a comment - Chrome suggestions work fine for me in dev channel on OSX, maybe you need to enable "Use a web service to help resolve spelling errors" in Chrome or maybe chrome takes the suggestions form some OS component...
          Hide
          David Scotson added a comment -

          You might need to turn off the TinyMCE spellchecker for the browser one to become active. Do you see any red lines under misspelled words?

          Ctrl-Right-Click works for me on Ubuntu Chromium.

          Show
          David Scotson added a comment - You might need to turn off the TinyMCE spellchecker for the browser one to become active. Do you see any red lines under misspelled words? Ctrl-Right-Click works for me on Ubuntu Chromium.
          Hide
          Damyon Wiese added a comment -

          I may be doing something wrong then - if it works then I agree with this solution. I don't like the use of a non-official google API.

          Show
          Damyon Wiese added a comment - I may be doing something wrong then - if it works then I agree with this solution. I don't like the use of a non-official google API.
          Hide
          Martin Dougiamas added a comment -

          My +1 for this:

          • Remove the spelling plugin completely (debated keeping it as per Charles above but can't see the complexity being worth it) IFF
          • We add "Use Control-RightClick to get browser menu" as an unselectable item at the bottom of the normal menu (is it possible to make it selectable and actually send a control-right-click??)
          Show
          Martin Dougiamas added a comment - My +1 for this: Remove the spelling plugin completely (debated keeping it as per Charles above but can't see the complexity being worth it) IFF We add "Use Control-RightClick to get browser menu" as an unselectable item at the bottom of the normal menu (is it possible to make it selectable and actually send a control-right-click??)
          Hide
          Martin Dougiamas added a comment -

          I should add that I disabled the spelling plugin and tested browser spelling (and ctrl-right-click) in Chrome, Safari and Firefox on Mac OS X, all worked fine.

          Show
          Martin Dougiamas added a comment - I should add that I disabled the spelling plugin and tested browser spelling (and ctrl-right-click) in Chrome, Safari and Firefox on Mac OS X, all worked fine.
          Hide
          Dan Poltawski added a comment -

          Reopening for Martins comments to be addressed.

          Thanks

          Show
          Dan Poltawski added a comment - Reopening for Martins comments to be addressed. Thanks
          Hide
          CiBoT added a comment -

          Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.

          Show
          CiBoT added a comment - Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.
          Hide
          Petr Škoda added a comment -

          CTRL+ right click context menu hint added.

          Show
          Petr Škoda added a comment - CTRL+ right click context menu hint added.
          Hide
          Damyon Wiese added a comment -

          Tested this on IE9, firefox, and chrome and everything is working except for one minor thing:

          The tooltip for the right click hint displays as "<em>CTRL + right click for more options</em>" in all tested browsers (needs tags escaped/stripped).

          Can you please fix this?

          Thanks Petr!

          Show
          Damyon Wiese added a comment - Tested this on IE9, firefox, and chrome and everything is working except for one minor thing: The tooltip for the right click hint displays as "<em>CTRL + right click for more options</em>" in all tested browsers (needs tags escaped/stripped). Can you please fix this? Thanks Petr!
          Hide
          CiBoT added a comment -

          Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.

          Show
          CiBoT added a comment - Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.
          Hide
          Petr Škoda added a comment -

          weird, it means it worked in Safari only, thanks!

          Show
          Petr Škoda added a comment - weird, it means it worked in Safari only, thanks!
          Hide
          Damyon Wiese added a comment -

          Thanks Petr,

          Looks good now. Integrated to master.

          Show
          Damyon Wiese added a comment - Thanks Petr, Looks good now. Integrated to master.
          Hide
          Jason Fowler added a comment -

          Not sure if this is related, but I can't test on IE8

          Webpage error details

          User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
          Timestamp: Wed, 17 Apr 2013 07:15:05 UTC

          Message: Invalid argument.
          Line: 7571
          Char: 13
          Code: 0
          URI: http://jason.moodle.local/imaster/theme/yui_combo.php?3.9.1/build/simpleyui/simpleyui.js&3.9.1/build/loader/loader.js

          Show
          Jason Fowler added a comment - Not sure if this is related, but I can't test on IE8 Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Timestamp: Wed, 17 Apr 2013 07:15:05 UTC Message: Invalid argument. Line: 7571 Char: 13 Code: 0 URI: http://jason.moodle.local/imaster/theme/yui_combo.php?3.9.1/build/simpleyui/simpleyui.js&3.9.1/build/loader/loader.js
          Hide
          Jason Fowler added a comment -

          Browser spell check works fine in IE10, Chrome, Safari and Firefox.

          Moodle spell check works in IE9 (couldn't test IE8 due to JS errors that seem unrelated)

          Show
          Jason Fowler added a comment - Browser spell check works fine in IE10, Chrome, Safari and Firefox. Moodle spell check works in IE9 (couldn't test IE8 due to JS errors that seem unrelated)
          Hide
          Dan Poltawski added a comment -

          Blooming Marvelous! It's time for a knees up - your changes are upstream!

          Thanks for making Moodle better!

          Toodle pip

          Show
          Dan Poltawski added a comment - Blooming Marvelous! It's time for a knees up - your changes are upstream! Thanks for making Moodle better! Toodle pip
          Hide
          Mary Cooch added a comment -

          Removing docs_required label as this is now documented in http://docs.moodle.org/25/en/Text_editor

          Show
          Mary Cooch added a comment - Removing docs_required label as this is now documented in http://docs.moodle.org/25/en/Text_editor
          Hide
          Dan Rapoza added a comment - - edited

          I don't know if a new tracker should be created or something added to this one. I'd be happy to create a new one if that's appropriate.

          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 it possible to add a parameter to simply disable the tinyMCE right click menu entirely? We find that everything on the right-click menu is redundant with the toolbar above anyway. We removed manually, but a parameter might be helpful?

          Show
          Dan Rapoza added a comment - - edited I don't know if a new tracker should be created or something added to this one. I'd be happy to create a new one if that's appropriate. 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 it possible to add a parameter to simply disable the tinyMCE right click menu entirely? We find that everything on the right-click menu is redundant with the toolbar above anyway. We removed manually, but a parameter might be helpful?
          Hide
          Willy Lee added a comment -

          This works great in 2.4 if you change the version required in version.php. Is this worth releasing for 2.4 since MDL-38867 is considered a major bug and this corrects the usability of that change?

          Show
          Willy Lee added a comment - This works great in 2.4 if you change the version required in version.php. Is this worth releasing for 2.4 since MDL-38867 is considered a major bug and this corrects the usability of that change?

            People

            • Votes:
              14 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: