📄 rte_popup_adv_image.asp
字号:
Response.Write(vbCrLf & vbCrLf & " try{" & _
vbCrLf & " insertElementPosition(editor.contentWindow, img);" & _
vbCrLf & " }catch(exception){" & _
vbCrLf & " alert('" & strTxtErrorInsertingObject & "');" & _
vbCrLf & " editor.contentWindow.focus();" & _
vbCrLf & " }")
'Else this is IE so placing the image is simpler
Else
Response.Write(vbCrLf & vbCrLf & " try{" & _
vbCrLf & " editor.contentWindow.focus();" & _
vbCrLf & " editor.contentWindow.document.selection.createRange().pasteHTML(img.outerHTML);" & _
vbCrLf & " }catch(exception){" & _
vbCrLf & " alert('" & strTxtErrorInsertingObject & "');" & _
vbCrLf & " editor.contentWindow.focus();" & _
vbCrLf & " }")
End If
'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 image
function getImage(URL){
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").src = URL
}
//Function to change image properties
function changeImage(){
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").alt = document.getElementById('Alt').value
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").align = document.getElementById('align').value
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").border = document.getElementById('border').value
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").hspace = document.getElementById('hoz').value
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").vspace = document.getElementById('vert').value
//Check a value for width and hieght is set or image will be deleted
if (document.getElementById('width').value!=''){
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").width = document.getElementById('width').value
}
if (document.getElementById('height').value!=''){
document.getElementById("prevWindow").contentWindow.document.getElementById("prevFile").height = document.getElementById('height').value
}
}
<%
'If image upload is enabled then have the following function
If blnImageUpload Then
%>
//Function to check upload file is selected
function checkFile(){
if (document.getElementById('file').value==''){
alert('<% = strTxtErrorUploadingImage %>\n<% = strTxtNoImageToUpload %>')
return false;
}else{
alert('<% = strTxtPleaseWaitWhileImageIsUploaded %>');
return true;
}
}<%
End If
%>
</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"><h1><% = strTxtImageProperties %></h1></td>
</tr>
<tr>
<td colspan="2" class="RTEtableRow"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td width="38%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="88%" class="text"><% = strTxtPath %>: <span id="path"><% = strImageUploadPath %></span></td>
</tr>
<%
'If image upload is enabled then display an image upload form
If blnImageUpload Then
%>
<tr>
<td class="text"><% = strTxtFileName %>:<iframe src="RTE_file_browser.asp?look=img<% = strQsSID2 %>" id="fileWindow" width="98%" height="180px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
</tr>
<form method="post" action="RTE_popup_adv_image.asp?PB=Y<% = strQsSID2 %>" name="frmUpload" enctype="multipart/form-data" onsubmit="return checkFile();" >
<tr>
<td class="text"><% = strTxtImageUpload %></td>
</tr>
<tr>
<td class="smText"><% Response.Write(strTxtImagesMustBeOfTheType & ", " & Replace(strImageTypes, ";", ", ", 1, -1, 1) & ", " & strTxtAndHaveMaximumFileSizeOf & " " & intUploadMaxImageSize & "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><%
'Else file uploading is disabled so show a larger file browser window
Else
%>
<tr>
<td class="text"><% = strTxtFileName %>:<iframe src="RTE_file_browser.asp?look=img<% = strQsSID2 %>" id="fileWindow" width="98%" height="278px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
</tr>
<%
End If
%>
</table></td>
<td width="58%" valign="top">
<form method="post" action="RTE_popup_adv_image.asp<% = strQsSID1 %>" name="frmImageInsrt">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="25%" align="right" class="text"><% = strTxtImageURL %>:</td>
<td colspan="5"><input name="URL" type="text" id="URL" value="" size="38" onchange="document.getElementById('Submit').disabled=false;" onkeypress="document.getElementById('Submit').disabled=false;">
<input name="preview" type="button" id="preview" value="<% = strTxtPreview %>" onclick="getImage(document.getElementById('URL').value)">
</td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtAlternativeText %>:</td>
<td colspan="5"><input name="Alt" type="text" id="Alt" size="38" onBlur="changeImage()"></td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtWidth %>:</td>
<td width="4%"><input name="width" type="text" id="width" size="3" maxlength="3" onkeyup="changeImage()" autocomplete="off" /></td>
<td width="22%" align="right" class="text"><% = strTxtHorizontal %>:</td>
<td width="6%"><input name="hoz" type="text" id="hoz" size="3" maxlength="3" onkeyup="changeImage()" autocomplete="off" /></td>
<td width="20%" align="right" class="text"><% = strTxtAlignment %>:</td>
<td width="30%"><select size="1" name="align" id="align" onchange="changeImage()">
<option value="" selected >Default</option>
<option value="left">Left</option>
<option value="right">Right</option>
<option value="texttop">Texttop</option>
<option value="absmiddle">Absmiddle</option>
<option value="baseline">Baseline</option>
<option value="absbottom">Absbottom</option>
<option value="bottom">Bottom</option>
<option value="middle">Middle</option>
<option value="top">Top</option>
</select></td>
</tr>
<tr>
<td align="right" class="text"><% = strTxtHeight %>:</td>
<td><input name="height" type="text" id="height" size="3" maxlength="3" onkeyup="changeImage()" autocomplete="off" /></td>
<td align="right" class="text"><% = strTxtVertical %>:</td>
<td><input name="vert" type="text" id="vert" size="3" maxlength="3" onkeyup="changeImage()" autocomplete="off" /></td>
<td align="right" class="text"><% = strTxtBorder %>:</td>
<td><input name="border" type="text" id="border" size="3" maxlength="2" onKeyUp="changeImage()" autocomplete="off" /></td>
</tr>
<tr>
<td align="right" valign="top" class="text"><% = strTxtPreview %>:</td>
<td colspan="5"><iframe src="RTE_popup_image_preview.asp<% = strQsSID1 %>" id="prevWindow" width="98%" height="215px" style="border: #A5ACB2 1px solid;background-color: #FFFFFF;"></iframe></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="38%" valign="top" class="RTEtableBottomRow"><%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnLCode 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 width="24%" align="right" class="RTEtableBottomRow"> <input type="hidden" name="postBack" value="true">
<input type="submit" name="Submit" id="Submit" value=" <% = strTxtOK %> "> <input type="button" name="cancel" value=" <% = strTxtCancel %> " onclick="window.close()">
<br /><br />
</td>
</tr>
</form>
</table>
</body>
</html>
<%
'If the file space is exceeded then tell the user
If blnFileSpaceExceeded Then
Response.Write("<script language=""JavaScript"">")
Response.Write("alert('" & strTxtErrorUploadingImage & ".\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('" & strTxtErrorUploadingImage & ".\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('" & strTxtErrorUploadingImage & ".\n" &strTxtImageOfTheWrongFileType & ".\n" & strTxtImagesMustBeOfTheType & ", " & Replace(strImageTypes, ";", ", ", 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('" & strTxtErrorUploadingImage & ".\n" & strTxtImageFileSizeToLarge & " " & lngErrorFileSize & "KB.\n" & strTxtMaximumFileSizeMustBe & " " & intUploadMaxImageSize & "KB');")
Response.Write("</script>")
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -