Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable uploading file into RTE (CKEditor) field with drag&drop in CP and Channel Form #4171

Open
wants to merge 19 commits into
base: 7.dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added plugins to CKEditor:
- insert image by URL
- find and replace
  • Loading branch information
intoeetive committed Mar 20, 2024
commit 9243ce822474a9502c0c6ac7bc393b61cff28e19
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';

import FileManagerUI from './filemanagerui';
import FileManagerEditing from './filemanagerediting';
import EEUploadAdapter from '../../eeupload/src/uploadadapter';

/**
* The FileManager feature, a bridge between the CKEditor 5 WYSIWYG editor and the
Expand Down Expand Up @@ -47,7 +46,7 @@ export default class FileManager extends Plugin {
* @inheritDoc
*/
static get requires() {
return [ FileManagerEditing, FileManagerUI, EEUploadAdapter ];
return [ FileManagerEditing, FileManagerUI ];
}
}

Expand Down
16 changes: 7 additions & 9 deletions js-src/ckeditor5-build-classic/src/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';

import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
Expand All @@ -19,12 +18,7 @@ import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock';
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript';
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript';
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
import Image from '@ckeditor/ckeditor5-image/src/image';
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize';
import { Image, ImageInsert, AutoImage, ImageCaption, ImageStyle, ImageToolbar, ImageResize } from '@ckeditor/ckeditor5-image';
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
import Link from '@ckeditor/ckeditor5-link/src/link';
Expand All @@ -49,6 +43,8 @@ import { Style } from '@ckeditor/ckeditor5-style';
import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support';
import { SourceEditing } from '@ckeditor/ckeditor5-source-editing';
import { ShowBlocks } from '@ckeditor/ckeditor5-show-blocks';
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
import { SimpleUploadAdapter } from '@ckeditor/ckeditor5-upload';

