Ckeditor (toolbar definition) toolbar custom configuration

Source: Internet
Author: User
All function buttons are displayed on the toolbar of ckeditor by default. You need to customize the toolbar for security or simplified reasons. Ckeditor toolbar custom configuration is very simple.

Edit the config. js file in the ckeditor directory. The default value is the following toolbar code,

Note that the tool buttons are grouped. the braces in a name are a tool button group. The buttons behind the items are specific. "/" indicates a line break in the toolbar, "-" indicates the middle line between tool icons. "|"

(Special Note: config. JS does not have the following code. By default, all buttons are displayed. However, if you customize the toolbar, it is best to copy all the following code to config. JS, and then delete unnecessary buttons)


config.toolbar = 'Full'; config.toolbar_Full =[    { name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },    { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },    { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },    { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',         'HiddenField' ] },    '/',    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },    { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',    '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },    { 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','-','About' ] }]; config.toolbar_Basic =[    ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']];

The following is the deleted toolbar code.

config.toolbar = 'Full';    config.toolbar_Full = [        {name: 'document',items: ['Source', '-', 'DocProps', 'Preview', 'Print', '-']},        {name: 'clipboard',items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},        {name: 'editing',items: ['Find', 'Replace', '-', 'SelectAll', '-']},        { name: 'basicstyles',items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},        '/',        {name: 'paragraph',items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']},        {name: 'links',items: ['Link', 'Unlink', 'Anchor']},        {name: 'insert',items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak']},        '/',        { name: 'styles',items: ['Styles', 'Format', 'Font', 'FontSize']},        { name: 'colors',items: ['TextColor', 'BGColor']},        { name: 'tools',items: [ 'ShowBlocks', '-']}    ];    config.toolbar_Basic = [['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'About']];

 

 

Definition of the toolbar:

Source = source code mode
-
Save = save (submit form)
Newpage = new
Preview = Preview
-= Split line
Templates = Template
Cut = cut
Copy = copy
Paste = Paste
Pastetext = paste as unformatted text
Pastefromword = paste from MS word
-
Print = print
Spellchecker = spell check
Scayt = instant spelling check
Undo = undo
Redo = redo
-
Find = search
Replace = replace
-
Selectall = select all
Removeformat = clear format
Form = form
Checkbox = check box
Radio = single queue
Textfield = Single Line Text
Textarea = multi-line text
Select = List/menu
Button = button
Imagebutton = image button
Hiddenfield = hidden field
/
Bold = bold
Italic = skew
Underline = underline
Strike = strikethrough
-
Subscript = subscript
Superscript = superscript
Numberedlist = Number list
Bulletedlist = project list
-
Outdent = reduce indentation
Indent = increase indentation
BLOCKQUOTE = block reference
Creatediv = create a div container
Justifyleft = left alignment
Justifycenter = center
Justifyright = right alignment
Justifyblock = alignment at both ends
Bidiltr = text direction from left to right
Bidirtl = text direction from right to left
Link = insert/edit hyperlink (Upload File)
Unlink = unlink
Anchor = insert/edit an anchor Link
Image = image (upload)
Flash = animation (upload)
Table = table
Horizontalrule = insert a horizontal line
Smiley = insert emoticon
Specialchar = Insert special characters
Pagebreak = insert a paging character
/
Styles = style shortcuts
Format = text format
Font = font
Fontsize = text size
Textcolor = text color
Bgcolor = background color
Maximize = full screen editing mode
Showblocks = display block
-
About = show about

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.