CKEditor:工具栏未显示

时间:2012-12-06 23:01:38

标签: javascript ckeditor

我创建了一个名为timestamp的插件。 plugin.js的代码是这样的:

CKEDITOR.plugins.add( 'timestamp',
{
    init: function( editor )
    {
        editor.addCommand( 'insertTimestamp',
            {
                exec : function( editor )
                {    
                    var timestamp = new Date();
                    editor.insertHtml( timestamp.toString() );
                }
            });
        editor.ui.addButton( 'Timestamp',
        {
            label: 'Insert Timestamp',
            command: 'insertTimestamp',
            icon: this.path + '/icons/timestamp.png'
        } );
    }
} );

图标位于/_source/plugins/timestamp/icons

但是当我尝试在./samples/fullpage.html中添加插件时,甚至工具栏都没有出现 代码:

<script>
            CKEDITOR.replace( 'editor1', {
                fullPage: true,
                extraPlugins: 'wysiwygarea,timestamp',
            toolbar :
            [
                [ 'Bold', 'Italic', '-', 'NumberedList' ],
                [ 'Timestamp' ]
            ]
            });



</script>

如果我试图在config.js中添加此插件,工具栏会显示但没有时间戳(我的自定义插件)

代码:

config.extraPlugins ='timestamp';

请让我知道什么是错的。谢谢

2 个答案:

答案 0 :(得分:1)

只需删除extraPlugin: 'wysiwygarea'或在full.html中不需要extraPlugins : 'docprops'。跳跃它会工作:))

答案 1 :(得分:0)

你添加插件之后,你的工具栏停止出现很可能是因为你在插件中遇到了一些JS错误,这会破坏一切。检查您的控制台并在此处粘贴信息(或尝试自己解决问题:))。