diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-10-27 19:18:23 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-10-27 19:18:23 +0300 |
commit | 2aa9ee56fd8f4e36c9d5c65cf1b7dc15def11f82 (patch) | |
tree | 588a8966292aeede61abb1cf43791bf4c1749248 /program | |
parent | eb721e35b2fe59eee160dd0116871b847b9f6e3b (diff) |
Fix so disabling emoticons plugin really removes emoticons button from HTML editor
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcmail.php | 6 | ||||
-rw-r--r-- | program/js/editor.js | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index d74b70534..d64ba2d93 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1884,6 +1884,8 @@ class rcmail extends rcube $spelldict = intval($this->config->get('spellcheck_dictionary')); $disabled_plugins = array(); $disabled_buttons = array(); + $extra_plugins = array(); + $extra_buttons = array(); if (!$spellcheck) { $disabled_plugins[] = 'spellchecker'; @@ -1893,6 +1895,8 @@ class rcmail extends rcube 'mode' => $mode, 'disabled_plugins' => $disabled_plugins, 'disabled_buttons' => $disabled_buttons, + 'extra_plugins' => $extra_plugins, + 'extra_buttons' => $extra_buttons, )); if ($hook['abort']) { @@ -1924,6 +1928,8 @@ class rcmail extends rcube 'spelldict' => $spelldict, 'disabled_plugins' => $hook['disabled_plugins'], 'disabled_buttons' => $hook['disabled_buttons'], + 'extra_plugins' => $hook['extra_plugins'], + 'extra_buttons' => $hook['extra_buttons'], ); $this->output->add_label('selectimage', 'addimage', 'selectmedia', 'addmedia'); diff --git a/program/js/editor.js b/program/js/editor.js index 3a76ad0b0..50ba03da6 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -88,11 +88,11 @@ function rcube_text_editor(config, id) // full-featured editor else { $.extend(conf, { - plugins: 'autolink charmap code colorpicker directionality emoticons link image media nonbreaking' + plugins: 'autolink charmap code colorpicker directionality link image media nonbreaking' + ' paste table tabfocus textcolor searchreplace spellchecker', toolbar: 'bold italic underline | alignleft aligncenter alignright alignjustify' + ' | bullist numlist outdent indent ltr rtl blockquote | forecolor backcolor | fontselect fontsizeselect' - + ' | link unlink table | emoticons charmap image media | code searchreplace undo redo', + + ' | link unlink table | $extra charmap image media | code searchreplace undo redo', spellchecker_rpc_url: abs_url + '/?_task=utils&_action=spell_html&_remote=1', spellchecker_language: rcmail.env.spell_lang, accessibility_focus: false, @@ -102,6 +102,16 @@ function rcube_text_editor(config, id) }); } + // add TinyMCE plugins/buttons from Roundcube plugin + $.each(config.extra_plugins || [], function() { + if (conf.plugins.indexOf(this) < 0) + conf.plugins = conf.plugins + ' ' + this; + }); + $.each(config.extra_buttons || [], function() { + if (conf.toolbar.indexOf(this) < 0) + conf.toolbar = conf.toolbar.replace('$extra', '$extra ' + this); + }); + // disable TinyMCE plugins/buttons from Roundcube plugin $.each(config.disabled_plugins || [], function() { conf.plugins = conf.plugins.replace(this, ''); @@ -109,7 +119,8 @@ function rcube_text_editor(config, id) $.each(config.disabled_buttons || [], function() { conf.toolbar = conf.toolbar.replace(this, ''); }); - conf.toolbar = conf.toolbar.replace(/\|\s+\|/g, '|'); + + conf.toolbar = conf.toolbar.replace('$extra', '').replace(/\|\s+\|/g, '|'); // support external configuration settings e.g. from skin if (window.rcmail_editor_settings) |