Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Initial implementation #1

Merged
merged 26 commits into from
Sep 13, 2019
Merged

Initial implementation #1

merged 26 commits into from
Sep 13, 2019

Conversation

pomek
Copy link
Member

@pomek pomek commented Sep 3, 2019

Suggested merge commit message (convention)

Feature: Initial implementation of the feature. Closes ckeditor/ckeditor5#1365.


Additional information

From the initial requirements, a few of them are not implemented in this PR:

  • If possible it would be nice to put collapsed selection after the hr widget, but that's not necessary and could be extracted into a followup.

    After inserting the hr, the selection is set on the element.

  • Pasting from Google Docs works but I didn't check how it goes with Word.

  • Integration with floating elements?

    @dkonopka - could you say anything about?

  • Our demo isn't perfect but we can improve it after closing the PR.

@pomek pomek requested a review from mlewand September 3, 2019 08:12
Copy link
Member

@Reinmar Reinmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some organizational things first.

docs/_snippets/features/horizontal-rule.html Outdated Show resolved Hide resolved
docs/_snippets/features/horizontal-rule.js Outdated Show resolved Hide resolved
docs/_snippets/features/horizontal-rule.js Show resolved Hide resolved
src/horizontalrulecommand.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
theme/horizontalrule.css Outdated Show resolved Hide resolved
@pomek
Copy link
Member Author

pomek commented Sep 3, 2019

I fixed all reported issues. @dkonopka, feel free to remove r- label when you will finish your job here.


ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ HorizontalRule, ... ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read more about {@link builds/guides/integration/installing-plugins installing plugins}.
</info-box>

## Contribute
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


.ck-content .ck-horizontal-rule {
/* Handle proper `<hr>` display next to elements with `float` property, e.g. side image case. */
overflow: hidden;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that this style is only here? What about content produced by CKE5? Will hrs be trimmed there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks everything ok:

Screen Shot 2019-09-05 at 09 45 01

Demo: https://jsfiddle.net/26qopj3s/

* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

.ck-content .ck-horizontal-rule {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a content style if it uses .ck-horizontal-rule because this class is not printed out by the editor. So, this is part of UI styles and as such should, AFAIK, be prepended with .ck instead.

cc @dkonopka

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are completely right, thanks for being watchful 👍

padding: 5px;
}

.ck-content .ck-horizontal-rule hr {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar as above – if these are supposed to be content styles then .ck-horizontal-rule is just not there. So the only selector that we can use is .ck-content hr.

Copy link
Member

@Reinmar Reinmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented.

@pomek
Copy link
Member Author

pomek commented Sep 5, 2019

Fixed.

@Reinmar Reinmar merged commit de9b35a into master Sep 13, 2019
@Reinmar Reinmar deleted the t/ckeditor/1365 branch September 13, 2019 08:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the horizontal rule (line) feature
3 participants