import Mention from '../plugins/ckeditor5-mention/src/mention';
import ReadMore from '../plugins/readmore/src/readmore';
Expand All @@ -60,7 +56,8 @@ export default class ClassicEditor extends ClassicEditorBase {}
// Plugins to include in the build.
ClassicEditor.builtinPlugins = [
Essentials,
UploadAdapter,
SimpleUploadAdapter,
FindAndReplace,
Autoformat,
Clipboard,
Strikethrough,
Expand All @@ -78,8 +75,9 @@ ClassicEditor.builtinPlugins = [
ImageCaption,
ImageStyle,
ImageToolbar,
ImageUpload,
ImageResize,
ImageInsert,
AutoImage,
Indent,
IndentBlock,
Link,
Expand Down
1,268 changes: 575 additions & 693 deletions package-lock.json

Large diffs are not rendered by default.

76 changes: 39 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,47 @@
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@ckeditor/ckeditor5-adapter-ckfinder": "^38.1.1",
"@ckeditor/ckeditor5-alignment": "^38.1.1",
"@ckeditor/ckeditor5-autoformat": "^38.1.1",
"@ckeditor/ckeditor5-basic-styles": "^38.1.1",
"@ckeditor/ckeditor5-block-quote": "^38.1.1",
"@ckeditor/ckeditor5-ckbox": "^38.1.1",
"@ckeditor/ckeditor5-ckfinder": "^38.1.1",
"@ckeditor/ckeditor5-clipboard": "^38.1.1",
"@ckeditor/ckeditor5-code-block": "^38.1.1",
"@ckeditor/ckeditor5-core": "^38.1.1",
"@ckeditor/ckeditor5-adapter-ckfinder": "^41",
"@ckeditor/ckeditor5-alignment": "^41",
"@ckeditor/ckeditor5-autoformat": "^41",
"@ckeditor/ckeditor5-basic-styles": "^41",
"@ckeditor/ckeditor5-block-quote": "^41",
"@ckeditor/ckeditor5-ckbox": "^41",
"@ckeditor/ckeditor5-ckfinder": "^41",
"@ckeditor/ckeditor5-clipboard": "^41",
"@ckeditor/ckeditor5-code-block": "^41",
"@ckeditor/ckeditor5-core": "^41",
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^30.0.0",
"@ckeditor/ckeditor5-editor-classic": "^38.1.1",
"@ckeditor/ckeditor5-engine": "^38.1.1",
"@ckeditor/ckeditor5-essentials": "^38.1.1",
"@ckeditor/ckeditor5-font": "^38.1.1",
"@ckeditor/ckeditor5-heading": "^38.1.1",
"@ckeditor/ckeditor5-horizontal-line": "^38.1.1",
"@ckeditor/ckeditor5-html-embed": "^38.1.1",
"@ckeditor/ckeditor5-image": "^38.1.1",
"@ckeditor/ckeditor5-indent": "^38.1.1",
"@ckeditor/ckeditor5-link": "^38.1.1",
"@ckeditor/ckeditor5-list": "^38.1.1",
"@ckeditor/ckeditor5-media-embed": "^38.1.1",
"@ckeditor/ckeditor5-mention": "^38.1.1",
"@ckeditor/ckeditor5-page-break": "^38.1.1",
"@ckeditor/ckeditor5-paragraph": "^38.1.1",
"@ckeditor/ckeditor5-paste-from-office": "^38.1.1",
"@ckeditor/ckeditor5-remove-format": "^38.1.1",
"@ckeditor/ckeditor5-special-characters": "^38.1.1",
"@ckeditor/ckeditor5-table": "^38.1.1",
"@ckeditor/ckeditor5-theme-lark": "^38.1.1",
"@ckeditor/ckeditor5-typing": "^38.1.1",
"@ckeditor/ckeditor5-ui": "^38.1.1",
"@ckeditor/ckeditor5-word-count": "^38.1.1",
"@ckeditor/ckeditor5-source-editing": "^38.1.1",
"@ckeditor/ckeditor5-show-blocks": "^38.1.1",
"@ckeditor/ckeditor5-style": "^38.1.1",
"@ckeditor/ckeditor5-html-support": "^38.1.1",
"@ckeditor/ckeditor5-editor-classic": "^41",
"@ckeditor/ckeditor5-engine": "^41",
"@ckeditor/ckeditor5-essentials": "^41",
"@ckeditor/ckeditor5-font": "^41",
"@ckeditor/ckeditor5-heading": "^41",
"@ckeditor/ckeditor5-horizontal-line": "^41",
"@ckeditor/ckeditor5-html-embed": "^41",
"@ckeditor/ckeditor5-image": "^41",
"@ckeditor/ckeditor5-indent": "^41",
"@ckeditor/ckeditor5-link": "^41",
"@ckeditor/ckeditor5-list": "^41",
"@ckeditor/ckeditor5-media-embed": "^41",
"@ckeditor/ckeditor5-mention": "^41",
"@ckeditor/ckeditor5-page-break": "^41",
"@ckeditor/ckeditor5-paragraph": "^41",
"@ckeditor/ckeditor5-paste-from-office": "^41",
"@ckeditor/ckeditor5-remove-format": "^41",
"@ckeditor/ckeditor5-special-characters": "^41",
"@ckeditor/ckeditor5-table": "^41",
"@ckeditor/ckeditor5-theme-lark": "^41",
"@ckeditor/ckeditor5-typing": "^41",
"@ckeditor/ckeditor5-ui": "^41",
"@ckeditor/ckeditor5-word-count": "^41",
"@ckeditor/ckeditor5-source-editing": "^41",
"@ckeditor/ckeditor5-show-blocks": "^41",
"@ckeditor/ckeditor5-style": "^41",
"@ckeditor/ckeditor5-html-support": "^41",
"@ckeditor/ckeditor5-upload": "^41",
"@ckeditor/ckeditor5-find-and-replace": "^41",
"@types/jquery": "^3.3.31",
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ public function buildToolbarConfig($config)
'alignCenter',
'alignRight'
];
$toolbarConfig['image']->insert = new \stdClass();
$toolbarConfig['image']->insert->type = 'auto';
$toolbarConfig['image']->insert->integrations = ['url'];

if (in_array('heading', $toolbarConfig['toolbar']->items)) {
$toolbarConfig['heading'] = new \stdClass();
$toolbarConfig['heading']->options = [
Expand Down Expand Up @@ -354,6 +358,7 @@ public static function defaultToolbars()
"indent",
"link",
"filemanager",
"insertImage",
"insertTable",
"mediaEmbed",
"htmlEmbed",
Expand All @@ -366,6 +371,7 @@ public static function defaultToolbars()
"readMore",
"fontColor",
"fontBackgroundColor",
"findAndReplace",
"showBlocks",
"sourceEditing"
],
Expand Down
6 changes: 5 additions & 1 deletion system/ee/language/english/rte_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@

'line_rte' => 'Horizontal rule',

'filemanager_rte' => 'Image',
'filemanager_rte' => 'Image or File Picker',

'insertImage_rte' => 'Insert image via URL',

'insertTable_rte' => 'Table',

Expand Down Expand Up @@ -339,6 +341,8 @@

'sourceEditing_rte' => 'Source editing',

'findAndReplace_rte' => 'Find and replace',

'open_in_new_tab' => 'Open in a new tab',

'source_rte' => 'View Source',
Expand Down
1 change: 1 addition & 0 deletions themes/ee/asset/img/rte-icons/findandreplace_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions themes/ee/asset/img/rte-icons/insertimage_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 12 additions & 30 deletions themes/ee/asset/javascript/src/fields/rte/ckeditor/ckeditor.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading