4

TinyMCE 4 をモダンなテーマで使用しています。エディターの下部にあるツールバーの場所を設定したい (ステータス バーがある場所と同じように)

コードは次のとおりですが、機能していません。

tinymce.init({
                selector: 'textarea#editor',
                menubar: false,
                statusbar: false,
                resize: false,
                height: textEditHeight,
                theme_modern_toolbar_location : "bottom",
});
4

5 に答える 5

4

これは古い投稿であることは知っていますが、解決策を共有すると思いました。

「init」イベントのイベント ハンドラーを追加し、jQuery を使用してツールバーとエディターの div の順序を変更します。

tinyMCE.init({
...

    setup: function (ed) {
      ed.on('init', function (evt) {
          var toolbar = $(evt.target.editorContainer)
                            .find('>.mce-container-body >.mce-toolbar-grp');
          var editor = $(evt.target.editorContainer)
                            .find('>.mce-container-body >.mce-edit-area');

          // switch the order of the elements
          toolbar.detach().insertAfter(editor);
      });
}
于 2015-02-24T22:04:19.997 に答える
4

純粋な CSS を使用する方法を見つけました。このコードをカスタム css ファイルまたは html のスタイル タグに追加するだけです。

#mceu_5-body{
   display: flex;
   flex-direction: column-reverse;
}

それが行うことは、divが配置される方向を逆にすることです。つまり、下から上へです。唯一の欠点は、flex が最新の CSS プロパティであるため、古いブラウザーではサポートされていないことです。

于 2016-10-06T07:10:48.477 に答える
3

tinyMCE ドキュメントに基づいて、 theme_modern_toolbar_location : "bottom" のみを使用できます

高度なテーマを使用する場合。

theme : "advanced",

完全な例:

<script type="text/javascript">
// O2k7 skin
tinyMCE.init({
        // General options
        mode : "exact",
        elements : "elm1",
        theme : "advanced",
        skin : "o2k7",
        plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        theme_advanced_toolbar_location : "bottom"
});

</script>

<form method="post" action="dump.php">
        <textarea id="elm1" name="elm1" style="width:100%">
        </textarea>


</form>
于 2013-10-13T15:43:08.260 に答える
1

彼らのブログ投稿の 1 つで、advanced_theme を削除したと述べています。したがって、TinyMCE の下部にあるツールバーを使用する場合は、新しいスキンを作成する必要があります。

于 2013-10-19T02:38:57.163 に答える
0

カスタム css ファイルの下部に css コードを挿入します

.mce-top-part{
    position:absolute;
    bottom:0
}
于 2019-02-07T08:21:34.217 に答える