Menu

#60 Realtime Spellchecker (Firefox 2.0)

open
nobody
None
5
2014-08-28
2006-10-21
No

Interface to work with the Firefox 2 Spellchecker for
textareas.

Usage:
1.
Extract the plugin file under the plugins directory so
it ends up as editor/plugins/rtSpellCheck/fckplugin.js

2.
Include the plugin in your config file:
FCKConfig.Plugins.Add( 'rtSpellCheck' ) ;

3.
Replace the default 'SpellCheck' button in your
toolbar with 'rtSpellCheck'

That's all the changes required, it uses your skin
button and current translations.

Now users with IE or Firefox<2.0 will get the previous
behavior, no change for them.
But for Firefox 2 users will get the spellchecker
underlines removed by default, and clicking the
spellcheck button will toggle the state:
if it's enabled then Firefox will do the spellchecking
and the browser context menu with spell suggestions
will be available
if it's disabled then they get the same behavior as non
Firefox 2 users.

The state of the button is preserved across sessions.

Discussion

  • Alfonso Martinez

     
  • Alfonso Martinez

    Logged In: YES
    user_id=1356422
    Originator: YES

    Updated so it doesn't remove the context menu if the button isn't present in the toolbar (although it will still disable the automatic spellcheck from firefox)

     
  • Chad Killingsworth

    Logged In: YES
    user_id=1452321
    Originator: NO

    The latest version of this gives plugin gives a "Unknown Toolbar Item" error when the editor loads in FF browsers who haven't loaded the plugin previously. I've resorted to an older version for now to avoid the problem.

     
  • Alfonso Martinez

    Logged In: YES
    user_id=1356422
    Originator: YES

    Do you mean that the version from 2006-11-20 22:33 fails but the 2006-10-21 12:56 version works for you?

     
  • Chad Killingsworth

    Logged In: YES
    user_id=1452321
    Originator: NO

    Correct. The 11-20 version fails on some FF browsers, but not all. The 10-21 version seems to work great everywhere. I haven't been able to track down exactly where the problem is occurring - partially because it works just fine on the machine I do my development work.

     
  • Paul Neumeyer

    Paul Neumeyer - 2007-03-07

    Logged In: YES
    user_id=1737282
    Originator: NO

    The code needs this fix:
    Note: the added try catch as _getValue fails

    FCKStorage.GetValue = function( module, name, defaultValue )
    {
    try {
    var value = this._getValue('FCK' + module + name);

    if ( value === null ) {
    return defaultValue;
    }
    else
    {
    if ( value == 'true' ) return true;
    if ( value == 'false' ) return false;
    //return the string
    return value;
    }
    } catch (e) {
    return defaultValue;
    }
    }

     
  • Matt

    Matt - 2007-03-07

    Logged In: YES
    user_id=1225267
    Originator: NO

    applied the patch from 2007-03-07 06:15

    The code works, but now the view source button doesn't?

    I recieve this error:

    <code>
    FCK.EditorDocument has no properties
    Refresh()fckplugin.js (line 246)
    hitch()fckplugin.js (line 195)
    FCKEvents("OnAfterSetHTML", undefined)fckeditorcode_gec... (line 28)
    GetLinkedFieldValue("")fckeditorcode_gec... (line 29)
    GetLinkedFieldValue(undefined)fckeditorcode_gec... (line 29)
    FCKDialogCommand()fckeditorcode_gec... (line 64)
    FCKToolbarButton()fckeditorcode_gec... (line 76)
    FCKToolbarButton_OnClick(click clientX=0, clientY=0)fckeditorcode_gec... (line 75)
    [Break on this error] FCK.EditorDocument.body.spellcheck = this.active;
    </code>

    fckplugin.js (line 246)

     
  • Alfonso Martinez

    Logged In: YES
    user_id=1356422
    Originator: YES

    I've added the patch proposed by Paul Neumeyer as it shouldn't do any harm, although I'm not sure under what circumstances it could fail. I've tested to disable cookies and it worked fine for me.
    And most important, this version is ready to work with the 2.4 FCKeditor series, I had made the changes some time ago but I wasn't able to properly test and check everything.

    I don't think that this fixes the problem stated by chadk3, but I don't have the old version around.
    File Added: rtSpellCheck 0.6.zip

     
  • Alfonso Martinez

     
  • kitichai

    kitichai - 2007-11-24

    Logged In: YES
    user_id=1281347
    Originator: NO

    Thank you for this Plug-in, it works for me.
    I'm using eGroupware v.1.4 with FCKeditor.

    ps. Could anyone tell me how can I set rtSpellCheck as enable by automatic (don't have to click on toolbar).

    Thank you again
    Kitichai

     
  • kitichai

    kitichai - 2007-11-24

    Logged In: YES
    user_id=1281347
    Originator: NO

    Thank you for this Plug-in, it works for me.
    I'm using eGroupware v.1.4 with FCKeditor.

    ps. Could anyone tell me how can I set rtSpellCheck as enable by automatic (don't have to click on toolbar).

    Thank you again
    Kitichai

     

Log in to post a comment.