tiny_mce插入/编辑图像自定义html

tiny_mce插入/编辑图像自定义html,html,image,tinymce,Html,Image,Tinymce,插入图像时如何更改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('mceIn

插入图像时如何更改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',),{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});