Skip to content
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

Fix for: Custom colors added to colorButton_colors in form label/code don't work correctly #2646

Merged
merged 15 commits into from
Feb 15, 2019

Conversation

engineering-this
Copy link
Contributor

What is the purpose of this pull request?

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

  • Unit tests
  • Manual tests

What changes did you make?

Forced plugin to set colorCode instead of colorName on text.
Reason behind this change can be found here: #1478 (comment)

Closes #1478

@Comandeer Comandeer self-requested a review December 5, 2018 13:38
@Comandeer Comandeer self-assigned this Dec 5, 2018
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Please rebase the branch onto latest master, as it's targeted to 4.11.2, not 4.12.0.

Additionally unit test fails in IE 8:
selection_059


<script>
CKEDITOR.replace( 'editor', {
colorButton_colors: 'Not blue/F00,00F'
Copy link
Member

Choose a reason for hiding this comment

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

Maybe restrict toolbar to only one colorbutton? ATM there are two buttons: for background and text.

plugins/colorbutton/plugin.js Show resolved Hide resolved
@@ -283,8 +282,8 @@ CKEDITOR.plugins.add( 'colorbutton', {
output.push( '<td>' +
'<a class="cke_colorbox" _cke_focus=1 hidefocus=true' +
' title="', colorLabel, '"' +
' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'', colorName, '\',\'', type, '\'); return false;"' +
' href="javascript:void(\'', colorLabel, '\')"' +
' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'#', colorCode, '\',\'', type, '\'); return false;"' +
Copy link
Member

Choose a reason for hiding this comment

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

IMO normalization of the color should be done inside clickFn.

CHANGES.md Outdated
@@ -6,6 +6,7 @@
Fixed Issues:

* [#1986](https://github.com/ckeditor/ckeditor-dev/issues/1986): Fixed: Cell Properties dialog from [Table Tools](https://ckeditor.com/cke4/addon/tabletools) plugin shows styles that are not allowed through [`config.allowedContent`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent).
* [#1478](https://github.com/ckeditor/ckeditor-dev/issues/1478): Fixed: Custom colors added to [Color Button](https://ckeditor.com/cke4/addon/colorbutton) via `colorButton_colors` in form label/code don't work correctly.
Copy link
Member

Choose a reason for hiding this comment

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

Config variable can be linked.

@engineering-this engineering-this changed the base branch from major to master December 5, 2018 15:49
@engineering-this engineering-this self-assigned this Dec 5, 2018
@engineering-this
Copy link
Contributor Author

I've added fixStyles:true option to assert.beautified.html, so test passes on IE8.
Fixed things mentioned in review comments.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Du to the changes now two tests are failing in every browser:
selection_064

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

In fact it's a breaking change in behaviour and should be noted in API docs. Also the whole docs should be updated.

@engineering-this
Copy link
Contributor Author

Updated docs, and rebased branch.

@Comandeer Comandeer assigned Comandeer and unassigned Comandeer Jan 17, 2019
@Comandeer Comandeer assigned Comandeer and unassigned Comandeer Feb 3, 2019
@Comandeer Comandeer changed the base branch from master to major February 4, 2019 14:45
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Please rebase branch onto latest major.

@engineering-this
Copy link
Contributor Author

Rebased, updated version references.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

LGTM!

@Comandeer Comandeer merged commit 74ebaae into major Feb 15, 2019
@CKEditorBot CKEditorBot deleted the t/1478 branch February 15, 2019 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom colors added to colorButton_colors in form label/code don't work at all
2 participants