-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8444 from ckeditor/i/8433
Fix (image): Don't attach the image resizer to images inside the HTML embed preview. Closes #8433.
- Loading branch information
Showing
7 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div id="editor"> | ||
<h3>Regular image</h3> | ||
<figure class="image"> | ||
<img alt="sample" src="sample.jpg"> | ||
<figcaption>Caption</figcaption> | ||
</figure> | ||
|
||
<h3>HTML embed preview</h3> | ||
<div class="raw-html-embed"> | ||
<img alt="sample" src="sample.jpg"> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals console, window, document */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; | ||
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; | ||
import HtmlEmbed from '@ckeditor/ckeditor5-html-embed/src/htmlembed'; | ||
import ImageInsert from '../../../../src/imageinsert'; | ||
import ImageResize from '../../../../src/imageresize'; | ||
|
||
import { UploadAdapterMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mocks'; | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ ArticlePluginSet, HtmlEmbed, ImageInsert, ImageResize ], | ||
toolbar: [ 'imageInsert', '|', 'htmlEmbed' ], | ||
htmlEmbed: { | ||
showPreviews: true | ||
} | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
|
||
editor.plugins.get( 'FileRepository' ).createUploadAdapter = loader => { | ||
return new UploadAdapterMock( loader ); | ||
}; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### The ImageResize plugin crashes if HtmlEmbed plugin has enabled showPreviews option [#8433](https://github.com/ckeditor/ckeditor5/issues/8433) | ||
|
||
1. Confirm that there is no error in the console. | ||
2. Confirm that the image in "Regular image" section can be resized: focus the image (four image resizers should be visible) and then resize the image using any of the resizer. | ||
3. Confirm that the image in "HTML embed preview" can't be resized. | ||
4. Insert new image and confirm that it can be resized. | ||
5. Add new HTML code containing an image (e.g. `<img src="sample.jpg">`) and confirm that it is not possible to resize it. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.