📄 _editor_0js2__jsp.java
字号:
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
com.caucho.server.webapp.WebApp webApp
= (com.caucho.server.webapp.WebApp) config.getServletContext();
com.caucho.jsp.TaglibManager manager = webApp.getJspApplicationContext().getTaglibManager();
manager.addTaglibFunctions(_jsp_functionMap, "editor_js_lt", "/WEB-INF/tlds/LabelTag.tld");}
public void destroy()
{
_caucho_isDead = true;
super.destroy();
}
public void init(com.caucho.vfs.Path appDir)
throws javax.servlet.ServletException
{
com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
mergePath.addMergePath(appDir);
mergePath.addMergePath(resinHome);
com.caucho.loader.DynamicClassLoader loader;
loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
String resourcePath = loader.getResourcePathSpecificFirst();
mergePath.addClassPath(resourcePath);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(appDir.lookup("editor_full/editor_js2.jsp"), -6050894462411172015L, false);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
}
private final static char []_jsp_string3;
private final static char []_jsp_string0;
private final static char []_jsp_string1;
private final static char []_jsp_string2;
static {
_jsp_string3 = "\", window, \"dialogWidth:26em; dialogHeight:20.5em; status:0; help:0\");\r\n IframeID.focus();\r\n if (arr != null)\r\n {\r\n //content=cws_Composition.document.body.innerHTML;\r\n //content=content+arr[1];\r\n cws_InsertSymbol(arr[1]);\r\n IframeID.focus();\r\n //cws_Composition.document.body.innerHTML=content;\r\n \r\n //if (document.form2.upfiles.value !=\"\")\r\n //{\r\n //document.form2.upfiles.value=document.form2.upfiles.value+\"|\"+get_upfilename(arr[2]);\r\n //}\r\n //else\r\n //{\r\n //document.form2.upfiles.value=get_upfilename(arr[2]);\r\n //} \r\n }\r\n else IframeID.focus();\r\n}\r\nelse {\r\n cws_UserDialog('InsertImage');\r\n}\r\n}\r\n\r\nfunction cws_forlink()\r\n{\r\nif (cws_bIsIE5){ \r\n var arr=showModalDialog(editorRootPath + \"/editor_full/images/link.jsp\",window, \"dialogWidth:23em; dialogHeight:11em; status:0; help:0\");\r\n IframeID.focus();\r\n if (arr != null)\r\n { \r\n cws_InsertSymbol(arr);\r\n IframeID.focus();\r\n \r\n }\r\n else IframeID.focus();\r\n}\r\nelse {cws_UserDialog('CreateLink');}\r\n}\r\n\r\nfunction cws_forfile()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/file.htm\", \"\", \"dialogWidth:23em; dialogHeight:11em; status:0; help:0\");\r\n \r\n if (arr != null)\r\n {\r\n //content=WBTB_Composition.document.body.innerHTML;\r\n //content=content+arr[1];\r\n //WBTB_Composition.document.body.innerHTML=content;\r\n cws_InsertSymbol(arr[1]);\r\n IframeID.focus();\r\n //if (document.form2.upfiles.value !=\"\")\r\n //{\r\n //document.form2.upfiles.value=document.form2.upfiles.value+\"|\"+get_upfilename(arr[2]);\r\n //}\r\n //else\r\n //{\r\n //document.form2.upfiles.value=get_upfilename(arr[2]);\r\n //}\r\n \r\n }\r\n else IframeID.focus();\r\n}\r\n\r\nfunction getHTML() {\r\n var html;\r\n if (cws_bTextMode==2) \r\n {\r\n html = IframeID.document.body.innerText\r\n }\r\n else\r\n {\r\n html = IframeID.document.body.innerHTML\r\n }\r\n return html;\r\n}\r\n\r\nfunction setHTML(html) {\r\n IframeID.document.body.innerHTML = html;\r\n}".toCharArray();
_jsp_string0 = "\r\n\r\n//if (cws_bLoad==false)\r\n//{\r\n //cws_InitDocument(\"Body\",\"GB2312\");\r\n//}\r\n\r\nvar cws_bIsIE5=document.all;\r\nvar cws_bIsNC=false;\r\nif (!cws_bIsIE5)\r\n cws_bIsNC=true;\r\n\r\nif (cws_bIsNC){\r\ndocument.write('<iframe width=\"260\" height=\"165\" id=\"colourPalette\" src=\"' + editorRootPath + '/editor_full/images/nc_selcolor.htm\" style=\"visibility:hidden; position: absolute; left: 0px; top: 0px;\" frameborder=\"0\" scrolling=\"no\" ></iframe>');\r\n}\r\n\r\nif (PostType == 0)\r\n{\r\n cws_setMode(3);\r\n document.getElementById(\"cws_TabDesign\").style.display='none';\r\n document.getElementById(\"cws_TabDesign\").style.display='none';\r\n //onpaste\r\n //document.selection.createRange().text\r\n //(window.clipboardData.getData(\"Text\")\r\n}\r\n\r\n//\u6570\u636e\u4f20\u9012\r\nfunction cws_CopyData(hiddenid)\r\n{\r\n //document.Dvform.Submit.disabled=true;\r\n //document.Dvform.Submit2.disabled=true;\r\n if (PostType == 0 && cws_bTextMode == 3)\r\n {\r\n cws_PasteData()\r\n }\r\n d = IframeID.document;\r\n if (cws_bTextMode == 2)\r\n {\r\n cont = d.body.innerText;\r\n }else{\r\n cont = d.body.innerHTML; \r\n }\r\n var ChekEmptyCode = cws_ChekEmptyCode(cont);\r\n if (ChekEmptyCode == '' || ChekEmptyCode == null){\r\n cont='';\r\n }\r\n else{\r\n cont = cws_correctUrl(cont);\r\n if (cws_filterScript)\r\n cont=cws_FilterScript(cont);\r\n }\r\n document.getElementById(hiddenid).value = cont;\r\n}\r\n\r\nfunction cws_PasteData()\r\n{\r\n var regExp;\r\n cont = IframeID.document.body.innerHTML;\r\n regExp = /<[s|t][a-z]([^>]*)>/ig\r\n cont = cont.replace(regExp, '');\r\n regExp = /<\\/[s|t][a-z]([^>]*)>/ig\r\n cont = cont.replace(regExp, '');\r\n IframeID.document.body.innerHTML = cont\r\n}\r\n//-------------------------------------\r\nfunction ctlent(eventobject)\r\n{\r\n if(event.ctrlKey && event.keyCode==13)\r\n {\r\n this.document.Dvform.submit();\r\n }\r\n}\r\n\r\nfunction putEmot(thenNo)\r\n{\r\n var ToAdd = '['+thenNo+']';\r\n IframeID.document.body.innerHTML+=ToAdd;\r\n IframeID.focus();\r\n}\r\nfunction gopreview()\r\n{\r\ndocument.preview.Dvtitle.value=document.Dvform.topic.value;\r\ndocument.preview.theBody.value=IframeID.document.body.innerHTML;\r\nvar popupWin = window.open('', 'preview_page', 'scrollbars=yes,width=750,height=450');\r\ndocument.preview.submit()\r\n}\r\n\r\n//--------------------------------------------------------------------------------\r\nfunction cws_foreColor()\r\n{\r\n if (!cws_validateMode()) return;\r\n if (cws_bIsIE5){\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/selcolor.jsp\", \"\", \"dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0\");\r\n if (arr != null) FormatText('forecolor', arr);\r\n else IframeID.focus();\r\n }else{\r\n FormatText('forecolor', '');\r\n // var arr = openEditScript(editorRootPath + \"/editor_full/images/nc_selcolor.htm\",250,150);\r\n }\r\n}\r\n\r\nfunction cws_backColor()\r\n{\r\n if (!cws_validateMode()) return;\r\n if (cws_bIsIE5)\r\n {\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/selcolor.jsp\", \"\", \"dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0\");\r\n if (arr != null) FormatText('backcolor', arr);\r\n else IframeID.focus();\r\n }else{\r\n FormatText('backcolor', '');\r\n }\r\n}\r\n\r\nfunction cws_correctUrl(cont)\r\n{\r\n var regExp;\r\n var url=location.href.substring(0,location.href.lastIndexOf(\"/\")+1);\r\n cont=cws_rCode(cont,location.href+\"#\",\"#\");\r\n cont=cws_rCode(cont,url,\"\");\r\n cont=cws_rCode(cont,\"<a>\u3000</a>\",\"\");\r\n //regExp = /<a.*href=\\\"(.*)\\\"[^>]*>/gi;\r\n //\u5c06\u8fde\u63a5\u52a0\u4e0ablank\u6807\u8bb0\r\n //regExp = /<(a[^>]*) href=([^ |>]*)([^>]*)/gi\r\n //cont = cont.replace(regExp, \"<$1 href=$2 target=\\\"_blank\\\" \") ;\r\n //regExp = /<([^>]*)/gi //\u8f6c\u6362\u4e3a\u5c0f\u5199htm\r\n //cont = cont.replace(regExp, function($1){return $1.toLowerCase()})\r\n return cont;\r\n}\r\n\r\n\r\nfunction cws_cleanHtml()\r\n{\r\n if (cws_bIsIE5){\r\n var fonts = IframeID.document.body.all.tags(\"FONT\");\r\n }else{\r\n var fonts = IframeID.document.getElementsByTagName(\"FONT\");\r\n }\r\n var curr;\r\n for (var i = fonts.length - 1; i >= 0; i--) {\r\n curr = fonts[i];\r\n if (curr.style.backgroundColor == \"#ffffff\") curr.outerHTML = curr.innerHTML;\r\n }\r\n}\r\n\r\nfunction cws_getPureHtml()\r\n{\r\n var str = \"\";\r\n //var paras = IframeID.document.body.all.tags(\"P\");\r\n //var paras = IframeID.document.getElementsByTagName(\"p\");\r\n //if (paras.length > 0){\r\n //for (var i=paras.length-1; i >= 0; i--) str= paras[i].innerHTML + \"\\n\" + str;\r\n //} else {\r\n str = IframeID.document.body.innerHTML;\r\n //}\r\n str=cws_correctUrl(str);\r\n return str;\r\n}\r\n\r\nfunction FormatUrl(html)\r\n{\r\n var regExp = /<a.*href=\\\"(.*)\\\"[^>]*>/gi;\r\n html = html.replace(regExp,\"<a href=$1 target=\\\"_blank\\\" >\")\r\n return html;\r\n}\r\n\r\n\r\nfunction cws_getEl(sTag,start)\r\n{\r\n while ((start!=null) && (start.tagName!=sTag)) start = start.parentElement;\r\n return start;\r\n}\r\n\r\n//\u9009\u62e9\u5185\u5bb9\u66ff\u6362\u6587\u672c\r\nfunction cws_InsertSymbol(str1)\r\n{\r\n IframeID.focus();\r\n if (cws_bIsIE5){\r\n cws_selectRange();\r\n cws_edit.pasteHTML(str1);\r\n }\r\n else {\r\n IframeID.document.body.innerHTML = IframeID.document.body.innerHTML + str1; \r\n } \r\n}\r\n\r\n//\u9009\u62e9\u4e8b\u4ef6\r\nfunction cws_selectRange(){\r\n cws_selection = IframeID.document.selection;\r\n cws_edit = cws_selection.createRange();\r\n cws_RangeType = cws_selection.type;\r\n}\r\n\r\n//\u5e94\u7528html\r\nfunction cws_specialtype(Mark1, Mark2){\r\n var strHTML;\r\n if (cws_bIsIE5){\r\n cws_selectRange();\r\n if (cws_RangeType == \"Text\"){\r\n if (Mark2==null)\r\n {\r\n strHTML = \"<\" + Mark1 + \">\" + cws_edit.htmlText + \"</\" + Mark1 + \">\"; \r\n }else{\r\n strHTML = Mark1 + cws_edit.htmlText + Mark2; \r\n }\r\n cws_edit.pasteHTML(strHTML);\r\n IframeID.focus();\r\n cws_edit.select();\r\n }\r\n else{window.alert(\"\u8bf7\u9009\u62e9\u76f8\u5e94\u5185\u5bb9\uff01\")} \r\n }\r\n else{\r\n if (Mark2==null)\r\n {\r\n strHTML = \"<\" + Mark1 + \">\" + IframeID.document.body.innerHTML + \"</\" + Mark1 + \">\"; \r\n }else{\r\n strHTML = Mark1 + IframeID.document.body.innerHTML + Mark2; \r\n }\r\n IframeID.document.body.innerHTML=strHTML\r\n IframeID.focus();\r\n }\r\n}\r\n\r\n// \u4fee\u6539\u7f16\u8f91\u680f\u9ad8\u5ea6\r\nfunction cws_Size(num)\r\n{\r\n var obj=document.getElementById(\"cws_edit\");\r\n //if (parseInt(obj.style.height)+num>=300) {\r\n //alert(obj.style.height)\r\n //obj.style.height = (parseInt(obj.style.height) + num);\r\n if (num>0){\r\n obj.style.height=num+\"px\";\r\n obj.style.width=\"100%\";\r\n }\r\n else{\r\n obj.style.height=\"\";\r\n //alert(-num+\"px\");\r\n obj.style.width=-num+\"px\";\r\n }\r\n}\r\n\r\nfunction cws_getText()\r\n{\r\n if (cws_bTextMode==2)\r\n return IframeID.document.body.innerText;\r\n else\r\n {\r\n cws_cleanHtml();\r\n return IframeID.document.body.innerHTML;\r\n }\r\n}\r\n\r\nfunction cws_putText(v)\r\n{\r\n if (cws_bTextMode==2)\r\n IframeID.document.body.innerText = v;\r\n else\r\n IframeID.document.body.innerHTML = v;\r\n}\r\nfunction cws_doSelectClick(str, el)\r\n{\r\n var Index = el.selectedIndex;\r\n if (Index != 0){\r\n el.selectedIndex = 0;\r\n FormatText(str,el.options[Index].value);\r\n }\r\n}\r\n//\u67e5\u627e\u914d\u5bf9\u5b57\u7b26\u51fa\u73b0\u6b21\u6570,\u6ca1\u6709\u7ed3\u679c\u4e3a0\r\nfunction TabCheck(word,str){\r\n var tp=0\r\n chktp=str.search(word);\r\n if (chktp!=-1)\r\n {\r\n eval(\"var tp=\\\"\"+str+\"\\\".match(\"+word+\").length\")\r\n }\r\n return tp;\r\n}\r\n\r\nfunction cws_help()\r\n{\r\n showModalDialog(editorRootPath + \"/editor_full/images/help.html\", \"\", \"dialogWidth:13.5em; dialogHeight:12.5em; status:0; help:0\");\r\n}\r\n\r\nfunction openEditScript(url, width, height){\r\n var Win = window.open(url,\"openEditScript\",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );\r\n}\r\n\r\nfunction cws_View()\r\n{\r\n if (cws_bTextMode==2) {\r\n cont=IframeID.document.body.innerText;\r\n } else {\r\n cont=IframeID.document.body.innerHTML;\r\n }\r\n cont=cws_correctUrl(cont);\r\n bodyTag=\"<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\\nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}\\nbody{boder:0px}</style></head><BODY bgcolor=\\\"#FFFFFF\\\" >\";\r\n if (cws_filterScript)\r\n cont=cws_FilterScript(cont);\r\n cont=cws_rCode(cont,\"\\\\[dvnews_ad]\",\"<img src='images/images/pic_ad.jpg' vspace=10 hspace=10 align=left border=1 title='Advertising'>\");\r\n cont=cws_rCode(cont,\"\\\\[dvnews_page]\",\"<br><br><hr size=2 width=95% align=left> <font color=red face='Tahoma,Arail' size=2><b>Next Page ...</b></font><br><hr size=2 width=95% align=left>\");\r\n preWin=window.open('preview','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0');\r\n preWin.document.open();\r\n preWin.document.write(bodyTag);\r\n preWin.document.write(cont);\r\n preWin.document.close();\r\n preWin.document.title=\"Preview\";\r\n preWin.document.charset=cws_charset;\r\n}\r\n\r\n//Colour pallete top offset\r\nfunction getOffsetTop(elm) {\r\n var mOffsetTop = elm.offsetTop;\r\n var mOffsetParent = elm.offsetParent;\r\n while(mOffsetParent){\r\n mOffsetTop += mOffsetParent.offsetTop;\r\n mOffsetParent = mOffsetParent.offsetParent;\r\n }\r\n return mOffsetTop;\r\n}\r\n\r\n//Colour pallete left offset\r\nfunction getOffsetLeft(elm) {\r\n var mOffsetLeft = elm.offsetLeft;\r\n var mOffsetParent = elm.offsetParent;\r\n while(mOffsetParent) {\r\n mOffsetLeft += mOffsetParent.offsetLeft;\r\n mOffsetParent = mOffsetParent.offsetParent;\r\n }\r\n return mOffsetLeft;\r\n}\r\n\r\n//Function to hide colour pallete\r\nfunction hideColourPallete() {\r\n document.getElementById(\"colourPalette\").style.visibility=\"hidden\";\r\n}\r\n\r\n\r\n//------------------------------------------------------\r\nfunction OpenSmiley()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/smiley.htm\", \"\", \"dialogWidth:60em; dialogHeight:15.5em; status:0; help:0\");\r\n if (arr != null){\r\n var ss;\r\n ss=arr.split(\"*\")\r\n path=ss[0];\r\n ubbstring=ss[1];\r\n IframeID.document.body.innerHTML+=ubbstring;\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\nfunction cws_forswf()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/swf.jsp\", \"\", \"dialogWidth:30em; dialogHeight:10em; status:0; help:0\");\r\n if (arr != null){\r\n var ss;\r\n ss=arr.split(\"*\")\r\n path=ss[0];\r\n row=ss[1];\r\n col=ss[2];\r\n var string;\r\n string=\"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width=\"+row+\" height=\"+col+\"><param name=movie value=\"+path+\"><param name=quality value=high><embed src=\"+path+\" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=\"+row+\" height=\"+col+\"></embed></object>\"\r\n //string=\"[flash=\"+row+\",\"+col+\"]\"+path+\"[/flash]\"\r\n IframeID.document.body.innerHTML+=string;\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\nfunction rand() {\r\n return parseInt((1000)*Math.random()+1);\r\n}\r\n\r\nfunction cws_forwmv()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/wmv.jsp\", \"\", \"dialogWidth:30em; dialogHeight:14em; status:0; help:0\");\r\n \r\n if (arr != null){\r\n var ss;\r\n ss=arr.split(\"*\")\r\n path=ss[0];\r\n autostart=ss[1];\r\n width=ss[2];\r\n height=ss[3];\r\n ran=rand();\r\n var string;\r\n var ubbstring;\r\n string=\"<object align=center classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 hspace=5 vspace=5 width=\"+ width +\" height=\"+ height +\"><param name=Filename value=\"+ path +\"><param name=ShowStatusBar value=1><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=\"+ path +\" width=\"+ width +\" height=\"+ height +\"></embed></object>\";\r\n string=\"<EMBED id=MediaPlayer\"+ran+\" src=\"+ path +\" width=\"+ width +\" height=\"+ height +\" autostart=\\\"\"+ autostart +\"\\\" loop=\\\"false\\\"></EMBED><p></p>\";\r\n //string=\"[MP=\"+ width +\",\"+ height +\",\"+ autostart +\"]\"+ path +\"[/MP]\";\r\n IframeID.document.body.innerHTML+=string;\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\nfunction cws_forrm()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/rm.jsp\", \"\", \"dialogWidth:30em; dialogHeight:14em; status:0; help:0\");\r\n \r\n if (arr != null)\r\n {\r\n var ss;\r\n ss = arr.split(\"*\")\r\n path = ss[0];\r\n row = ss[1];\r\n col = ss[2];\r\n autostart = ss[3];\r\n ran = rand();\r\n var string;\r\n string=\"<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='\"+row+\"' height='\"+col+\"'><param name='CONTROLS' value='ImageWindow'><param name='CONSOLE' value='Clip'><param name='AUTOSTART' value='\"+ autostart +\"'><param name=src value=\"+path+\"></object><br><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width=\"+row+\" height=32><param name='CONTROLS' value='ControlPanel,StatusBar'><param name='CONSOLE' value='Clip'></object>\";\r\n //string = \"[RM=\"+ row +\",\"+ col +\",\"+ autostart +\"]\"+ path +\"[/RM]\";\r\n IframeID.document.body.innerHTML+=string;\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\n//\u56fe\u7247\u4e0e\u94fe\u63a5\u4e8b\u4ef6\r\nfunction cws_UserDialog(what)\r\n{\r\n if (!cws_validateMode()) return;\r\n IframeID.focus();\r\n if (what == \"CreateLink\") {\r\n if (cws_bIsNC)\r\n {\r\n insertLink = prompt(\"\u8bf7\u586b\u5199\u8d85\u7ea7\u94fe\u63a5\u5730\u5740\u4fe1\u606f\uff1a\", \"http://\"); \r\n if ((insertLink != null) && (insertLink != \"\") && (insertLink != \"undefined\")) {\r\n IframeID.document.execCommand('CreateLink', false, insertLink);\r\n }else{\r\n IframeID.document.execCommand('unlink', false, null);\r\n }\r\n }\r\n else {\r\n IframeID.document.execCommand(what, true, null);\r\n }\r\n }\r\n //\u53bb\u6389\u6dfb\u52a0\u56fe\u7247\u65f6\u7684src=\"file://\r\n if(what == \"InsertImage\"){\r\n imagePath = prompt('\u8bf7\u586b\u5199\u56fe\u7247\u94fe\u63a5\u5730\u5740\u4fe1\u606f\uff1a', 'http://'); \r\n if ((imagePath != null) && (imagePath != \"\")) {\r\n IframeID.document.execCommand('InsertImage', false, imagePath);\r\n }\r\n IframeID.document.body.innerHTML = (IframeID.document.body.innerHTML).replace(\"src=\\\"file://\",\"src=\\\"\");\r\n }\r\n cws_pureText = false;\r\n IframeID.focus();\r\n}\r\n\r\n//--------------------\r\nfunction cws_GetRangeReference(editor)\r\n{\r\n editor.focus();\r\n var objReference = null;\r\n var RangeType = editor.document.selection.type;\r\n var selectedRange = editor.document.selection.createRange();\r\n \r\n switch(RangeType)\r\n {\r\n case 'Control' :\r\n if (selectedRange.length > 0 ) \r\n {\r\n objReference = selectedRange.item(0);\r\n }\r\n break;\r\n case 'None' :\r\n objReference = selectedRange.parentElement();\r\n break;\r\n case 'Text' :\r\n objReference = selectedRange.parentElement();\r\n break;\r\n }\r\n return objReference\r\n}\r\n\r\nfunction cws_CheckTag(item,tagName)\r\n{\r\n if (item.tagName.search(tagName)!= -1)\r\n {\r\n return item;\r\n }\r\n if (item.tagName == 'BODY')\r\n {\r\n return false;\r\n }\r\n item=item.parentElement;\r\n return cws_CheckTag(item,tagName);\r\n}\r\n\r\nfunction cws_code(){\r\n cws_specialtype(\"[code]\",\"[/code]\"); \r\n}\r\n\r\nfunction cws_quote(){\r\n cws_specialtype(\"<div style='margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3'>\",\"</div>\");\r\n}\r\n\r\nfunction cws_replace(){\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/replace.jsp\", \"\", \"dialogWidth:16.5em; dialogHeight:13em; status:0; help:0\");\r\n if (arr != null){\r\n var ss;\r\n ss = arr.split(\"*\")\r\n a = ss[0];\r\n b = ss[1];\r\n i = ss[2];\r\n con = IframeID.document.body.innerHTML;\r\n if (i == 1)\r\n {\r\n con = cws_rCode(con,a,b,true);\r\n }else{\r\n con = cws_rCode(con,a,b);\r\n }\r\n IframeID.document.body.innerHTML = con;\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\nfunction insertSpecialChar()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/specialchar.jsp\", \"\",\"dialogWidth:25em; dialogHeight:15em; status:0; help:0\");\r\n if (arr != null) cws_InsertSymbol(arr);\r\n IframeID.focus() ;\r\n}\r\n\r\nfunction doZoom( sizeCombo ) \r\n{\r\n if (sizeCombo.value != null || sizeCombo.value != \"\")\r\n if (cws_bIsIE5){\r\n var z = IframeID.document.body.runtimeStyle;}\r\n else{\r\n var z = IframeID.document.body.style;\r\n }\r\n z.zoom = sizeCombo.value + \"%\" ;\r\n}\r\n//--------------------\r\n\r\nfunction cws_fortable()\r\n{\r\n if (!cws_validateMode()) return;\r\n IframeID.focus();\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/table.jsp\", window, \"dialogWidth:22em; dialogHeight:18.5em; status:0; help:0;scroll:no;\");\r\n if (arr)\r\n {\r\n IframeID.document.body.innerHTML+=arr;\r\n }\r\n IframeID.focus();\r\n}\r\n\r\nfunction cws_InsertRow()\r\n{\r\n editor = IframeID;\r\n objReference = cws_GetRangeReference(editor);\r\n objReference = cws_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');\r\n switch(objReference.tagName)\r\n {\r\n case 'TABLE' :\r\n var newTable = objReference.cloneNode(true);\r\n var newRow = newTable.insertRow();\r\n for(x = 0; x<newTable.rows[0].cells.length; x++)\r\n {\r\n var newCell = newRow.insertCell();\r\n }\r\n objReference.outerHTML = newTable.outerHTML;\r\n break;\r\n case 'TBODY' :\r\n var newTable = objReference.cloneNode(true);\r\n var newRow = newTable.insertRow();\r\n for(x = 0; x<newTable.rows[0].cells.length; x++)\r\n {\r\n var newCell = newRow.insertCell();\r\n }\r\n objReference.outerHTML=newTable.outerHTML;\r\n break;\r\n case 'TR' :\r\n var rowIndex = objReference.rowIndex;\r\n var parentTable = objReference.parentElement.parentElement;\r\n var newTable = parentTable.cloneNode(true);\r\n var newRow = newTable.insertRow(rowIndex+1);\r\n for(x = 0; x< newTable.rows[0].cells.length; x++)\r\n {\r\n var newCell = newRow.insertCell();\r\n }\r\n parentTable.outerHTML = newTable.outerHTML;\r\n break;\r\n case 'TD' :\r\n var parentRow = objReference.parentElement;\r\n var rowIndex = parentRow.rowIndex;\r\n var cellIndex = objReference.cellIndex;\r\n var parentTable = objReference.parentElement.parentElement.parentElement;\r\n var newTable = parentTable.cloneNode(true);\r\n var newRow = newTable.insertRow(rowIndex+1);\r\n for(x = 0; x< newTable.rows[0].cells.length; x++)\r\n {\r\n var newCell = newRow.insertCell();\r\n if (x == cellIndex)newCell.id='ura';\r\n }\r\n parentTable.outerHTML = newTable.outerHTML;\r\n var r = editor.document.body.createTextRange();\r\n var item = editor.document.getElementById('ura');\r\n item.id = '';\r\n r.moveToElementText(item);\r\n r.moveStart('character',r.text.length);\r\n r.select();\r\n break;\r\n default :\r\n return;\r\n }\r\n}\r\n\r\nfunction cws_DeleteRow()\r\n{\r\n editor=IframeID;\r\n objReference=cws_GetRangeReference(editor);\r\n objReference=cws_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');\r\n switch(objReference.tagName)\r\n {\r\n case 'TR' :var rowIndex = objReference.rowIndex;//Get rowIndex\r\n var parentTable=objReference.parentElement.parentElement;\r\n parentTable.deleteRow(rowIndex);\r\n break;\r\n case 'TD' :var cellIndex=objReference.cellIndex;\r\n var parentRow=objReference.parentElement;//Get Parent Row\r\n var rowIndex = parentRow.rowIndex;//Get rowIndex\r\n var parentTable=objReference.parentElement.parentElement.parentElement;\r\n parentTable.deleteRow(rowIndex);\r\n if (rowIndex>=parentTable.rows.length)\r\n {\r\n rowIndex=parentTable.rows.length-1;\r\n }\r\n if (rowIndex>=0)\r\n {\r\n var r = editor.document.body.createTextRange();\r\n r.moveToElementText(parentTable.rows[rowIndex].cells[cellIndex]);\r\n r.moveStart('character',r.text.length);\r\n r.select();\r\n }\r\n else\r\n {\r\n parentTable.removeNode(true);\r\n }\r\n break;\r\n default :return;\r\n }\r\n}\r\n\r\nfunction cws_InsertColumn()\r\n{\r\n editor = IframeID;\r\n objReference= cws_GetRangeReference(editor);\r\n objReference=cws_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');\r\n switch(objReference.tagName)\r\n {\r\n case 'TABLE' :// IF a table is selected, it adds a new column on the right hand side of the table.\r\n var newTable=objReference.cloneNode(true);\r\n for(x=0; x<newTable.rows.length; x++)\r\n {\r\n var newCell = newTable.rows[x].insertCell();\r\n }\r\n newCell.focus();\r\n objReference.outerHTML=newTable.outerHTML;\r\n break;\r\n case 'TBODY' :// IF a table is selected, it adds a new column on the right hand side of the table.\r\n var newTable=objReference.cloneNode(true);\r\n for(x=0; x<newTable.rows.length; x++)\r\n {\r\n var newCell = newTable.rows[x].insertCell();\r\n }\r\n objReference.outerHTML=newTable.outerHTML;\r\n break;\r\n case 'TR' :// IF a table is selected, it adds a new column on the right hand side of the table.\r\n objReference=objReference.parentElement.parentElement;\r\n var newTable=objReference.cloneNode(true);\r\n for(x=0; x<newTable.rows.length; x++)\r\n {\r\n var newCell = newTable.rows[x].insertCell();\r\n }\r\n objReference.outerHTML=newTable.outerHTML;\r\n break;\r\n case 'TD' :// IF the cursor is in a cell, or a cell is selected, it adds a new column to the right of that cell.\r\n var cellIndex = objReference.cellIndex;//Get cellIndex\r\n var rowIndex=objReference.parentElement.rowIndex;\r\n var parentTable=objReference.parentElement.parentElement.parentElement;\r\n var newTable=parentTable.cloneNode(true);\r\n for(x=0; x<newTable.rows.length; x++)\r\n {\r\n var newCell = newTable.rows[x].insertCell(cellIndex+1);\r\n if (x==rowIndex)newCell.id='ura';\r\n }\r\n parentTable.outerHTML=newTable.outerHTML;\r\n var r = editor.document.body.createTextRange();\r\n var item=editor.document.getElementById('ura');\r\n item.id='';\r\n r.moveToElementText(item);\r\n r.moveStart('character',r.text.length);\r\n r.select();\r\n break;\r\n default :\r\n return;\r\n }\r\n}\r\n\r\nfunction cws_DeleteColumn()\r\n{\r\n editor = IframeID;\r\n objReference=cws_GetRangeReference(editor);\r\n objReference=cws_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');\r\n switch(objReference.tagName)\r\n {\r\n \r\n case 'TD' :var rowIndex=objReference.parentElement.rowIndex;\r\n var cellIndex = objReference.cellIndex;//Get cellIndex\r\n var parentTable=objReference.parentElement.parentElement.parentElement;\r\n var newTable=parentTable.cloneNode(true);\r\n if (newTable.rows[0].cells.length==1)\r\n {\r\n parentTable.removeNode(true);\r\n return;\r\n }\r\n for(x=0; x<newTable.rows.length; x++)\r\n {\r\n if (newTable.rows[x].cells[cellIndex]=='[object]')\r\n {\r\n newTable.rows[x].deleteCell(cellIndex);\r\n }\r\n }\r\n if (cellIndex>=newTable.rows[0].cells.length)\r\n {\r\n cellIndex=newTable.rows[0].cells.length-1;\r\n }\r\n if (cellIndex>=0) newTable.rows[rowIndex].cells[cellIndex].id='ura';\r\n parentTable.outerHTML=newTable.outerHTML;\r\n if (cellIndex>=0){\r\n var r = editor.document.body.createTextRange();\r\n var item=editor.document.getElementById('ura');\r\n item.id='';\r\n r.moveToElementText(item);\r\n r.moveStart('character',r.text.length);\r\n r.select();\r\n }\r\n break;\r\n default :return;\r\n }\r\n}\r\n\r\nfunction cws_foremot()\r\n{\r\n var arr = showModalDialog(editorRootPath + \"/editor_full/images/emot.jsp\", \"\", \"dialogWidth:26em; dialogHeight:13em; status:0; help:0\");\r\n \r\n if (arr != null)\r\n {\r\n //content=cws_Composition.document.body.innerHTML;\r\n //content=content+arr;\r\n //cws_Composition.document.body.innerHTML=content;\r\n cws_InsertSymbol(arr);\r\n IframeID.focus();\r\n }\r\n else IframeID.focus();\r\n}\r\n\r\n".toCharArray();
_jsp_string1 = "\r\n\r\nfunction IsWebedit() {\r\n".toCharArray();
_jsp_string2 = "\r\n}\r\n\r\nfunction cws_forimg()\r\n{\r\nif (cws_bIsIE5){ \r\n var arr=showModalDialog(editorRootPath + \"/editor_full/images/img.jsp?isWebedit=".toCharArray();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -