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 @@ ...@@ -34,7 +34,7 @@
<? endif; ?> <? endif; ?>
<label> <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> placeholder="<?= _('Schreiben Sie hier Ihren Beitrag.') ?>"></textarea>
</label> </label>
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<!-- Postinginhalt --> <!-- Postinginhalt -->
<div class="content"> <div class="content">
<span data-edit-topic="<?= $post['topic_id'] ?>" <?= $edit_posting == $post['topic_id'] ? '' : 'style="display: none;"' ?>> <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>
<span data-show-topic="<?= $post['topic_id'] ?>" data-topic-content="<?= $post['topic_id'] ?>" <?= $edit_posting != $post['topic_id'] ? '' : 'style="display: none;"' ?>> <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 @@ ...@@ -38,6 +38,7 @@
<?= _('Inhalt') ?> <?= _('Inhalt') ?>
<?= I18N::textarea('content', $scm->content, [ <?= I18N::textarea('content', $scm->content, [
'class' => 'add_toolbar wysiwyg size-l', 'class' => 'add_toolbar wysiwyg size-l',
'data-editor' => 'extraPlugins=FindAndReplace',
]) ?> ]) ?>
</label> </label>
</fieldset> </fieldset>
......
...@@ -7,7 +7,6 @@ import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock'; ...@@ -7,7 +7,6 @@ import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock';
import EasyImagePlugin from '@ckeditor/ckeditor5-easy-image/src/easyimage'; import EasyImagePlugin from '@ckeditor/ckeditor5-easy-image/src/easyimage';
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials'; import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials';
import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; 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 FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js';
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js'; import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js';
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport'; import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport';
...@@ -49,9 +48,7 @@ import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js'; ...@@ -49,9 +48,7 @@ import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js';
import Mathematics from 'ckeditor5-math/src/math'; import Mathematics from 'ckeditor5-math/src/math';
/* ckeditor elan */ /* ckeditor elan */
import StudipA11YDialog, { updateVoiceLabel } from '../cke/studip-a11y-dialog/a11y-dialog.js'; 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 StudipUpload from '../cke/StudipUpload.js';
import StudipWikiLink from '../cke/wiki-link/wiki-link.js';
import SpecialCharactersSmiley from '../cke/special_characters/SpecialCharactersSmiley.js'; import SpecialCharactersSmiley from '../cke/special_characters/SpecialCharactersSmiley.js';
import SpecialCharactersGreek from '../cke/special_characters/SpecialCharactersGreek.js'; import SpecialCharactersGreek from '../cke/special_characters/SpecialCharactersGreek.js';
...@@ -65,7 +62,6 @@ const builtinPlugins = [ ...@@ -65,7 +62,6 @@ const builtinPlugins = [
BoldPlugin, BoldPlugin,
CodeBlock, CodeBlock,
EssentialsPlugin, EssentialsPlugin,
FindAndReplace,
FontColor, FontColor,
FontBackgroundColor, FontBackgroundColor,
GeneralHtmlSupport, GeneralHtmlSupport,
...@@ -95,7 +91,6 @@ const builtinPlugins = [ ...@@ -95,7 +91,6 @@ const builtinPlugins = [
SpecialCharactersMathematical, SpecialCharactersMathematical,
SpecialCharactersText, SpecialCharactersText,
Strikethrough, Strikethrough,
StudipBlockQuote,
StudipUpload, StudipUpload,
Subscript, Subscript,
Superscript, Superscript,
......
...@@ -15,12 +15,15 @@ ClassicEditor.defaultConfig = { ...@@ -15,12 +15,15 @@ ClassicEditor.defaultConfig = {
'redo', 'redo',
'findAndReplace', 'findAndReplace',
'|', '|',
'heading',
'bold', 'bold',
'italic', 'italic',
'underline', 'underline',
'strikethrough', 'strikethrough',
'subscript', 'subscript',
'superscript', 'superscript',
'fontColor',
'fontBackgroundColor',
'|', '|',
'removeFormat', 'removeFormat',
'|', '|',
...@@ -34,10 +37,6 @@ ClassicEditor.defaultConfig = { ...@@ -34,10 +37,6 @@ ClassicEditor.defaultConfig = {
'alignment:right', 'alignment:right',
'alignment:center', 'alignment:center',
'alignment:justify', 'alignment:justify',
'-',
'heading',
'fontColor',
'fontBackgroundColor',
'|', '|',
'link', 'link',
'insertTable', 'insertTable',
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* wysiwyg.js - Replace HTML textareas with WYSIWYG editor. * wysiwyg.js - Replace HTML textareas with WYSIWYG editor.
*/ */
import parseOptions from './parse_options.js'; 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'; import WikiLink from '../cke/wiki-link/wiki-link.js';
const wysiwyg = { const wysiwyg = {
...@@ -131,7 +133,7 @@ function parseEditorOptions(data) { ...@@ -131,7 +133,7 @@ function parseEditorOptions(data) {
} }
if (parsed.extraPlugins) { if (parsed.extraPlugins) {
const pluginMap = { WikiLink }; const pluginMap = { FindAndReplace, StudipBlockQuote, WikiLink };
result.options.extraPlugins = parsed.extraPlugins.split(',').reduce((memo, plugin) => { result.options.extraPlugins = parsed.extraPlugins.split(',').reduce((memo, plugin) => {
return plugin in pluginMap ? [...memo, pluginMap[plugin]] : memo; return plugin in pluginMap ? [...memo, pluginMap[plugin]] : memo;
}, []); }, []);
...@@ -153,12 +155,8 @@ function getToolbarOptions(parsed) { ...@@ -153,12 +155,8 @@ function getToolbarOptions(parsed) {
removeItems: [ removeItems: [
'undo', 'undo',
'redo', 'redo',
'findAndReplace',
'strikethrough', 'strikethrough',
'horizontalLine', 'horizontalLine',
'insertBlockQuote',
'splitBlockQuote',
'removeBlockQuote',
], ],
}; };
} else if (parsed.toolbar === 'minimal') { } else if (parsed.toolbar === 'minimal') {
...@@ -169,15 +167,14 @@ function getToolbarOptions(parsed) { ...@@ -169,15 +167,14 @@ function getToolbarOptions(parsed) {
'underline', 'underline',
'subscript', 'subscript',
'superscript', 'superscript',
'fontColor',
'fontBackgroundColor',
'|', '|',
'removeFormat', 'removeFormat',
'|', '|',
'bulletedList', 'bulletedList',
'numberedList', 'numberedList',
'|', '|',
'fontColor',
'fontBackgroundColor',
'|',
'link', 'link',
'math', 'math',
'specialCharacters', 'specialCharacters',
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<script> <script>
import CoursewareDefaultBlock from './CoursewareDefaultBlock.vue'; import CoursewareDefaultBlock from './CoursewareDefaultBlock.vue';
import FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace';
import { blockMixin } from './block-mixin.js'; import { blockMixin } from './block-mixin.js';
import { ClassicEditor, BalloonEditor } from '@/assets/javascripts/chunks/wysiwyg' import { ClassicEditor, BalloonEditor } from '@/assets/javascripts/chunks/wysiwyg'
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
...@@ -44,6 +45,7 @@ export default { ...@@ -44,6 +45,7 @@ export default {
editor: ClassicEditor, editor: ClassicEditor,
editorConfig: { editorConfig: {
// The configuration of the editor. // The configuration of the editor.
extraPlugins: [FindAndReplace],
} }
}; };
}, },
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
<input type="hidden" name="submit" value="true"> <input type="hidden" name="submit" value="true">
<input type="hidden" name="cmd" value="show"> <input type="hidden" name="cmd" value="show">
<br> <textarea name="body" class="wiki-editor add_toolbar wysiwyg size-l" data-editor="extraPlugins=FindAndReplace,WikiLink"
<textarea name="body" class="wiki-editor add_toolbar wysiwyg size-l" data-editor="extraPlugins=WikiLink"
><?= wysiwygReady($body) ?></textarea> ><?= wysiwygReady($body) ?></textarea>
</fieldset> </fieldset>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment