Author Topic: How to modify TinyMCE toolbar  (Read 4519 times)

Offline husky83

  • Jr. Member
  • **
  • Posts: 19
How to modify TinyMCE toolbar
« on: October 13, 2017, 01:24:03 PM »
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?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: How to modify TinyMCE toolbar
« Reply #1 on: October 14, 2017, 02:43:57 AM »
program/js/editor.js

Offline husky83

  • Jr. Member
  • **
  • Posts: 19
Re: How to modify TinyMCE toolbar
« Reply #2 on: October 14, 2017, 11:49:47 AM »
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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: How to modify TinyMCE toolbar
« Reply #3 on: October 15, 2017, 02:04:10 AM »
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…

Offline husky83

  • Jr. Member
  • **
  • Posts: 19
Re: How to modify TinyMCE toolbar
« Reply #4 on: October 15, 2017, 11:45:50 AM »
Nope, here's the contents:
Code: [Select]
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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Re: How to modify TinyMCE toolbar
« Reply #5 on: October 17, 2017, 02:39:24 AM »
so what you did was something like this:

Code: [Select]
--- 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…