使用此 codepen http://codepen.io/tinymce/pen/NGegZK
代码:
tinymce.init({
selector: 'textarea',
height: 500,
theme: 'modern',
plugins: [
'advlist autolink lists link image hr anchor media table',
'emoticons template paste textcolor colorpicker imagetools'
],
toolbar1: 'bold italic formatting | fontsizeselect forecolor backcolor removeformat | format bullist numlist outdent indent | table link emoticons',
image_advtab: true,
menubar: false,
templates: [
{ title: 'Test template 1', content: 'Test 1' },
{ title: 'Test template 2', content: 'Test 2' }
],
setup: function(editor) {
editor.addButton('formatting', {
type: 'menubutton',
text: '',
icon: true,
image: 'http://www.veryicon.com/icon/16/System/iOS7%20Minimal/Text%20Formatting%20Border%20color.png',
menu: [{
text: 'Make me font size select!',
}
}, {
text: 'Forecolor etc',
}]
});
},
content_css: [
'//fast.fonts.net/cssapi/e6dc9b99-64fe-4292-ad98-6974f93cd2a2.css',
'//www.tinymce.com/css/codepen.min.css'
]
});
注意第三项是自定义格式菜单(看起来像蜡笔)
我想要做的是将 fontsizeselect forecolor backcolor removeformat 插件嵌入到该菜单中。
我需要从头开始重建所有插件吗?看起来它们应该可以在菜单中使用,不是吗?谢谢。