Show:
Defined in: src/core/tools.js:4

CKEDITOR.tools class utility which adds additional methods to those of CKEditor.

Index

Methods

Methods

CKEDITOR.tools.jsonp

(
  • urlTemplate
  • urlParams
  • callback
  • errorCallback
)
Object static

Sends a request using the JSONP technique.

Parameters:

  • urlTemplate CKEDITOR.template

    The template of the URL to be requested. All properties passed in urlParams can be used, plus a {callback}, which represent a JSONP callback, must be defined.

  • urlParams Object

    Parameters to be passed to the urlTemplate.

  • callback Function

    A function to be called in case of success.

  • errorCallback Function

    A function to be called in case of failure.

Returns:

Object:

An object with the following properties:

  • id: the transaction ID
  • a cancel() method

debounce

(
  • callback
  • timeout
  • context
  • args
)
static

Debounce util function. If a function execution is expensive, it might be debounced. This means that it will be executed after some amount of time after its last call. For example, if we attach a a function on scroll event, it might be called hundreds times per second. In this case it may be debounced with, let's say 100ms. The real execution of this function will happen 100ms after last scroll event.

Parameters:

  • callback Function

    The callback which has to be called after given timeout.

  • timeout Number

    Timeout in milliseconds after which the callback will be called.

  • context Object

    The context in which the callback will be called. This argument is optional.

  • args Array

    An array of arguments which the callback will receive.

merge

(
  • objects
)
Object static

Returns a new object containing all of the properties of all the supplied objects. The properties from later objects will overwrite those in earlier objects.

Passing in a single object will create a shallow copy of it.

Parameters:

  • objects Object multiple

    One or more objects to merge.

Returns:

Object:

A new merged object.

simulate

(
  • element
  • event
)
static

Simulates event on a DOM element.

Parameters:

  • element DOMElement

    The element on which the event shoud be simualted.

  • event String

    The name of the event which have to be simulated.