打开source\script_upload.js文件,做以下改动
function insertAttach(id) {//IE下插入附件功能
var localimgpreview = '';
var path = $('attach_' + id).value;
var ext = getExt(path);//获取图片后缀
var re = new RegExp("(^|\\s|,)" + ext + "($|\\s|,)", "ig");
var localfile = $('attach_' + id).value.substr($('attach_' + id).value.replace(/\\/g, '/').lastIndexOf('/') + 1);
if(path == '') {
return;
}
if(extensions != '' && (re.exec(extensions) == null || ext == '')) {
alert('对不起,不支持上传此类扩展名的文件');
return;
}
attachexts[id] = inArray(ext, ['gif', 'jpg', 'jpeg', 'png', 'bmp']) ? 2 : 1;
var inhtml = '<div class="borderboxpic"><table cellspacing="0" cellpadding="0" border="0"><tr>';
if(is_ie || userAgent.indexOf('firefox') >= 1) {
var picPath = getPath($('attach_' + id));
var imgCache = new Image();
imgCache.src = picPath;
//原内容:
//inhtml += '<td><img src="' + picPath +'" width="60" height="80"> </td>';
//改为
if (is_ie) {
inhtml += '<td><div id="showpic_'+id+'" style="width:60px; height:80px;margin-right:10px;filter:progidXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);"></div></td>';
}
else
{
inhtml += '<td><img src="' + picPath +'" width="60" height="80"> </td>';
}
}
if(is_ie && typeof no_insert=='undefined' || insertType==0) {
//insertAttachimgTag(id)-->IE将缩略图插入至uchome编辑器
localfile += ' <a href="javascript:;" title="点击这里插入内容中当前光标的位置" onclick="insertAttachimgTag(' + id + ');return false;">[插入]</a>';
}
localfile += ' <span id="showmsg' + id + '"><a href="javascript:;" onclick="delAttach(' + id + ')">[删除]</a></span>';
inhtml += '<td>' + localfile +'<br/>';
inhtml += '图片描述:<br/><textarea name="pic_title" cols="40" rows="2"></textarea>';
inhtml += '</td></tr></table></div>';
$('localfile_' + id).innerHTML = inhtml;//填充编辑器下方显示浏览的图片缩略图、图片描述等内容及样式
//增加
if (is_ie) {
$('showpic_'+ id).filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = picPath;
}
$('attach_' + id).style.display = 'none';
addAttach();
}
原帖地址
http://huqq.blog.163.com/blog/static/18302517520109145260144/ |