CKEditor 4 Documentation

CKEDITOR.plugins.copyformatting

Files

Available since: 4.6.0

Defined By

Properties

CKEDITOR.plugins.copyformatting
view source
: Stringprivate
Stores the name of the command (if any) initially bound to the keystroke used for format applying (CKEDITOR.config.co...

Stores the name of the command (if any) initially bound to the keystroke used for format applying (CKEDITOR.config.copyFormatting_keystrokePaste), to restore it after copy formatting is deactivated.

CKEDITOR.plugins.copyformatting
view source
: Array
An array of elements on which extracting formatting should be stopped. ...

An array of elements on which extracting formatting should be stopped. If Copy Formatting reaches an element from the array, it ends going up the document tree and fetching the element parents' styles.

Defaults to: ['ul', 'ol', 'table']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of elements that will be transformed into inline styles while applying formatting to the plain text context,...

An array of elements that will be transformed into inline styles while applying formatting to the plain text context, e.g. trying to apply styles from the <li> element (<li style="font-size: 24px;">) to a regular paragraph will cause changing the <li> element into a corresponding <span> element (<span style="font-size: 24px;">).

Defaults to: ['li']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of attributes that should be excluded from extracted styles. ...

An array of attributes that should be excluded from extracted styles.

Defaults to: ['id', 'style', 'href', 'data-cke-saved-href', 'dir']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of attributes to be excluded while transforming styles from elements inside elementsForInlineTransform into ...

An array of attributes to be excluded while transforming styles from elements inside elementsForInlineTransform into <span> elements with styles (e.g. when applying these styles to text context).

Defaults to: ['value', 'type']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of elements that will be excluded from the transformation while applying formatting to the plain text context. ...

An array of elements that will be excluded from the transformation while applying formatting to the plain text context.

Defaults to: ['table', 'thead', 'tbody', 'ul', 'ol']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of block boundaries that should be always transformed into inline elements with styles, e.g. ...

An array of block boundaries that should be always transformed into inline elements with styles, e.g. <div style="font-size: 24px;" class="important"> becomes <span style="font-size: 24px;" class="important">.

Defaults to: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div']

CKEDITOR.plugins.copyformatting
view source
: Array
An array of elements which should not be deleted when removing old styles from the current selection. ...

An array of elements which should not be deleted when removing old styles from the current selection. Instead the styles are stripped from the elements, preserving the elements themselves, e.g. <ul style="font-size: 24px" class="important"> becomes <ul>.

Defaults to: ['ul', 'ol', 'li', 'td', 'th', 'tr', 'thead', 'tbody', 'table']

Defined By

Methods

CKEDITOR.plugins.copyformatting
view source
( ) : CKEDITOR.dom.elementprivate
Adds the screen reader messages wrapper. ...

Adds the screen reader messages wrapper. Multiple calls will create only one message container.

Returns

CKEDITOR.plugins.copyformatting
view source
( editor, newStyles ) : Booleanprivate
Initializes applying given styles to the currently selected content in the editor. ...

Initializes applying given styles to the currently selected content in the editor.

The actual applying is performed inside event listeners for the CKEDITOR.plugins.copyformatting.state.applyFormatting event.

Parameters

Returns

  • Boolean

    false if styles could not be applied, true otherwise.

CKEDITOR.plugins.copyformatting
view source
( editor, range, styles )private
Applies the list style inside the list context. ...

Applies the list style inside the list context.

Parameters

CKEDITOR.plugins.copyformatting
view source
( editor, range, styles )private
Applies the table style inside the table context. ...

Applies the table style inside the table context.

Parameters

CKEDITOR.plugins.copyformatting
view source
( editor, range, styles )private
Applies styles inside the plain text context. ...

Applies styles inside the plain text context.

Parameters

CKEDITOR.plugins.copyformatting
view source
( editor )private
Attaches the paste keystroke handler to the given editor instance. ...

Attaches the paste keystroke handler to the given editor instance.

Parameters

CKEDITOR.plugins.copyformatting
view source
( element ) : Objectprivate
Converts a given element into a style definition that could be used to create an instance of CKEDITOR.style. ...

Converts a given element into a style definition that could be used to create an instance of CKEDITOR.style.

Note that all definitions have a type property set to CKEDITOR.STYLE_INLINE.

Parameters

Returns

  • Object

    The style definition created from the element.

CKEDITOR.plugins.copyformatting
view source
( editor )private
Detaches the paste keystroke handler from the given editor instance. ...

Detaches the paste keystroke handler from the given editor instance.

Parameters

CKEDITOR.plugins.copyformatting
view source
( range ) : Stringprivate
Determines the context of the given selection. ...

Determines the context of the given selection. See CKEDITOR.config.copyFormatting_allowedContexts for a list of possible context values.

Parameters

Returns

  • String
CKEDITOR.plugins.copyformatting
view source
( editor, element ) : CKEDITOR.style[]private
Extracts styles from the given element and its ancestors. ...

Extracts styles from the given element and its ancestors. This function walks up the document tree, starting from the given element, and ends on the editor's editable or when the element from breakOnElements is reached.

Parameters

Returns

CKEDITOR.plugins.copyformatting
view source
( editor, range ) : CKEDITOR.style[]private
Extracts styles from the given range. ...

Extracts styles from the given range. This function finds all elements in the given range and then applies _extractStylesFromElement on them.

Parameters

Returns

  • CKEDITOR.style[]

    An array containing all extracted styles. Styles in the array returned by this method might be duplicated; it should be cleaned later on.

CKEDITOR.plugins.copyformatting
view source
( styles ) : CKEDITOR.style[]private
Filters styles before applying them by using CKEDITOR.filter. ...

Filters styles before applying them by using CKEDITOR.filter.

Parameters

Returns

CKEDITOR.plugins.copyformatting
view source
( editor ) : CKEDITOR.dom.elementprivate
Returns a container element where the mouse cursor should be overridden. ...

Returns a container element where the mouse cursor should be overridden.

Parameters

Returns

  • CKEDITOR.dom.element

    For inline editor, it is the editable itself and for classic editor it is the document element of the editor iframe.

CKEDITOR.plugins.copyformatting
view source
( ) : Objectprivate
Returns a screen reader messages wrapper. ...

Returns a screen reader messages wrapper.

Returns

  • Object
CKEDITOR.plugins.copyformatting
view source
( range ) : Objectprivate
Gets offsets as well as start and end containers for the selected word. ...

Gets offsets as well as start and end containers for the selected word. It also handles cases like lu<span style="color: #f00;">n</span>ar.

Parameters

Returns

  • Object

    return An object with the following properties:

    • startNode : CKEDITOR.dom.element

      The node where the word's beginning is located.

    • startOffset : Number

      The offset inside the startNode indicating the word's beginning.

    • endNode : CKEDITOR.dom.element

      The node where the word's ending is located.

    • endOffset : Number

      The offset inside the endNode indicating the word's ending.

CKEDITOR.plugins.copyformatting
view source
( editor, msg )private
Puts a message solely for screen readers, meant to provide status updates for the Copy Formatting plugin. ...

Puts a message solely for screen readers, meant to provide status updates for the Copy Formatting plugin.

Parameters

  • editor : CKEDITOR.editor

    The editor instance.

  • msg : string

    The name of the message in the language file.

CKEDITOR.plugins.copyformatting
view source
( range, element )private
Removes all styles from the element in a given range without removing the element itself. ...

Removes all styles from the element in a given range without removing the element itself.

Parameters

  • range : CKEDITOR.dom.range

    The range where the element should be found.

  • element : String

    The tag name of the element.