mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3896 - CKeditor icon for enhance WikiText URLs syntax
This commit is contained in:
@@ -2567,7 +2567,7 @@ class utils
|
||||
$aDefaultConf = array(
|
||||
'language'=> $sLanguage,
|
||||
'contentsLanguage' => $sLanguage,
|
||||
'extraPlugins' => 'disabler,codesnippet,mentions',
|
||||
'extraPlugins' => 'disabler,codesnippet,mentions,objectshortcut',
|
||||
);
|
||||
|
||||
// Mentions
|
||||
|
||||
46
js/ckeditor/plugins/objectshortcut/dialogs/objectshortcut.js
Normal file
46
js/ckeditor/plugins/objectshortcut/dialogs/objectshortcut.js
Normal file
@@ -0,0 +1,46 @@
|
||||
CKEDITOR.dialog.add( 'objectshortcutDialog', function( editor ) {
|
||||
return {
|
||||
|
||||
// Basic properties of the dialog window: title, minimum size.
|
||||
title: 'Object shortcut',
|
||||
minWidth: 300,
|
||||
minHeight: 200,
|
||||
|
||||
// Dialog window content definition.
|
||||
contents: [
|
||||
{
|
||||
id: 'tab-basic',
|
||||
label: 'Basic Settings',
|
||||
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
id: 'class',
|
||||
label: 'Class',
|
||||
|
||||
validate: CKEDITOR.dialog.validate.notEmpty( "Class field cannot be empty." )
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'id',
|
||||
label: 'Id',
|
||||
validate: CKEDITOR.dialog.validate.notEmpty( "Id field cannot be empty." )
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'label',
|
||||
label: 'Label',
|
||||
},
|
||||
]
|
||||
},
|
||||
],
|
||||
|
||||
// This method is invoked once a user clicks the OK button, confirming the dialog.
|
||||
onOk: function() {
|
||||
editor.insertHtml( '[[' + this.getValueOf( 'tab-basic', 'class' ) + ':'
|
||||
+ this.getValueOf( 'tab-basic', 'id' ) +
|
||||
( this.getValueOf( 'tab-basic', 'label' ) ? '|' + this.getValueOf( 'tab-basic', 'label' ) : '') +
|
||||
']]' );
|
||||
}
|
||||
};
|
||||
});
|
||||
BIN
js/ckeditor/plugins/objectshortcut/icons/objectshortcut.png
Normal file
BIN
js/ckeditor/plugins/objectshortcut/icons/objectshortcut.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 643 B |
29
js/ckeditor/plugins/objectshortcut/plugin.js
Normal file
29
js/ckeditor/plugins/objectshortcut/plugin.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// Register the plugin within the editor.
|
||||
CKEDITOR.plugins.add( 'objectshortcut', {
|
||||
|
||||
// Register the icons.
|
||||
icons: 'objectshortcut',
|
||||
|
||||
// The plugin initialization logic goes inside this method.
|
||||
init: function( editor ) {
|
||||
|
||||
// Define an editor command that opens our dialog window.
|
||||
editor.addCommand( 'objectshortcut', new CKEDITOR.dialogCommand( 'objectshortcutDialog' ) );
|
||||
|
||||
// Create a toolbar button that executes the above command.
|
||||
editor.ui.addButton( 'Objectshortcut', {
|
||||
|
||||
// The text part of the button (if available) and the tooltip.
|
||||
label: 'Object Shortcut',
|
||||
|
||||
// The command to execute on click.
|
||||
command: 'objectshortcut',
|
||||
|
||||
// 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( 'objectshortcutDialog', this.path + 'dialogs/objectshortcut.js' );
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user