CKEDITOR.Link Class
src/core/link.js:7
Link class utility. Provides methods for create, delete and update links.
Constructor
CKEDITOR.Link
-
editor
Parameters:
-
editor
ObjectThe CKEditor instance.
Index
Methods
_getCompleteURI
-
URI
Checks if the URI has an '@' symbol. If it does and the URI looks like an email and doesn't have 'mailto:', 'mailto:' is added to the URI. If it doesn't and the URI doesn't have a scheme, the default 'http' scheme with hierarchical path '//' is added to the URI.
Parameters:
-
URI
StringThe URI of the link.
Returns:
The URI updated with the protocol.
advanceSelection
-
link
Advances the editor selection to the next available position after a given link or the one in the current selection.
Parameters:
-
link
CKEDITOR.dom.elementThe link element which link style should be removed.
create
-
URI
-
attrs
-
modifySelection
Create a link with given URI as href.
Parameters:
-
URI
StringThe URI of the link.
-
attrs
ObjectA config object with link attributes. These might be arbitrary DOM attributes.
-
modifySelection
ObjectA config object with an advance attribute to indicate if the selection should be moved after the link creation.
getFromSelection
()
CKEDITOR.dom.element
Retrieves a link from the current selection.
Returns:
The retrieved link or null if not found.
remove
-
link
-
modifySelection
Removes a link from the editor.
Parameters:
-
link
CKEDITOR.dom.elementThe link element which link style should be removed.
-
modifySelection
ObjectA config object with an advance attribute to indicate if the selection should be moved after the link creation.
update
-
attrs
-
link
-
modifySelection
Updates the href of an already existing link.
Parameters:
-
attrs
Object | StringThe attributes to update or remove. Attributes with null values will be removed.
-
link
CKEDITOR.dom.elementThe link element which href should be removed.
-
modifySelection
ObjectA config object with an advance attribute to indicate if the selection should be moved after the link creation.