javascript TinyMCE 的 addButton() 函数中所有可能的设置属性是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14399267/
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
What are all the possible settings attributes in TinyMCE's addButton() function?
提问by mae
The documentationis not very clear on this.
该文件是不是对这个很清楚。
name - String - Button name to add.
settings - Object - Settings object with title, cmd etc.
name - String - 要添加的按钮名称。
设置 - 对象 - 带有标题、cmd等的设置对象。
"etc"? Really? Where can I see the rest of the possible attributes?
“等等”?真的吗?我在哪里可以看到其余的可能属性?
采纳答案by Jason
autofocus
: True if the control should be focused when renderedborder
: Border box values example: 1 1 1 1classes
: Space separated list of classes to adddisabled
: Is the control disabled by defaulthidden
: Is the control hidden by defaulticon
: Icon to use for buttonimage
: Image to use for iconmargin
: Margin box values example: 1 1 1 1minHeight
: Minimal height for the controlminWidth
: Minimal width for the controlname
: Name of the control instancepadding
: Padding box values example: 1 1 1 1role
: WAI-ARIA role to use for controlsize
: Size of the button small|medium|largestyle
: Style CSS properties to addtext
: Text to display inside widgettooltip
: Tooltip text to display when hovering
autofocus
: 如果控件在渲染时应该被聚焦,则为真border
:边框值示例:1 1 1 1classes
:要添加的以空格分隔的类列表disabled
: 控件是否默认禁用hidden
: 控件是否默认隐藏icon
: 用于按钮的图标image
: 用于图标的图像margin
:边距框值示例:1 1 1 1minHeight
: 控件的最小高度minWidth
: 控件的最小宽度name
: 控件实例的名称padding
:填充框值示例:1 1 1 1role
: 用于控制的 WAI-ARIA 角色size
:按钮的大小小|中|大style
:要添加的样式 CSS 属性text
: 在小部件内显示的文本tooltip
: 悬停时显示的工具提示文本
For a full list of all the settings and methods see the TinyMCE documentation page
有关所有设置和方法的完整列表,请参阅TinyMCE 文档页面
回答by Thariama
What you would like to know is what settings may fit into the settings object (tinymce 3). Here it is:
您想知道的是哪些设置可能适合设置对象(tinymce 3)。这里是:
title --> title
label --> label
scope --> scope
onclick --> function to be called onclick
menu_button --> flag, defines if the button is a menu button
cmd --> tinymce command to get executed onClick
ui --> paramter for the tinymce command cmd
value --> value for the tinymce command cmd
Those settings get assigned in the function createButton
of the class ControlManager
.
这些设置createButton
在类的函数中分配ControlManager
。
回答by Andy
Having had the same issue trying to find the addButton
docs in V4 I found the link, just in case anybody needs it.
在尝试addButton
在 V4 中查找文档时遇到了同样的问题,我找到了链接,以防万一有人需要它。
Hope it helps someone!
希望它可以帮助某人!