Skip to content

Commit

Permalink
(#85) ckeditor 5 XeImageUploadPlugin class 로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
highk committed Feb 13, 2023
1 parent 228a6b2 commit 6795d62
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assets/ckeditor5-36.0.0/build/ckeditor5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/ckeditor5-36.0.0/build/ckeditor5.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
export default function ImageUploadPlugin( editor ) {
editor.editing.view.document.on( 'clipboardInput', (evt, data) => {
const dataTransfer = data.dataTransfer;
import { Plugin } from '@ckeditor/ckeditor5-core';

if(dataTransfer.files.length) {
dataTransfer.files.forEach((file) => {
const adaptor = new XeUploadAdapter(editor, file);
adaptor.upload();
});
export default class ImageUploadPlugin extends Plugin {
static get pluginName() {
return 'XeImageUpload';
}

data.content = null;
}
return;
})
init() {
const editor = this.editor;
editor.editing.view.document.on( 'clipboardInput', (evt, data) => {
const dataTransfer = data.dataTransfer;

if(dataTransfer.files.length) {
dataTransfer.files.forEach((file) => {
const adaptor = new XeUploadAdapter(editor, file);
adaptor.upload();
});

data.content = null;
}
return;
})
}
}

class XeUploadAdapter {
Expand Down

0 comments on commit 6795d62

Please sign in to comment.