CKEditor add spellchecker icon [SOLVED]

Moderator: crythias

Locked
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

CKEditor add spellchecker icon [SOLVED]

Post by dstover »

I am having trouble getting a spell checker icon to display in the toolbar of the CKEditor. I am able to enable Scayt (Spell Check as you type) but am not able to display an icon. Not sure where to add that in. I have tried RichTextEditor.dtl but no success. Looked in Core.UI.RichTextEditor.js but do not see an obvious place to put it.

Thanks in advance for any info...Dan.
Last edited by dstover on 17 Nov 2014, 18:45, edited 1 time in total.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: CKEditor add spellchecker icon

Post by crythias »

See if you might get a hint from here. You don't have to do all the steps, but you might find out how to add the icon.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

Re: CKEditor add spellchecker icon

Post by dstover »

I have tried multiple combinations and have had no success adding the Spell Checker icon. Here is the relevant code from Core.UI.RichTextEditor.js:

Code: Select all

Editor = CKEDITOR.replace(EditorID,
        {
            customConfig: '', // avoid loading external config files
            defaultLanguage: UserLanguage,
            language: UserLanguage,
            width: Core.Config.Get('RichText.Width', 620),
            resize_minWidth: Core.Config.Get('RichText.Width', 620),
            height: Core.Config.Get('RichText.Height', 320),
            removePlugins : 'elementspath,scayt,menubutton',
	    pasteFromWordRemoveFontStyles: false, 	// DMS 08/08/2014 - put this here to enable styles to work
	    pasteFromWordRemoveStyles: false,		// DMS 08/08/2014 - put this here to enable styles to work
	    forcePasteAsPlainText: false,
            format_tags: 'p;h1;h2;h3;h4;h5;h6;pre',
            fontSize_sizes: '8px;10px;12px;16px;18px;20px;22px;24px;26px;28px;30px;',
            extraAllowedContent: 'div table tr td th colgroup col style[*]{*}',
            enterMode: CKEDITOR.ENTER_BR,
            shiftEnterMode: CKEDITOR.ENTER_BR,
            contentsLangDirection: Core.Config.Get('RichText.TextDir', 'ltr'),
            disableNativeSpellChecker: false,
            toolbar: CheckFormID().length ? Core.Config.Get('RichText.Toolbar') : Core.Config.Get('RichText.ToolbarWithoutImage'),
            filebrowserUploadUrl: Core.Config.Get('Baselink'),
            extraPlugins: Core.Config.Get('RichText.SpellChecker') ? 'aspell,onchange' : 'onchange',
            entities: false
        });
** I added the two "pasteFromWord" lines so that styles would translate correctly on a paste operation.

Here is relevant code from RichTextEditor.dtl:

Code: Select all

Core.Config.Set('RichText.TextDir', '$Env{"TextDirection"}');
    Core.Config.Set('RichText.SpellChecker', '$Env{"BrowserSpellCheckerInline"}');
    Core.Config.Set('RichText.EditingAreaCSS', 'body.cke_editable { $Config{"Frontend::RichText::DefaultCSS"} }');

    // decide if we need to use the enhanced mode (with tables)
    if ( '$Config{"Frontend::RichText::EnhancedMode"}' === '1' ) {
        Core.Config.Set('RichText.Toolbar', [
            ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'NumberedList', 'BulletedList', 'Table', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Link', 'Unlink', 'Undo', 'Redo', 'SelectAll' ],
		    '/',
            ['Image', 'HorizontalRule', 'PasteText', 'PasteFromWord', '-', '-', 'Find', 'Replace', 'SpellCheck', 'TextColor', 'BGColor', 'RemoveFormat', '-', 'ShowBlocks', 'Source', 'SpecialChar', '-', 'Maximize'],
            ['Format', 'Font', 'FontSize' ]
        ]);
        Core.Config.Set('RichText.ToolbarWithoutImage', [
            ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'NumberedList', 'BulletedList', 'Table', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Link', 'Unlink', 'Undo', 'Redo', 'SelectAll' ],
            '/',
            ['HorizontalRule', 'PasteText', 'PasteFromWord', '-', '-', 'Find', 'Replace', 'SpellCheck', 'TextColor', 'BGColor', 'RemoveFormat', '-', 'ShowBlocks', 'Source', 'SpecialChar', '-', 'Maximize'],
            ['Format', 'Font', 'FontSize' ]
        ]);
    }
    else {
        Core.Config.Set('RichText.Toolbar', [
            ['Bold', 'Italic', 'Underline', 'Strike', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Link', 'Unlink', '-', 'Image', 'HorizontalRule', '-', 'Undo', 'Redo', '-', 'Find', 'SpellCheck'],
            '/',
            ['Format', 'Font', 'FontSize', '-', 'TextColor', 'BGColor', 'RemoveFormat', '-', 'Source', 'SpecialChar', '-', 'Maximize']
        ]);
        Core.Config.Set('RichText.ToolbarWithoutImage', [
            ['Bold', 'Italic', 'Underline', 'Strike', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Link', 'Unlink', '-', 'HorizontalRule', '-', 'Undo', 'Redo', '-', 'Find', 'SpellCheck'],
            '/',
            ['Format', 'Font', 'FontSize', '-', 'TextColor', 'BGColor', 'RemoveFormat', '-', 'Source', 'SpecialChar', '-', 'Maximize']
        ]);
    }
As you can see, SpellCheck is referenced but the icon does not display.

Any assistance would be appreciated. Thanks in advance...Dan.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: CKEditor add spellchecker icon

Post by crythias »

extraPlugins: Core.Config.Get('RichText.SpellChecker') ? 'aspell,onchange' : 'onchange',

You probably didn't have to do much more than enable spell checker in SysConfig.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

Re: CKEditor add spellchecker icon

Post by dstover »

Thanks very much. i enabled Core::SpellChecker in SysConfig and changed /usr/bin/ispell to /usr/bin/aspell and it worked.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
dstover
Znuny advanced
Posts: 135
Joined: 04 Jun 2013, 23:14
Znuny Version: 3.3.3
Real Name: Dan Stover
Company: EMAC, Inc.

Re: CKEditor add spellchecker icon

Post by dstover »

Thanks very much. i enabled Core::SpellChecker in SysConfig and changed /usr/bin/ispell to /usr/bin/aspell and it worked.
OTRS 3.3.3
Ubuntu 12.04
MySQL DB
Locked