CKEditor Custom Plugins Button

前端 未结 7 764
猫巷女王i
猫巷女王i 2020-12-22 22:41

I\'ve written a custom plugin for CKEditor--successful on all fronts, save one currently: I can\'t, for the life of me, figure out how to customize the image on the button

相关标签:
7条回答
  • 2020-12-22 23:33

    To add your custom icon you need to edit skins/moono/*.css For the editor itself you need to add the same CSS class in the following files

    • editor.css
    • editor_gecko.css (firefox)
    • editor_ie.css
    • editor_ie7.css
    • editor_ie8.css
    • editor_iequirks.css

    The format name for a CSS button class is .cke_button__myCustomIcon_icon

    You can either use your own image file for the icon or edit the sprite /skins/moono/icons.png to add your's.

    In your plugin.js you need to have something like

    editor.ui.addButton('myplugin',
    {
        label: 'myplugin',
        command: FCKCommand_myplugin,
        icon: 'myCustomIcon'
    });
    
    0 讨论(0)
提交回复
热议问题