[英]Joomla! 1.5.26 TinyMCE init from JEditor or Javascript
基本上就是Joomla! 用户加载特定页面时,可以启用或禁用基于参数的编辑器(JCE / TinyMCE)。 禁用表示:内容不可编辑,并且必须设置不透明度背景。
在default.php中:
<?php
$editor =& JFactory::getEditor();
/*
Parameter Type Default Description
$name string The control name
$html string The contents of the text area
$width string The width of the text area (px or %)
$height string The height of the text area (px or %)
$col int The number of columns for the textarea
$row int The number of rows for the textarea
$buttons boolean true True and the editor buttons will be displayed
$params array array() Associative array of editor parameters
*/
echo $editor->display('emailText', $this->articleFullText, '960', '700', '20', '20', false);
?>
是否可以在default.php(视图)中设置编辑器设置? (我没有找到任何特定的参数)
我创建了以下功能(由于stackoverflow),该功能可启用或禁用编辑器
function setEditorEditable(editable) {
if (editable == 1) {
tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'true');
J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 1);
} else {
tinymce.get(tinymce.activeEditor.id).getBody().setAttribute('contenteditable', 'false');
J('#' + tinymce.activeEditor.id + '_parent').fadeTo(0, 0.5);
}
}
但是,如果我在jQuery .ready中调用该函数,则编辑器DOM obj为null。
如何在代码中以及如何在代码中设置/更改编辑器设置?
谢谢!
这取决于要更改的编辑器设置和时间点。 可以在编辑器的init上设置一些参数。 此后无法更改其他一些参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.