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

📄 rte_popup_file_atch.asp

📁 简单的asp论坛源码系统,很适用于初学者!界面简洁,功能齐全
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		'Set title, or window if required	       
		If strTitle <> "" Then Response.Write(vbCrLf & "			hyperlink[i].setAttribute('title','" & strTitle & "');")
		If strWindow <> "" Then Response.Write(vbCrLf & "			hyperlink[i].setAttribute('target','" & strWindow & "');")
			       
		Response.Write(vbCrLf & "		}" & _
			       vbCrLf & "	}")
	End If
	
	
	
	'Else no selected area so use the hyperlink text as the displayed text
	Response.Write(vbCrLf & "}else{")
	
	
	'Tell that we are making a hyperlink 'a'
	Response.Write(vbCrLf & vbCrLf & "	link = editor.contentWindow.document.createElement('a');")
	
	
	Response.Write(vbCrLf & vbCrLf & "	link.setAttribute('href', '" & strHyperlink & "');")
	If strTitle <> "" Then Response.Write(vbCrLf & "	link.setAttribute('title', '" & strTitle & "');")
	If strWindow <> "" Then Response.Write(vbCrLf & "	link.setAttribute('target', '" & strWindow & "');")
	
	'Use the selected text range make this the displayed text otherwise use the link as the displayed text
	Response.Write(vbCrLf & vbCrLf & "	link.appendChild(editor.contentWindow.document.createTextNode('" & strHyperlink & "'));")
	
     	'If this is Mozilla then we need to call insertElementPosition to find where to place the file
     	If RTEenabled = "Gecko" OR RTEenabled = "opera" Then 
		
		Response.Write(vbCrLf & vbCrLf & "	try{" & _
					vbCrLf & "		insertElementPosition(editor.contentWindow, link);" & _
					vbCrLf & "	}catch(exception){" & _
					vbCrLf & "		alert('" & strTxtErrorInsertingObject & "');" & _
					vbCrLf & "		editor.contentWindow.focus();" & _
					vbCrLf & "	}")
	
	'Else this is IE so placing the file is simpler
	Else
		Response.Write(vbCrLf & vbCrLf & "	try{" & _
					vbCrLf & "		editor.contentWindow.focus();" & _
					vbCrLf & "		editor.contentWindow.document.selection.createRange().pasteHTML(link.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 to preview URL
function showPreview(attached){

	//Get the file extension to check
	var extension = attached;
	extension.toLowerCase();
	extension = extension.slice(extension.lastIndexOf('.'), extension.length);
	
	//Display file if of the correct type
	if (extension==".txt" 
	 || extension==".text" 
	 || extension==".htm" 
	 || extension==".html" 
	 || extension==".gif" 
	 || extension==".jpg" 
	 || extension==".jpeg" 
	 || extension==".png" 
	 || extension==".bmp"){
		try {
			document.getElementById("prevWindow").contentWindow.location.href = attached;
		}catch(exception){
		}
	
	}else{
		document.getElementById("prevWindow").contentWindow.location.href="RTE_popup_link_preview.asp?b=0<% = strQsSID2 %>";
	
	}
}

//Function to check upload file is selected
function checkFile(){
	if (document.getElementById('file').value==''){
	
		alert('<% = strTxtErrorUploadingFile %>\n<% = strTxtNoFileToUpload %>')
		return false;
	}else{
		alert('<% = strTxtPleaseWaitWhileFileIsUploaded %>');
		return true;
	}
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin:0px;" OnLoad="self.focus(); initilzeElements();">
<table width="100%"  border="0" cellpadding="3" cellspacing="0" class="RTEtableTopRow">
    <tr class="RTEtableTopRow">
      <td colspan="2" width="63%"><h1><% = strTxAttachFileProperties %></h1></td>
    </tr>
    <tr>
      <td colspan="2" class="RTEtableRow"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
        <tr>
          <td width="42%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="88%" class="text"><% = strTxtPath %>: <span id="path"><% = strAttachFilePath %>" </span></td>
            </tr>
            <tr>
              <td class="text"><% = strTxtFileName %>:<iframe src="RTE_file_browser.asp<% = strQsSID1 %>" id="fileWindow" width="98%" height="180px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
            </tr>
            <form method="post" action="RTE_popup_file_atch.asp?PB=Y<% = strQsSID2 %>" name="frmUpload" enctype="multipart/form-data" onsubmit="return checkFile();" >
             <tr>
              <td class="text"><% = strTxtFileUpload %></td>
            </tr>
            <tr>
              <td class="smText"><% Response.Write(strTxtFilesMustBeOfTheType & ", " & Replace(strUploadFileTypes, ";", ", ", 1, -1, 1) & ", " & strTxtAndHaveMaximumFileSizeOf & " " & intUploadMaxFileSize & "KB") %></td>
            </tr>
            <tr>
              <td><input id="file" name="file" type="file" size="35" /></td>
            </tr>
            <tr>
              <td>
              	<input name="upload" type="submit" id="upload" value="Upload">
              </td>
            </tr>
           </form>
          </table></td>
          <td width="58%" valign="top">
          <form method="post" action="RTE_popup_file_atch.asp<% = strQsSID1 %>" name="frmImageInsrt">
            <table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td width="19%" align="right" class="text"><% = strTxtFileURL %>:</td>
                <td width="81%" colspan="5"><input name="URL" type="text" id="URL" value="" size="40" 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('URL').value)">
                </td>
                <tr>
                <td align="right" class="text"><% = strTxtTitle %>:</td>
                <td><input name="Title" type="text" id="Title" size="40" maxlength="40"></td>
              </tr>
              <tr>
                <td align="right" class="text"><% = strTxtWindow %>:</td>
                <td><select name="windowSel" id="windowSel" onchange="document.getElementById('Window').value=this.options[this.selectedIndex].value">
                  <option value="" selected>Default</option>
                  <option value="_blank">New Window</option>
                  <option value="_self">Same Window</option>
                  <option value="_parent">Parent Window</option>
                  <option value="_top">Top Window</option>
                </select>
                  <input name="Window" type="text" id="Window" size="12" maxlength="15"></td>
              </tr>
              </tr>
                <td align="right" valign="top" class="text"><% = strTxtPreview %>:</td>
                <td colspan="5"><iframe src="RTE_popup_link_preview.asp<% = strQsSID1 %>" id="prevWindow" width="98%" height="220px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
                </tr>
          </table></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"><input type="hidden" name="postBack" value="true">
          <input type="submit" name="Submit" id="Submit" value="     <% = strTxtOK %>     ">&nbsp;<input type="button" name="cancel" value=" <% = strTxtCancel %> " onclick="window.close()">
        </form>
        <br /><br />
      </td>
    </tr>

</table>
</body>
</html><%

'If the file space is exceeded then tell the user
If blnFileSpaceExceeded Then
	Response.Write("<script language=""JavaScript"">")
	Response.Write("alert('" & strTxtErrorUploadingFile & ".\n" & strTxtAllotedFileSpaceExceeded & " " & intUploadAllocatedSpace & "MB.\n" & strTxtDeleteFileOrImagesUingCP & "');")
	Response.Write("</script>")
	
'If the file already exists tell the user
ElseIf blnFileExists Then 
	Response.Write("<script language=""JavaScript"">")
	Response.Write("alert('" & strTxtErrorUploadingFile & ".\n" & strTxtFileAlreadyUploaded & ".\n" & strTxtSelectOrRenameFile & "');")
	Response.Write("</script>")
	
'If the file upload has failed becuase of the wrong extension display an error message
ElseIf blnExtensionOK = False Then
	Response.Write("<script language=""JavaScript"">")
	Response.Write("alert('" & strTxtErrorUploadingFile & ".\n" &strTxtFileOfTheWrongFileType & ".\n" & strTxtFilesMustBeOfTheType & ", "  &  Replace(strUploadFileTypes, ";", ", ", 1, -1, 1) & "');")
	Response.Write("</script>")

'Else if the file upload has failed becuase the size is to large display an error message
ElseIf lngErrorFileSize <> 0 Then
	Response.Write("<script language=""JavaScript"">")
	Response.Write("alert('" & strTxtErrorUploadingFile & ".\n" & strTxtFileSizeToLarge & " " & lngErrorFileSize & "KB.\n" & strTxtMaximumFileSizeMustBe & " " & intUploadMaxFileSize & "KB');")
	Response.Write("</script>")
End If
%>

⌨️ 快捷键说明

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