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

Support style string definition (Fixes #533) #541

Merged
merged 3 commits into from
Jun 9, 2016
Merged

Support style string definition (Fixes #533) #541

merged 3 commits into from
Jun 9, 2016

Conversation

jbalsas
Copy link
Contributor

@jbalsas jbalsas commented Jun 8, 2016

Hey @ipeychev, this is the improvement we discussed for #533.

Now, this will work out of the box:

[...]
AlloyEditor.editable('editable', {
    coreStyles_bold: customBoldStyle,
    coreStyles_italic: customItalicStyle,
    coreStyles_underline: customUnderlineStyle,
    coreStyles_strike: customStrikeStyle,
    coreStyles_subscript: customSubscriptStyle,
    coreStyles_superscript: customSuperscriptStyle
});

@jbalsas jbalsas changed the title Update buttons using basicStyles plugin commands to use their matching style implementation Support style string definition (Fixes #533) Jun 8, 2016
@jbalsas
Copy link
Contributor Author

jbalsas commented Jun 8, 2016

/cc @qasid

@ipeychev
Copy link
Contributor

ipeychev commented Jun 8, 2016

Just started reviewing :)

:octocat: Sent from GH.

@@ -11,11 +11,15 @@
// Allows validating props being passed to the component.
propTypes: {
/**
* The style the button should handle as described by http://docs.ckeditor.com/#!/api/CKEDITOR.style
* The style the button should handle. It can be a style object as described by http://docs.ckeditor.com/#!/api/CKEDITOR.style
* or a string pointing to an object inside the editor instance configuration
Copy link
Contributor

@ipeychev ipeychev Jun 8, 2016

Choose a reason for hiding this comment

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

Hey Chema,

This sentence "a string pointing to an object inside the editor instance configuration" will need an example. We shall document this for 1.2.3 release and I'm not sure what exactly could be this string.

Could you please add an example to this comment?

Thanks,

Copy link
Contributor Author

@jbalsas jbalsas Jun 8, 2016

Choose a reason for hiding this comment

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

Ok, I'll add an example tomorrow. You can see the usage in the buttons that are now configured with the string. For example,

style: 'coreStyles_bold'

will try to get the style from editor.config.coreStyles_bold and

style: 'myPlugin.myCustomObject.myCustomStyle'

will try to get it from editor.config.myPlugin.myCustomObject.myCustomStyle

Do you think that would be clear enough? If so, I'll push that tomorrow morning! :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this will be enough and the whole change is great!

Thanks,

@jbalsas
Copy link
Contributor Author

jbalsas commented Jun 9, 2016

Pushed new commit with improved docs 😉

@ipeychev
Copy link
Contributor

ipeychev commented Jun 9, 2016

Just started reviewing :)

:octocat: Sent from GH.

@ipeychev ipeychev merged commit 8c12053 into liferay:master Jun 9, 2016
@ipeychev
Copy link
Contributor

ipeychev commented Jun 9, 2016

Thank you, pull request merged!

:octocat: Sent from GH.

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.

2 participants