Show:

The ButtonTwitter class provides functionality for creating a link which allows people to tweet part of the content in the editor.

Methods

_getHref

() String protected

Generates the appropriate twitter url based on the selected text and the configuration options received via props.

Returns:

String:

A valid twitter url with the selected text and given configuration.

getStateClasses

() String

Returns the list of state classes associated to the current element's state, according to the results of the isActive and isDisabled methods.

Returns:

String:

A string with the state CSS classes.

handleClick

()

Creates or removes the twitter link on the selection.

isActive

() Boolean

Checks if the current selection is contained within a link that points to twitter.com/intent/tweet.

Returns:

Boolean:

True if the selection is inside a twitter link, false otherwise.

render

() Object

Lifecycle. Renders the UI of the button.

Returns:

Object:

The content which should be rendered.

Properties

editor

Object

The editor instance where the component is being used.

key

String static

The name which will be used as an alias of the button in the configuration.

Default: twitter

label

String

The label that should be used for accessibility purposes.

tabIndex

Number

The tabIndex of the button in its toolbar current state. A value other than -1 means that the button has focus and is the active element.