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

📄 htmleditor.asp

📁 功能齐全的oa系统
💻 ASP
📖 第 1 页 / 共 3 页
字号:
break
case 13:
break;
case 27:
_CPopup_Hide()
break;
default:
return;
}
el=idList.rows[iRow].cells[iCell]
if(el &&el._item)
if(13==ev.keyCode){
ev.keyCode=0
this.Select(el)
}
else
this.Highlight(el)
}
function _CListPopupRenderer_OnMouseOver()
{
var el=_CUtil_GetElement(this.oDocument.parentWindow.event.srcElement,"TD")
if(el &&el._item &&el!=this.elCurrent)
this.Highlight(el)
}
function _CListPopupRenderer_Highlight(el)
{
var elC=this.elCurrent
if(elC)elC.style.borderWidth=elC.style.borderColor=elC.style.borderStyle=""
el.style.borderWidth="1px"
el.style.borderColor="green"
el.style.borderStyle="solid"
this.elCurrent=el
}
function _CListPopupRenderer_Select(elTD)
{
g_state.RestoreSelection()
var el=elTD.children[0]
switch(this.szType)
{
case "font":
if(!el)
parent._CFontFacesPopupRenderer_InsertOther(this)
else
_Format("FontName",el.face)
break
case "fontsize":
_Format("FontSize",el.size)
break
case "formatblock":
_Format("FormatBlock","<"+el.tagName+">")
break
case "ForeColor":
_Format("ForeColor",elTD.bgColor)
break
}
_CPopup_Hide()
}
function _CLinkPopupRenderer_AddLink(d)
{
var szURL=d.all.urlValue.value
var szType=d.all.urlType[d.all.urlType.selectedIndex].text
var oSel=g_state.GetSelection()
szURL=((0==szURL.indexOf("mailto:")||0==szURL.indexOf("http://")||0==szURL.indexOf("ftp://"))?"":szType)+szURL
if(szURL!="")
{
if((oSel.parentElement)&&(oSel.text==""))
{
oSel.expand("word")
if(oSel.text=="")
{
var sText=""
var oStore=oSel.duplicate()
if(d.all.pageList){
var idx=d.all.pageList.selectedIndex
if(d.all.pageList[idx].value==szURL)
sText=d.all.pageList[idx].text
else
sText=szURL
}
else
sText=szURL
oSel.pasteHTML('<A HREF="'+szURL+'">'+sText+'</A>')
oSel.setEndPoint("StartToStart",oStore)
oSel.select()
_CPopup_Hide()
return
}
}
else
if((oSel.item)&&(oSel.item(0).tagName=="IMG"))
{
oSel.item(0).width=oSel.item(0).offsetWidth
oSel.item(0).height=oSel.item(0).offsetHeight
oSel.item(0).border=(d.all.displayBorder.checked)?1:""
}
if(d.all.urlValue.value!="")
oSel.execCommand("CreateLink",false,szURL)
else
oSel.execCommand("UnLink",false,szURL)
}
oSel.select()
_CPopup_Hide()
}
function _CLinkPopupRenderer_PrepareHTML()
{
var oSel=g_state.GetSelection()
var oEl,bImg=false,szURL=sz=""
if(oSel.parentElement)
{
oEl=_CUtil_GetElement(oSel.parentElement(),"A")
}
else
{
oEl=_CUtil_GetElement(oSel.item(0),"A")
bImg=oSel.item(0).tagName=="IMG"
}
if(oEl)szURL=oEl.href
sz ="<TABLE ALIGN=center>"
var arTypes=new Array("http","ftp","mailto")
var arText=new Array("http://","ftp://","mailto:")
var szType=szURL.substring(0,szURL.indexOf(":"))
if(("http"==szType)||("ftp"==szType))
szURL=szURL.substring(szURL.indexOf("//")+2)
else
szURL=szURL.substring(szURL.indexOf(":")+1)
sz+="<BR>输入或修改一个链接地址: <NOBR><SELECT ID=urlType>"
for(var i=0;i<arTypes.length;i++){
sz+= "<OPTION VALUE='"+arTypes[i]+"' "+(arTypes[i]==szType?" SELECTED ":"")+">"+arText[i]
}
sz+="</SELECT><INPUT ID=urlValue SIZE=45 VALUE=\""+szURL+"\" TYPE=text></NOBR>"
if(bImg)
{
sz+="<BR><INPUT TYPE=checkbox ID=displayBorder "+((oSel.item(0).border!=0)?" checked ":"")+">是否显示图片链接边框?"
}
sz+="</TD></TR><TR><TD ALIGN=center><INPUT ONCLICK=\"parent._CLinkPopupRenderer_AddLink(this.document)\" TYPE=submit ID=idSave VALUE=\" "+(szURL==""?"插 入":"修 改")+" \"> <INPUT ONCLICK=\"parent._CPopup_Hide()\" TYPE=reset ID=idCancel VALUE=\" 取 消 \"></TD></TR></TABLE>"
return sz
}
function _CImagePopupRenderer_AddImage(d)
{
var szURL=d.all.urlValue.value
var szType=d.all.urlType[d.all.urlType.selectedIndex].text
var oSel=g_state.GetSelection()
var szALT=d.all.imgAlt.value
var szALIGN=d.all.imgAlign[d.all.imgAlign.selectedIndex].value
var szBORDER=d.all.imgBorder.value
var SelImg
if(!oSel.parentElement)SelImg=oSel.item(0)
szURL=((0==szURL.indexOf("http://")||0==szURL.indexOf("ftp://"))?"":szType)+szURL
if(szURL!="")
{
if(SelImg)
{
if(SelImg.src!=szURL)SelImg.src=szURL
if(SelImg.alt!=szALT)SelImg.alt=szALT
if(SelImg.align.toLowerCase()!=szALIGN)_Format("Justify",szALIGN)
if(SelImg.border!=szBORDER)SelImg.border=szBORDER
}
else
insertHTML('<IMG SRC="'+szURL+'"'+(szALT==""?"":' ALT="'+szALT+'"')+(szALIGN==""?"":' ALIGN="'+szALIGN+'"')+(szBORDER==""?"":' BORDER="'+szBORDER+'"')+'>')
oSel.select()
_CPopup_Hide()
return
}
}
function _CImagePopupRenderer_PrepareHTML()
{
var oSel=g_state.GetSelection()
var szURL=szALT=szALIGN=szBORDER=sz=""
var SelImg
if(!oSel.parentElement)
{
SelImg=oSel.item(0)
if(SelImg.tagName=="IMG")
{
szURL=SelImg.href
szALT=SelImg.alt
szALIGN=SelImg.align.toLowerCase()
szBORDER=SelImg.border
}
}
sz ="<TABLE ALIGN=center><BR>输入或修改一个图片地址: <NOBR><SELECT ID=urlType>"
var arTypes=new Array("http","ftp")
var arText=new Array("http://","ftp://")
var szType=szURL.substring(0,szURL.indexOf(":"))
if(("http"==szType)||("ftp"==szType))
szURL=szURL.substring(szURL.indexOf("//")+2)
else
szURL=szURL.substring(szURL.indexOf(":")+1)
for(var i=0;i<arTypes.length;i++){
sz+= "<OPTION VALUE='"+arTypes[i]+"' "+(arTypes[i]==szType?" SELECTED ":"")+">"+arText[i]
}
sz+="</SELECT><INPUT ID=urlValue SIZE=45 VALUE=\""+szURL+"\" TYPE=text></NOBR>"
sz+="<BR><NOBR>注释文本: <INPUT ID=imgAlt SIZE=44 VALUE=\""+szALT+"\" TYPE=text></NOBR>"
sz+="<BR><NOBR>对齐模式: <SELECT ID=imgAlign>"
var arTypes=new Array("","left","right","top","texttop","middle","absmiddle","baseline","bottom","absbottom","center")
var arText=new Array("默认","左对齐","右对齐","顶边对齐","文本上方","相对垂直居中","绝对垂直居中","基线","相对底边对齐","绝对底边对齐","水平居中")
for(var i=0;i<arTypes.length;i++){
sz+= "<OPTION VALUE='"+arTypes[i]+"' "+(arTypes[i]==szALIGN?" SELECTED ":"")+">"+arText[i]
}
sz+="</SELECT> 边框粗细: <INPUT ID=imgBorder SIZE=5 VALUE=\""+szBORDER+"\" TYPE=text></NOBR>"
sz+="</TD></TR><TR><TD ALIGN=center><INPUT ONCLICK=\"parent._CImagePopupRenderer_AddImage(this.document)\" TYPE=submit ID=idSave VALUE=\" "+(szURL==""?"插 入":"修 改")+" \"> <INPUT ONCLICK=\"parent._CPopup_Hide()\" TYPE=reset ID=idCancel VALUE=\" 取 消 \"> <INPUT ONCLICK=\"parent._CPopup_Hide();window.open('/oa/mypic.asp','MYPIC','width=300,height=300,scrollbars=1,resizable=1')\" TYPE=reset ID=idCancel VALUE=\" 打开我的图片夹 \"></TD></TR></TABLE>"
return sz
}
function _CUtil_GetElement(oEl,sTag)
{
while(oEl!=null &&oEl.tagName!=sTag)
oEl=oEl.parentElement
return oEl
}
function _CUtil_BuildColorTable(sID,fmt,szClick)
{
var sz,cPick=new Array("00","33","66","99","CC","FF"),iCnt=2
var iColors=cPick.length,szColor=""
sz="<TABLE CELLSPACING=0 CELLPADDING=0><TR><TD VALIGN=middle><DIV CLASS=currentColor ID=\""+sID+"Current\">&nbsp;</DIV></TD><TD><TABLE ONMOUSEOUT=\"document.all."+sID+"Current.style.backgroundColor=''\" ONMOUSEOVER=\"document.all."+sID+"Current.style.backgroundColor=event.srcElement.bgColor\" CLASS=colorTable CELLSPACING=0 CELLPADDING=0 ID=\""+sID+"\">"
for(var r=0;r<iColors;r++){
sz+="<TR>"
for(var g=iColors-1;g>=0;g--)
for(var b=iColors-1;b>=0;b--){
szColor=cPick[r]+cPick[g]+cPick[b]
sz+="<TD BGCOLOR=\"#"+szColor+"\"_item=\""+szColor+"\" TITLE=\"#"+szColor+"\" "+(szClick?"ONCLICK=\""+szClick+"\" ":"")+">&nbsp;</TD>"
}
sz+="</TR>"
}
sz+="</TABLE></TD></TR></TABLE>"
return sz
}
function replace(str,replace_what,replace_with)
{
var ndx=str.indexOf(replace_what);
var delta=replace_with.length - replace_what.length;
while(ndx >= 0)
{
str=str.substring(0,ndx)+replace_with+str.substring(ndx+replace_what.length);
ndx=str.indexOf(replace_what,ndx+delta+1);
}
return str;
}
function _CUtil_TrimCR(sValue){
return replace(sValue,"\r\n"," ")
}
function _CUtil_GetBlock(oEl)
{
var sBlocks="|H1|H2|H3|H4|H5|H6|P|PRE|LI|TD|DIV|BLOCKQUOTE|DT|DD|TABLE|HR|IMG|"
while((oEl!=null)&&(sBlocks.indexOf("|"+oEl.tagName+"|")==-1))
oEl=oEl.parentElement
return oEl
}
function _CUtil_DomainSuffix(szHost){
var idx=szHost.indexOf("commun")
if(idx>=0){
idx=szHost.indexOf(".",idx)
return szHost.substring(idx+1)
}else
{
idx=szHost.lastIndexOf(".",szHost.length-5)
return szHost.substring(idx+1)
}
return szHost
}
function _CUtil_CleanHTML(){
var bBindings=(g_state.aBindings.length>0)
var elAll=idEditbox.document.all
var iCount=elAll.length
for(var i=iCount-1;i>=0;i--){
if(elAll[i].tagName=="IMG"){
elAll[i].width=elAll[i].offsetWidth
elAll[i].height=elAll[i].offsetHeight
}
if((elAll[i].tagName=="INPUT")&&(bBindings))
elAll[i].outerHTML='['+elAll[i].name+']';
}
return idEditbox.document.body.innerHTML
}
var g_state
window.onload = _initEditor
function _drawIE4Focus()
{
  if(isIE4) document.write("<INPUT TYPE=textbox STYLE=\"width:0;height:0;left:0;position:absolute\">")
}
</SCRIPT>
<STYLE>
body{border-style:none;border-width:medium;margin:0pt;padding:0pt}
#idMode{margin-top:0pt}
.tbButton{text-align:left;margin-left:0pt;margin-right:1pt;margin-top:0pt;margin-bottom:0pt;padding:0pt}
#EditBox{position:relative;}
</STYLE>
<STYLE id="skin" disabled>
#idEditRegion{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;padding:0px}
#tbUpRight,#tbUpLeft{width:13px}
#idMode{margin-left:11px;padding:0pt}
#idMode label{color:navy;text-decoration:none;font-size:14.9px}
</STYLE>
<STYLE id="defPopupSkin">
#popup body{border-top-style:none;border-top-width:medium;margin:0px;padding:0pt}
#popup .colorTable{height:91px}
#popup #header{width:100%}
#popup #close{cursor:default;font-size:12px;width:18px;text-align:center}
#popup #content{padding:0pt}
#popup table{vertical-align:top}
#popup .tabBody{border-left:1px solid black;border-right:1px solid black;border-top-style:none;border-top-width:medium;border-bottom:1px solid black}
#popup .tabItem,#popup .tabSpace{border-left:1px solid black;border-bottom:1px solid black}
#popup .tabItem{font-size:14.9px;border-top:1px solid black}
#popup .currentColor{width:20px;height:20px;border:1px solid black;margin-left:0pt;margin-right:15pt;margin-top:0pt;margin-bottom:0pt}
#popup .tabItem div{cursor:hand;margin:3px;padding:0px}
#popup .tabItem div.disabled{color:gray;cursor:default}
#customFont{font-size:14.9px}
</STYLE>
<STYLE id="popupSkin">
#popup body{background-color:#F1F1F1;border:1px solid #6699CC;background-position:0%;font-size:14.9px}
#popup #header{background-color:#6699CC;color:white;background-position:0%}
#popup #caption{text-align:left;font-size:14.9px}
#popup .ColorTable,#popup #idList td#current{border:1px solid black}
#popup #idList td{cursor:hand;border:1px solid #F1F1F1}
#popup #close{cursor:hand;color:#99CCFF;border:1px solid #99CCFF;margin-right:6px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:2px}
#popup #tableProps .tablePropsTitle{color:#6699CC;text-align:left;border-bottom:1px solid black;margin-left:0pt;margin-right:0pt;margin-top:0pt;margin-bottom:5pt}
#tableButtons,#tableProps{padding:5px}
#popup #tableContents{height:175px}
#popup #tableProps .tablePropsTitle,#popup #tableProps,#popup #tableProps table{font-size:14.9px}
#popup #tableOptions{font-size:14.9px;padding-left:5pt;padding-right:5pt;padding-top:15pt;padding-bottom:15pt}
#popup #puDivider{background-color:black;width:1px;background-position:0%}
#popup #content{margin:0pt;padding-left:3pt;padding-right:3pt;padding-top:5pt;padding-bottom:8pt}
#popup #ColorPopup{width:250px}
#popup .ColorTable tr{height:6px}
#popup .ColorTable td{width:6px;cursor:hand}
#popup .block p,#popup .block h1,#popup .block h2,#popup .block h3,#popup .block h4,#popup .block h5,#popup .block h6,#popup .block pre{margin:0pt;padding:0pt}
</STYLE>
<script language=javascript>
var IsLoadOK = false
</script>

