fckeditor\editor\dialog\fck_image\fck_image.js 修改函数
前台输入
function SetUrl( url, width, height, alt )
{
if ( sActualBrowser == 'Link' )
{
GetE('txtLnkUrl').value = url ;
UpdatePreview() ;
}
else
{
GetE('txtUrl').value = url ;
GetE('txtWidth').value = width ? width : '' ;
GetE('txtHeight').value = height ? height : '' ;
if ( alt )
GetE('txtAlt').value = alt;
UpdatePreview() ;
UpdateOriginal( true ) ;
FCKConfig.setUploadImg(url);//修改---
}
window.parent.SetSelectedTab( 'Info' ) ;
}
在 fckeditor\fckconfig.js 最后加上函数
FCKConfig.setUploadImg = function(_res){
if(!_res) return;
objDrop=parent.document.getElementById("PicSelect");
objText=parent.document.getElementById("TextPic");
var nIndex = objDrop.selectedIndex;
if(objDrop.options[0].value=="")objDrop.options[0]=null;
var oLen=objDrop.length;
if(oLen>0)
{
for(var i=0; i<oLen; i++)
{
if(objDrop.options[i].value==_res) return;
}
}
objDrop.options[oLen] = new Option('Image'+[oLen+1], _res);
objDrop.selectedIndex = nIndex;
if(objText.value=="" || objText.value.length==0)objText.value=_res;
}
前台输入
<tr>
<td class="classtd">
图片:</td>
<td class="classtd">
<asp:TextBox ID="TextPic" runat="server" MaxLength="50"></asp:TextBox>
<select id="PicSelect" onchange="document.getElementById('ShowPic').src=options[selectedIndex].value;document.getElementById('TextPic').value=options[selectedIndex].value;">
<option value="">选择已上传图片</option>
</select>
<img id="ShowPic" />
</td>
</tr>