📄 file.htm
字号:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language=javascript src="dialog.js"></script>
<script language="javascript">
document.write ("<link href='../language/" + AvailableLangs["Active"] + ".css' type='text/css' rel='stylesheet'>");
document.write ("<link href='dialog.css' type='text/css' rel='stylesheet'>");
document.write ("<TITLE>" + lang["DlgFile"] + "</TITLE>");
function RadioClick(what){
if (what=="url"){
d_checkfromfile.checked=false;
d_fromurl.disabled=false;
if (config.AllowBrowse=="1"){
d_browse.disabled=false;
}
d_checkfromurl.checked=true;
d_file.myform.uploadfile.disabled=true;
}else{
d_checkfromurl.checked=false;
d_file.myform.uploadfile.disabled=false;
d_checkfromfile.checked=true;
d_fromurl.disabled=true;
if (config.AllowBrowse=="1"){
d_browse.disabled=true;
}
}
}
function UploadLoaded(){
RadioClick('file');
}
function UploadError(sErrDesc){
AbleItems();
RadioClick('file');
divProcessing.style.display="none";
try {
BaseAlert(d_file.myform.uploadfile,eval(sErrDesc));
}
catch(e){}
}
function UploadSaved(sPathFileName){
d_fromurl.value = sPathFileName;
ReturnValue();
}
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(){
if (d_checkfromurl.checked){
GetFileName(d_fromurl.value, "/");
ReturnValue();
}else{
if (!d_file.CheckUploadForm()) return false;
GetFileName(d_file.myform.uploadfile.value, "\\");
DisableItems();
divProcessing.style.display="";
d_file.myform.submit();
}
}
function DisableItems(){
d_checkfromfile.disabled=true;
d_checkfromurl.disabled=true;
d_fromurl.disabled=true;
if (config.AllowBrowse=="1"){
d_browse.disabled=true;
}
Ok.disabled=true;
}
function AbleItems(){
d_checkfromfile.disabled=false;
d_checkfromurl.disabled=false;
d_fromurl.disabled=false;
if (config.AllowBrowse=="1"){
d_browse.disabled=false;
}
Ok.disabled=false;
}
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(){
AvailableLangs.TranslatePage(document);
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><span lang=DlgFileSource></span></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_checkfromfile" value="1" onclick="RadioClick('file')"><label for=d_checkfromfile><span lang=DlgFromFile></span></label>:</td>
<td noWrap width="80%">
<Script Language=JavaScript>
document.write("<iframe id=d_file frameborder=0 src='../" + config.ServerExt + "/upload." + config.ServerExt + "?type=file&style=" + config.StyleName + "&language=" + AvailableLangs["Active"] + "' width='100%' height='22' scrolling=no></iframe>");
</Script>
</td>
</tr>
<tr>
<td noWrap width="20%"><input type=radio id="d_checkfromurl" value="1" onclick="RadioClick('url')"><label for=d_checkfromurl><span lang=DlgFromUrl></span></label>:</td>
<td noWrap width="80%">
<script language="javascript">
if (config.AllowBrowse=="1"){
document.write("<input type=text id='d_fromurl' style='width:191px' size=20 value='http://'><input style='width:63px;height:18px;margin-left:2px;padding-top:0px;' type=button id='d_browse' onclick=\"SelectBrowse('file','fromurl')\" lang=DlgBtnBrowse align=absmiddle>");
} else {
document.write("<input type=text id='d_fromurl' size=40 value='http://'>");
}
</script>
</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()" lang=DlgBtnOK> <input type=button value='' onclick="window.close();" lang=DlgBtnCancel></td></tr>
</table>
</td></tr></table>
<div id=divProcessing style="width:200px;height:30px;position:absolute;left:70px;top:30px;display:none">
<table border=0 cellpadding=0 cellspacing=1 bgcolor="#000000" width="100%" height="100%"><tr><td bgcolor=#3A6EA5><marquee align="middle" behavior="alternate" scrollamount="5"><font color=#FFFFFF><span lang=DlgComUploading></span></font></marquee></td></tr></table>
</div>
<input type=hidden id=d_filename value="">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -