Roundcube Community Forum

 

How to modify TinyMCE toolbar

Started by husky83, October 13, 2017, 01:24:03 PM

Previous topic - Next topic

husky83

Hi!
I'd like to add a few buttons to the TinyMCE menubar - which file do I need to change in order to do that?

alec


husky83

Great, thanks :-D

Tried that - added "strikethrough" in the first section of both "toolbar" stanzas in program/js/editor.js - to no avail. Restarted both NginX/PHP and Redis Cache - but still no button shown.
Any ideas why it doesn't work?

JohnDoh

in program/js/ do you also have a file called editor.min.js? if so you'll need to delete that file and (if you want minified js) re-minify editor.js
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

husky83

Nope, here's the contents:
user@host:/home/user# ls -l /usr/share/roundcubemail/program/js/
total 584
-rw-r--r-- 1 root root 296658 Oct  5 19:21 app.js
-rw-r--r-- 1 root root  22127 Sep  7 10:11 common.js
-rw-r--r-- 1 root root  27819 Oct 13 19:44 editor.js
-rw-r--r-- 1 root root  34367 Apr  4  2017 googiespell.js
-rw-r--r-- 1 root root  88107 Oct  5 19:21 jquery.min.js
-rw-r--r-- 1 root root  13578 Oct  5 19:21 jstz.min.js
-rw-r--r-- 1 root root  46460 Sep  7 10:11 list.js
-rw-r--r-- 1 root root  20228 Oct  5 19:21 publickey.js
drwxr-xr-x 1 root root     74 Oct  9 17:42 tinymce
-rw-r--r-- 1 root root  31056 Jun 22 10:13 treelist.js


Any idea how to make the added buttons appear?

JohnDoh

so what you did was something like this:


--- a/program/js/editor.js  2017-10-15 07:34:57.004498382 +0100
+++ b/program/js/editor.js  2017-10-17 07:34:29.531100299 +0100
@@ -90,7 +90,7 @@
     $.extend(conf, {
       plugins: 'autolink charmap code colorpicker directionality link lists image media nonbreaking'
         + ' paste table tabfocus textcolor searchreplace spellchecker',
-      toolbar: 'bold italic underline | alignleft aligncenter alignright alignjustify'
+      toolbar: 'strikethrough bold italic underline | alignleft aligncenter alignright alignjustify'
         + ' | bullist numlist outdent indent ltr rtl blockquote | forecolor backcolor | fontselect fontsizeselect'
         + ' | link unlink table | $extra charmap image media | code searchreplace undo redo',
       spellchecker_rpc_url: abs_url + '/?_task=utils&_action=spell_html&_remote=1',


it works fine for me. I guess check where your browser is reading editor.js from and that in version your browser is using has the change in.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...