如何使用 jQuery 适配器将配置信息传递到 CKEditor?
我正在使用最新的 CKeditor 和 jQuery 适配器。
我已经成功让它工作并显示。
但是,由于我对 CKeditor 完全陌生,如何使用 jQuery 方法传入配置变量?
这就是我从我所读到的内容中得到的
$( '#input-content' ).ckeditor('', {
toolbar: 'basic'
});
,第一个参数是回调,第二个参数是配置。但这样做并没有改变编辑器。
如何使用jQuery<使用这些配置属性等/strong> 适配器?
I'm using the latest CKeditor with jQuery adapter.
I have successfully got it to work, and display.
However, as I am completely new to CKeditor, how do I pass in config variables using the jQuery method?
This is what I've got
$( '#input-content' ).ckeditor('', {
toolbar: 'basic'
});
I think from what I've read, the first argument is meant to be a callback, and the 2nd the config. But doing this has not changed the editor at all.
How do I use these config properties etc using the jQuery adapter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我已经使用这段代码完成了这一点。希望这有帮助。
这是 html:
这是 javascript:
I have accomplished this using this code. Hopefully this helps.
Here is the html:
and here is the javascript:
我传递了一个空函数...
I passed an empty function...
只需添加相应的配置对象,上面我添加了 coreStyles_bold,我所做的就是将 CK API 文档中的“=”更改为“:”
Simply add the respective config object, above I added coreStyles_bold, All I did is change the "=" from the CK API documentation to a ":"
有一个官方文档,请参阅 jQuery 适配器
ckeditor() 方法接受两个可选参数:
There is an official documentation for it, see jQuery Adapter
The ckeditor() method accepts two optional parameters:
不确定这是否是 CKEDITOR 的新功能,但只是想分享我的解决方案(以防它可以帮助现在寻找此功能的任何人):
...我的配置如下所示(只需复制默认的 config.js):
Not sure if this is a new feature of CKEDITOR, but just want to share my solution (in case it helps anyone looking for this now):
... and my config looks like this (simply copied the default config.js):