CKEDITOR.tools Class
src/core/tools.js:4
CKEDITOR.tools class utility which adds additional methods to those of CKEditor.
Index
Methods
- CKEDITOR.tools.jsonp static
- debounce static
- merge static
- simulate static
Methods
CKEDITOR.tools.jsonp
-
urlTemplate
-
urlParams
-
callback
-
errorCallback
Sends a request using the JSONP technique.
Parameters:
-
urlTemplate
CKEDITOR.templateThe 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
ObjectParameters to be passed to the
urlTemplate
. -
callback
FunctionA function to be called in case of success.
-
errorCallback
FunctionA function to be called in case of failure.
Returns:
An object with the following properties:
- id: the transaction ID
- a
cancel()
method
debounce
-
callback
-
timeout
-
context
-
args
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
FunctionThe callback which has to be called after given timeout.
-
timeout
NumberTimeout in milliseconds after which the callback will be called.
-
context
ObjectThe context in which the callback will be called. This argument is optional.
-
args
ArrayAn array of arguments which the callback will receive.
merge
-
objects
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 multipleOne or more objects to merge.
Returns:
A new merged object.
simulate
-
element
-
event
Simulates event on a DOM element.
Parameters:
-
element
DOMElementThe element on which the event shoud be simualted.
-
event
StringThe name of the event which have to be simulated.