I need to do post-deletion operations after a file is deleted (logging and some content checks). Is creating a plugin project still really the only way to create functionality after a file is deleted? It seems like total overkill to me! Would there be any way of creating a JavaScript callback? I mean something like a callback like
CKFinder.afterSuccessfulFileDelete = function() { /* Ajax calls etc logic */ }
Wouldn't "callbacks" be possible even in the serverside config by using overloading or overriding methods or reflection or similar tricks?
I'm even willing to do any hacks you can come up with, like binding .cke_button_deleteFile to a custom click handler or Anything that would make this simpler!
The delete menuitem click handler is just CKFinder.tools.callFunction(9,4); return false; - can I override that reliably and safely? Even hacking the core would seem simpler than creating and maintaining a separate dll ;_;
Please, any comment or help is greatly aperciated!
Clinging to staws
I tried this in dev console, just an example of how low I will go to avoid the DLL issues:
$('iframe').contents()
.find('iframe').contents()
.find('.cke_button_deleteFile')
.attr('onclick', '').unbind('click').on('click', function() { alert(1); });
I think that would have worked... Except that the menu gets recreated apparently at every rightclick, so this approach doesn't work... sigh.
Even better
Even better would be if there was a way to hook into the event before it actually fires. Like attach to the generation of cke_button_deleteFile somehow so that I could wrap the default CKFinder operation and incorporate my own Ajax Logic but I cannot find any event that I could hook into. Just the simple generation of the drop down menu with access to the DOM element would be enough for me, but I just can't find it!