<%@ page contentType="text/html;charset=GBK" %>
<html>

<head>
  <title>插入文件链接</title>
<script type="text/javascript" src="popup.js"></script>
<script type="text/javascript">
	function onOK() {
	var f_desc = document.getElementById('f_desc').value;
	if (f_desc == ""){
		alert("链接文字不能为空!");
		document.getElementById('f_desc').focus();
		return;
	}
	var f_url  = document.getElementById("f_url").value;
	var returnStr = "<a href='";
	returnStr += f_url ;
	returnStr += "'>";
	returnStr += f_desc;
	returnStr += "</a>";
	  __dlg_close(returnStr);
	  return false;
	};

	function onCancel() {
	  __dlg_close(null);
	  return false;
	};
</script>

<style type="text/css">
html, body {
  background: ButtonFace;
  color: ButtonText;
  font: 11px Tahoma,Verdana,sans-serif;
  margin: 0px;
  padding: 0px;
}
body { padding: 5px; }
table {
  font: 11px Tahoma,Verdana,sans-serif;
}
form p {
  margin-top: 5px;
  margin-bottom: 5px;
}
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
fieldset { padding: 0px 10px 5px 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }

.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>

</head>

<body onLoad="javascript: window.resizeTo(450, 200); document.getElementById('f_desc').focus();">

<div class="title">插入文件链接</div>
<!--- new stuff --->
<form action="" method="get">
<table border="0" width="100%" style="padding: 0px; margin: 0px">
  <tbody>

  <tr>
    <td style="text-align: left">文件路径(URL):</td>
    <td>
    <%
        String htmlarea_files=(String)session.getAttribute("htmlarea_files")==null?"":(String)session.getAttribute("htmlarea_files");
        String htmlarea_file=(String)request.getParameter("filePath");
        htmlarea_files=htmlarea_files+htmlarea_file+",";
        session.setAttribute("htmlarea_files",htmlarea_files);
    %>
        <input type="text" name="url" id="f_url" style="width:75%" readonly="true"  title="已上传的文件的URL" value="<%=(String)request.getParameter("filePath")%>"/>
    </td>
  </tr>
  <tr>
    <td style="text-align: left">文件超链接说明:</td>
    <td>
        <input type="text" name="desc" id="f_desc" style="width:75%" title="超链接的文字说明" value=""/>
    </td>
  </tr>
  </tbody>
</table>
<br clear="all" />
<table width="100%" style="margin-bottom: 0.2em">
 <tr>
  <td valign="bottom" style="text-align: center">
    <button type="button" name="ok" onclick="return onOK();">确定</button>
    <button type="button" name="cancel" onclick="return onCancel();">取消</button>
  </td>
 </tr>
</table>
</form>
</body>
</html>
