2017-06-22 11 views
0

私はckeditorサンプルのカスタムプラグインを動作させようとしていますが、これまでのところ何も得られていません。コンソールエラーはなく、プラグインもありません。ckeditorタイムスタンプカスタムプラグインのサンプルが動作しない

これは私が次だ例です。

を私はそのまま自分のコードをコピーしたので、私容疑者問題はもっと私に関連しています下記のckeditor設定。

私のプラグインのディレクトリ構造(githubのからコピーされたすべてのファイル):

$ tree public/javascripts/ckeditor/plugins/timestamp 
public/javascripts/ckeditor/plugins/timestamp 
├── icons 
│   └── timestamp.png 
├── plugin.js 
└── samples 
    └── timestamp.html 

マイCKEditorバージョンの公開/ JavaScriptの/ CKEditorバージョン/ config.jsの:

/** 
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 
* For licensing, see LICENSE.md or http://ckeditor.com/license 
*/ 

CKEDITOR.editorConfig = function(config) { 
    // Define changes to default configuration here. 
    // For complete reference see: 
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config 

    // The toolbar groups arrangement, optimized for two toolbar rows. 
    config.toolbarGroups = [ 
     { name: 'styles', groups: [ 'styles' ] }, 
     { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, 
     { name: 'editing',  groups: [ 'find', 'selection', 'spellchecker' ] }, 
     { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, 
     { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, 
     { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, 
     { name: 'others' }, 
     { name: 'forms' }, 
     { name: 'tools' } 
    ]; 

    // Remove some buttons provided by the standard plugins, which are 
    // not needed in the Standard(s) toolbar. 
    config.removeButtons = 'Underline,Styles,Strike,Image,Outdent,Indent,Blockquote,Cut,Copy,Paste,PasteFromWord,Undo,Redo'; 

    // Set the most common block elements. 
    config.format_tags = 'p;h1;h2;h3;h4'; 

    // Simplify the dialog windows. 
    config.removeDialogTabs = 'image:advanced;link:advanced'; 

    // Whether to escape basic HTML entities in the document, including: 
    // (nbsp,gt,lt,amp) 
    config.basicEntities = false; 
    config.entities_additional = 'lt,gt,amp,quot' 
    config.entities_latin = false; 
    config.entities_greek = false; 
    config.disableNativeSpellChecker = false; 
    config.removePlugins = 'wsc,scayt'; 
    config.extraPlugins = 'timestamp'; 
    config.scayt_autoStartup = false; 
    config.height = 1000; 
}; 

そして、これがすべてでありますそうですか。あなたは、このようなツールバーのグループを持っていないので

editor.ui.addButton('Timestamp', { 
    label: 'Insert Timestamp', 
    command: 'insertTimestamp', 
    toolbar: 'insert' 
}); 

:いいえジャバスクリプトエラーのいずれか:/

enter image description here

答えて

1

プラグインは、「挿入」ツールバーのグループに入れることにするツールバーのボタンを作成しませんあなたの設定は、表示されません。

+0

それは完全にそれだった - ありがとう@Wizard! – doub1ejack

関連する問題