I need to run a script when the user pushes the OK-button in the dialog for inserting images. As I have understood I can do this by registering a listener on the CKEDITOR.dialog’s “ok”-event, but this doesn’t work. I also tried to register at listener at the “resize-event” and this is working ok but is not to any use for me:’( Can someone please help me? I'm using JSP.
Attached the code I’m running.
<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript"> //<![CDATA[ CKEDITOR.dialog.on('ok', function( ev ) { alert('CKEDITOR.dialog.'+ev.name); }); CKEDITOR.dialog.on('resize', function( ev ) { alert('CKEDITOR.dialog.'+ev.name); }); //]]> </script> </head> <body> <form action="#" method="post"> <h1>Hello World!</h1> <textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea> <script type="text/javascript"> //<![CDATA[ // Replace the <textarea id="editor1"> with an CKEditor instance. var editor = CKEDITOR.replace( 'editor1' ); //]]> </script> </form> </body> </html>