]> git.joonet.de Git - adminer.git/commitdiff
Update compatibility with TinyMCE v4 (#247)
authorSteven Adger <adgitate@gmail.com>
Mon, 29 Jan 2018 17:09:35 +0000 (10:09 -0700)
committerJakub Vrána <jakub@vrana.cz>
Mon, 29 Jan 2018 17:09:35 +0000 (18:09 +0100)
plugins/tinymce.php

index 3c3af090718799267444aaff35b9e99a75a63eb8..5c4d32bc8c5596c2d88261f6ee684b8dc5a27a71 100644 (file)
@@ -31,17 +31,9 @@ class AdminerTinymce {
                ?>
 <script<?php echo nonce(); ?>>
 tinyMCE.init({
-       mode: 'none',
-       theme: 'advanced',
-       plugins: 'contextmenu,paste,table',
        entity_encoding: 'raw',
-       theme_advanced_buttons1: 'bold,italic,link,unlink,|,sub,sup,|,bullist,numlist,|,cleanup,code',
-       theme_advanced_buttons2: 'tablecontrols',
-       theme_advanced_buttons3: '',
-       theme_advanced_toolbar_location: 'top',
-       theme_advanced_toolbar_align: 'left',
        language: '<?php echo $lang; ?>'
-});
+}); // learn how to customize here: https://www.tinymce.com/docs/configure/
 </script>
 <?php
        }
@@ -70,7 +62,7 @@ tinyMCE.init({
                if (preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
                        return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea>" . script("
 tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
-tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
+tinyMCE.EditorManager.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
 qs('#form').onsubmit = function () {
        tinyMCE.each(tinyMCE.editors, function (ed) {
                ed.remove();