X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fplugin%2F_ckeditor%2Fplugin.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fplugin%2F_ckeditor%2Fplugin.twig;h=663f104f72e1b26d839794fe513facd53e27a6db;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig new file mode 100644 index 000000000..663f104f7 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/plugin/_ckeditor/plugin.twig @@ -0,0 +1,44 @@ +/** + * @file + * {{ plugin_label }} CKEditor plugin. + * + * Basic plugin inserting abbreviation elements into the CKEditor editing area. + * + * @DCG The code is based on an example from CKEditor Plugin SDK tutorial. + * + * @see http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1 + */ +(function (Drupal) { + + 'use strict'; + + CKEDITOR.plugins.add('{{ plugin_id }}', { + + // Register the icons. + icons: '{{ short_plugin_id }}', + + // The plugin initialization logic goes inside this method. + init: function(editor) { + + // Define an editor command that opens our dialog window. + editor.addCommand('{{ command_name }}', new CKEDITOR.dialogCommand('{{ command_name }}Dialog')); + + // Create a toolbar button that executes the above command. + editor.ui.addButton('{{ short_plugin_id }}', { + + // The text part of the button (if available) and the tooltip. + label: Drupal.t('Insert abbreviation'), + + // The command to execute on click. + command: '{{ command_name }}', + + // The button placement in the toolbar (toolbar group name). + toolbar: 'insert' + }); + + // Register our dialog file, this.path is the plugin folder path. + CKEDITOR.dialog.add('{{ command_name }}Dialog', this.path + 'dialogs/{{ short_plugin_id }}.js'); + } + }); + +} (Drupal));