如何从斗斗4中移除按钮?

时间:2022-10-29 14:19:57

The question is in the title : How to remove buttons from CKeditor 4 .

问题是在标题中:如何从CKeditor 4中移除按钮。

Documentation does not answer it clearly

文档没有很清楚地回答。

10 个解决方案

#1


39  

Based on reinmar answer and tested here is the better answer. Add this in your ckeditor config.js :

基于reinmar的回答和测试,这里是更好的答案。将此添加到您的ckeditor配置中。js:

config.removeButtons = 'Underline,JustifyCenter';

For reference you can find the complete list of CKeditor 4 buttons there : http://ckeditor.com/comment/123266#comment-123266

为参考,您可以在那里找到一个完整的CKeditor 4按钮列表:http://ckeditor.com/comment/123266# comm-123266。

#2


25  

I finaly found how, but I don't like this way as instead of removing what you don't want, you define which buttons you want (and simply don't put what you don't want). When you call CKeditor.replace you can define the toolbar like so:

我终于找到了,但是我不喜欢这样做,因为我不想删除你不想要的东西,你可以定义你想要的按钮(并且简单的不要把你不想要的)。当你叫CKeditor。替换您可以这样定义工具栏:

    CKEDITOR.replace( 'YOURE_TEXT_AREA_ID', {
    toolbar: [
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
    { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
    { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
    { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
    '/',
    { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
    { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
    { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
    { name: 'others', items: [ '-' ] },
    { name: 'about', items: [ 'About' ] }
]
});

(For reference this is the standard full toolbar) Items represent buttons so simply delete the items you don't want. Thats it.

(这是标准的完整工具栏)条目表示按钮,所以简单地删除你不想要的条目。这是它。

Is there any better answer ?

有更好的答案吗?

#3


13  

To remove buttons, try:

删除按钮,尝试:

$(document).ready(function() {
   CKEDITOR.config.removePlugins = 'Save,Print,Preview,Find,About,Maximize,ShowBlocks';
});

The comma-separated list must contain the name of each button you want to remove. The following link is the complete list of the buttons containing the toolbar ckeditor:

逗号分隔的列表必须包含要删除的每个按钮的名称。下面的链接是包含工具栏控制器的按钮的完整列表:

list-buttons

list-buttons

#4


7  

In config.js file inside scripts/ckeditor/ of your project, just do the following way

在配置。js文件在脚本/ckeditor/您的项目中,只是按照下面的方式。

config.removePlugins = 'elementspath,save,image,flash,iframe,link,smiley,tabletools,find,pagebreak,templates,about,maximize,showblocks,newpage,language';

config.removeButtons = 'Copy,Cut,Paste,Undo,Redo,Print,Form,TextField,Textarea,Button,SelectAll,NumberedList,BulletedList,CreateDiv,Table,PasteText,PasteFromWord,Select,HiddenField';

#5


4  

There is a handy tool come by default with the bundle, which can be found at ckeditor/samples/toolbarconfigurator/index.html. It allows you to config the toolbar using GUI.

有一个很方便的工具,默认情况下有一个bundle,它可以在ckeditor/samples/toolbarconfigurator/index.html中找到。它允许您使用GUI配置工具栏。

#6


3  

After much fooling around with manually removing button and styling the toolbar by editing the config.js file, I found the ToolBar Configurator.

在通过手动删除按钮和编辑工具栏来修改工具栏之后。js文件,我找到了工具栏配置器。

With that you can easily enable or disable buttons. Change button group order and add separators.

这样你就可以轻松地启用或禁用按钮。更改按钮组顺序并添加分隔符。

It is located in the /samples/toolbarconfigurator of the ckeditor folder. Just launch the index.html. The Toolbar Configurator is inlcuded in all the different download packages on the download page

它位于ckeditor文件夹的/samples/toolbarconfigurator中。只是启动index . html。在下载页面上的所有不同的下载包中都包含了工具栏配置器。

When you are done creating your toolbar, just click Get toolbar config and copy the style to the config.js file located in the main ckeditor folder.

当您完成创建工具栏时,只需单击Get toolbar config并将样式复制到config。js文件位于主要的ckeditor文件夹中。

如何从斗斗4中移除按钮?

#7


1  

Open your config.js file and paste this code

打开你的配置。js文件并粘贴此代码。

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
    config.removePlugins = 'blockquote,save,flash,iframe,tabletools,pagebreak,templates,about,showblocks,newpage,language,print,div';
    config.removeButtons = 'Print,Form,TextField,Textarea,Button,CreateDiv,PasteText,PasteFromWord,Select,HiddenField,Radio,Checkbox,ImageButton,Anchor,BidiLtr,BidiRtl,Font,Format,Styles,Preview,Indent,Outdent';
};

#8


0  

Try

试一试

config.removeButtons = 'Save'; 

this will completely remove the save button.

这将完全删除save按钮。

#9


0  

Its so Simple. Modify config.js file as below

它如此简单。修改配置。js文件如下

CKEDITOR.editorConfig = function (config) {

config.removePlugins = 'save,newpage,flash,about,iframe,language'; 
//The options which you don't need in the toolbar, you can add them in the above remove plugins list.

};

#10


-4  

CKEDITOR.config.removePlugins = 'elementspath,save,about,forms,find,selectall,specialchar,flash,smiley,iframe,showblocks,language';

#1


39  

Based on reinmar answer and tested here is the better answer. Add this in your ckeditor config.js :

基于reinmar的回答和测试,这里是更好的答案。将此添加到您的ckeditor配置中。js:

config.removeButtons = 'Underline,JustifyCenter';

For reference you can find the complete list of CKeditor 4 buttons there : http://ckeditor.com/comment/123266#comment-123266

为参考,您可以在那里找到一个完整的CKeditor 4按钮列表:http://ckeditor.com/comment/123266# comm-123266。

#2


25  

I finaly found how, but I don't like this way as instead of removing what you don't want, you define which buttons you want (and simply don't put what you don't want). When you call CKeditor.replace you can define the toolbar like so:

我终于找到了,但是我不喜欢这样做,因为我不想删除你不想要的东西,你可以定义你想要的按钮(并且简单的不要把你不想要的)。当你叫CKeditor。替换您可以这样定义工具栏:

    CKEDITOR.replace( 'YOURE_TEXT_AREA_ID', {
    toolbar: [
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
    { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
    { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
    { name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
    '/',
    { name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
    { name: 'colors', items: [ 'TextColor', 'BGColor' ] },
    { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
    { name: 'others', items: [ '-' ] },
    { name: 'about', items: [ 'About' ] }
]
});

(For reference this is the standard full toolbar) Items represent buttons so simply delete the items you don't want. Thats it.

(这是标准的完整工具栏)条目表示按钮,所以简单地删除你不想要的条目。这是它。

Is there any better answer ?

有更好的答案吗?

#3


13  

To remove buttons, try:

删除按钮,尝试:

$(document).ready(function() {
   CKEDITOR.config.removePlugins = 'Save,Print,Preview,Find,About,Maximize,ShowBlocks';
});

The comma-separated list must contain the name of each button you want to remove. The following link is the complete list of the buttons containing the toolbar ckeditor:

逗号分隔的列表必须包含要删除的每个按钮的名称。下面的链接是包含工具栏控制器的按钮的完整列表:

list-buttons

list-buttons

#4


7  

In config.js file inside scripts/ckeditor/ of your project, just do the following way

在配置。js文件在脚本/ckeditor/您的项目中,只是按照下面的方式。

config.removePlugins = 'elementspath,save,image,flash,iframe,link,smiley,tabletools,find,pagebreak,templates,about,maximize,showblocks,newpage,language';

config.removeButtons = 'Copy,Cut,Paste,Undo,Redo,Print,Form,TextField,Textarea,Button,SelectAll,NumberedList,BulletedList,CreateDiv,Table,PasteText,PasteFromWord,Select,HiddenField';

#5


4  

There is a handy tool come by default with the bundle, which can be found at ckeditor/samples/toolbarconfigurator/index.html. It allows you to config the toolbar using GUI.

有一个很方便的工具,默认情况下有一个bundle,它可以在ckeditor/samples/toolbarconfigurator/index.html中找到。它允许您使用GUI配置工具栏。

#6


3  

After much fooling around with manually removing button and styling the toolbar by editing the config.js file, I found the ToolBar Configurator.

在通过手动删除按钮和编辑工具栏来修改工具栏之后。js文件,我找到了工具栏配置器。

With that you can easily enable or disable buttons. Change button group order and add separators.

这样你就可以轻松地启用或禁用按钮。更改按钮组顺序并添加分隔符。

It is located in the /samples/toolbarconfigurator of the ckeditor folder. Just launch the index.html. The Toolbar Configurator is inlcuded in all the different download packages on the download page

它位于ckeditor文件夹的/samples/toolbarconfigurator中。只是启动index . html。在下载页面上的所有不同的下载包中都包含了工具栏配置器。

When you are done creating your toolbar, just click Get toolbar config and copy the style to the config.js file located in the main ckeditor folder.

当您完成创建工具栏时,只需单击Get toolbar config并将样式复制到config。js文件位于主要的ckeditor文件夹中。

如何从斗斗4中移除按钮?

#7


1  

Open your config.js file and paste this code

打开你的配置。js文件并粘贴此代码。

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
    config.removePlugins = 'blockquote,save,flash,iframe,tabletools,pagebreak,templates,about,showblocks,newpage,language,print,div';
    config.removeButtons = 'Print,Form,TextField,Textarea,Button,CreateDiv,PasteText,PasteFromWord,Select,HiddenField,Radio,Checkbox,ImageButton,Anchor,BidiLtr,BidiRtl,Font,Format,Styles,Preview,Indent,Outdent';
};

#8


0  

Try

试一试

config.removeButtons = 'Save'; 

this will completely remove the save button.

这将完全删除save按钮。

#9


0  

Its so Simple. Modify config.js file as below

它如此简单。修改配置。js文件如下

CKEDITOR.editorConfig = function (config) {

config.removePlugins = 'save,newpage,flash,about,iframe,language'; 
//The options which you don't need in the toolbar, you can add them in the above remove plugins list.

};

#10


-4  

CKEDITOR.config.removePlugins = 'elementspath,save,about,forms,find,selectall,specialchar,flash,smiley,iframe,showblocks,language';