如何将 Balloonpanel 插件集成到我的编辑器中?
How to integrate Balloonpanel plugin into my editor?
我尝试将 balloonpanel 插件集成到我的编辑器中。
我使用文档中的代码。
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 );
}
} );
} );
但是,当我点击编辑器时,它会给出以下错误信息。
下面提供了文档link
不知道什么意思
更新:(附上代码)
我的原始代码是这样的,
<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
上找到有关问题实际状态的更多信息
我尝试将 balloonpanel 插件集成到我的编辑器中。
我使用文档中的代码。
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 );
}
} );
} );
但是,当我点击编辑器时,它会给出以下错误信息。
下面提供了文档link
不知道什么意思
更新:(附上代码)
我的原始代码是这样的,
<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