Update compatibility with TinyMCE v4 (#247)
This commit is contained in:
parent
0d90f1f1dd
commit
a003866a55
|
@ -31,17 +31,9 @@ class AdminerTinymce {
|
||||||
?>
|
?>
|
||||||
<script<?php echo nonce(); ?>>
|
<script<?php echo nonce(); ?>>
|
||||||
tinyMCE.init({
|
tinyMCE.init({
|
||||||
mode: 'none',
|
|
||||||
theme: 'advanced',
|
|
||||||
plugins: 'contextmenu,paste,table',
|
|
||||||
entity_encoding: 'raw',
|
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; ?>'
|
language: '<?php echo $lang; ?>'
|
||||||
});
|
}); // learn how to customize here: https://www.tinymce.com/docs/configure/
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -70,7 +62,7 @@ tinyMCE.init({
|
||||||
if (preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
|
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("
|
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.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 () {
|
qs('#form').onsubmit = function () {
|
||||||
tinyMCE.each(tinyMCE.editors, function (ed) {
|
tinyMCE.each(tinyMCE.editors, function (ed) {
|
||||||
ed.remove();
|
ed.remove();
|
||||||
|
|
Loading…
Reference in a new issue