Update compatibility with TinyMCE v4 (#247)

This commit is contained in:
Steven Adger 2018-01-29 10:09:35 -07:00 committed by Jakub Vrána
parent 0d90f1f1dd
commit a003866a55

View 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();