Hello,

While my office appreciated having the Google Spellcheck plugin added, they wanted to know why Firefox's auto-spellcheck doesn't work on our site.
I googled and found a lot of people complaining about this issue with Wordpress (and a patch to fix it) but the patch affects what appears to be a Wordpress-specific configuration file.

I should say that, if you right-click the site's TinyMCE textfields and select "Spell Check This Field" it will work just as planned, but for some reason (and unlike any other site) that option defaults to unchecked.

Any ideas?

Comments

raulpober’s picture

I was curious about that too, so I peaked in the javascript source for tinymce, and the gecko spellcheck is explicitly disabled. You can find it easily by searching for "spell" in the tiny_mce_src.js and tiny_mce.js files. I though that I would change it simply by changing the default setting in the code, but that has not made any difference. I guess I'll keep working at it.

raulpober’s picture

it seems to be an issue (conflict?) with the advanced HR plugin. When I turned that off, my edits caused the firefox spell check to be on by default. This was very repeatable, advhr on -> spellcheck off, advhr off -> spellcheck on. I'm running tinymce 2.1.1.1 on Drupal 5.1.

The edits are:

(tiny_mce.js)

Change: this._def("gecko_spellcheck",false); to this._def("gecko_spellcheck",true);

(tiny_mce_src.js)

Change: this._def("gecko_spellcheck",false); to this._def("gecko_spellcheck",true);

Not sure if both are needed or not.

Offlein’s picture

Fantastic work raul, thank you. I am having trouble determining what exactly advhr does (or why i'd need it).. so i'm gonna try turning it off and hope that's ok.

Craig

--
I was the lead developer for the New York State Senate.

raulpober’s picture

Sounds like a good plan. I recall that advhr just gives more control over the horizontal rule like allowing you to change the height without coding it. I quickly looked through the javascript for the advhr plugin, but could not find anything obvious that would be causing the conflict. Very strange!

Offlein’s picture

Thanks for the clarification. I've been using it for a few weeks now, and all seems well!

--
I was the lead developer for the New York State Senate.

bitman’s picture

TinyMCE disables Firefox spellcheck by default.

http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/gecko_spellcheck

To enable it in Drupal, you should customize the TinyMCE theme. See the tinymce module's readme to find out how. Add this line to the theme function:

$init['gecko_spellcheck'] = 'true';

lucypher’s picture

What did you mean exactly?
In which file and where I should add the line???

bitman’s picture

See the section on "TWEAKING THE TINYMCE THEME" in the module's README.TXT. You must add the function given there to the file template.php in your theme's directory. Replace "function theme_tinymce_theme" with "function _tinymce_theme". If the file template.php does not exist for your theme, create the file, and put "<?php" on the first line before the theme function.

Include this line in the theme function before $init is returned:

$init['gecko_spellcheck'] = 'true';

If you use multiple themes, you must repeat these steps for each theme.

jasondiceman@drupal.org’s picture

In themes/your_theme/template.php paste the following code...

/* get Firefox spellcheck to work in TinyMCE */

function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {

  $init['gecko_spellcheck'] = 'true';
 
  // Always return $init; !!
  return $init;
}

Note I put this code after "include_once 'theme-settings-init.php';" but I'm not sure that matters.

See more TinyMCE tweaks at http://drupal.org/node/213021

cheers

TomChiverton’s picture

http://drupal.org/node/278970 is the bug.
It contains patches for 2.0-alpha and 2.0-release

-Anti-’s picture

> In themes/your_theme/template.php paste the following code...

I'm using the wysiwyg module, and this doesn't work :(