⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rte_popup_link.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
				vbCrLf & "		editor.contentWindow.focus();" & _
				vbCrLf & "	}")
	
	'Else this is IE so placing the link is simpler
	Else
		Response.Write(vbCrLf & vbCrLf & "	try{" & _
					vbCrLf & "		editor.contentWindow.focus();" & _
					vbCrLf & "		editor.contentWindow.document.selection.createRange().pasteHTML(hyperlink.outerHTML);" & _
					vbCrLf & "	}catch(exception){" & _
					vbCrLf & "		alert('" & strTxtErrorInsertingObject & "');" & _
					vbCrLf & "		editor.contentWindow.focus();" & _
					vbCrLf & "	}")
	End If
	
	Response.Write(vbCrLf & "}")
	


	
	'Set focus
	'If Opera change the focus method
	If RTEenabled = "opera" Then
		
		Response.Write(vbCrLf & "	editor.focus();")
	Else
		Response.Write(vbCrLf & "	editor.contentWindow.focus();")
	End If
	
	'Close window
	Response.Write(vbCrLf & "window.close();")	
End If



%>

function initialise(){
<%

	'Mozilla and Opera use different methods than IE to get the selected text
	If RTEenabled = "Gecko" OR RTEenabled = "opera" Then
		Response.Write("	var selectedRange = window.opener.document.getElementById('WebWizRTE').contentWindow.window.getSelection().toString();")
	Else
		Response.Write("	var selectedRange = window.opener.document.getElementById('WebWizRTE').contentWindow.document.selection.createRange().text; ")
	End If
%>
	//Use editor selected range to fill text boxes
	if (selectedRange != undefined){
		document.getElementById('URL').value = selectedRange
		document.getElementById('email').value = selectedRange
	}
	if (document.getElementById('URL').value==''){
		document.getElementById('Submit').disabled=true;
	}
	
	self.focus();
}


//Function to preview URL
function showPreview(linkSelection){
	if (linkSelection.options[linkSelection.selectedIndex].value=="http://" || linkSelection.options[linkSelection.selectedIndex].value=="https://"){
		try {
			document.getElementById("previewLink").contentWindow.location.href =(linkSelection.options[linkSelection.selectedIndex].value + document.getElementById("URL").value);
		}catch(exception){
		}
	
	}else{
		document.getElementById("previewLink").contentWindow.location.href="RTE_popup_link_preview.asp?b=0";
	
	}
}

//Disable preview button for some links
function disablePreview(linkSelection){
	if (linkSelection.options[linkSelection.selectedIndex].value=="http://" || linkSelection.options[linkSelection.selectedIndex].value=="https://"){
		document.getElementById("preview").disabled=false;
		document.getElementById("previewLink").contentWindow.location.href="RTE_popup_link_preview.asp";
		
	}else{
		document.getElementById("preview").disabled=true;
		document.getElementById("previewLink").contentWindow.location.href="RTE_popup_link_preview.asp?b=0";
	}
}

//Function swap link type
function swapLinkType(selType){
	if (selType.value == "email"){
		document.getElementById("hyperlink").style.display="none";
    		document.getElementById("mailLink").style.display="block";<%
    		
'If this is Gekco based browser or Opera the element needs to be set to visable
If RTEenabled = "Gecko" OR RTEenabled = "opera" Then Response.Write(vbCrLf & "		document.getElementById(""mailLink"").style.visibility=""visable"";") 		
    		%>
    		
	}else{
		document.getElementById("mailLink").style.display="none";
		document.getElementById("hyperlink").style.display="block";<%
		
'If this is Gekco based browser or Opera the element needs to be set to visable
If RTEenabled = "Gecko" OR RTEenabled = "opera" Then Response.Write(vbCrLf & "		document.getElementById(""hyperlink"").style.visibility=""visable"";") 		
    		%>
	}
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin:0px;" OnLoad="initialise();">
<table width="100%"  border="0" cellpadding="3" cellspacing="0" class="RTEtableTopRow">
  <form method="post" name="frmLinkInsrt">
    <tr class="RTEtableTopRow">
      <td colspan="2"><h1><% = strTxtHyperlinkProperties %></h1></td>
    </tr>
    <tr>
      <td colspan="2" class="RTEtableRow"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
        <tr>
          <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
            <tr>
              <td width="20%" align="right" class="text"><% = strTxtLinkType %>:</td>
              <td width="80%"><select name="selType" id="selType" onchange="swapLinkType(this)">
                  <option value="link" selected>Hyperlink</option>
                  <option value="email">Email</option>
              </select></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td height="240">            
          <span id="hyperlink">
            <table width="100%" border="0" cellpadding="2" cellspacing="0">
              <tr>
                <td width="20%" align="right" class="text"><% = strTxtAddress %>:</td>
                <td width="80%">
                 <select name="linkChoice" id="linkChoice" onchange="disablePreview(this)">
                   <option value="http://" selected>http://</option>
                   <option value="https://">https://</option>
                   <option value="ftp://">ftp://</option>
                   <option value="file://">file://</option>
                   <option value="news://">news://</option>
                   <option value="telnet://">telnet://</option>
                 </select>
                  <input name="URL" type="text" id="URL" size="27" onchange="document.getElementById('Submit').disabled=false;" onkeypress="document.getElementById('Submit').disabled=false;">
                <input name="preview" type="button" id="preview" value="<% = strTxtPreview %>" onclick="showPreview(document.getElementById('linkChoice'))">
                </td>
              </tr>
              <tr>
                <td align="right" valign="top" class="text"><% = strTxtPreview %>:</td>
                <td><iframe src="RTE_popup_link_preview.asp" id="previewLink" width="98%" height="150px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
              </tr>
          </table>
           </span>
           <span id="mailLink" style="display:none">
            <table width="100%" border="0" cellpadding="2" cellspacing="0">
              <tr>
                <td align="right" class="text"><% = strTxtEmail %>:</td>
                <td><input name="email" type="text" id="email" size="40" onfocus="document.forms.frmLinkInsrt.Submit.disabled=false;"></td>
              </tr>
              <tr>
                <td width="20%" align="right" class="text"><% = strTxtSubject %>:</td>
                <td width="80%"><input name="subject" type="text" id="subject" size="40" maxlength="50"></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;<br /><br /><br /><br /><br /><br /><br /><br /></td>
              </tr>
            </table>
           </span>            </td>
        </tr>
      </table></td>
    </tr>
    <tr>
    <td class="RTEtableBottomRow" valign="top">&nbsp;<%

'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnAbout Then
	Response.Write("<span class=""text"" style=""font-size:10px""><a href=""http://www.richtexteditor.org"" target=""_blank"" style=""font-size:10px"">Web Wiz Rich Text Editor</a> version " & strRTEversion & "</span>")
End If 
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******      
      
      %></td>
      <td align="right" class="RTEtableBottomRow" nowrap valign="top"><input type="hidden" name="postBack" value="true"><input type="submit" id="Submit" name="Submit" value="     <% = strTxtOK %>     ">&nbsp;<input type="button" name="cancel" value=" <% = strTxtCancel %> " onclick="window.close()">
      <br /><br />
     </td>
    </tr>
  </form>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -