3 * {{ plugin_label }} CKEditor plugin.
5 * Basic plugin inserting abbreviation elements into the CKEditor editing area.
7 * @DCG The code is based on an example from CKEditor Plugin SDK tutorial.
9 * @see http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1
15 CKEDITOR.plugins.add('{{ plugin_id }}', {
17 // Register the icons.
18 icons: '{{ short_plugin_id }}',
20 // The plugin initialization logic goes inside this method.
21 init: function(editor) {
23 // Define an editor command that opens our dialog window.
24 editor.addCommand('{{ command_name }}', new CKEDITOR.dialogCommand('{{ command_name }}Dialog'));
26 // Create a toolbar button that executes the above command.
27 editor.ui.addButton('{{ short_plugin_id }}', {
29 // The text part of the button (if available) and the tooltip.
30 label: Drupal.t('Insert abbreviation'),
32 // The command to execute on click.
33 command: '{{ command_name }}',
35 // The button placement in the toolbar (toolbar group name).
39 // Register our dialog file, this.path is the plugin folder path.
40 CKEDITOR.dialog.add('{{ command_name }}Dialog', this.path + 'dialogs/{{ short_plugin_id }}.js');