Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
CSL
Znuny expert
Posts: 159
Joined: 11 Nov 2011, 19:27
Znuny Version: 3.0.11

Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Post by CSL »

We upgraded to OTRS 3.3 recently and the biggest complaint from our users was the CKEditor (rich text editor) right-click context menu.

This overrides the web browser's own right-click menu with CKEditor's copy and paste commands, which has the annoying side-effect of preventing you from using automatic spell checking and corrections in browsers like Firefox.

Being able to quickly spell-check emails that were going out to clients was deemed vital, so I worked around this by editing this file:

Code: Select all

/opt/otrs/var/httpd/htdocs/js/thirdparty/ckeditor-4.3/ckeditor.js
On line 944 in that file it loads all of the plugins that CKEditor will be configured to use, inside the section CKEDITOR.config.plugins=

There are 3 entries that you need to remove from this list in order to disable the right-click context menu:

Code: Select all

'context menu' 'table tools' 'list style'
(the modified line with those plugins removed is below. You can copy and paste this over line 944 if your CKEditor is the same version 4.3, otherwise you're better to manually remove them instead in case the line has changed):

Code: Select all

!0,CKEDITOR.config.disableNativeSpellChecker=!0,CKEDITOR.config.contentsCss=CKEDITOR.basePath+"contents.css",CKEDITOR.config.plugins="dialogui,dialog,a11yhelp,about,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,dialogadvtab,div,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,format,forms,horizontalrule,htmlwriter,iframe,image,indent,indentlist,indentblock,justify,link,list,magicline,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,resize,save,selectall,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,templates,toolbar,undo,wysiwygarea",
Once you've deleted those entries from the list of plugins,

Clear OTRS's cache:

Code: Select all

perl /opt/otrs/bin/otrs.DeleteCache.pl
perl /opt/otrs/bin/otrs.LoaderCache.pl -o delete
Restart the web server,
Then try to right click in an editor window (email reply, etc).
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL
elitt
Znuny newbie
Posts: 70
Joined: 08 Jan 2015, 17:01
Znuny Version: 5.0.10
Real Name: Egareg JAOUEN
Company: Elitt

Re: Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Post by elitt »

Thank you for this tip !

I fight against aspell because CKeditor has a specific context menu but aspell doesn't work anymore on my server and my agents really need spellchecking...
Your tip let them use the spellchecker embedded in their browser.
OTRS v5.0.10 on Fedora25 with posgreSQL 9.4.9 database
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Post by crythias »

I'm including CKEditor docs for those who want a simpler (?) option: Hold ctrl key and right-click menu appears.
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
janArbeit
Znuny newbie
Posts: 5
Joined: 25 Feb 2016, 09:22
Znuny Version: OTRS 4.0
Real Name: Jan
Company: zetcom

Re: Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Post by janArbeit »

Is it possible to hide the table button from the button list? Because I fear if the ckeditor context menu is disabled somebody won't realize that tables cannot be changed anymore. Maybe somebody starts with a initial table configuration and edits it for a long time and then realizes no more rows can be added, i.e. I would prefer not to allow to add tables at all.
tpsupport
Znuny newbie
Posts: 75
Joined: 02 Feb 2011, 14:45
Znuny Version: 6.0.12

Re: Disable OTRS Rich Text Editor (CKEditor) Right-Click Menu

Post by tpsupport »

See my post for OTRS 6 and ckeditor 4.7 here: viewtopic.php?f=62&t=26360&p=165069#p165069

To remove the additional Items in the Richtext editor menu I disabled "Frontend::RichText::EnhancedMode" in Sysconfig.
Link to config item:
https://yourserver.com/index.pl?Action= ... hancedMode
Znuny 6.5 LTS - Ubuntu 20.04 x64, Azure Database for MySQL server 5.7, Perl 5.22.1, Apache/2.4.18
Post Reply