Javascript 创建CKEditor插件时,如何添加一个";“彩色选择器”;我的对话? 用户单击“我的插件”按钮 弹出的对话框中有一些文本框等 在该对话框中,用户可以单击一个按钮,然后会弹出一个颜色选择器,让用户选择他想要的颜色
使用以下颜色选择器插件;附加到CKEditorJavascript 创建CKEditor插件时,如何添加一个";“彩色选择器”;我的对话? 用户单击“我的插件”按钮 弹出的对话框中有一些文本框等 在该对话框中,用户可以单击一个按钮,然后会弹出一个颜色选择器,让用户选择他想要的颜色,javascript,jquery,colors,ckeditor,Javascript,Jquery,Colors,Ckeditor,使用以下颜色选择器插件;附加到CKEditor表单中的输入[type=“text”]字段: 此实现的不同之处在于,用户无需单击按钮来选择颜色。当用户聚焦到相应的字段时,会触发颜色选择。今天我遇到了同样的问题。这是我的解决方案,它实际上是来自CKEditor 4.2的TableCell插件的复制粘贴。希望能有帮助 CKEDITOR.dialog.add( 'myDialog', function( editor ) { return { title: 'Add Data', mi
表单中的输入[type=“text”]
字段:
此实现的不同之处在于,用户无需单击按钮来选择颜色。当用户聚焦到相应的字段时,会触发颜色选择。今天我遇到了同样的问题。这是我的解决方案,它实际上是来自CKEditor 4.2的TableCell插件的复制粘贴。希望能有帮助
CKEDITOR.dialog.add( 'myDialog', function( editor ) {
return {
title: 'Add Data',
minWidth: 300,
minHeight: 200,
contents: [
{
id: 'dataTab',
label: 'Line',
title: 'Line',
elements: [
...
{
type: "hbox",
padding: 0,
widths: ["80%", "20%"],
children: [
{
id: 'linecolor',
type: 'text',
label: 'Line color',
setup: function( element ) {
...
},
commit: function( element ) {
...
}
},
{
type: "button",
id: "lineColorChooser",
"class": "colorChooser",
label: "Choose",
style: "margin-left: 8px",
onLoad: function () {
this.getElement().getParent().setStyle("vertical-align", "bottom")
},
onClick: function () {
editor.getColorFromDialog(function (color) {
color && this.getDialog().getContentElement("dataTab", "linecolor").setValue( color );
this.focus()
}, this)
}
}
]
},
...
]
}
],
};
});
你有办法解决这个小问题吗?因为我有完全相同的问题:)你救了我一天D