📄 win_hyperlink.asp
字号:
<html>
<head>
<title>超链接</title>
<link rel="stylesheet" href="html_edit.css" type="text/css">
</head>
<script language="JavaScript">
var linkType;
var DHTMLSafe;
function initialize()
{
DHTMLSafe = window.dialogArguments.DHTMLSafe;
var trSel=DHTMLSafe.DOM.selection.createRange();
var coll=DHTMLSafe.DOM.all.tags("A");
var key="",aaa="";
var fBreak=false;
for(i=0;i<coll.length&&!fBreak;i++)
{
trLink=DHTMLSafe.DOM.body.createTextRange();
trLink.moveToElementText(coll[i]);
if((trSel.compareEndPoints("EndToStart",trLink)==1) && (trSel.compareEndPoints("StartToEnd",trLink)==-1))
{
if(trSel.compareEndPoints("StartToStart",trLink)==1) { trSel.setEndPoint("StartToStart",trLink); }
if(trSel.compareEndPoints("EndToEnd",trLink)==-1) {trSel.setEndPoint("EndToEnd",trLink); }
trSel.select();
//oyterHTML 全部
document.all.linkform.ovar.value=coll[i].outerText; //innerText
document.all.linkform.oHref.value=coll[i].href;
document.all.linkform.oTarget.value=coll[i].target;
document.all.linkform.oStyle.value=coll[i].style.cssText;
document.all.linkform.oClass.value=coll[i].className;
linkType="update";
fBreak=true;
}
}
if(!fBreak)
{
if(trSel.compareEndPoints("StartToEnd",trSel)==0)
{
linkType="new";
document.all.linkform.oHref.select();
}
else
{ linkType="link"; }
}
}
function linkit()
{
var tmp_Href=document.all.linkform.oHref.value;
if (tmp_Href=="" || tmp_Href==null || tmp_Href=="http://")
{
alert("请先输入链接的地址!");
document.all.linkform.oHref.focus();
return;
}
window.dialogArguments.jk_edit_hyperlink(window.dialogArguments.jk_edit_hot,
document.all.linkform.ovar.value,
tmp_Href,
document.all.linkform.oTarget.value,
document.all.linkform.oStyle.value,
document.all.linkform.oClass.value,
document.all.linkform.oName.value
);
window.close();
}
function show_target()
{
var ntarget=document.linkform.otargets.options[document.linkform.otargets.selectedIndex].value;
document.linkform.oTarget.value=ntarget;
}
</script>
<body onload="initialize()" bgcolor="menu" style="border:0;overflow:hidden;">
<table border=0><tr><td height=3></td></tr></table>
<table border=0 width="100%">
<form name="linkform">
<tr><td align=center>
<fieldset style="padding-bottom:5px"><legend disabled><span id="oTitle">超链接</span></legend>
<table cellpadding="1" cellspacing="2" border="0" width="98%">
<tr>
<td class="styled">链接文字:</td>
<td colspan="3"><input type="text" name="ovar" size="40" value=""></td>
</tr>
<tr>
<td class="styled">链接地址:</td>
<td colspan="3"><input type="text" name="oHref" size="40" value="http://"></td>
</tr>
<tr>
<td class="styled">目标窗口:</td>
<td colspan="3"><input type="text" name="oTarget" size="15" value=""> <select name=otargets onChange="javascript:show_target();">
<option value="">请选择...</option>
<option value="_blank">新窗口 (_blank)</option>
<option value="_parent">父窗口 (_parent)</option>
<option value="_self">同一窗口 (_self)</option>
<option value="_top">顶端窗口(_top)</option>
</select></td>
</tr>
<tr>
<td class="styled">链接样式:</td>
<td colspan="3"><input type="text" name="oStyle" size="40" value=""></td>
</tr>
<tr>
<td class="styled">Class:</td>
<td><input type="text" name="oClass" size="10" value=""></td>
<td class="styled">Name:</td>
<td><input type="text" name="oName" size="10" value=""></td>
</tr>
</table>
</fieldset>
<table width="98%" border=0 cellpadding=0 cellspacing=0 height="35">
<tr><td align="right"><input name="oInsert" id="oInsert" type="button" value=" 确实 " style="width:64px;" onClick="linkit();"> <input name="ok2" type="button" value=" 取消 " style="width:64px;" onClick="self.close();"></td></tr>
</table>
</td></tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -