Altering CKEditor

Recently I needed to do some work on reconfiguring CKEditor in Drupal with the WYSIWYG module install.  The issue was to allow modern browsers & OS to use their built-in spell checker in CKEditor textareas.  If you test this out you'll notice that the native browser spell check does not work.  You could turn on the CKEditor spell check, but I'm not fond of it.

The method I found - http://murfitt.net/blog/getting-browser-spell-checker-work-ckeditor-drupal - is to add some lines to the CKEditor config file.  Specifically:

config.disableNativeSpellChecker = false;
config.removePlugins = 'scayt,menubutton,contextmenu';
config.browserContextMenuOnCtrl = true;

But that's not terribly useful - in terms of altering the CKEditor library - if you update it and wipe out the alteration.

This blog post - http://fuseinteractive.ca/blog/wysiwyg-module-ckeditor-taming-beast - comes to the rescue.  It shows how to build a custom module to deal with some of CKEditor's other issues, like the overly long button bar that won't "break" in smaller windows.  At the end of the post, the author provides all the source code, including a custom config file - ckeditor_custom_config.js - where you can place the spell check fix.

So I just combined them since both the spell check and long button bar are both items that really bug me.  One alteration I made was to change:

config.removePlugins = 'scayt,menubutton,contextmenu';

to

config.removePlugins = 'scayt,menubutton';

as the last parameter disables the mouse right click which I use to handle altering IMG fields, for example.  This does prevent you from doing a right click to get a pop up of spelling suggestions but does not prevent misspelled words from being underlined or otherwise highlighted.  

Note that the custom module also makes other alterations in CKEditor, so I'd read that blog post to get a full idea of what is happening.

I have made my version of the module available at: https://drupal.psu.edu/fserver/project/ckeditor_custom