javascript CKEditor - 没有工具栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8344567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CKEditor - No toolbars
提问by fredck
So I got a textarea
with CKEditor
plugin but I just want it clean, without anything. No toolbars and no status or whatever bar. It′s simple but I can′t find it on docs or web!
所以我得到了一个textarea
withCKEditor
插件,但我只想让它干净,没有任何东西。没有工具栏,没有状态或任何栏。这很简单,但我在文档或网络上找不到它!
My CKEditor
is started with:
我CKEditor
的开头是:
$('#texto').ckeditor({skin:'office2003'});
$('#texto').ckeditor({skin:'office2003'});
采纳答案by wsanville
You can edit the config.js
file in the directory where you put the source files to specify custom toolbars.
您可以config.js
在放置源文件的目录中编辑文件以指定自定义工具栏。
CKEDITOR.editorConfig = function( config )
{
config.toolbar = 'Custom'; //makes all editors use this toolbar
config.toolbar_Custom = []; //define an empty array or whatever buttons you want.
};
See the developer's guidefor more info.
有关更多信息,请参阅开发人员指南。
回答by fredck
Actually, the right way for it is simply removing the plugins that render these features:
实际上,正确的方法是删除呈现这些功能的插件:
config.removePlugins = 'toolbar,elementspath,resize';
With the new CKEditor 4, you may even build your own editor without these plugins, making your the editor code smaller: http://ckeditor.com/builder
使用新的 CKEditor 4,您甚至可以在没有这些插件的情况下构建自己的编辑器,从而使您的编辑器代码更小:http: //ckeditor.com/builder
回答by John Magnolia
Following on from @wsanwille answer to also hide the toolbar.
继@wsanwille 回答后,也隐藏工具栏。
CKEDITOR.replace('description', {
toolbar: 'Custom', //makes all editors use this toolbar
toolbarStartupExpanded : false,
toolbarCanCollapse : false,
toolbar_Custom: [] //define an empty array or whatever buttons you want.
});
回答by Duy Momentive
With CKE 4 or newer, you can use below lines to config your CKE locally:
使用 CKE 4 或更新版本,您可以使用以下几行在本地配置您的 CKE:
<script type="text/javascript">
$(document).ready(function()
{
CKEDITOR.replace('textArea-id');
CKEDITOR.config.toolbar = [['Bold','Italic','Underline']] ;
CKEDITOR.config.uiColor = '#fff';
});
Hope this helps.
希望这可以帮助。