簡體   English   中英

的Joomla! 1.5.26從JEditor或Javascript初始化TinyMCE

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM