You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
klintersrv/editor/dialog/file.htm

173 lines
3.4 KiB

<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript src="dialog.js"></script>
<link href='dialog.css' type='text/css' rel='stylesheet'>
<TITLE>ÎļþÊôÐÔ</TITLE>
<script language="javascript">
function ReturnValue(){
var url = d_fromurl.value;
var sFilePic = getFilePic(url);
var sPicSrc = relativePath2setPath("sysimage/file/"+sFilePic);
dialogArguments.insertHTML("<img id=eWebEditor_TempElement_Img border=0 src='"+sPicSrc+"'><a id=eWebEditor_TempElement_Href href='"+url+"' target=_blank>"+d_filename.value+"</a>");
var oTempElement = dialogArguments.eWebEditor.document.getElementById("eWebEditor_TempElement_Img");
oTempElement.src = sPicSrc;
oTempElement.removeAttribute("id");
oTempElement = dialogArguments.eWebEditor.document.getElementById("eWebEditor_TempElement_Href");
oTempElement.href = url;
oTempElement.removeAttribute("id");
window.returnValue = null;
window.close();
}
function ok(){
GetFileName(d_fromurl.value, "/");
ReturnValue();
}
function getFilePic(url){
var sExt;
sExt=url.substr(url.lastIndexOf(".")+1);
sExt=sExt.toUpperCase();
var sPicName;
switch(sExt){
case "TXT":
sPicName = "txt.gif";
break;
case "CHM":
case "HLP":
sPicName = "hlp.gif";
break;
case "DOC":
sPicName = "doc.gif";
break;
case "PDF":
sPicName = "pdf.gif";
break;
case "MDB":
sPicName = "mdb.gif";
break;
case "GIF":
sPicName = "gif.gif";
break;
case "JPG":
sPicName = "jpg.gif";
break;
case "BMP":
sPicName = "bmp.gif";
break;
case "PNG":
sPicName = "pic.gif";
break;
case "ASP":
case "JSP":
case "JS":
case "PHP":
case "PHP3":
case "ASPX":
sPicName = "code.gif";
break;
case "HTM":
case "HTML":
case "SHTML":
sPicName = "htm.gif";
break;
case "ZIP":
sPicName = "zip.gif";
break;
case "RAR":
sPicName = "rar.gif";
break;
case "EXE":
sPicName = "exe.gif";
break;
case "AVI":
sPicName = "avi.gif";
break;
case "MPG":
case "MPEG":
case "ASF":
sPicName = "mp.gif";
break;
case "RA":
case "RM":
sPicName = "rm.gif";
break;
case "MP3":
sPicName = "mp3.gif";
break;
case "MID":
case "MIDI":
sPicName = "mid.gif";
break;
case "WAV":
sPicName = "audio.gif";
break;
case "XLS":
sPicName = "xls.gif";
break;
case "PPT":
case "PPS":
sPicName = "ppt.gif";
break;
case "SWF":
sPicName = "swf.gif";
break;
default:
sPicName = "unknow.gif";
break;
}
return sPicName;
}
function GetFileName(url, opt){
d_filename.value=url.substr(url.lastIndexOf(opt)+1);
}
function InitDocument(){
adjustDialog();
}
</script>
<BODY onload="InitDocument()">
<table border=0 cellpadding=0 cellspacing=5 id=tabDialogSize><tr><td>
<table border=0 cellpadding=0 cellspacing=0 align=center>
<tr>
<td>
<fieldset>
<legend>ÎļþÀ´Ô´</legend>
<table border=0 cellpadding=5 cellspacing=0 width="100%">
<tr><td>
<table border=0 cellpadding=0 cellspacing=2 width="100%">
<tr>
<td noWrap width="20%"><input type=radio id="d_checkfromurl" value="1" checked><label for=d_checkfromurl>ÍøÂç</label>:</td>
<td noWrap width="80%"><input type=text id='d_fromurl' size=40 value='http://'></td>
</tr>
</table>
</td></tr>
</table>
</fieldset>
</td>
</tr>
<tr><td height=5></td></tr>
<tr><td noWrap align=right><input type=submit value='È·¶¨' id=Ok onclick="ok()">&nbsp;&nbsp;<input type=button value='È¡Ïû' onclick="window.close();"></td></tr>
</table>
</td></tr></table>
<input type=hidden id=d_filename value="">
</body>
</html>