CKEditor 4 Documentation

CKEDITOR.plugins.clipboard.dataTransfer

Files

Facade for the native dataTransfer/clipboadData object to hide all differences between browsers.

Available since: 4.5

Defined By

Properties

CKEDITOR.plugins.clipboard.dataTransfer
view source
: Objectreadonly

A native DOM event object.

A native DOM event object.

CKEDITOR.plugins.clipboard.dataTransfer
view source
: Objectprivate

Private properties and methods.

Private properties and methods.

CKEDITOR.plugins.clipboard.dataTransfer
view source
: Stringreadonly
Data transfer ID used to bind all dataTransfer objects based on the same event (e.g. ...

Data transfer ID used to bind all dataTransfer objects based on the same event (e.g. in drag and drop events).

CKEDITOR.plugins.clipboard.dataTransfer
view source
: CKEDITOR.editorreadonly
Source editor — the editor where the drag starts. ...

Source editor — the editor where the drag starts. Might be undefined if the drag starts outside the editor (e.g. when dropping files to the editor).

Defined By

Methods

CKEDITOR.plugins.clipboard.dataTransfer
view source
new( [nativeDataTransfer], [editor] ) : CKEDITOR.plugins.clipboard.dataTransfer
Creates a class instance. ...

Creates a class instance.

Parameters

  • nativeDataTransfer : Object (optional)

    A native data transfer object.

  • editor : CKEDITOR.editor (optional)

    The source editor instance. If the editor is defined, dataValue will be created based on the editor content and the type will be 'html'.

Returns

CKEDITOR.plugins.clipboard.dataTransfer
view source
( ) : Fileprivate
When the content of the clipboard is pasted in Chrome, the clipboard data object has an empty files property, but it ...

When the content of the clipboard is pasted in Chrome, the clipboard data object has an empty files property, but it is possible to get the file as items[0].getAsFile(); (#12961).

Returns

  • File

    File instance or null if not found.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( )
Copies the data from the native data transfer to a private cache. ...

Copies the data from the native data transfer to a private cache. This function is needed because the data from the native data transfer is available only synchronously to the event listener. It is not possible to get the data asynchronously, after a timeout, and the CKEDITOR.editor.paste event is fired asynchronously — hence the need for caching the data.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( type, [getNative] ) : String
Facade for the native getData method. ...

Facade for the native getData method.

Parameters

  • type : String

    The type of data to retrieve.

  • getNative : Boolean (optional)

    Indicates if the whole, original content of the dataTransfer should be returned. Introduced in CKEditor 4.7.0.

    Defaults to: false

Returns

  • String

    type Stored data for the given type or an empty string if the data for that type does not exist.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( i ) : File
Gets the file at the index given. ...

Gets the file at the index given.

Parameters

  • i : Number

    Index.

Returns

  • File

    File instance.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( ) : Number
Gets the number of files in the dataTransfer object. ...

Gets the number of files in the dataTransfer object.

Returns

  • Number

    The number of files.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( targetEditor ) : Number
Gets the data transfer type. ...

Gets the data transfer type.

Parameters

Returns

CKEDITOR.plugins.clipboard.dataTransfer
view source
( ) : Boolean
Checks if the data transfer contains any data. ...

Checks if the data transfer contains any data.

Returns

  • Boolean

    true if the object contains no data.

CKEDITOR.plugins.clipboard.dataTransfer
view source
( type, value )
Facade for the native setData method. ...

Facade for the native setData method.

Parameters

  • type : String

    The type of data to retrieve.

  • value : String

    The data to add.