nl_tokens: Updates image size of CSS property
pl_tokens: function updateImageSizeCSS ( editor ) { var offset = editor . getCaretPos ( ) ; // find tag from current caret position var info = require ( 'editorUtils' ) . outputInfo ( editor ) ; var cssRule = require ( 'cssEditTree' ) . parseFromPosition ( info . content , offset , true ) ; if ( cssRule ) { // check if there is property with image under caret var prop = cssRule . itemFromPosition ( offset , true ) , m ; if ( prop && ( m = / url\((["']?)(.+?)\1\) / i . exec ( prop . value ( ) || '' ) ) ) { getImageSizeForSource ( editor , m [ 2 ] , function ( size ) { if ( size ) { var compoundData = cssRule . range ( true ) ; cssRule . value ( 'width' , size . width + 'px' ) ; cssRule . value ( 'height' , size . height + 'px' , cssRule . indexOf ( 'width' ) + 1 ) ; require ( 'actionUtils' ) . compoundUpdate ( editor , _ . extend ( compoundData , { <mask> : cssRule . toString ( ) , caret : offset } ) ) ; } } ) ; } } }