tiny_link/link

Link helper for Tiny Link plugin.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) getCurrentLinkData

Source:

Get current link data.

Source:

Handle insertion of a new link, or update of an existing one.

(static, constant) toggleActiveState

Source:

Change the active state of button.

Source:

Handle unlink of a link

Methods

(inner) getAnchorElement(editor, selectedElm) → {Element}

Source:

Get anchor element.

Parameters:
Name Type Description
editor TinyMCE
selectedElm Element
Returns:
Type
Element
Source:

Get selected link.

Parameters:
Name Type Description
editor TinyMCE
Returns:
Type
Element

(inner) getTextSelection(editor) → {string}

Source:

Get only the selected text. In some cases, window.getSelection() is not run as expected. We should only get the text value For ex: XYZSome text here window.getSelection() will return XYZSome text here

Parameters:
Name Type Description
editor TinyMCE
Returns:

Selected text

Type
string

(inner) isInAnchor(editor, selectedElm) → {boolean}

Source:

Check the current selected element is an anchor or not.

Parameters:
Name Type Description
editor TinyMCE
selectedElm Element
Returns:
Type
boolean

(async, inner) setLinkOnSelection(currentForm, editor, url)

Source:

Final step setting the anchor on the selection.

Parameters:
Name Type Description
currentForm Element
editor TinyMCE
url String

URL the link will point to.

(inner) toggleState(editor, toggler) → {function}

Source:

Change state of button.

Parameters:
Name Type Description
editor TinyMCE
toggler function
Returns:
Type
function