简体   繁体   English

TinyMCE:启用单个按钮

[英]TinyMCE: Enable Individual Buttons

Can I add individual buttons? 我可以添加单个按钮吗?

I would like to give the user control, but not too much control so I need to enable some buttons but disable others. 我想给用户控制权,但不要给他们太多控制权,因此我需要启用一些按钮,而禁用其他按钮。

Can this be done? 能做到吗?

I have figured this out now. 我现在已经弄清楚了。

You have to use a theme. 您必须使用主题。 I used a pre-defined theme and I did this in the init function: 我使用了预定义的主题,并且在init函数中做到了:

tinyMCE.init({
    theme : "advanced",
    mode: "exact",
    elements : "elm1",
    theme_advanced_toolbar_location : "top",
    theme_advanced_buttons1 : "bold,italic,underline,separator,"
        + "formatselect,bullist,numlist,link,unlink,image,separator,"
            +"undo,redo,cleanup,code,separator,charmap",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
});

You name your textarea elm1 and then your good to go 您将您的textarea elm1命名为“好”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM