Hi guys,
I am fairly new to CKEditor but I have been doing some research and can't seem to find any examples of what I want to do.
I want to be able to capture mouse clicks on links within the editor area.
So far, from my searching, I have come up with the following code:
Now this seems to work up to the point where I attach the action. I get a error stating that there is no "on" function for this element.
However, when I check the DOM and the contents of that arr variable, it seems to have correctly selected the elements. I think I must be pretty close, but am missing the vital piece.
Or maybe there is a better way to do this? I see that the current link functionality has a double click attached which pulls up the Link Dialog, so guess it must be implemented already somehow.
Thanks for any advice you can give.
I am fairly new to CKEditor but I have been doing some research and can't seem to find any examples of what I want to do.
I want to be able to capture mouse clicks on links within the editor area.
So far, from my searching, I have come up with the following code:
var editor = CKEDITOR.instances.page_content; var arr = editor.document.$.getElementsByTagName("a"); for (var i = 0; i < arr.length; i++) { var element = arr[i]; element.on('click', function() { alert('link clicked'); }); }
Now this seems to work up to the point where I attach the action. I get a error stating that there is no "on" function for this element.
However, when I check the DOM and the contents of that arr variable, it seems to have correctly selected the elements. I think I must be pretty close, but am missing the vital piece.
Or maybe there is a better way to do this? I see that the current link functionality has a double click attached which pulls up the Link Dialog, so guess it must be implemented already somehow.
Thanks for any advice you can give.