-
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
Added identifying attribute to the Magic Line plugin #1453
Conversation
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.
CHANGES.md
Outdated
@@ -7,6 +7,7 @@ | |||
|
|||
New Features: | |||
|
|||
* [#933](https://github.com/ckeditor/ckeditor-dev/issues/1441): [Magic Line](https://ckeditor.com/cke4/addon/magicline) line element can now be identifiable using `data-cke-magic-line="1"` attribute. |
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.
Wrong issue number here. Please also remember that new entry should be added on the end of existing list.
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.
Another thing is that this fix is targeting major (next major is 4.9.0
) so the changelog entry should be put under CKEditor 4.9 not CKEditor 4.8.1.
</textarea> | ||
|
||
<script> | ||
CKEDITOR.replace( 'editor1', { |
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.
@@ -0,0 +1,67 @@ | |||
<textarea cols="80" id="editor1" name="editor1" rows="10"> |
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.
For indentation tab
s should be used (check .editorconfig
), however this whole file uses spaces, please fix this.
extraPlugins: 'magicline', | ||
magicline_color: 'blue', | ||
allowedContent: true | ||
}); |
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.
Should be } );
. Also indentation is wrong here, should be:
CKEDITOR.replace( 'editor1', {
extraPlugins: 'magicline',
magicline_color: 'blue',
allowedContent: true
} );
allowedContent: true | ||
}); | ||
|
||
CKEDITOR.addCss( 'span[data-cke-magic-line="1"] { border-top: solid 1px red !important; } ' + |
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.
Also here the 2nd, 3rd and 4th line should be just indented by one tab, don't try to align it with the CSS string from the first line.
CKEDITOR.replace( 'editor1', { | ||
extraPlugins: 'magicline', | ||
magicline_color: 'blue', | ||
allowedContent: true |
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.
I think instead of blocking ACF, you could just attach proper plugins to the editor, so you will have:
@bender-ckeditor-plugins: wysiwygarea, basicstyles, elementspath, magicline,toolbar, table, list, magicline, div, horizontalrule
and then editor config will need only magicline_color: 'blue'
.
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea, basicstyles, elementspath, magicline | ||
|
||
1. Hover the cursor over the editor and find a magic line pop-up. |
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.
Calling it magicline pop-up may be a little misleading, I would go with something like:
- Hover over different editor elements in a way that magic line is visible.
and basically this one step is enough. Then you will have Expected and Actual:
Whole magic line element is red/blue.
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.
LGTM 👍
What is the purpose of this pull request?
New feature
Does your PR contain necessary tests?
All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
What changes did you make?
Added
data-cke-magic-line="1"
attribute to the Magic Line line element.Closes #1441