aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-11-09 14:09:22 +0100
committerElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-11-09 14:09:22 +0100
commit7a6820decff2c90d7cd4077239e30945c4da1c19 (patch)
treef5e8e15a13a811af356eef10d678c81ed4f837f5
parent5248566335cd124c95b8218551acf5a9a21c2371 (diff)
drop StudipBlockQuote from default toolbar, move text formatting, re #3213
-rw-r--r--app/views/course/forum/index/_new_entry.php2
-rw-r--r--app/views/course/forum/index/_post.php2
-rw-r--r--app/views/course/scm/edit.php1
-rw-r--r--resources/assets/javascripts/cke/builtin-plugins.js5
-rw-r--r--resources/assets/javascripts/cke/classic-editor.js7
-rw-r--r--resources/assets/javascripts/lib/wysiwyg.js13
-rw-r--r--resources/vue/components/courseware/CoursewareTextBlock.vue2
-rw-r--r--templates/wiki/edit.php3
8 files changed, 14 insertions, 21 deletions
diff --git a/app/views/course/forum/index/_new_entry.php b/app/views/course/forum/index/_new_entry.php
index 64f1c14..d9d14ea 100644
--- a/app/views/course/forum/index/_new_entry.php
+++ b/app/views/course/forum/index/_new_entry.php
@@ -34,7 +34,7 @@
<? endif; ?>
<label>
- <textarea class="add_toolbar wysiwyg size-l" data-textarea="new_entry" name="content" required tabindex="3"
+ <textarea class="add_toolbar wysiwyg size-l" data-editor="extraPlugins=StudipBlockQuote" data-textarea="new_entry" name="content" required tabindex="3"
placeholder="<?= _('Schreiben Sie hier Ihren Beitrag.') ?>"></textarea>
</label>
diff --git a/app/views/course/forum/index/_post.php b/app/views/course/forum/index/_post.php
index d21b4ef..aae8453 100644
--- a/app/views/course/forum/index/_post.php
+++ b/app/views/course/forum/index/_post.php
@@ -86,7 +86,7 @@
<!-- Postinginhalt -->
<div class="content">
<span data-edit-topic="<?= $post['topic_id'] ?>" <?= $edit_posting == $post['topic_id'] ? '' : 'style="display: none;"' ?>>
- <textarea data-textarea="<?= $post['topic_id'] ?>" data-reset="<?= wysiwygReady($post['content_raw']) ?>" name="content" class="add_toolbar wysiwyg"><?= wysiwygReady($post['content_raw']) ?></textarea>
+ <textarea data-textarea="<?= $post['topic_id'] ?>" data-reset="<?= wysiwygReady($post['content_raw']) ?>" name="content" class="add_toolbar wysiwyg" data-editor="extraPlugins=StudipBlockQuote"><?= wysiwygReady($post['content_raw']) ?></textarea>
</span>
<span data-show-topic="<?= $post['topic_id'] ?>" data-topic-content="<?= $post['topic_id'] ?>" <?= $edit_posting != $post['topic_id'] ? '' : 'style="display: none;"' ?>>
diff --git a/app/views/course/scm/edit.php b/app/views/course/scm/edit.php
index 87ad30f..931aef7 100644
--- a/app/views/course/scm/edit.php
+++ b/app/views/course/scm/edit.php
@@ -38,6 +38,7 @@
<?= _('Inhalt') ?>
<?= I18N::textarea('content', $scm->content, [
'class' => 'add_toolbar wysiwyg size-l',
+ 'data-editor' => 'extraPlugins=FindAndReplace',
]) ?>
</label>
</fieldset>
diff --git a/resources/assets/javascripts/cke/builtin-plugins.js b/resources/assets/javascripts/cke/builtin-plugins.js
index 3b285df..71fc342 100644
--- a/resources/assets/javascripts/cke/builtin-plugins.js
+++ b/resources/assets/javascripts/cke/builtin-plugins.js
@@ -7,7 +7,6 @@ import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock';
import EasyImagePlugin from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials';
import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository';
-import FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace';
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js';
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js';
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport';
@@ -49,9 +48,7 @@ import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js';
import Mathematics from 'ckeditor5-math/src/math';
/* ckeditor elan */
import StudipA11YDialog, { updateVoiceLabel } from '../cke/studip-a11y-dialog/a11y-dialog.js';
-import StudipBlockQuote from '../cke/studip-quote/StudipBlockQuote.js';
import StudipUpload from '../cke/StudipUpload.js';
-import StudipWikiLink from '../cke/wiki-link/wiki-link.js';
import SpecialCharactersSmiley from '../cke/special_characters/SpecialCharactersSmiley.js';
import SpecialCharactersGreek from '../cke/special_characters/SpecialCharactersGreek.js';
@@ -65,7 +62,6 @@ const builtinPlugins = [
BoldPlugin,
CodeBlock,
EssentialsPlugin,
- FindAndReplace,
FontColor,
FontBackgroundColor,
GeneralHtmlSupport,
@@ -95,7 +91,6 @@ const builtinPlugins = [
SpecialCharactersMathematical,
SpecialCharactersText,
Strikethrough,
- StudipBlockQuote,
StudipUpload,
Subscript,
Superscript,
diff --git a/resources/assets/javascripts/cke/classic-editor.js b/resources/assets/javascripts/cke/classic-editor.js
index 0e21c0a..09369f6 100644
--- a/resources/assets/javascripts/cke/classic-editor.js
+++ b/resources/assets/javascripts/cke/classic-editor.js
@@ -15,12 +15,15 @@ ClassicEditor.defaultConfig = {
'redo',
'findAndReplace',
'|',
+ 'heading',
'bold',
'italic',
'underline',
'strikethrough',
'subscript',
'superscript',
+ 'fontColor',
+ 'fontBackgroundColor',
'|',
'removeFormat',
'|',
@@ -34,10 +37,6 @@ ClassicEditor.defaultConfig = {
'alignment:right',
'alignment:center',
'alignment:justify',
- '-',
- 'heading',
- 'fontColor',
- 'fontBackgroundColor',
'|',
'link',
'insertTable',
diff --git a/resources/assets/javascripts/lib/wysiwyg.js b/resources/assets/javascripts/lib/wysiwyg.js
index 978328b..00f453d 100644
--- a/resources/assets/javascripts/lib/wysiwyg.js
+++ b/resources/assets/javascripts/lib/wysiwyg.js
@@ -2,6 +2,8 @@
* wysiwyg.js - Replace HTML textareas with WYSIWYG editor.
*/
import parseOptions from './parse_options.js';
+import FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace';
+import StudipBlockQuote from '../cke/studip-quote/StudipBlockQuote.js';
import WikiLink from '../cke/wiki-link/wiki-link.js';
const wysiwyg = {
@@ -131,7 +133,7 @@ function parseEditorOptions(data) {
}
if (parsed.extraPlugins) {
- const pluginMap = { WikiLink };
+ const pluginMap = { FindAndReplace, StudipBlockQuote, WikiLink };
result.options.extraPlugins = parsed.extraPlugins.split(',').reduce((memo, plugin) => {
return plugin in pluginMap ? [...memo, pluginMap[plugin]] : memo;
}, []);
@@ -153,12 +155,8 @@ function getToolbarOptions(parsed) {
removeItems: [
'undo',
'redo',
- 'findAndReplace',
'strikethrough',
'horizontalLine',
- 'insertBlockQuote',
- 'splitBlockQuote',
- 'removeBlockQuote',
],
};
} else if (parsed.toolbar === 'minimal') {
@@ -169,15 +167,14 @@ function getToolbarOptions(parsed) {
'underline',
'subscript',
'superscript',
+ 'fontColor',
+ 'fontBackgroundColor',
'|',
'removeFormat',
'|',
'bulletedList',
'numberedList',
'|',
- 'fontColor',
- 'fontBackgroundColor',
- '|',
'link',
'math',
'specialCharacters',
diff --git a/resources/vue/components/courseware/CoursewareTextBlock.vue b/resources/vue/components/courseware/CoursewareTextBlock.vue
index df376c5..ba9fa93 100644
--- a/resources/vue/components/courseware/CoursewareTextBlock.vue
+++ b/resources/vue/components/courseware/CoursewareTextBlock.vue
@@ -23,6 +23,7 @@
<script>
import CoursewareDefaultBlock from './CoursewareDefaultBlock.vue';
+import FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace';
import { blockMixin } from './block-mixin.js';
import { ClassicEditor, BalloonEditor } from '@/assets/javascripts/chunks/wysiwyg'
import { mapActions } from 'vuex';
@@ -44,6 +45,7 @@ export default {
editor: ClassicEditor,
editorConfig: {
// The configuration of the editor.
+ extraPlugins: [FindAndReplace],
}
};
},
diff --git a/templates/wiki/edit.php b/templates/wiki/edit.php
index 3e42108..0aa428b 100644
--- a/templates/wiki/edit.php
+++ b/templates/wiki/edit.php
@@ -11,8 +11,7 @@
<input type="hidden" name="submit" value="true">
<input type="hidden" name="cmd" value="show">
- <br>
- <textarea name="body" class="wiki-editor add_toolbar wysiwyg size-l" data-editor="extraPlugins=WikiLink"
+ <textarea name="body" class="wiki-editor add_toolbar wysiwyg size-l" data-editor="extraPlugins=FindAndReplace,WikiLink"
><?= wysiwygReady($body) ?></textarea>
</fieldset>