タイムスタンプという名前のプラグインを作成しました。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';
何がうまくいかないのか教えてください。ありがとう