Skip to content
Snippets Groups Projects
Commit 7a6820de authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

drop StudipBlockQuote from default toolbar, move text formatting, re #3213

parent 52485663
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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;"' ?>>
......
......@@ -38,6 +38,7 @@
<?= _('Inhalt') ?>
<?= I18N::textarea('content', $scm->content, [
'class' => 'add_toolbar wysiwyg size-l',
'data-editor' => 'extraPlugins=FindAndReplace',
]) ?>
</label>
</fieldset>
......
......@@ -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,
......
......@@ -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',
......
......@@ -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',
......
......@@ -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],
}
};
},
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment