我尝试将气球面板插件集成到我的编辑器中。
我使用文档中的代码。
editor.on( 'instanceReady', function() {
var toolbar = new CKEDITOR.ui.balloonToolbar( editor );
toolbar.addItems( {
link: new CKEDITOR.ui.button( {
command: 'link'
} ),
unlink: new CKEDITOR.ui.button( {
command: 'unlink'
} )
} );
editor.on( 'selectionChange', function( evt ) {
var lastElement = evt.data.path.lastElement;
if ( lastElement ) {
toolbar.attach( lastElement );
}
} );
} );
但是,当我单击编辑器时,它会给出以下错误消息。
下面提供了文档链接
不知道什么意思。
更新:(附上代码)
我的原始代码看起来像这样,
<body>
<textarea id="editor1"></textarea>
<script>
CKEDITOR.replace('editor1', {
toolbarGroups: [{
name: 'basicstyles'
}, {
name: 'authorgroup'
}],
removePlugins: 'indent,indentblock,indentlist,list,removeformat,table,tabletools,entities,menu,find,font,iframe,pagebreak,flash,print,preview,save,smiley,pastetext,crossreference,youtube,footnotes,dragdrop,basket,horizontalrule,indentlist,image,format,selectall,specialchar,spellchecker,pastefromword,showblocks,link,unlink,anchor,copyformatting',
extraPlugins: 'indentmodify,indentblockmodify,indentlistmodify,listmodify,removeformatmodified,table1,tabletools1,entitiesmodified,menumodified,findmodified,stylesheetparser,characterStyle,zoom,eventhandler,navigate,comment,symbol,notification,authorproff,proffpara,Newcitation,customfootnotes,floatingmenu,pubsearch,balloontoolbar,balloonpanel,autocorrect'
});
//My instanceReady Code Goes Here
</script>
</body>
最佳答案
我使用新的 CKEditor 实例检查了此代码示例,它工作正常。您向我们提供的信息太少,无法得到任何可靠的答案。
要在没有错误或奇怪行为的情况下运行此示例,您应该在 CKEditor 配置中包含 wysiwygarea,toolbar,link,balloontoolbar
插件。访问Setting CKEditor configuration如果您需要一些帮助。
如果它不能解决您的问题,请向我们展示一些代码或尝试使用最少的配置重现问题。
Codepen工作样本。
我必须提到,它无法按预期工作,因为我们在选择的 balloonpanel
定位方面存在一些问题。您可以在github上找到有关问题实际状态的更多信息。
关于javascript - 如何将 Balloonpanel 插件集成到我的编辑器中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49318773/