Here is an overview of the javascipt structure of KFM to which will ease the development of plugins, widgets and the KFM core. There are two javascript libraries included in KFM. Mootools and jQuery. The rest of the functions are for a large part special KFM functions.
Contents |
Mootools JavaScript library. See for more information http://mootools.net/ It is advised not to use mootools tricks, since it will be deprecated in the future.
The jQuery library is included in the nocompatible modes which results in the fact that the basic jQuery call is $j() in stead of the default $(). There are some jQuery plugins added to KFM which you can use. The current libraries are:
kfm_prompt('Description','initial value of textbox',function(value){});
Displays a box with description as text, initial value in the textbox and the function is is executed when OK is pressed. The parameter value is the value present in the textbox.
kfm.showMessages(['message1','message2']);
Function that shows messages that will disappear automatically after some time. Input parameter must be an array.
kfm.showErrors([{message:'Error message error1'},{message:'Error message error2'}]);
This shows a KFM box of errors. Input parameter is an array of objects with message as the error message.
kfm_modal_open('HTML content of KFM modal','modal title');
This opens a KFM modal box that displays HTML content.
kfm_inArray(needle, [haystack]);
checks if needle is in haystack which is an array. Returns true when needle is in haystack, false otherwise.