From e770cffe95ebb971c1a8ffd87f1e717faf2d507b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 31 Jan 2018 15:49:42 +0100 Subject: [PATCH 1/4] Changed: Rename `insertImage` UI button to `uploadImage`. --- tests/manual/uploadadapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/uploadadapter.js b/tests/manual/uploadadapter.js index d7cc707..33269b9 100644 --- a/tests/manual/uploadadapter.js +++ b/tests/manual/uploadadapter.js @@ -28,7 +28,7 @@ ClassicEditor Enter, Typing, Paragraph, Heading, Undo, Bold, Italic, Heading, List, Image, ImageToolbar, Clipboard, ImageCaption, ImageStyle, ImageUpload, CKFinderUploadAdapter ], - toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'insertImage' ], + toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'uploadImage' ], ckfinder: { // eslint-disable-next-line max-len uploadUrl: 'https://cksource.com/weuy2g4ryt278ywiue/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json' From 287211678c9c5346272bdc1c54c72d7b1bd1e692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 31 Jan 2018 17:00:43 +0100 Subject: [PATCH 2/4] Changed: Rename `upload/filerepository~Adapter` to `UploadAdapter`. --- src/uploadadapter.js | 10 +++++----- tests/uploadadapter.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uploadadapter.js b/src/uploadadapter.js index c096395..086d130 100644 --- a/src/uploadadapter.js +++ b/src/uploadadapter.js @@ -47,7 +47,7 @@ export default class CKFinderUploadAdapter extends Plugin { } // Register CKFinderAdapter - this.editor.plugins.get( FileRepository ).createAdapter = loader => new Adapter( loader, url, this.editor.t ); + this.editor.plugins.get( FileRepository ).createAdapter = loader => new UploadAdapter( loader, url, this.editor.t ); } } @@ -55,9 +55,9 @@ export default class CKFinderUploadAdapter extends Plugin { * Upload adapter for CKFinder. * * @private - * @implements module:upload/filerepository~Adapter + * @implements module:upload/filerepository~UploadAdapter */ -class Adapter { +class UploadAdapter { /** * Creates a new adapter instance. * @@ -91,7 +91,7 @@ class Adapter { /** * Starts the upload process. * - * @see module:upload/filerepository~Adapter#upload + * @see module:upload/filerepository~UploadAdapter#upload * @returns {Promise} */ upload() { @@ -105,7 +105,7 @@ class Adapter { /** * Aborts the upload process. * - * @see module:upload/filerepository~Adapter#abort + * @see module:upload/filerepository~UploadAdapter#abort * @returns {Promise} */ abort() { diff --git a/tests/uploadadapter.js b/tests/uploadadapter.js index cb5352e..7823535 100644 --- a/tests/uploadadapter.js +++ b/tests/uploadadapter.js @@ -42,7 +42,7 @@ describe( 'CKFinderUploadAdapter', () => { expect( editor.plugins.get( CKFinderUploadAdapter ) ).to.be.instanceOf( CKFinderUploadAdapter ); } ); - describe( 'Adapter', () => { + describe( 'UploadAdapter', () => { let adapter, loaderMock; beforeEach( () => { From 006fb7e7bc64c9a9a6b1ad73d69a2e41e0c47765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Wed, 31 Jan 2018 18:33:57 +0100 Subject: [PATCH 3/4] Change: Move `ImageUpload` feature to ckeditor5-image package. --- tests/manual/uploadadapter.js | 2 +- tests/uploadadapter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/manual/uploadadapter.js b/tests/manual/uploadadapter.js index 33269b9..e65a07c 100644 --- a/tests/manual/uploadadapter.js +++ b/tests/manual/uploadadapter.js @@ -19,7 +19,7 @@ import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle'; import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic'; import List from '@ckeditor/ckeditor5-list/src/list'; -import ImageUpload from '@ckeditor/ckeditor5-upload/src/imageupload'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import CKFinderUploadAdapter from '../../src/uploadadapter'; ClassicEditor diff --git a/tests/uploadadapter.js b/tests/uploadadapter.js index 7823535..e320a34 100644 --- a/tests/uploadadapter.js +++ b/tests/uploadadapter.js @@ -6,7 +6,7 @@ /* globals document */ import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor'; import Image from '@ckeditor/ckeditor5-image/src/image'; -import ImageUpload from '@ckeditor/ckeditor5-upload/src/imageupload'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import CKFinderUploadAdapter from '../src/uploadadapter'; import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; import { createNativeFileMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mocks'; From 5a3a953da112021b19eb2432fc91f24dde716851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Thu, 1 Feb 2018 11:49:30 +0100 Subject: [PATCH 4/4] Changed: Renamed `FileRepository#createAdapter()` to `FileRepository#createUploadAdapter()`. --- src/uploadadapter.js | 2 +- tests/uploadadapter.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uploadadapter.js b/src/uploadadapter.js index 086d130..b8283b9 100644 --- a/src/uploadadapter.js +++ b/src/uploadadapter.js @@ -47,7 +47,7 @@ export default class CKFinderUploadAdapter extends Plugin { } // Register CKFinderAdapter - this.editor.plugins.get( FileRepository ).createAdapter = loader => new UploadAdapter( loader, url, this.editor.t ); + this.editor.plugins.get( FileRepository ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t ); } } diff --git a/tests/uploadadapter.js b/tests/uploadadapter.js index e320a34..a2195d6 100644 --- a/tests/uploadadapter.js +++ b/tests/uploadadapter.js @@ -50,7 +50,7 @@ describe( 'CKFinderUploadAdapter', () => { file.name = 'image.jpeg'; loaderMock = { file }; - adapter = editor.plugins.get( FileRepository ).createAdapter( loaderMock ); + adapter = editor.plugins.get( FileRepository ).createUploadAdapter( loaderMock ); } ); it( 'crateAdapter method should be registered and have upload and abort methods', () => { @@ -59,7 +59,7 @@ describe( 'CKFinderUploadAdapter', () => { expect( adapter.abort ).to.be.a( 'function' ); } ); - it( 'should not set the FileRepository.createAdapter factory if not configured', () => { + it( 'should not set the FileRepository.createUploadAdapter factory if not configured', () => { const editorElement = document.createElement( 'div' ); document.body.appendChild( editorElement ); @@ -70,7 +70,7 @@ describe( 'CKFinderUploadAdapter', () => { .then( editor => { const fileRepository = editor.plugins.get( FileRepository ); - expect( fileRepository ).to.not.have.property( 'createAdapter' ); + expect( fileRepository ).to.not.have.property( 'createUploadAdapter' ); editorElement.remove();