Show: Inherited Protected Private Deprecated

# CKEDITOR.plugins.ae_autolink Class

Defined in: `src/plugins/autolink.js:30`

CKEditor plugin which automatically generates links when user types text which looks like URL.

## Constructor

### `CKEDITOR.plugins.ae_autolink`

()

Defined in `src/plugins/autolink.js:30`

## Index

### Methods

- _getLastWord
- _onKeyDown
- _onKeyUp
- _removeLink
- _replaceContentByLink
- _subscribeToKeyEvent
- init
- isValidURL

### Events

- autolinkAdd

## Methods

### `_getLastWord`

() String protected

Defined in `src/plugins/autolink.js:56`

Retrieves the last word introduced by the user. Reads from the current caret position backwards until it finds the first white space.

#### Returns:

String:

The last word introduced by user

### `_onKeyDown`

(

- `event`

)
protected

Defined in `src/plugins/autolink.js:132`

Listens to the `keydown` event and if the keycode is `Backspace`, removes the previously created link.

#### Parameters:

- `event` EventFacade

  EventFacade object

### `_onKeyUp`

(

- `event`

)
protected

Defined in `src/plugins/autolink.js:159`

Listens to the `Enter` and `Space` key events in order to check if the last word introduced by the user should be replaced by a link element.

#### Parameters:

- `event` EventFacade

  EventFacade object

### `_removeLink`

() protected

Defined in `src/plugins/autolink.js:237`

Removes the created link element, and replaces it by its text.

### `_replaceContentByLink`

(

- `content`

)
protected

Defined in `src/plugins/autolink.js:183`

Replaces content by a link element.

#### Parameters:

- `content` String

  The text that has to be replaced by an link element

### `_subscribeToKeyEvent`

() protected

Defined in `src/plugins/autolink.js:264`

Subscribe to a key event of the editable aria.

### `init`

(

- `editor`

)

Defined in `src/plugins/autolink.js:39`

Initialization of the plugin, part of CKEditor plugin lifecycle. The function registers the `keyup` event on the editing area.

#### Parameters:

- `editor` Object

  The current editor instance

### `isValidURL`

(

- `link`

)
Boolean protected

Defined in `src/plugins/autolink.js:120`

Checks if the given link is a valid URL.

#### Parameters:

- `link` String

  The link we want to know if it is a valid URL

#### Returns:

Boolean:

Returns true if the link is a valid URL, false otherwise

## Events

### `autolinkAdd`

Defined in `src/plugins/autolink.js:230`

Fired when a URL is detected in text and converted to a link.

#### Event Payload:

- `el` CKEDITOR.dom.element

  Node of the created link.