(Created page with '.. and the client side (JavaScript) plugin that will call the FileSize command: (save the code as '''plugin.js''' in "plugins/myplugin" folder) <source> CKFinder.addPlugin( 'mypl…') |
|||
Line 1: | Line 1: | ||
+ | ===== plugin.js ===== | ||
.. and the client side (JavaScript) plugin that will call the FileSize command: | .. and the client side (JavaScript) plugin that will call the FileSize command: | ||
(save the code as '''plugin.js''' in "plugins/myplugin" folder) | (save the code as '''plugin.js''' in "plugins/myplugin" folder) |
Latest revision as of 10:31, 25 May 2010
plugin.js
.. and the client side (JavaScript) plugin that will call the FileSize command: (save the code as plugin.js in "plugins/myplugin" folder)
CKFinder.addPlugin( 'myplugin', function( api ) { api.addFileContextMenuOption( { label : 'File Size', command : "FileSize" } , function( api, file ) { api.connector.sendCommand( 'FileSize', { fileName : api.getSelectedFile().name }, function( xml ) { if ( xml.checkError() ) return; var size = xml.selectSingleNode( 'Connector/FileSize/@size' ); api.openMsgDialog( "", "The exact size of a file is: " + size.value + " bytes"); } ); }); });