我需要插件下拉列表中的下拉列表。为此,我制作了一个显示下拉列表的插件,但内部下拉列表的内容没有出现。这是我这样做的方式:
init : function( editor )
{
items = {};
for ( var i = 0 ; i < markup.length ; i++ )
{
items[ parts[ 0 ] ] =
{
label : parts[ 0 ],
group : 'microdata',
icon: this.path + 'icon1.png' ,
order : i,
getItems: function()
{
var selection = editor.getSelection();
return {
name: CKEDITOR.TRISTATE_OFF,
friend: CKEDITOR.TRISTATE_OFF
};
}
}
editor.addMenuGroup( 'microdata' );
editor.addMenuItems( items,friend:
{
label: 'friend',
group: 'microdata',
//command: 'friendCmd',
order: 10
}
);
editor.ui.add( 'Microdata', CKEDITOR.UI_MENUBUTTON,
{
label: 'Microdata',
command: 'Microdata',
modes : { wysiwyg:1 },
className : 'cke_button_microdata',
icon: this.path + 'icon1.png' ,
onMenu : function()
{
var activeItems = {};
for ( var prop in items )
{
if ( items.hasOwnProperty( prop ) )
activeItems[ prop ] = CKEDITOR.TRISTATE_ON;
}
return activeItems;
}
} );