gwt + ckeditor config.js定制化问题
来源:互联网 发布:psp值得玩的游戏知乎 编辑:程序博客网 时间:2024/05/05 20:29
此问题出现在本地测试的时候:
1. 定制化config.js应该放的位置
放到gwt/server 端的src/main/webapp/ckeditor_local/config.js下,这样会被打包到apache-tomee/webapps/ROOT下, 然后
$wnd.CKEDITOR
.replace(id, {
customConfig : '/ckeditor_local/config.js'
});
就可以使定制化生效了。
2. 使用独立服务器(CDN)放置ckeditor的包时, 需要在index.html中配置如下:
<script type="text/javascript">
var CKEDITOR_BASEPATH = '//www-static.***.com/libs/ckeditor-4.4.5/';
</script>
<script src="//www-static.***.com/libs/ckeditor-4.4.5/ckeditor.js"></script>
但是customConfig : '/ckeditor/config.js'就不work了。这个是误解。 这个是因为www-static上的ckeditor package plugins里没有autosave, 而我的ckeditor_local/config.js里有autosave的配置,所以导致出错,实际上可以在firebug中看到这个错误的原因。 而且和CKEDITOR_BASEPATH也没有关系。 我发现CKEDITOR_BASEPATH根本没必要配置。
3. 一直想把定制的ckeditor/config.js放到gwt/client一侧,但是一直不生效。【这个是错误做法,肯定不行。 只能放到gwt server, webapp下,也就是web server的root path下】
无论放到src/main/resources还是src/main/resources/com/.../client/ckeditor/config.js 都不行。
4. 添加ckeditor autogrow插件
editor.config.extraPlugins = 'autogrow';
editor.config.autoGrow_minHeight = 100;
editor.config.autoGrow_maxHeight = 1000;
editor.config.removePlugins = 'resize';
5. ckeditor 在使用CDN情况下的配置
refer to: https://cdn.ckeditor.com/
6. 从server本地添加autosave插件的方法:
$wnd.CKEDITOR.plugins.addExternal('autosave',
'/ckeditor_local/plugins/autosave/', 'plugin.js');
$wnd.CKEDITOR
.replace(id, {
customConfig : '/ckeditor_local/config.js'
});
7. 如果Toolbar 上没有出现想要的button, 比如TextColor, BGColor, 可能是因为缺少插件(那些插件不是默认添加的)
可以这样一次添加多个插件,主要如果写多次 config.extraPlugins =xxx, 后面的会覆盖前面的。
config.extraPlugins = 'autosave,colorbutton,showblocks';
8. 获取CKEditor Toolbar命令Button的状态
public native int getCommandState(String command) /*-{
return this.@com.xyz.gwt.client.entries.CKEditor::editor
.getCommand(command).state;
}-*/;
- gwt + ckeditor config.js定制化问题
- CKEDITOR config.js配置
- CKEDITOR config.js配置
- CKEditor配置config.js
- CKEditor不能读取config.js配置的问题
- CKEditor config.js文件配置
- ckeditor config.js 的自定义
- CKEDITOR的config.js文件
- CKEditor之配置文件config.js
- ckeditor用户自定义配置文件config.js
- CKEditor config.js 详细配置说明
- CKEditor config.js 详细配置说明
- CKEditor之config.js自定义编辑
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- android 图片阅读 之 穹の思念
- C语言辗转相除法求最大公约数(欧几里得算法)
- Android 中 EditText 如何隐藏系统提供的键盘总结
- 数据结构课程设计【附上代码】
- C3P0,Proxool,BoneCP,Druid等连接池的断开自动重联功能
- gwt + ckeditor config.js定制化问题
- ubuntu下MySQL数据库中文乱码问题解决
- c#操作json
- SEO实战:目标用户组排名技巧
- Yii2优雅的Active Record
- 冒泡排序
- 分享一个Android Expand Collapse的动画
- Android ListView使用BaseAdapter与ListView的优化
- JAX-RS规范-常用注解浅析