简体   繁体   中英

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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