问题
How to set custom width parameter to img tag created by tinymce?
I mean when you inster the image in textarea, how to change it's width to some custom value ? Image managers config does not provide such feature so I want to modify this script, just need to know where to start
SOLVED Here is my script that I added in tinyMCE initialization block
imagemanager_insert_template : function(fo, enc) {return '<img src=\"' + enc.xmlEncode(fo.url) + '\" width=\"$width_mini\" height=\"' + $width_mini/(fo.custom.width/fo.custom.height) + '\"/>';
},
That does the trick.
回答1:
Already answered but will post as answer so others will see that there is a solution for this problem
imagemanager_insert_template : function(fo, enc) {return '<img src=\"' + enc.xmlEncode(fo.url) + '\" width=\"$width_mini\" height=\"' + $width_mini/(fo.custom.width/fo.custom.height) + '\"/>';
},
来源:https://stackoverflow.com/questions/6889111/how-to-set-custom-width-parameter-to-img-tag-created-by-tinymce