My current CMS does not seem to apply a class name when an element is floated left or right. Instead of delving into the TinyMCE code, I would prefer to use jQuery to solve this issue.
Currently, when aligning an image to the left or right, inline styles are added directly to the image tag like this:
<img src="image.jpg" style="float:left">
I had hoped to automatically add a class name of "alignleft" to elements with this style applied. Unfortunately, my attempt at using jQuery did not yield results:
$( 'a[ style=' + 'float: left;' + ']' ).addClass( 'alignleft' );
Any suggestions on how to approach this?