其中CKEditor 4中提供的所有工具栏按钮名称和组名称的列表? [英] Where the list of all toolbar button names and group names available in CKEditor 4?

查看:2937
本文介绍了其中CKEditor 4中提供的所有工具栏按钮名称和组名称的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题类似于 CKEditor 4中有哪些工具栏按钮?加强这个旧的其他。我在这里添加了一些我所面临的看法和个人困难。



CKEditor文档很好,但对于 Javascript程序员来说是粉碎和第一次使用CKEditor部署器),因为停在中间...例如:


  • =http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-removeButtons =nofollow> removeButtons ,我还需要有效名称列表


  • 如果我需要自定义—通过源代码,更改数组元素—我不仅需要线索和示例作为这里是,但包含有效名称,语法规则,上下文异常以及可能的正式插件名称列表的完整列表。




QUESTION:有一个命令(一个简单的 alert(debug))或所有可能的名称的文档列表?(或所有受控和已注册的插件名称,组名称等)






... CKEditor4作为(最好的最好!)即插即用编辑器,但对于程序员,它是假的,没有适当的管理受控名称支持。



注意: config.js 需要引用有效名称,没有文档显示所有有效名称的列表, $ c> config.js 数组。这是程序员需要的,但是今天(2013年8月),我们需要花费大部分时间使用Google来查找有效的名称,或者使用浏览器的元素检查器来获取线索。没有名称, 没有任何简单的编程任务。



DREAM: href =http://ckeditor.com/download =nofollow> ckeditor.com/download 提供良好的自定义ckeditor(!!)。但对于开发人员,没有显示按钮图标和相关联的名称或工具组名称等的工具或插图...也就是说,到名称(反之亦然)。对于每个地图,我们当然还需要上下文例外,例如源无法与内联编辑器配合使用









更实用的例子在@Noseratio和@davidkonrad注释后编辑)。问题是每个上下文的有效名称是什么?



如果我在 config

  editor.config.toolbarGroups = [
{name:'clipboard',groups: undo']},
...
{name:'styles'},
{name:'colors'},
];

我需要更改 {name:'styles'} 到一个自定义的,例如我需要这个功能:

  {name:'styles',items: 'Styles','Format','FontSize']} 

名称,以及何时(上下文)使用属性名称,项目,组与这些名称。我做一个错误,如果我在toolbarGroups属性使用项目,或如果我使用字体大小而不是字体大小。此外,使用 addButtonCommand 和其他,我需要知道任何有效的参数。这是错误定义,

  addButtonCommand('FontSize',lang.underline,'underline',
config .coreStyles_underline);

但难以在不知道每个上下文的所有有效名称列表的情况下工作。






更多实用示例,在@MahanGM评论后编辑)



如果我使用此v4指南和说明
(即等同于此v3 ),我有名称问题 ,当使用CKEditor4和内联编辑器时:




  • 默认CKEditor工具栏设置


  • 如果我脱掉spellchecker(旧v3名称SpellChecker),为什么不工作?


  • 我可以在内联编辑器中使用什么名称?在 editor.config.toolbar 数组中使用和使用项目


  • ...等等...(读我的问题:所有的问题是上下文中有效名称的正确选择 >)...程序员需要一个完整的正式规范,不仅是信息的线索和片段



解决方案

工具栏配置帮助了我很多:

  //编辑器基于config.toolbarGroups自动生成工具栏配置。 
