[SOLVED] Problem CKEditor Toolbar Full

Moderator: crythias

Post Reply
PriteshP23
OTRS newbie
Posts: 98
Joined: 02 Sep 2014, 23:01
OTRS Version?: 4.0.9-02

[SOLVED] Problem CKEditor Toolbar Full

Post by PriteshP23 »

Hello,
I am new to OTRS. I am using OTRS 3.6 and CK Editor 4.3. There is a problem in Copy from word. Basically, i want to use CKEditor Toolbar_Full WITH bydefault SpellCheck on and Paste from Word. I think i have to modify var/httpd/htdocs/js/Core.UI.RichTextEditor.js file. Please let me know if i need to change other files.

How to make toolbar_Full from simple Toolbar in RichTextEditor.js file ?

THANKS in advanced for your input and time.

Code: Select all

Editor = CKEDITOR.replace(EditorID,
{
customConfig: '', // avoid loading external config files
defaultLanguage: UserLanguage,
language: UserLanguage,
removePlugins : 'elementspath,scayt,menubutton',
disableNativeSpellChecker: false,
extraPlugins: Core.Config.Get('RichText.SpellChecker') ? 'aspell' : ''
});
Last edited by PriteshP23 on 03 Jun 2015, 11:33, edited 1 time in total.
OTRS 4.0.10-02 PostgreSQL 9.3.5
Perl 5.10.1 (linux) is used.
OS: Cent OS 6.5

jojo
Moderator
Posts: 14844
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: Problem CKEditor Toolbar Full

Post by jojo »

there is a sysconfig option to switch on some more CKEditor features. Not all features of the editor menue can be used in OTRS, thats why the full menu can not be used
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com

PriteshP23
OTRS newbie
Posts: 98
Joined: 02 Sep 2014, 23:01
OTRS Version?: 4.0.9-02

Re: Problem CKEditor Toolbar Full

Post by PriteshP23 »

@jojo
I tried this. But not working :(
Thanks in advanced.

Code: Select all

            toolbar_Full: Core.Config.Get('RichText.ToolbarFull'),
OTRS 4.0.10-02 PostgreSQL 9.3.5
Perl 5.10.1 (linux) is used.
OS: Cent OS 6.5

jojo
Moderator
Posts: 14844
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: Problem CKEditor Toolbar Full

Post by jojo »

switxh on Frontend::RichText::EnhancedMode via sysconfig
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com

PriteshP23
OTRS newbie
Posts: 98
Joined: 02 Sep 2014, 23:01
OTRS Version?: 4.0.9-02

Re: Problem CKEditor Toolbar Full

Post by PriteshP23 »

It is already swithced ON. Yes, i agree that it enables los of option than simple toolbar but not all that i want in toolbar. Atleast, It is better than before.
I believe one need to make modifications in Core.UI.RichTextEditor.js file.
Thanks for reply.
OTRS 4.0.10-02 PostgreSQL 9.3.5
Perl 5.10.1 (linux) is used.
OS: Cent OS 6.5

PriteshP23
OTRS newbie
Posts: 98
Joined: 02 Sep 2014, 23:01
OTRS Version?: 4.0.9-02

Re: Problem CKEditor Toolbar Full

Post by PriteshP23 »

Its almost done but Spellcheck is working only with Ctrl, not by single click and icon is not displaying. Any idea ?

Code: Select all

// add code to this file: var/httpd/htdocs/js/Core.UI.RichTextEditor.js

toolbar_Full: Core.Config.Get('RichText.ToolbarFull'),
+ toolbar: CheckFormID().length ? Core.Config.Get('RichText.ToolbarFull') : Core.Config.Get('RichText.ToolbarWithoutImage'),

// add code to this file: Kernel/Output/HTML/Standard/RichTextEditor.dtl

+Core.Config.Set('RichText.Toolbar_Full', [
+['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' ]
+]);
OTRS 4.0.10-02 PostgreSQL 9.3.5
Perl 5.10.1 (linux) is used.
OS: Cent OS 6.5

PriteshP23
OTRS newbie
Posts: 98
Joined: 02 Sep 2014, 23:01
OTRS Version?: 4.0.9-02

Re: Problem CKEditor Toolbar Full

Post by PriteshP23 »

Here is final version that worked for me:

Code: Select all

Core.Config.Set('RichText.Toolbar_Full', [
['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_Full', [
['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']
]);
}
Thanks a lot guys !
OTRS 4.0.10-02 PostgreSQL 9.3.5
Perl 5.10.1 (linux) is used.
OS: Cent OS 6.5

tpsupport
OTRS newbie
Posts: 71
Joined: 02 Feb 2011, 14:45
OTRS Version?: 6.0.12

Re: [SOLVED] Problem CKEditor Toolbar Full

Post by tpsupport »

For OTRS 6 and ckeditor 4.7 you also need to remove liststyle, contextmenu and tabletools from ckeditor.js.

Code: Select all

# Remove Ckeditor plugins with sed
sed -i 's/list,liststyle/list/g' /opt/otrs/var/httpd/htdocs/js/thirdparty/ckeditor-*/ckeditor.js
sed -i 's/menu,contextmenu/menu/g' /opt/otrs/var/httpd/htdocs/js/thirdparty/ckeditor-*/ckeditor.js
sed -i 's/table,tabletools/table/g' /opt/otrs/var/httpd/htdocs/js/thirdparty/ckeditor-*/ckeditor.js
Additionally you need to remove contextmenu_linkopen from Core.UI.RichTextEditor.js.

Code: Select all

otrs/var/httpd/htdocs/js/Core.UI.RichTextEditor.js
         EditorConfig = {
-            extraPlugins: 'splitquote,preventimagepaste,contextmenu_linkopen',
+            extraPlugins: 'splitquote,preventimagepaste',
OTRS 6 - Ubuntu 16.04 x64, Azure Database for MySQL server 5.7, Perl 5.22.1, Apache/2.4.18

Post Reply