tinyMCE remove element and its parent?

Hello. I have made a custom image plugin to add captions and copyright info at image insertion. So when you insert the image there is a class added and also the caption and copyright is added to the bottom of the image.

Everything is working fine. However, when I select the image and hit delete, the image is deleted but the class and copyright, caption info is not deleted. Of course because the selected Node is IMG.

What I have been looking for in the code is a way to modify the delete/remove function to if IMG is selected Node, remove it and its parent.

  1. I was wondering if anyone knew where the remove functions are in tinyMCE.js and if this is even possible.
  2. Also how do i modify the status bar at the bottom of the editor?

You guys are always so helpful. Thank you in advanceā€¦