config.toolbar = [
{name:'document',groups:['mode','document','doctools'],items:['Source',' - ' ,'newPage','Preview','Print',' - ','Templates']},
{name:'clipboard',groups:剪切','复制','粘贴','粘贴文本','粘贴字符',' - ','撤消','重做']},
{name:'editing' ,'selection','spellchecker'],items:['Find','Replace',' - ','SelectAll',' - ','Scayt']},
{name:'forms' item:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},
' b $ b {name:'basicstyles',groups:['basicstyles','cleanup'],items:['Bold','Italic','Underline','Strike','Subscript','Superscript' '''''''''''''''''','''''''','''''' ,'BulletedList',' - ','Outdent','Indent',' - ','Blockquote','CreateDiv','JustifyLeft','JustifyRight','JustifyBlock' - ','BidiLtr','BidiRtl','Language']},
{name:'links',items:['Link','Unlink','Anchor']},
{ name:'insert',items:['Image','Flash','Table','Horizo​​ntalRule','Smiley','SpecialChar','PageBreak','Iframe']},
' ,
{name:'styles',items:['Styles','Format','Font','FontSize']} ,'BGColor']},
{name:'tools',items:['Maximize','ShowBlocks']},
{name:'others',items:[' - ']} ,
{name:'about',items:['About']}
];

  //工具栏组配置。 
config.toolbarGroups = [
{name:'document',groups:['mode','document','doctools']},
{name:'clipboard' ['clipboard','undo']},
{name:'editing',groups:['find','selection','spellchecker']},
{name:'forms'} ,
'/',
{name:'basicstyles',groups:['basicstyles','cleanup']},
{name:'paragraph' ,'indent','blocks','align','bidi']},
{name:'links'},
{name:'insert'},
' ,
{name:'styles'},
{name:'colors'},
{name:'tools'},
{name:'others'},
{name:'about'}
];

在自己的init中使用时:

  CKEDITOR.replace('topicMessageInput',{
toolbar:[
{name:'document',groups:['mode','document','doctools' ],items:['Source',' - ','Save','NewPage','Preview','Print',' - ','Templates']},
{na ..

希望它有帮助。


This question is similar to What toolbar buttons are available in CKEditor 4? and a reinforce of this old other one. I add here some perceptions and personal difficulties that I faced.

The CKEditor documentation is good, but pulverized and "incomplete" for Javascript programmers (first-time CKEditor deployer), because "stops in the middle"... Examples:

  • if I need removeButtons, I need also the list of valid names.

  • if I need to customize — by source-code, changing array elements —, I need not only clues and examples as here, but a full list of valid names, syntax rules, context exceptions, and perhaps a list of "official plugin names".

QUESTION: there are a command (a simple alert(debug)) or a documented list of all possible names? (or all controled and registered plugin-names, group-names, etc.)


... CKEditor4 is promoted as (the best of the best!) "plug and play" editor, but, for programmers, it is false, without proper "managing controlled-names" support.

NOTE: all config.js need a reference to valid names, and no documentation show a list of all valid names for my changes at config.js arrays. This is all that a programmer need, but today (August 2013) we need to expend most of time using Google to find valid names, or using browser's "element inspector" to get clues about it. With no name, no programming task is simple at config array.

DREAM: for web designer the ckeditor.com/download supply a good "customize ckeditor" (!!). But for developers, there are no tool or illustration showing "button icons and associated names", or group names, etc... That is, an "organized map from features to names" (and vice-versa). For each map we need also, of course, the "context exceptions", like "Source" that not works with inline editor.



(More practical examples, edit after @Noseratio and @davidkonrad comments). The problem is "what the valid name for each context?"

If I have at my config something like,

editor.config.toolbarGroups = [
    { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
             ...
    { name: 'styles' },
    { name: 'colors' },
];

and I need to change { name: 'styles' } to a customized one, for example I need this functions:

  { name: 'styles', items : [ 'Styles', 'Format', 'FontSize' ] }

so, I need to know all that names, and when (contexts) to use properties "name", "items", "groups" with these names. I do a bug if I use "items" at toolbarGroups property, or if I use "Fontsize" instead "FontSize". Also, with addButtonCommand and others, I need to know any valid parameter. It is WRONG to to define,

  addButtonCommand( 'FontSize', lang.underline, 'underline',
                     config.coreStyles_underline );

but is difficult to work without knowing "all valid names list" for each context.


(More practical examples, edit after @MahanGM comment)

If I use this v4 guide and instructions (that is equivalent to this v3), I have "name problems", when using CKEditor4 and inline editor:

  • The "default CKEditor toolbar setting" is the "full toolbar"?

  • If I take off 'spellchecker' (old v3 name 'SpellChecker'), why not work? and why need take off also 'Scayt'?

  • What names I can use with inline editor? When use groups and when use items in the editor.config.toolbar array?

  • ... etc. ... (read my question: all the problem is the correct choice of valid name in a context)... Programmer need a "complete formal specification", not only clues and fragments of information.

解决方案

This one from Toolbar Configuration helped me a lot:

// Toolbar configuration generated automatically by the editor based on config.toolbarGroups.
config.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' ] }
];

and

// Toolbar groups configuration.
config.toolbarGroups = [
    { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
    { name: 'forms' },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
    { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
    { name: 'links' },
    { name: 'insert' },
    '/',
    { name: 'styles' },
    { name: 'colors' },
    { name: 'tools' },
    { name: 'others' },
    { name: 'about' }
];

when using in own init:

CKEDITOR.replace( 'topicMessageInput', {
        toolbar: [
                { name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
                { na..

Hope it helps.

这篇关于其中CKEditor 4中提供的所有工具栏按钮名称和组名称的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