Custom Formaters
Custom Formaters enable plugins to add escaped or encoded output.
Here are some examples, output is alerted against kdp.evaluate method, but formaters can be used in configuration properties as well:
Formaters avlaible by default include:
- timeFormat takes time in seconds and returns hh:mm:ss format
- dateFormat takes a time stamp returns javascript toString format
- numberWithCommas takes a number and returns number with comas
Adding your own custom formaters: customFormater.js
See external resources for how to include custom javascript file like customFormater.js
- mw.kalturaPluginWrapper(function(){
- mw.util.formaters().register({
- 'escape': function( value ){
- return escape( value );
- },
- 'reverse': function( value){
- return value.split("").reverse().join("");
- }
- });
- });
html5 qunit | flash qunit