在 wordpress 中创建了一个自定义窗口,如下所示:
现在我需要按钮INSERT
和CANCEL
(见上图)看起来像其他任何地方(见下图)像CANCEL
和Add Link
这段代码给了我窗口,但我找不到任何更改按钮的选项。一定有什么,还是应该有什么!?甚至尝试更改样式(某些样式是用 javascript 添加的)内联样式!important
但没有效果...
( function($) {
tinymce.create( 'tinymce.plugins.hd_fancybox_button', {
init: function( editor, url ) {
editor.addButton( 'hd_fancybox_button', {
icon: 'icons dashicons-icon',
tooltip: 'Fancybox',
cmd: 'plugin_command',
image : url + '/img/popup-icon.png'
});
editor.addCommand( 'plugin_command', function() {
editor.windowManager.open({
title: 'Fancybox',
width: 500,
height: 300,
inline: 1,
id: 'hd-fancybox-button-insert-dialog',
body: [
{
type : 'textbox',
name : 'title',
label : 'Title',
classes : 'selected_image_title',
}, {
type : 'button',
name : 'button',
label : 'Image',
text : 'Image',
classes : 'upload_image_button'
}
],
buttons: [{
text: 'Insert',
id: 'hd-fancybox-button-insert',
onclick: function( e ) {
insertImg(editor);
closeBox();
},
},
{
text: 'Cancel',
id: 'hd-fancybox-button-cancel',
onclick: 'close'
}],
});
appendInsertDialog();
});
}
});
现在几个小时后,我发现我可以使用style
类似的属性
{
text: 'Cancel',
id: 'hd-fancybox-button-cancel',
onclick: 'close',
style: 'background-color:orange;border:lime 1px solid;position:absolute;left:0px;top:0px;'
}
您有机会添加这样的样式不是很好吗?当然,你可以改变颜色......