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

Add phrase button to wysiwyg. #548

Merged
merged 3 commits into from Aug 11, 2016
Merged

Add phrase button to wysiwyg. #548

merged 3 commits into from Aug 11, 2016

Conversation

cruzanmo
Copy link

@cruzanmo cruzanmo commented Aug 3, 2016

For our purposes a "phrase" is a group of one or more words.

This PR allows any component to add a phrase button to the wysiwyg behavior.

e.g.

text:
  _has:
    -
      fn: wysiwyg
      buttons:
        - bold
        - italic
        - strikethrough
        - anchor
        - phrase:
            aria: annotate
            name: annotate
            contentDefault: A¹
            phraseClassList: ['clay-annotated'] # adds this class to the span
            phraseTagName: span

https://trello.com/c/EUYTk5fh/13-l-new-article-component-footnotes

* traverse down from the selection to find at least one phrase
* @returns {boolean}
*/
selectionContainsPhrase: function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be easier to read if this function was named something like hasSelectionPhrase to convey a boolean return value.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 79.184% when pulling 4c46dbb on phrases into f89c1c9 on master.

@davidandrewfrey
Copy link
Contributor

⭐ ⭐ ⭐ ⭐ ⭐

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 79.184% when pulling 47c70c0 on phrases into f89c1c9 on master.

@nelsonpecora
Copy link
Contributor

👍

@cruzanmo cruzanmo merged commit f9d33b9 into master Aug 11, 2016
@cruzanmo cruzanmo deleted the phrases branch August 11, 2016 16:04
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.

None yet

4 participants