function setBGColor(szValue)\n{\ng_state.bgColor=szValue\nidEditbox.document.body.bgColor=g_state.bgColor\n}\nfunction setSelection(bDir){\nvar tr=idEditbox.document.body.createTextRange()\ntr.collapse(bDir)\ntr.select()\ng_state.SaveSelection()\n}\nfunction setDefaultStyle(szValue)\n{\ng_state.css=szValue\nif(g_state.bMode)\nidEditbox.document.body.style.cssText=g_state.css\n}\nfunction setSkin(szSkin)\n{\nif(szSkin==null)\ndocument.styleSheets.skin.cssText=g_state.defaultSkin\nelse\ndocument.styleSheets.skin.cssText=szSkin\ndocument.styleSheets.skin.disabled=false\n}\nfunction setToolbar(id,g_state)\n{\nvar el=document.all[id]\nif(el)\nel.style.display=(g_state)?\"\":\"none\"\nif(id==\"tbmode\"){\n_setSize()\n}\n}\nfunction setMode(bMode)\n{\nif(bMode!=g_state.bMode){\ng_state.bMode=bMode\nvar objBody=idEditbox.document.body\nif(!bMode&&!g_state.bMode)\n{\nobjBody.bgColor=objBody.style.cssText=\"#FFFFFF\"\nif(g_state.customButtons)\nidStandardBar.style.display=\"none\"\nelse\nidToolbar.style.display=\"none\"\nobjBody.innerText=idEditbox.document.body.innerHTML\nobjBody.className=\"textMode\"\n}\nif((bMode)&&(g_state.bMode))\n{\nsetDefaultStyle(g_state.css)\nsetBGColor(g_state.bgColor)\nobjBody.className=idStandardBar.style.display=idToolbar.style.display=\"\"\nobjBody.innerHTML=idEditbox.document.body.innerText\n}\n_setSize()\nsetSelection(true)\n}\nreturn bMode\n}\nfunction _Format(szHow,szValue){\nvar oSel=g_state.GetSelection()\nvar sType=oSel.type\nvar oTarget=(sType==\"None\"?idEditbox.document:oSel)\nvar oBlock=(oSel.parentElement!=null?_CUtil_GetBlock(oSel.parentElement()):oSel.item(0))\nswitch(szHow)\n{\ncase \"Justify\":\nif(oBlock)\n{\noBlock.style.textAlign=\"\"\nif(((oBlock.tagName==\"TABLE\")||(oBlock.tagName==\"IMG\"))&&((\"left\"==oBlock.align)&&(\"Left\"==szValue))){\noBlock.align=\"\"\nbreak;\n}\noBlock.align=szValue\nif((oBlock.tagName==\"HR\")||((oBlock.tagName==\"IMG\")&&szValue!=\"Center\"))break;\n}\nszHow=szHow+szValue\nszValue=\"\"\ndefault:\noTarget.execCommand(szHow,false,szValue)\nbreak\n}\ng_state.RestoreSelection()\nreturn true\n}\nfunction _pageReady()\n{\nidEditbox.document.body.onblur=idEditbox.onblur=g_state.SaveSelection\nidEditbox.document.onkeydown=_Editor_KeyDownHandler\nidEditbox.document.onmousedown=_Editor_ClickHandler\nidEditbox.document.ondblclick=_Editor_DblClickHandler\nidEditbox.document.body.oncontextmenu=new Function(\"return false\")\nif(g_state.szSearch!=\"\")idPopup.document.domain=idEditbox.document.domain=document.domain=g_state.szSearch\nelse{\ng_state.szSearch=_CUtil_DomainSuffix(location.hostname)\nif(g_state.szSearch!=\"\")idPopup.document.domain=idEditbox.document.domain=document.domain=parent.document.domain=g_state.szSearch\n}\nif(document.styleSheets.skin.disabled)setSkin(null)\n_setSize()\nidEditor.style.visibility=\"\"\ng_state.bLoaded=true\n\/\/ var tr=idEditbox.document.body.createTextRange()\n\/\/ tr.select()\n\/\/ g_state.SaveSelection()\n\/\/ setSelection(false)\nsetBGColor(g_state.bgColor)\n}\n

解决方案 »

  1.   

    function _initEditor(){\ng_state=new _CState()\nwindow.onresize=_setSize\nvar sz=\"\"\nsz+=\"<STYLE>A{text-decoration:none}\\nTD{font-size:14.9px}\\n.textMode{border-top: 1px black solid;font-size:14.9px}\\n.NOBORDER TD{border:1px gray solid}BODY{border:1px black solid;border-top:none;font-size:14.9px}<\/STYLE><BODY ONCONTEXTMENU=\\\"return false\\\">\"+L_DEFAULTHTML_TEXT+\"<\/BODY>\"\n_CPopup_Init()\nidEditbox.document.designMode=\"on\"\nidEditbox.document.open(\"text\/html\",\"replace\")\nidEditbox.document.write(sz)\nidEditbox.document.close()\nsetTimeout(\"_pageReady()\",100)\n}\nfunction _Editor_ClickHandler(){\ng_state.selection=null\n}\nfunction _Editor_KeyDownHandler(){\nvar ev=this.parentWindow.event\nif((ev.keyCode==78||ev.keyCode==72)&&ev.ctrlKey){\nif(ev.keyCode==78)\nwindow.open(parent.location)\nev.keyCode=0;ev.returnValue=false\n}\nif(ev.keyCode==9)\ng_state.SaveSelection()\nelse\ng_state.selection=null\n}\nfunction _Editor_DblClickHandler(){\nvar el=this.parentWindow.event.srcElement\nif(el.tagName==\"IMG\"){\nel.removeAttribute(\"width\")\nel.removeAttribute(\"height\")\nel.style.removeAttribute(\"width\")\nel.style.removeAttribute(\"height\")\nel.width=el.width\nel.height=el.height\n}\nif(el.tagName==\"TABLE\")\n_CPopup_Show(\'Table\')\n}\nfunction _setSize(){\ndocument.all.idEditbox.style.pixelHeight=document.body.clientHeight - idToolbar.offsetHeight - document.all.idMode.offsetHeight\ndocument.all.idPopup.style.pixelLeft=(document.body.clientWidth - idPopup.document.all.puRegion.offsetWidth)\/ 2\n}\nfunction _drawToolbar()\n{\nvar aIds=new Array(\"cut\",\"copy\",\"paste\",\"bar1\",\"undo\",\"redo\",\"bar2\",\"link\",\"table\",\"image\",\"bar3\",\"formatblock\",\"fontstyle\",\"fontsize\",\"bar4\",\"bold\",\"italic\",\"underline\",\"bar5\",\"left\",\"center\",\"right\",\"bar6\",\"orderedlist\",\"unorderedlist\",\"outdent\",\"indent\",\"bar7\",\"textcolor\")\nvar aTips=new Array(\"剪切\",\"复制\",\"粘贴\",\"\",\"撤销\",\"恢复\",\"\",\"超链接\",\"插入表格\",\"插入图片\",\"\",\"字体格式\",\"字体\",\"字体尺寸\",\"\",\"加粗\",\"斜体\",\"下划线\",\"\",\"左对齐\",\"居中\",\"右对齐\",\"\",\"编号\",\"项目符号\",\"减少缩进\",\"增加缩进\",\"\",\"字体颜色\")\nvar aCommand=new Array(\"_Format(\'cut\')\",\"_Format(\'copy\')\",\"_Format(\'paste\')\",null,\"_Format(\'undo\')\",\"_Format(\'redo\')\",null,\"_CPopup_Show(\'Link\')\",\"_CPopup_Show(\'Table\')\",\"_CPopup_Show(\'Image\')\",null,\"_CPopup_Show(\'formatblock\')\",\"_CPopup_Show(\'font\')\",\"_CPopup_Show(\'fontsize\')\",null,\"_Format(\'bold\')\",\"_Format(\'italic\')\",\"_Format(\'underline\')\",null,\"_Format(\'Justify\',\'Left\')\",\"_Format(\'Justify\',\'Center\')\",\"_Format(\'Justify\',\'Right\')\",null,\"_Format(\'insertorderedlist\')\",\"_Format(\'insertunorderedlist\')\",\"_Format(\'outdent\')\",\"_Format(\'indent\')\",null,\"_CPopup_Show(\'ForeColor\')\")\nvar sz=\"<DIV ID=idStandardBar><NOBR>\",iLeft=0,iHeight=24\nfor(var i=0 ;i<aSizes.length;i++)\n{\nsz+=\"<SPAN CLASS=tbButton ONKEYPRESS=\\\"if(event.keyCode==13){\"+aCommand[i]+\";event.keyCode=0}\\\" ID=\\\"tb\"+aIds[i]+\"\\\" STYLE=\\\"width:\"+aSizes[i]+\";height:\"+iHeight+\"\\\">\" +\"<SPAN STYLE=\\\"position:absolute;width:\"+aSizes[i]+\";height:\"+iHeight+\";clip:rect(0 \"+aSizes[i]+\" \"+iHeight+\" 0)\\\"><IMG ALT=\\\"\"+aTips[i]+\"\\\" TITLE=\\\"\"+aTips[i]+\"\\\" ONCLICK=\\\"\"+aCommand[i]+\";event.cancelBubble=true\\\" ONMOUSEDOWN=\\\"if(event.button==1)this.style.pixelTop=-\"+(iHeight*2)+\"\\\" ONMOUSEOVER=\\\"this.style.pixelTop=-\"+iHeight+\"\\\" ONMOUSEOUT=\\\"this.style.pixelTop=0\\\" ONMOUSEUP=\\\"this.style.pixelTop=-\"+iHeight+\"\\\" SRC=\\\"\"+L_TOOLBARGIF_TEXT+\"\\\" STYLE=\\\"position:absolute;top:0;left:-\"+iLeft+\"\\\"><\/SPAN><\/SPAN>\" +(aTips[i]==\"\"?\"<\/NOBR><NOBR>\":\"\")\niLeft+=aSizes[i]\n}\nsz+=\"<\/NOBR>\"\ndocument.write(sz+\"<\/DIV>\")\n}\nfunction _drawModeSelect(){\nvar sz=\"<TABLE CELLSPACING=0 CELLPADDING=0 ID=idMode><\/TABLE>\"\ndocument.write(sz)\n}\n
      

  2.   


    function _CState()\n{\nthis.selection=null\nthis.bMode=true\nthis.customButtons=false\nthis.css=this.bgColor=\"#FFFFFF\"\nthis.defaultSkin=document.styleSheets.skin.cssText\nthis.popupSkin=document.styleSheets.popupSkin.cssText\nthis.szSearch=location.search.substring(1)\nthis.aBindings=new Array()\nthis.aListPopups=new Object()\nthis.aCache=new Object()\nthis.bLoaded=false\nthis.oPhoto=null\nthis.RestoreSelection=_CState_RestoreSelection\nthis.GetSelection=_CState_GetSelection\nthis.SaveSelection=_CState_SaveSelection\n}\nfunction _CState_RestoreSelection()\n{\nif(this.selection)this.selection.select()\n}\nfunction _CState_GetSelection()\n{\nvar oSel=this.selection\nif(!oSel){\noSel=idEditbox.document.selection.createRange()\noSel.type=idEditbox.document.selection.type\n}\nreturn oSel\n}\nfunction _CState_SaveSelection()\n{\ng_state.selection=idEditbox.document.selection.createRange()\nif(!g_state.selection)\ng_state.selection=new Object\ng_state.selection.type=idEditbox.document.selection.type\n}\nfunction _CPopup_Init()\n{\nvar sz=\"<HTML ID=popup><STYLE>\" +document.styleSheets.defPopupSkin.cssText +\"\\n\" +document.styleSheets.popupSkin.cssText +\"<\/STYLE><BODY ONCONTEXTMENU=\\\"return false\\\" ONSCROLL=\\\"return false\\\" SCROLL=no TABINDEX=-1 ONSELECTSTART=\\\"return event.srcElement.tagName==\'INPUT\'\\\" ><DIV ID=puRegion><TABLE ID=header><TR><TH NOWRAP ID=caption><\/TH><TH VALIGN=middle ALIGN=RIGHT><DIV ID=close ONCLICK=\\\"parent._CPopup_Hide()\\\">×<\/DIV><\/TH><\/TR><\/TABLE><DIV ALIGN=CENTER ID=content><\/DIV><\/DIV><\/BODY><\/HTML>\"\nidPopup.document.open(\"text\/html\",\"replace\")\nidPopup.document.write(sz)\nidPopup.document.close()\n}\nfunction _CPopup_Hide()\n{\ndocument.all.idPopup.style.zIndex=-1\ndocument.all.idPopup.style.visibility=\"hidden\"\nidPopup.document._type=\"\"\nidPopup.document.onkeydown=idPopup.document.onmouseover=idPopup.document.onclick=null\n}\nfunction _CPopup_Show(szType)\n{\nvar oRenderer,szCacheKey=\"PopupRenderer.\"+szType\nif(!isIE4)\ng_state.SaveSelection()\nif(idPopup.document._type==szType)\n_CPopup_Hide()\nelse\n{\ndocument.all.idPopup.style.zIndex=-1\noRenderer=g_state.aCache[szCacheKey]\nif((!oRenderer)||(\"Link\"==szType)||(\"Image\"==szType))\ng_state.aCache[szCacheKey]=oRenderer=new _CPopupRenderer(szType)\ndocument.all.idPopup.style.visibility=\"\"\ndocument.all.idPopup.style.pixelHeight=document.all.idPopup.style.pixelWidth=idPopup.document.all.puRegion.style.pixelHeight=idPopup.document.all.puRegion.style.pixelWidth=50\nidPopup.document._type=szType\nidPopup.document._renderer=oRenderer\nidPopup.document.all.caption.innerText=oRenderer.GetCaption()\nidPopup.document.all.content.innerHTML=oRenderer.GetHTML()\nidPopup.document.onkeydown=new Function(\"this._renderer.OnKeyDown()\")\nidPopup.document.onmouseover=new Function(\"this._renderer.OnMouseOver()\")\nidPopup.document.onclick=new Function(\"this._renderer.OnClick()\")\noRenderer.ResetContext(idPopup.document)\nsetTimeout(\"_CPopupRenderer_Display(\'\"+szType+\"\')\",100)\n}\n}\nfunction _CPopupRenderer_Display(szType){\nvar oRenderer,szCacheKey=\"PopupRenderer.\"+szType\noRenderer=g_state.aCache[szCacheKey]\nif(oRenderer.autoSize){\nidPopup.document.all.puRegion.style.pixelHeight=document.all.idPopup.style.pixelHeight=idPopup.document.all.puRegion.offsetHeight\nidPopup.document.all.puRegion.style.pixelWidth=document.all.idPopup.style.pixelWidth=idPopup.document.all.puRegion.offsetWidth+50\ndocument.all.idPopup.style.pixelLeft=(document.body.clientWidth - idPopup.document.all.puRegion.offsetWidth)\/ 2\n}\nelse{\nidPopup.document.all.puRegion.style.pixelHeight=document.all.idPopup.style.pixelHeight=document.body.clientHeight - idToolbar.offsetHeight- document.all.idMode.offsetHeight-20\nidPopup.document.all.puRegion.style.pixelWidth=document.all.idPopup.style.pixelWidth=document.body.clientWidth - 50\ndocument.all.idPopup.style.pixelLeft=25\n}\ndocument.all.idPopup.style.zIndex=2\nidPopup.focus()\n}\nfunction _CPopupRenderer(szType)\n{\nthis.szType=szType\nthis.elCurrent=this.oDocument=null\nthis.ResetContext=_CPopupRenderer_ResetContext\nthis.GetCaption=_CPopupRenderer_GetCaption\nthis.GetHTML=_CPopupRenderer_GetHTML\nthis.autoSize=true\nthis.OnMouseOver=new Function()\nthis.OnKeyDown=_CListPopupRenderer_GenericOnKeyDown\nswitch(szType)\n{\ncase \"formatblock\":\ncase \"font\":\ncase \"fontsize\":\nthis.OnMouseOver= _CListPopupRenderer_OnMouseOver\nthis.OnKeyDown=_CListPopupRenderer_OnKeyDown\ncase \"ForeColor\":\nthis.OnClick=_CListPopupRenderer_OnClick\nthis.Highlight=_CListPopupRenderer_Highlight\nthis.Select=_CListPopupRenderer_Select\nbreak\ndefault:\nthis.OnClick=new Function()\nbreak\n}\nswitch(szType)\n{\ncase \"formatblock\":\nthis.szCaption=\"选择当前字体格式\"\nthis.PrepareHTML=_CFormatBlockPopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"font\":\nthis.szCaption=\"选择当前字体\"\nthis.PrepareHTML=_CFontFacesPopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"fontsize\":\nthis.szCaption=\"选择当前字体尺寸\"\nthis.PrepareHTML =_CFontSizesPopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"Link\":\nthis.szCaption=\"创建、修改链接\"\nthis.PrepareHTML=_CLinkPopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"Image\":\nthis.szCaption=\"创建、修改图片\"\nthis.PrepareHTML=_CImagePopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"Table\":\nthis.szCaption=\"创建、修改表格\"\nthis.PrepareHTML=_CTablePopupRenderer_PrepareHTML\nthis.szHTML=this.PrepareHTML()\nbreak\ncase \"ForeColor\":\nthis.szCaption=\"选择当前字体颜色\"\nthis.szHTML=\"<DIV ID=ColorPopup ALIGN=CENTER>\"+_CUtil_BuildColorTable(\"\")+\"<\/DIV>\"\nbreak\ndefault:\nthis.szCaption=\"\"\nbreak\n}\n}\n
      

  3.   

    function _CPopupRenderer_ResetContext(oDoc)\n{\nthis.oDocument=oDoc\nthis.elCurrent=null\nif(this.szType==\"Table\"){\nvar oSel=idEditbox.document.selection.createRange()\nvar oBlock=(oSel.parentElement!=null?_CUtil_GetElement(oSel.parentElement(),\"TABLE\"):_CUtil_GetElement(oSel.item(0),\"TABLE\"))\nif(oBlock!=null){\noDoc.all.tabEdit.className=\"\"\noDoc.all.tabEditBodytxtPadding.value=oBlock.cellPadding\noDoc.all.tabEditBodytxtSpacing.value=oBlock.cellSpacing\noDoc.all.tabEditBodytxtBorder.value=oBlock.border\noDoc.all.tabEditBodytxtBorderColor.value=oBlock.borderColor\noDoc.all.tabEditBodytxtBackgroundImage.value=oBlock.background\noDoc.all.tabEditBodytxtBackgroundColor.value=oBlock.bgColor\n}\noDoc.elCurrent=oBlock\n}\n}\nfunction _CPopupRenderer_GetCaption()\n{\nreturn this.szCaption\n}\nfunction _CPopupRenderer_GetHTML()\n{\nreturn this.szHTML\n}\nfunction _CFontSizesPopupRenderer_PrepareHTML()\n{\nvar sz=\"<TABLE ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>\"\nfor(var i=1;i <= 7;i++)\n{\nsz+=\"<TR><TD NOWRAP _item=\"+i+\" ALIGN=center STYLE=\\\"margin:0pt;padding:0pt\\\"><FONT SIZE=\"+i+\">\" +\"文字样例(\"+i+\")<\/FONT><\/TD><\/TR>\"\n}\nsz+=\"<\/TABLE>\"\nreturn sz\n}\nfunction _CFontFacesPopupRenderer_PrepareHTML()\n{\nvar sz=\"<TABLE ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>\"\nfor(var i=0;i<defaultFonts.length;i++)\n{\nif(i%2==0)sz+=\"<TR>\"\nsz+=\"<TD NOWRAP _item=\"+i+\" ALIGN=center STYLE=\\\"margin:0pt;padding:0pt\\\"><FONT FACE=\\\"\"+defaultFonts[i][0]+\"\\\">\" +defaultFonts[i][1] +\"<\/FONT>\"+(defaultFonts[i][2]?(\"(\"+defaultFonts[i][1]+\")\"):\"\")+\"<\/TD>\"\nif(i%2)sz+=\"<\/TR>\"\n}\nif(i%2)sz+=\"<\/TR>\"\nsz+=\"<TR><TD ROWSPAN=2 ONCLICK=\\\"parent._CFontFacesPopupRenderer_InsertOther(this)\\\" ALIGN=center _item=\\\"custom\\\" STYLE=\\\"margin:0pt;padding:0pt\\\" NOWRAP ID=customFont>其他字体...<\/TD><\/TR>\"\nsz+=\"<\/TABLE>\"\nreturn sz\n}\nfunction _CFontFacesPopupRenderer_InsertOther(){\nvar szFont=prompt(\"请输入您指定的字体名称: \",\"宋体\")\nif((szFont!=null)&&(szFont!=\"\"))\n_Format(\"FontName\",szFont)\n_CPopup_Hide()\n}\nfunction _CFormatBlockPopupRenderer_PrepareHTML()\n{\nvar sz,defaultParagraphs=new Array()\ndefaultParagraphs[0]=new Array(\"<P>\",\"普通\")\nfor(var i=1;i <= 6;i++)\ndefaultParagraphs[i]=new Array(\"<H\"+i+\">\",\"标题\"+i+\"(H\"+i+\")\")\ndefaultParagraphs[7]=new Array(\"<PRE>\",\"格式化文本(PRE)\")\nsz=\"<TABLE CLASS=block ALIGN=center ID=idList CELLSPACING=0 CELLPADDING=0>\"\nfor(var i=0;i<defaultParagraphs.length;i++)\n{\nsz+=\"<TR><TD NOWRAP _item=\"+i+\" ALIGN=center STYLE=\\\"margin:0pt;padding:0pt\\\">\"+defaultParagraphs[i][0] +defaultParagraphs[i][1] +\"<\/\"+defaultParagraphs[i][0].substring(1)+\"<\/TD><\/TR>\"\n}\nsz+=\"<\/TABLE>\"\nreturn sz\n}\nfunction _CTablePopupRenderer_PrepareHTMLPage(szID,bDisplay){\nvar sz=\"<TABLE height=100% \"+((!bDisplay)?\" style=\\\"display:none\\\"\":\"\")+\" width=100% CELLSPACING=0 CELLPADDING=0 ID=\"+szID+\"><TR ID=tableContents><TD ID=tableOptions VALIGN=TOP NOWRAP WIDTH=150 ROWSPAN=2><A HREF=\\\"javascript:parent._CTablePopupRenderer_Select(this,\'\"+szID+\"\',\'prop1\')\\\">设定行列<\/A><BR><A HREF=\\\"javascript:parent._CTablePopupRenderer_Select(this,\'\"+szID+\"\',\'prop2\')\\\">设定边框与间隔<\/A><BR><A HREF=\\\"javascript:parent._CTablePopupRenderer_Select(this,\'\"+szID+\"\',\'prop3\')\\\">设定边框<\/A><BR><A HREF=\\\"javascript:parent._CTablePopupRenderer_Select(this,\'\"+szID+\"\',\'prop4\')\\\">设定背景<\/A><BR><\/TD><TD BGCOLOR=black ID=puDivider ROWSPAN=2><\/TD><TD ID=tableProps VALIGN=TOP>\"\nif(szID==\"tabNewBody\"){\nsz+= \"<DIV ID=\'\"+szID+\"prop1\'><P CLASS=tablePropsTitle>设定行列<\/P><TABLE><TR><TD>行: <\/TD><TD><INPUT SIZE=2 MAXLENGTH=2 TYPE=text ID=\"+szID+\"txtRows VALUE=2 ><\/TD><\/TR><TR><TD>列: <\/TD><TD><INPUT SIZE=2 MAXLENGTH=2 TYPE=text ID=\"+szID+\"txtColumns VALUE=2 ><\/TD><\/TR><\/TABLE><\/DIV>\"\n}\nelse{\nsz+= \"<DIV ID=\'\"+szID+\"prop1\'><P CLASS=tablePropsTitle>设定行列<\/P>\" +\"<INPUT type=button ID=\"+szID+\"txtRows VALUE=\\\"插入行\\\" ONCLICK=\\\"parent._CTablePopupRenderer_AddRow(this)\\\"><P><INPUT type=button ID=\"+szID+\"txtCells VALUE=\\\"插入列\\\" ONCLICK=\\\"parent._CTablePopupRenderer_AddCell(this)\\\"><BR><\/DIV>\"\n}\nsz+=\"<DIV ID=\'\"+szID+\"prop2\' STYLE=\\\"display:none\\\"><P CLASS=tablePropsTitle>设定边框与间隔<\/P>单元格边框: <INPUT SIZE=2 TYPE=text ID=\"+szID+\"txtPadding VALUE=1><BR>单元格间隔: <INPUT SIZE=2 TYPE=text ID=\"+szID+\"txtSpacing VALUE=1><\/DIV><DIV ID=\"+szID+\"prop3 STYLE=\\\"display:none\\\"><P CLASS=tablePropsTitle>设定边框<\/P>边框宽度: <INPUT SIZE=2 TYPE=text ID=\"+szID+\"txtBorder VALUE=1><BR>边框颜色: <INPUT SIZE=4 TYPE=text ID=\"+szID+\"txtBorderColor value=#000000><BR>\" +_CUtil_BuildColorTable(\"idBorder\"+szID,\"\",\"parent._CTablePopupRenderer_ColorSelect(this,\'\"+szID+\"txtBorderColor\')\")+\"<\/DIV><DIV ID=\"+szID+\"prop4 SIZE=12 STYLE=\\\"display:none\\\"><P CLASS=tablePropsTitle>设定背景<\/P>背景图片: <INPUT TYPE=text ID=\"+szID+\"txtBackgroundImage SIZE=15><BR>背景颜色: <INPUT TYPE=text SIZE=4 ID=\"+szID+\"txtBackgroundColor><BR>\" +_CUtil_BuildColorTable(\"idBackground\"+szID,\"\",\"parent._CTablePopupRenderer_ColorSelect(this,\'\"+szID+\"txtBackgroundColor\')\")+\"<\/DIV><\/TD><\/TR><TR><TD align=center ID=tableButtons valign=bottom>\"\nif(szID==\"tabNewBody\"){\nsz+=\"<INPUT TYPE=submit ONCLICK=\\\"parent._CTablePopupRenderer_BuildTable(\'\"+szID+\"\',this.document)\\\" VALUE=\\\"创建表格\\\"> <INPUT TYPE=reset VALUE=\\\" 取 消 \\\" ONCLICK=\\\"parent._CPopup_Hide()\\\">\"\n}else{\nsz+=\"<INPUT TYPE=submit ONCLICK=\\\"parent._CTablePopupRenderer_BuildTable(\'\"+szID+\"\',this.document)\\\" VALUE=\\\"修改表格\\\"> <INPUT TYPE=reset VALUE=\\\" 取 消 \\\" ONCLICK=\\\"parent._CPopup_Hide()\\\">\"\n}\nsz+= \"<\/TD><\/TR><\/TABLE>\"\nreturn sz\n}\nfunction _CTablePopupRenderer_PrepareHTML()\n{\nvar sz=\"<TABLE CLASS=tabBox ID=\\\"tabSelect\\\" CELLSPACING=0 CELLPADDING=0 WIDTH=95%><TR HEIGHT=15><TD CLASS=tabItem STYLE=\\\"border-bottom:none\\\" NOWRAP><DIV ONCLICK=\\\"if(tabEdit.className!=\'disabled\'){this.className=\'selected\';this.parentElement.style.borderBottom=tabEdit.className=tabNewBody.style.display=\'\';tabEditBody.style.display=\'none\';tabEdit.parentElement.style.borderBottom=\'1px black solid\'}\\\" CLASS=selected ID=tabNew>创建表格<\/DIV><\/TD><TD CLASS=tabItem NOWRAP><DIV ONCLICK=\\\"if(this.className!=\'disabled\'){this.className=\'selected\';this.parentElement.style.borderBottom=tabNew.className=tabEditBody.style.display=\'\';tabNew.parentElement.style.borderBottom=\'1px black solid\';tabNewBody.style.display=\'none\'}\\\" CLASS=disabled ID=tabEdit>修改表格<\/DIV><\/TD><TD CLASS=tabSpace WIDTH=100%>&nbsp;<\/TD><\/TR><TR><TD VALIGN=TOP CLASS=tabBody COLSPAN=3>\"+_CTablePopupRenderer_PrepareHTMLPage(\"tabNewBody\",true)+_CTablePopupRenderer_PrepareHTMLPage(\"tabEditBody\",false)+\"<\/TD><\/TR><\/TABLE>\"\nreturn sz\n}\nfunction _CTablePopupRenderer_Select(el,szID,id)\n{\nvar d=el.document\nfor(var i=1;i<5;i++)\nd.all[szID+\"prop\"+i].style.display=\"none\"\nd.all[szID+id].style.display=\"\"\n}\nfunction _CTablePopupRenderer_ColorSelect(el,id)\n{\nel.document.all[id].value=el.bgColor\n}\nfunction _CTablePopupRenderer_AddRow(el){\nvar elRow=el.document.elCurrent.insertRow()\nfor(var i=0;i<el.document.elCurrent.rows[0].cells.length;i++){\nvar elCell=elRow.insertCell()\nelCell.innerHTML=\"&nbsp;\"\n}\n}\nfunction _CTablePopupRenderer_AddCell(el){\nfor(var i=0;i<el.document.elCurrent.rows.length;i++){\nvar elCell=el.document.elCurrent.rows[i].insertCell()\nelCell.innerHTML=\"&nbsp;\"\n}\n}\n
      

  4.   

    function _CTablePopupRenderer_BuildTable(szID,d)\n{\nif(szID==\"tabNewBody\"){\nvar sz=\"<TABLE \"+(((d.all[szID+\"txtBorder\"].value==\"\")||(d.all[szID+\"txtBorder\"].value==\"0\"))?\"class=\\\"NOBORDER\\\"\":\"\")+(d.all[szID+\"txtPadding\"].value!=\"\"?\"cellPadding=\\\"\"+d.all[szID+\"txtPadding\"].value+\"\\\" \":\"\")+(d.all[szID+\"txtSpacing\"].value!=\"\"?\"cellSpacing=\\\"\"+d.all[szID+\"txtSpacing\"].value+\"\\\" \":\"\")+(d.all[szID+\"txtBorder\"].value!=\"\"?\"border=\\\"\"+d.all[szID+\"txtBorder\"].value+\"\\\" \":\"\")+(d.all[szID+\"txtBorderColor\"].value!=\"\"?\"bordercolor=\\\"\"+d.all[szID+\"txtBorderColor\"].value+\"\\\" \":\"\")+(d.all[szID+\"txtBackgroundImage\"].value!=\"\"?\"background=\\\"\"+d.all[szID+\"txtBackgroundImage\"].value+\"\\\" \":\"\")+(d.all[szID+\"txtBackgroundColor\"].value!=\"\"?\"bgColor=\\\"\"+d.all[szID+\"txtBackgroundColor\"].value+\"\\\" \":\"\")+\">\"\nif(d.all[szID+\"txtRows\"].value>99)d.all[szID+\"txtRows\"].value=99\nif(d.all[szID+\"txtColumns\"].value>99)d.all[szID+\"txtColumns\"].value=50\nfor(var r=0;r<parseInt(d.all[szID+\"txtRows\"].value);r++)\n{\nsz+=\"<TR>\"\nfor(var c=0;c<parseInt(d.all[szID+\"txtColumns\"].value);c++)\nsz+=\"<TD>&nbsp;<\/TD>\"\nsz+=\"<\/TR>\"\n}\nsz+=\"<\/TABLE>\"\ninsertHTML(sz)\n}else\nif(d.elCurrent){\nd.elCurrent.cellPadding=d.all.tabEditBodytxtPadding.value\nd.elCurrent.cellSpacing=d.all.tabEditBodytxtSpacing.value\nd.elCurrent.border=d.all.tabEditBodytxtBorder.value\nd.elCurrent.className=(d.elCurrent.border==\"\"||d.elCurrent.border==0)?\"NOBORDER\":\"\"\nd.elCurrent.borderColor=d.all.tabEditBodytxtBorderColor.value\nd.elCurrent.bgColor=d.all.tabEditBodytxtBackgroundColor.value\nd.elCurrent.background=d.all.tabEditBodytxtBackgroundImage.value\n}\ng_state.RestoreSelection()\n_CPopup_Hide()\n}\nfunction _CListPopupRenderer_OnClick()\n{\nvar elTD=_CUtil_GetElement(this.oDocument.parentWindow.event.srcElement,\"TD\")\nif(elTD &&elTD._item)this.Select(elTD)\n}\nfunction _CListPopupRenderer_GenericOnKeyDown(){\nvar ev=this.oDocument.parentWindow.event\nif(ev.keyCode==27)_CPopup_Hide()\n}\nfunction _CListPopupRenderer_OnKeyDown()\n{\nvar el\nvar iRow=iCell=0\nvar ev=this.oDocument.parentWindow.event\nvar idList=this.oDocument.all.idList\nvar elTR=_CUtil_GetElement(this.elCurrent,\"TR\")\nvar elTD=_CUtil_GetElement(this.elCurrent,\"TD\")\nif(elTR!=null)\n{\niRow=elTR.rowIndex\niCell=elTD.cellIndex\n}\nswitch(ev.keyCode)\n{\ncase 37:\niCell--\nif(iCell<0)\niCell=idList.rows[iRow].cells.length-1\nbreak\ncase 38:\niRow--\nif(iRow<0)\niRow=idList.rows.length-1\nbreak\ncase 39:\niCell++\nif(iCell>idList.rows[iRow].cells.length-1)\niCell=0\nbreak\ncase 40:\niRow++\nif(iRow>idList.rows.length-1)\niRow=0\nbreak\ncase 13:\nbreak;\ncase 27:\n_CPopup_Hide()\nbreak;\ndefault:\nreturn;\n}\nel=idList.rows[iRow].cells[iCell]\nif(el &&el._item)\nif(13==ev.keyCode){\nev.keyCode=0\nthis.Select(el)\n}\nelse\nthis.Highlight(el)\n}\nfunction _CListPopupRenderer_OnMouseOver()\n{\nvar el=_CUtil_GetElement(this.oDocument.parentWindow.event.srcElement,\"TD\")\nif(el &&el._item &&el!=this.elCurrent)\nthis.Highlight(el)\n}\nfunction _CListPopupRenderer_Highlight(el)\n{\nvar elC=this.elCurrent\nif(elC)elC.style.borderWidth=elC.style.borderColor=elC.style.borderStyle=\"\"\nel.style.borderWidth=\"1px\"\nel.style.borderColor=\"green\"\nel.style.borderStyle=\"solid\"\nthis.elCurrent=el\n}\nfunction _CListPopupRenderer_Select(elTD)\n{\ng_state.RestoreSelection()\nvar el=elTD.children[0]\nswitch(this.szType)\n{\ncase \"font\":\nif(!el)\nparent._CFontFacesPopupRenderer_InsertOther(this)\nelse\n_Format(\"FontName\",el.face)\nbreak\ncase \"fontsize\":\n_Format(\"FontSize\",el.size)\nbreak\ncase \"formatblock\":\n_Format(\"FormatBlock\",\"<\"+el.tagName+\">\")\nbreak\ncase \"ForeColor\":\n_Format(\"ForeColor\",elTD.bgColor)\nbreak\n}\n_CPopup_Hide()\n}\nfunction _CLinkPopupRenderer_AddLink(d)\n{\nvar szURL=d.all.urlValue.value\nvar szType=d.all.urlType[d.all.urlType.selectedIndex].text\nvar oSel=g_state.GetSelection()\nszURL=((0==szURL.indexOf(\"mailto:\")||0==szURL.indexOf(\"http:\/\/\")||0==szURL.indexOf(\"ftp:\/\/\"))?\"\":szType)+szURL\nif(szURL!=\"\")\n{\nif((oSel.parentElement)&&(oSel.text==\"\"))\n{\noSel.expand(\"word\")\nif(oSel.text==\"\")\n{\nvar sText=\"\"\nvar oStore=oSel.duplicate()\nif(d.all.pageList){\nvar idx=d.all.pageList.selectedIndex\nif(d.all.pageList[idx].value==szURL)\nsText=d.all.pageList[idx].text\nelse\nsText=szURL\n}\nelse\nsText=szURL\noSel.pasteHTML(\'<A HREF=\"\'+szURL+\'\">\'+sText+\'<\/A>\')\noSel.setEndPoint(\"StartToStart\",oStore)\noSel.select()\n_CPopup_Hide()\nreturn\n}\n}\nelse\nif((oSel.item)&&(oSel.item(0).tagName==\"IMG\"))\n{\noSel.item(0).width=oSel.item(0).offsetWidth\noSel.item(0).height=oSel.item(0).offsetHeight\noSel.item(0).border=(d.all.displayBorder.checked)?1:\"\"\n}\nif(d.all.urlValue.value!=\"\")\noSel.execCommand(\"CreateLink\",false,szURL)\nelse\noSel.execCommand(\"UnLink\",false,szURL)\n}\noSel.select()\n_CPopup_Hide()\n}\nfunction _CLinkPopupRenderer_PrepareHTML()\n{\nvar oSel=g_state.GetSelection()\nvar oEl,bImg=false,szURL=sz=\"\"\nif(oSel.parentElement)\n{\noEl=_CUtil_GetElement(oSel.parentElement(),\"A\")\n}\nelse\n{\noEl=_CUtil_GetElement(oSel.item(0),\"A\")\nbImg=oSel.item(0).tagName==\"IMG\"\n}\nif(oEl)szURL=oEl.href\nsz =\"<TABLE ALIGN=center>\"\nvar arTypes=new Array(\"http\",\"ftp\",\"mailto\")\nvar arText=new Array(\"http:\/\/\",\"ftp:\/\/\",\"mailto:\")\nvar szType=szURL.substring(0,szURL.indexOf(\":\"))\nif((\"http\"==szType)||(\"ftp\"==szType))\nszURL=szURL.substring(szURL.indexOf(\"\/\/\")+2)\nelse\nszURL=szURL.substring(szURL.indexOf(\":\")+1)\nsz+=\"<BR>输入或修改一个链接地址: <NOBR><SELECT ID=urlType>\"\nfor(var i=0;i<arTypes.length;i++){\nsz+= \"<OPTION VALUE=\'\"+arTypes[i]+\"\' \"+(arTypes[i]==szType?\" SELECTED \":\"\")+\">\"+arText[i]\n}\nsz+=\"<\/SELECT><INPUT ID=urlValue SIZE=45 VALUE=\\\"\"+szURL+\"\\\" TYPE=text><\/NOBR>\"\nif(bImg)\n{\nsz+=\"<BR><INPUT TYPE=checkbox ID=displayBorder \"+((oSel.item(0).border!=0)?\" checked \":\"\")+\">是否显示图片链接边框?\"\n}\nsz+=\"<\/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>\"\nreturn sz\n}\nfunction _CImagePopupRenderer_AddImage(d)\n{\nvar szURL=d.all.urlValue.value\nvar szType=d.all.urlType[d.all.urlType.selectedIndex].text\nvar oSel=g_state.GetSelection()\nvar szALT=d.all.imgAlt.value\nvar szALIGN=d.all.imgAlign[d.all.imgAlign.selectedIndex].value\nvar szBORDER=d.all.imgBorder.value\nvar SelImg\nif(!oSel.parentElement)SelImg=oSel.item(0)\nszURL=((0==szURL.indexOf(\"http:\/\/\")||0==szURL.indexOf(\"ftp:\/\/\"))?\"\":szType)+szURL\nif(szURL!=\"\")\n{\nif(SelImg)\n{\nif(SelImg.src!=szURL)SelImg.src=szURL\nif(SelImg.alt!=szALT)SelImg.alt=szALT\nif(SelImg.align.toLowerCase()!=szALIGN)_Format(\"Justify\",szALIGN)\nif(SelImg.border!=szBORDER)SelImg.border=szBORDER\n}\nelse\ninsertHTML(\'<IMG SRC=\"\'+szURL+\'\"\'+(szALT==\"\"?\"\":\' ALT=\"\'+szALT+\'\"\')+(szALIGN==\"\"?\"\":\' ALIGN=\"\'+szALIGN+\'\"\')+(szBORDER==\"\"?\"\":\' BORDER=\"\'+szBORDER+\'\"\')+\'>\')\noSel.select()\n_CPopup_Hide()\nreturn\n}\n}\n
      

  5.   

    function _CImagePopupRenderer_PrepareHTML()\n{\nvar oSel=g_state.GetSelection()\nvar szURL=szALT=szALIGN=szBORDER=sz=\"\"\nvar SelImg\nif(!oSel.parentElement)\n{\nSelImg=oSel.item(0)\nif(SelImg.tagName==\"IMG\")\n{\nszURL=SelImg.href\nszALT=SelImg.alt\nszALIGN=SelImg.align.toLowerCase()\nszBORDER=SelImg.border\n}\n}\nsz =\"<TABLE ALIGN=center><BR>输入或修改一个图片地址: <NOBR><SELECT ID=urlType>\"\nvar arTypes=new Array(\"http\",\"ftp\")\nvar arText=new Array(\"http:\/\/\",\"ftp:\/\/\")\nvar szType=szURL.substring(0,szURL.indexOf(\":\"))\nif((\"http\"==szType)||(\"ftp\"==szType))\nszURL=szURL.substring(szURL.indexOf(\"\/\/\")+2)\nelse\nszURL=szURL.substring(szURL.indexOf(\":\")+1)\nfor(var i=0;i<arTypes.length;i++){\nsz+= \"<OPTION VALUE=\'\"+arTypes[i]+\"\' \"+(arTypes[i]==szType?\" SELECTED \":\"\")+\">\"+arText[i]\n}\nsz+=\"<\/SELECT><INPUT ID=urlValue SIZE=45 VALUE=\\\"\"+szURL+\"\\\" TYPE=text><\/NOBR>\"\nsz+=\"<BR><NOBR>注释文本: <INPUT ID=imgAlt SIZE=44 VALUE=\\\"\"+szALT+\"\\\" TYPE=text><\/NOBR>\"\nsz+=\"<BR><NOBR>对齐模式: <SELECT ID=imgAlign>\"\nvar arTypes=new Array(\"\",\"left\",\"right\",\"top\",\"texttop\",\"middle\",\"absmiddle\",\"baseline\",\"bottom\",\"absbottom\",\"center\")\nvar arText=new Array(\"默认\",\"左对齐\",\"右对齐\",\"顶边对齐\",\"文本上方\",\"相对垂直居中\",\"绝对垂直居中\",\"基线\",\"相对底边对齐\",\"绝对底边对齐\",\"水平居中\")\nfor(var i=0;i<arTypes.length;i++){\nsz+= \"<OPTION VALUE=\'\"+arTypes[i]+\"\' \"+(arTypes[i]==szALIGN?\" SELECTED \":\"\")+\">\"+arText[i]\n}\nsz+=\"<\/SELECT> 边框粗细: <INPUT ID=imgBorder SIZE=5 VALUE=\\\"\"+szBORDER+\"\\\" TYPE=text><\/NOBR>\"\nsz+=\"<\/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=\\\" 取 消 \\\"><\/TD><\/TR><\/TABLE>\"\nreturn sz\n}\nfunction _CUtil_GetElement(oEl,sTag)\n{\nwhile(oEl!=null &&oEl.tagName!=sTag)\noEl=oEl.parentElement\nreturn oEl\n}\nfunction _CUtil_BuildColorTable(sID,fmt,szClick)\n{\nvar sz,cPick=new Array(\"00\",\"33\",\"66\",\"99\",\"CC\",\"FF\"),iCnt=2\nvar iColors=cPick.length,szColor=\"\"\nsz=\"<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+\"\\\">\"\nfor(var r=0;r<iColors;r++){\nsz+=\"<TR>\"\nfor(var g=iColors-1;g>=0;g--)\nfor(var b=iColors-1;b>=0;b--){\nszColor=cPick[r]+cPick[g]+cPick[b]\nsz+=\"<TD BGCOLOR=\\\"#\"+szColor+\"\\\"_item=\\\"\"+szColor+\"\\\" TITLE=\\\"#\"+szColor+\"\\\" \"+(szClick?\"ONCLICK=\\\"\"+szClick+\"\\\" \":\"\")+\">&nbsp;<\/TD>\"\n}\nsz+=\"<\/TR>\"\n}\nsz+=\"<\/TABLE><\/TD><\/TR><\/TABLE>\"\nreturn sz\n}\nfunction replace(str,replace_what,replace_with)\n{\nvar ndx=str.indexOf(replace_what);\nvar delta=replace_with.length - replace_what.length;\nwhile(ndx >= 0)\n{\nstr=str.substring(0,ndx)+replace_with+str.substring(ndx+replace_what.length);\nndx=str.indexOf(replace_what,ndx+delta+1);\n}\nreturn str;\n}\nfunction _CUtil_TrimCR(sValue){\nreturn replace(sValue,\"\\r\\n\",\" \")\n}\nfunction _CUtil_GetBlock(oEl)\n{\nvar sBlocks=\"|H1|H2|H3|H4|H5|H6|P|PRE|LI|TD|DIV|BLOCKQUOTE|DT|DD|TABLE|HR|IMG|\"\nwhile((oEl!=null)&&(sBlocks.indexOf(\"|\"+oEl.tagName+\"|\")==-1))\noEl=oEl.parentElement\nreturn oEl\n}\nfunction _CUtil_DomainSuffix(szHost){\nvar idx=szHost.indexOf(\"commun\")\nif(idx>=0){\nidx=szHost.indexOf(\".\",idx)\nreturn szHost.substring(idx+1)\n}else\n{\nidx=szHost.lastIndexOf(\".\",szHost.length-5)\nreturn szHost.substring(idx+1)\n}\nreturn szHost\n}\nfunction _CUtil_CleanHTML(){\nvar bBindings=(g_state.aBindings.length>0)\nvar elAll=idEditbox.document.all\nvar iCount=elAll.length\nfor(var i=iCount-1;i>=0;i--){\nif(elAll[i].tagName==\"IMG\"){\nelAll[i].width=elAll[i].offsetWidth\nelAll[i].height=elAll[i].offsetHeight\n}\nif((elAll[i].tagName==\"INPUT\")&&(bBindings))\nelAll[i].outerHTML=\'[\'+elAll[i].name+\']\';\n}\nreturn idEditbox.document.body.innerHTML\n}\nvar g_state\nwindow.onload = _initEditor\nfunction _drawIE4Focus(){\nif(isIE4)document.write(\"<INPUT TYPE=textbox STYLE=\\\"width:0;height:0;left:0;position:absolute\\\">\")\n}\n<\/SCRIPT>\n
      

  6.   

    <STYLE>\nbody{border-style:none;border-width:medium;margin:0pt;padding:0pt}\n#idMode{margin-top:0pt}\n.tbButton{text-align:left;margin-left:0pt;margin-right:1pt;margin-top:0pt;margin-bottom:0pt;padding:0pt}\n#EditBox{position:relative;}\n<\/STYLE>\n<STYLE id=\"skin\" disabled>\n#idEditRegion{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;padding:0px}\n#tbUpRight,#tbUpLeft{width:13px}\n#idMode{margin-left:11px;padding:0pt}\n#idMode label{color:navy;text-decoration:none;font-size:14.9px}\n<\/STYLE>\n<STYLE id=\"defPopupSkin\">\n#popup body{border-top-style:none;border-top-width:medium;margin:0px;padding:0pt}\n#popup .colorTable{height:91px}\n#popup #header{width:100%}\n#popup #close{cursor:default;font-size:12px;width:18px;text-align:center}\n#popup #content{padding:0pt}\n#popup table{vertical-align:top}\n#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}\n#popup .tabItem,#popup .tabSpace{border-left:1px solid black;border-bottom:1px solid black}\n#popup .tabItem{font-size:14.9px;border-top:1px solid black}\n#popup .currentColor{width:20px;height:20px;border:1px solid black;margin-left:0pt;margin-right:15pt;margin-top:0pt;margin-bottom:0pt}\n#popup .tabItem div{cursor:hand;margin:3px;padding:0px}\n#popup .tabItem div.disabled{color:gray;cursor:default}\n#customFont{font-size:14.9px}\n<\/STYLE>\n<STYLE id=\"popupSkin\">\n#popup body{background-color:#F1F1F1;border:1px solid #6699CC;background-position:0%;font-size:14.9px}\n#popup #header{background-color:#6699CC;color:white;background-position:0%}\n#popup #caption{text-align:left;font-size:14.9px}\n#popup .ColorTable,#popup #idList td#current{border:1px solid black}\n#popup #idList td{cursor:hand;border:1px solid #F1F1F1}\n#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}\n#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}\n#tableButtons,#tableProps{padding:5px}\n#popup #tableContents{height:175px}\n#popup #tableProps .tablePropsTitle,#popup #tableProps,#popup #tableProps table{font-size:14.9px}\n#popup #tableOptions{font-size:14.9px;padding-left:5pt;padding-right:5pt;padding-top:15pt;padding-bottom:15pt}\n#popup #puDivider{background-color:black;width:1px;background-position:0%}\n#popup #content{margin:0pt;padding-left:3pt;padding-right:3pt;padding-top:5pt;padding-bottom:8pt}\n#popup #ColorPopup{width:250px}\n#popup .ColorTable tr{height:6px}\n#popup .ColorTable td{width:6px;cursor:hand}\n#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}\n<\/STYLE>\n<\/HEAD>\n<BODY STYLE=\"background-color:transparent\" oncontextmenu=\"return false\" tabindex=\"-1\" scroll=\"no\" onselectstart=\"return false\" ondragstart=\"return false\" onscroll=\"return false\">\n<DIV id=\"idEditor\" style=\"VISIBILITY:hidden\">\n<TABLE id=\"idToolbar\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" onclick=\"_CPopup_Hide()\">\n<TR><TD bgColor=menu><SCRIPT>_drawToolbar()<\/SCRIPT><\/TD><\/TR>\n<TR><TD bgColor=#000000 HEIGHT=1><\/TD><\/TR>\n<\/TABLE>\n<IFRAME NAME=\"idPopup\" STYLE=\"HEIGHT:200px;LEFT:25px;MARGIN-TOP:8px;POSITION:absolute;VISIBILITY:hidden;WIDTH:200px;Z-INDEX:-1\"><\/IFRAME>\n<DIV id=\"idEditRegion\">\n<IFRAME TABINDEX=1 ID=\"EditBox\" NAME=\"idEditbox\" WIDTH=\"100%\" HEIGHT=\"100%\" MARGINHEIGHT=\"1\" MARGINWIDTH=\"1\" ONFOCUS=\"_CPopup_Hide();\"><\/IFRAME>\n<\/DIV>\n<SCRIPT>_drawIE4Focus()<\/SCRIPT>\n<DIV id=\"tbmode\">\n<SCRIPT>_drawModeSelect()<\/SCRIPT>\n<\/DIV>\n<\/DIV>\n<\/BODY><SCRIPT LANGUAGE=vbscript>\nfunction convHTML(htmlstr)\nhtmlstr = replace(htmlstr, \"&quot;\", \"\"\"\")\nhtmlstr = replace(htmlstr, \"&lt;\", \"<\")\nhtmlstr = replace(htmlstr, \"&gt;\", \">\")\nhtmlstr = replace(htmlstr, \"&amp;\", \"&\")\nconvHTML = htmlstr\nend function\n<\/SCRIPT>";
    if(parent.parent)parent.parent.doc_html_html = doc_html_html;
    </script>
      

  7.   

    大家不要晕,更不要死啊这是我以前忘记那里找来的一个HTNL Editor源代码
    你只要把上面的代码连再一起另存为一个网页就可以了很库的Editor,只是谁能吧它翻译成正常的HTML文件啊??
    我写了一个程序,替换\" ,\\,\',\/,\n
    但是替换完了发现有错还有这个程序本身有个bug
    第一次打开使用的时候添加URL会有问题那位大虾能看懂并修改啊,高分赠送
    或者告诉我以上的替换完了为什么会出错先谢了
      

  8.   

    所以要把它替换成标准的html格式我写了个程序改了一下,基本上是正确的,但是有点小问题
    可能这个程序本身就有问题