(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…') |
(No difference)
|
Revision as of 09:07, 25 May 2010
.. 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"); } ); }); });