插入图像时如何更改html输出
由此:
<img title="?" src="?" alt="?" width="xxx" height="xxx" />
进入这个:
<a href="?" rel="?" title="?"> <img src="?" alt="?"></a>
如何设置变量。
我自己找到了答案。我编辑了 tiny_mce\plugins\advimage\js\image.js
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
进入
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.setHTML(tinyMCE.activeEditor.dom, '<a href="'+ foo +'" rel="lightbox[article]" title="'+ args['title'] +'"> <img src="'+ args['src'] +'" alt="'+ args['title'] +'"></a>'), {skip_undo : 1});