Show:
Defined in: src/core/link.js:6

Link class utility. Provides methods for create, delete and update links.

Constructor

Methods

_getCompleteURI

(
  • URI
)
String protected

Checks if the URI has a scheme. If not, the default 'http' scheme with hierarchical path '//' is added to it.

Parameters:

  • URI String

    The URI of the link.

Returns:

String:

The URI updated with the protocol.

create

(
  • URI
  • attrs
)

Defined in src/core/link.js:21

Create a link with given URI as href.

Parameters:

  • URI String

    The URI of the link.

  • attrs Object

    A config object with link attributes. These might be arbitrary DOM attributes.

getFromSelection

() CKEDITOR.dom.element

Defined in src/core/link.js:56

Retrieves a link from the current selection.

Returns:

CKEDITOR.dom.element:

The retrieved link or null if not found.

remove

(
  • link
)

Defined in src/core/link.js:82

Removes a link from the editor.

Parameters:

  • link CKEDITOR.dom.element

    The link element which link style should be removed.

update

(
  • URI
  • link
)

Updates the href of an already existing link.

Parameters:

  • URI String

    The new URI of the link.

  • link CKEDITOR.dom.element

    The link element which href should be removed.