-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Integrate caption with basicstyles plugin #1559
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ecb5079
Add unit test.
Comandeer 53c7426
Add manual test.
Comandeer a42106f
Check if focus is inside caption or element inside caption.
Comandeer 26d1af9
Introduce mechanism for forcing widget to be treated as focused.
Comandeer b061847
Update manual test.
Comandeer 476c5e2
Update API docs and issue references in code.
Comandeer a2d31b7
Update unit test.
Comandeer 07df769
Fix incorrect issue reference.
Comandeer feb8bca
Ignore manual test in unsupported environments.
Comandeer 8584317
Update version tags.
Comandeer 2a98c07
Remove redundant empty line.
Comandeer a9eafc1
Refactor isFocused parameter to forceFocus.
Comandeer 4f6a2fc
Update tags in manual test.
Comandeer d387933
Update check for unsupported environment in manual test.
Comandeer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
53 changes: 53 additions & 0 deletions
53
tests/plugins/imagebase/features/manual/captionbasicstyles.html
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,53 @@ | ||
<head> | ||
<link rel="stylesheet" href="/apps/ckeditor/contents.css"> | ||
</head> | ||
<body> | ||
<h1>Classic editor</h1> | ||
|
||
<div id="classic"> | ||
<p>Widget without caption:</p> | ||
<figure> | ||
<img src="../../../image2/_assets/foo.png" alt="foo"> | ||
</figure> | ||
|
||
<p>Widget with caption:</p> | ||
<figure> | ||
<img src="../../../image2/_assets/foo.png" alt="foo"> | ||
<figcaption>Test caption</figcaption> | ||
</figure> | ||
</div> | ||
|
||
<h1>Divarea</h1> | ||
|
||
<div id="divarea"> | ||
<p>Widget without caption:</p> | ||
<figure> | ||
<img src="../../../image2/_assets/foo.png" alt="foo"> | ||
</figure> | ||
|
||
<p>Widget with caption:</p> | ||
<figure> | ||
<img src="../../../image2/_assets/foo.png" alt="foo"> | ||
<figcaption>Test caption</figcaption> | ||
</figure> | ||
</div> | ||
|
||
<script> | ||
bender.tools.ignoreUnsupportedEnvironment( 'easyimage' ); | ||
|
||
var cfg = { | ||
on: { | ||
pluginsLoaded: function( evt ) { | ||
var editor = evt.editor, | ||
imageBase = CKEDITOR.plugins.imagebase; | ||
|
||
imageBase.addImageWidget( editor, 'testWidget', imageBase.addFeature( editor, 'caption', {} ) ); | ||
} | ||
}, | ||
height: 500 | ||
}; | ||
|
||
CKEDITOR.replace( 'classic', cfg ); | ||
CKEDITOR.replace( 'divarea', CKEDITOR.tools.object.merge( cfg, { extraPlugins: 'divarea' } ) ); | ||
</script> | ||
</body> |
25 changes: 25 additions & 0 deletions
25
tests/plugins/imagebase/features/manual/captionbasicstyles.md
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,25 @@ | ||
@bender-tags: 4.13.1, bug, 1646 | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea, toolbar, imagebase, basicstyles | ||
@bender-include: %BASE_PATH%/plugins/easyimage/_helpers/tools.js | ||
|
||
# Integration of caption and basicstyles | ||
|
||
1. Focus widget. | ||
2. Put cursor inside the caption. If caption contains text, delete it. | ||
3. Apply "Bold". | ||
|
||
## Expected | ||
|
||
* Bold is applied. | ||
* There is no visible placeholder. | ||
* Selection remains inside the caption. | ||
|
||
## Unexpected | ||
|
||
* Placeholder shows up. | ||
* Firefox/Edge: Selection is lost. | ||
|
||
--- | ||
|
||
Repeat for all editors. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test does not work (the divarea editor to be precise) on IE8. AFAIR,
imagebase
is not supposed to work on IE8 so it should be ignored probably.