diff --git a/ckeditor/plugins/sapnotelink/README.md b/ckeditor/plugins/sapnotelink/README.md new file mode 100644 index 00000000..5353b845 --- /dev/null +++ b/ckeditor/plugins/sapnotelink/README.md @@ -0,0 +1,12 @@ +# sapnotelink_ckgdoku +Plugin to insert the sapnotelink plugin source code in dokuwiki using the ckgedit editor (https://github.com/turnermm/ckgedit / https://www.dokuwiki.org/plugin:ckgedit). + +Dokuwiki sapnotelink from https://www.dokuwiki.org/plugin:sapnotelink + +## Installation +Refer to: https://www.dokuwiki.org/plugin:ckgedit:configuration#extra_plugins. +Unzip the files to your `dokuwiki/lib/plugins/ckgedit/ckeditor/plugins/` folder and rename the folder to **sapnotelink**. + +## Dokuwiki configuration + +Add the text **SAPnotelink** to the dokuwiki **plugin»ckgedit»extra_plugins** configuration. \ No newline at end of file diff --git a/ckeditor/plugins/sapnotelink/dialogs/sapnotelink.js b/ckeditor/plugins/sapnotelink/dialogs/sapnotelink.js new file mode 100644 index 00000000..b79ad776 --- /dev/null +++ b/ckeditor/plugins/sapnotelink/dialogs/sapnotelink.js @@ -0,0 +1,30 @@ +CKEDITOR.dialog.add( 'sapnotelinkDialog', function( editor ) { +return { + title: editor.lang.sapnotelink.title, + minWidth: 400, + minHeight: 200, + contents: [ + { + id: 'tab-basic', + label: editor.lang.sapnotelink.title, + elements: [ + { + type: 'text', + id: 'sapnotelink', + label: editor.lang.sapnotelink.content, + validate: CKEDITOR.dialog.validate.number( editor.lang.sapnotelink.number ) + } + ] + } + ], + onOk: function() { + var dialog = this; + var notenumber = this.text ? this.text : dialog.getValueOf('tab-basic', 'sapnotelink'); + if (!notenumber) { + alert( editor.lang.sapnotelink.empty ); + return false + } + editor.insertText('sap#' + notenumber); + } + }; +}); \ No newline at end of file diff --git a/ckeditor/plugins/sapnotelink/icons/sapnotelink.png b/ckeditor/plugins/sapnotelink/icons/sapnotelink.png new file mode 100644 index 00000000..383a2c60 Binary files /dev/null and b/ckeditor/plugins/sapnotelink/icons/sapnotelink.png differ diff --git a/ckeditor/plugins/sapnotelink/lang/de.js b/ckeditor/plugins/sapnotelink/lang/de.js new file mode 100644 index 00000000..15258d2e --- /dev/null +++ b/ckeditor/plugins/sapnotelink/lang/de.js @@ -0,0 +1,6 @@ +CKEDITOR.plugins.setLang("sapnotelink","de",{ + title: 'SAP Note', + content: 'Notenummer:', + empty: 'Darf nicht leer sein', + number: 'Muss eine Nummer sein', +}); \ No newline at end of file diff --git a/ckeditor/plugins/sapnotelink/lang/en.js b/ckeditor/plugins/sapnotelink/lang/en.js new file mode 100644 index 00000000..a8ed8374 --- /dev/null +++ b/ckeditor/plugins/sapnotelink/lang/en.js @@ -0,0 +1,6 @@ +CKEDITOR.plugins.setLang("sapnotelink","en",{ + title: 'SAP Note', + content: 'Notenumber:', + empty: 'Can not be empty', + number: 'Must be a number', +}); \ No newline at end of file diff --git a/ckeditor/plugins/sapnotelink/plugin.js b/ckeditor/plugins/sapnotelink/plugin.js new file mode 100644 index 00000000..630de169 --- /dev/null +++ b/ckeditor/plugins/sapnotelink/plugin.js @@ -0,0 +1,15 @@ +CKEDITOR.plugins.add( 'sapnotelink', { + icons: 'sapnotelink', + lang: 'en,de', + init: function( editor ) { + editor.addCommand( 'sapnotelink', new CKEDITOR.dialogCommand( 'sapnotelinkDialog' ) ); + editor.ui.addButton( 'SAPnotelink', { + label: editor.lang.sapnotelink.title, + command: 'sapnotelink', + toolbar: 'insert', + icon: this.path + 'icons/sapnotelink.png' + }); + + CKEDITOR.dialog.add( 'sapnotelinkDialog', this.path + 'dialogs/sapnotelink.js' ); + } +});