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:
-
urlTemplateCKEDITOR.templateThe template of the URL to be requested. All properties passed in
urlParamscan be used, plus a{callback}, which represent a JSONP callback, must be defined. -
urlParamsObjectParameters to be passed to the
urlTemplate. -
callbackFunctionA function to be called in case of success.
-
errorCallbackFunctionA 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:
-
callbackFunctionThe callback which has to be called after given timeout.
-
timeoutNumberTimeout in milliseconds after which the callback will be called.
-
contextObjectThe context in which the callback will be called. This argument is optional.
-
argsArrayAn 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:
-
objectsObject multipleOne or more objects to merge.
Returns:
A new merged object.
simulate
-
element -
event
Simulates event on a DOM element.
Parameters:
-
elementDOMElementThe element on which the event shoud be simualted.
-
eventStringThe name of the event which have to be simulated.