我正在尝试自定义默认styleselect
工具栏菜单,以便可以向其添加自定义菜单元素。这个想法是将字体大小作为styleselect
子菜单:
TinyMCE 4.0.5
我通过以下方式 初始化 a :
tinymce.init(
{
language_url : '/webobbywebapp/js/tiny_mce/language/es.js',
selector:'textarea',
plugins: "image, link, print",
toolbar: "styleselect | undo redo | removeformat | bold italic underline | aligncenter alignjustify | bullist numlist outdent indent | link | print | fontselect fontsizeselect",
menubar: false,
statusbar: true,
resize: true
});
由于我无法找到如何自定义默认样式选择菜单,我也在尝试创建一个完整的新菜单,我可以在其中添加字体大小控制。但我不想显示任何工具栏,我想要一个菜单栏。
编辑:现在我正在尝试使用以下代码修改样式选择菜单,但 fontselect 和 fontsizeselect 似乎已禁用
,style_formats: [{ 标题:“标题_”, 项目:[{标题:“标题1”,格式:“h1”},{标题:“标题2”,格式:“h2”},{标题:“标题3”,格式:“h3”},{标题:“标题 4”,格式:“h4”},{标题:“标题 5”,格式:“h5”},{标题:“标题 6”,格式:“h6”}] }, {标题:“_Inline”,项目:[{标题:“粗体”,图标:“粗体”,格式:“粗体”},{标题:“斜体”,图标:“斜体”,格式:“斜体”}, {title: "_Underline",icon: "underline",format: "underline"}, {title: "Strikethrough",icon: "strikethrough",format: "strikethrough"}, {title: "Superscript",icon: "上标”,格式:“上标”},{标题:“下标”,图标:“下标”,格式:“下标”},{标题:“代码”,图标:“代码”,格式:“代码”}] }, {title: "_Blocks",items: [{title: "Paragraph",format: "p"}, {title: "Blockquote",format: "blockquote"}, {title: "Div",format: "div" }, {title: "Pre",format: "pre"}]}, {title: "_Alignment",items: [{title: "Left",icon: "alignleft",format: "alignleft"}, {title: "Center",icon: "aligncenter",format: "aligncenter"}, {标题:“右”,图标:“对齐”,格式:“对齐”},{标题:“对齐”,图标:“对齐”,格式:“对齐”}]}, {title: "Classes", items: 'fontsizeselect'}, {标题:“dddClasses”,项目:“字体选择” }]