</HEAD>
<BODY  oncontextmenu="return false" STYLE ="BACKGROUND-COLOR: transparent" tabindex="-1" scroll ="no" onselectstart ="return false" ondragstart="return false" onscroll="return false">
<DIV id="idEditor" style="VISIBILITY: hidden">
<TABLE id="idToolbar" width="100%" cellspacing="0" cellpadding="0" onclick="_CPopup_Hide()">
<TR><TD bgColor=menu><SCRIPT>_drawToolbar()</SCRIPT></TD></TR>
<TR><TD bgColor=#000000 HEIGHT=1></TD></TR>
</TABLE>
<IFRAME NAME="idPopup" STYLE="HEIGHT: 200px; LEFT: 25px; MARGIN-TOP: 8px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 200px; Z-INDEX: -1"></IFRAME>
<DIV id="idEditRegion">
<IFRAME TABINDEX=1 ID="EditBox" NAME="idEditbox" WIDTH="100%" HEIGHT="100%" MARGINHEIGHT="1" MARGINWIDTH="1" ONFOCUS="_CPopup_Hide();"></IFRAME>
</DIV>
<SCRIPT>_drawIE4Focus()</SCRIPT>
<DIV id="tbmode">
<SCRIPT>_drawModeSelect();IsLoadOK=1</SCRIPT>
</DIV>
</DIV>

</BODY>

⌨️ 快捷键说明

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