CKFinder.Util.Util
Utility class
Methods
Parameters
- items : Array
- callback : Function
- thisArg : Object (optional)
Converts special characters to be used as inline css parameter, mainly url resources
Parameters
- text : String
String to escape
Returns
- String
Escapes HTML tags and special characters
Parameters
- text : String
The string to be escaped.
Returns
- String
The escaped string.
Parses url params for runtime config.
Returns
- {}
Checks if CKFinder runs in modal mode.
Returns
- Boolean
Checks if CKFinder runs in popup mode.
Returns
- Boolean
Checks if given event is shortcut. On mac it detects CMD
key as CTRL
key.
// User pressed ALT+CTRL+A on keyboard or ALT+CMD+A on Mac finder.on( 'keydown:65', function( evt ) { // Order is irrelevant console.log( finder.util.isShortCut( evt, 'alt+ctrl' ) ); // logs true console.log( finder.util.isShortCut( evt, 'ctrl+alt' ) ); // logs true
// Checks if all required keys are pressed but not others
console.log( finder.util.isShortCut( evt, '' ) ); // logs false
console.log( finder.util.isShortCut( evt, 'alt' ) ); // logs false
console.log( finder.util.isShortCut( evt, 'alt+shift' ) ); // logs false
console.log( finder.util.isShortCut( evt, 'ctrl+shift' ) ); // logs false
} );
Parameters
- evt : jQuery.Event
jQuery Event
- shortcut : String
An expected special keys combination
Returns
- boolean
Checks if CKFinder runs in widget mode.
Returns
- Boolean
Converts special characters to be used as jquery/JavaScript css parameter, mainly url resources
Parameters
- text : String
String to escape
Returns
- String
Creates a random string with requested length.
Parameters
- length : Number
String length
- charset : String (optional)
Charset to use
Returns
- String
Converts object to URL encoded string with parameters
Parameters
- params : Object
Returns
- String
var url = finder.util.toGet( { param1 : 'a' , param2 : 'b' } ); // url contains 'param1=a¶m2=b'
Returns url relative to CKFinder installation path or full url if starts with http
Parameters
- url : String