diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /editors/ckeditor_4_4/plugins/abbr/plugin.js | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to 'editors/ckeditor_4_4/plugins/abbr/plugin.js')
-rw-r--r-- | editors/ckeditor_4_4/plugins/abbr/plugin.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/editors/ckeditor_4_4/plugins/abbr/plugin.js b/editors/ckeditor_4_4/plugins/abbr/plugin.js new file mode 100644 index 0000000..4b22cf9 --- /dev/null +++ b/editors/ckeditor_4_4/plugins/abbr/plugin.js @@ -0,0 +1,58 @@ +/**
+ * Copyright (c) 2014, CKSource - Frederico Knabben. All rights reserved.
+ * Licensed under the terms of the MIT License (see LICENSE.md).
+ *
+ * Basic sample plugin inserting abbreviation elements into the CKEditor editing area.
+ *
+ * Created out of the CKEditor Plugin SDK:
+ * http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1
+ */
+
+// Register the plugin within the editor.
+CKEDITOR.plugins.add( 'abbr', {
+
+ // Register the icons.
+ icons: 'abbr',
+ lang: 'en,sl',
+
+ // The plugin initialization logic goes inside this method.
+ init: function( editor ) {
+
+ // Define an editor command that opens our dialog window.
+ editor.addCommand( 'abbr', new CKEDITOR.dialogCommand( 'abbrDialog' ) );
+
+ // Create a toolbar button that executes the above command.
+ editor.ui.addButton( 'Abbr', {
+
+ // The text part of the button (if available) and the tooltip.
+ label: editor.lang.abbr.gumb,
+
+ // The command to execute on click.
+ command: 'abbr',
+
+ // The button placement in the toolbar (toolbar group name).
+ toolbar: 'insert, 100'
+ });
+
+ if ( editor.contextMenu ) {
+
+ // Add a context menu group with the Edit Abbreviation item.
+ editor.addMenuGroup( 'abbrGroup' );
+ editor.addMenuItem( 'abbrItem', {
+ label: 'Uredi slovar',
+ icon: this.path + 'icons/abbr.png',
+ command: 'abbr',
+ group: 'abbrGroup'
+ });
+
+ editor.contextMenu.addListener( function( element ) {
+ if ( element.getAscendant( 'abbr', true ) ) {
+ return { abbrItem: CKEDITOR.TRISTATE_OFF };
+ }
+ });
+ }
+
+ // Register our dialog file -- this.path is the plugin folder path.
+ CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' );
+ }
+});
|