Helper for Tiny noautolink plugin.
- Source:
- Copyright:
- 2023 Meirza
- 2023 Meirza
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(static, constant) handleAction
Handle action.
(static, constant) toggleActiveState
Change the active state of button.
Methods
(inner) getAnchorElement(editor, selectedElm) → {Element}
Get anchor element.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
selectedElm |
Element |
Returns:
- Type
- Element
(inner) getSelectedContent(editor) → {String}
Return the full string based on the position of the cursor within the string.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE |
Returns:
- Type
- String
(inner) isInAnchor(editor, selectedElm) → {boolean}
Check the current selected element is an anchor or not.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
selectedElm |
Element |
Returns:
- Type
- boolean
(inner) isValidUrl(urlString) → {boolean}
Check if given string is a valid URL.
Parameters:
Name | Type | Description |
---|---|---|
urlString |
String | URL the link will point to. |
Returns:
True is valid, otherwise false.
- Type
- boolean
(inner) setNoAutoLink(editor, messages, urlString)
Display notification feedback when applying the noautolink to the selected text.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
messages |
object | |
urlString |
String |
(async, inner) setNoautolinkOnSelection(editor, url)
Wrap the selection with the nolink class.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
url |
String | URL the link will point to. |
(inner) toggleState(editor, toggler) → {function}
Change state of button.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
toggler |
function |
Returns:
- Type
- function
(inner) unsetNoAutoLink(editor, messages)
Display notification feedback when removing the noautolink to the selected text.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
messages |
object |
(async, inner) unsetNoautolinkOnSelection(editor, url)
Remove the nolink on the selection.
Parameters:
Name | Type | Description |
---|---|---|
editor |
TinyMCE | |
url |
String | URL the link will point to. |