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
Prev Previous commit
Next Next commit
file upload buttons
  • Loading branch information
intoeetive committed Mar 25, 2024
commit cb168e990bdad2febc5402c616be7191b79ef3e5
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export default class EEUploadAdapter extends Plugin {
if (!options) {
return;
}
options.uploadLocationId = this.editor.config.get('defaultdir');
if (!options.uploadLocationId) {
return;
}
if (!options.uploadUrl) {
/**
* The {@link module:upload/uploadconfig~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}
Expand Down Expand Up @@ -133,7 +137,7 @@ class Adapter {
if (!response || response.error) {
return reject(response && response.error ? response.error : genericErrorText);
}
const urls = response.path ? { default: response.path } : response.urls;
const urls = response.path ? { default: response.path } : response.url ? { default: response.url } : response.urls;
// Resolve with the normalized `urls` property and pass the rest of the response
// to allow customizing the behavior of features relying on the upload adapters.
resolve({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default class FileManagerCommand extends Command {
}
};

options.directories = this.editor.config.get('directories');
options.defaultdir = this.editor.config.get('defaultdir');

function pickFile(evt) {
const file = evt.detail;
if (Object.prototype.toString.call(file) === '[object String]') {
Expand Down
3 changes: 2 additions & 1 deletion js-src/ckeditor5-build-classic/src/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +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, ImageInsert, AutoImage, ImageCaption, ImageStyle, ImageToolbar, ImageResize, ImageUpload } from '@ckeditor/ckeditor5-image';
import { Image, ImageInsert, AutoImage, ImageCaption, ImageStyle, ImageToolbar, ImageResize, ImageUpload, ImageUtils } 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 Down Expand Up @@ -79,6 +79,7 @@ ClassicEditor.builtinPlugins = [
ImageToolbar,
ImageResize,
ImageInsert,
ImageUpload,
AutoImage,
Indent,
IndentBlock,
Expand Down
Loading