我一直在所选文本上添加内容工具栏。
但是当您右键单击任何地方时,您将看到一个上下文菜单,其中包含一项“链接”。如何在此列表中添加例如charmap插件? 我想不通。
到目前为止,这是我的代码:
tinymce.init({
branding : false,
content_css : '/css/tinymce_content.css',
language : 'nl',
menubar : false,
plugins : ['charmap fullscreen hr link lists paste tabfocus'],
relative_urls : false,
remove_script_host : false,
selector : '#' + alineaId,
style_formats: [
{title: 'Heading 2', format: 'h2'},
{title: 'Heading 3', format: 'h3'},
{title: 'Heading 4', format: 'h4'},
{title: 'Heading 5', format: 'h5'},
{title: 'Heading 6', format: 'h6'},
{title: 'Normal', block: 'p'}
],
toolbar : 'fullscreen | undo redo',
fullscreen_new_window : true,
fullscreen_settings : {
theme_advanced_path_location : 'top'
},
setup: function (editor) {
editor.ui.registry.addContextToolbar('textselection', {
predicate: function (node) {
return !editor.selection.isCollapsed();
},
items: 'bold italic | styleselect | link | bullist numlist',
position: 'selection',
scope: 'node'
});
}
});
这是一个链接,其中还包括一个代码笔。右键单击编辑器,您将看到带有“链接”的上下文菜单,我要在该菜单上添加charmap插件。
答案 0 :(得分:1)
使用与toolbar
相同的格式:
contextmenu: 'charmap undo | redo'