原阿塞的,经过优化了
edit.js
//需要的基础变量
var AsaiEdit;
var edit;
var RangeType;
var selection;
var filterScript = false;
var charset="gb2312";
var bLoad=false;
var pureText=true;
var bTextMode=1;
var colour;
//这里是编辑器css的样式
window.onload=function()
{
content=document.getElementById(""+an+"").value;
IFrame.document.body.innerHTML=content;
document.getElementById(""+an+"").value="";
}
document.write("");
//段落样式
function FontHBsty(asty)
{
if(asty==1)
{specialtype("
"," ");}
else if(asty==2)
{specialtype(""," ");}
else if(asty==3)
{specialtype(""," ");}
else if(asty==4)
{specialtype(""," ");}
else if(asty==5)
{specialtype(""," ");}
else if(asty==6)
{specialtype(""," ");}
else if(asty==7)
{specialtype(""," ");}
else if(asty==8)
{specialtype("","
");}
else if(asty==9)
{specialtype(""," ");}
else if(asty==10)
{specialtype(""," ");}
else if(asty==11)
{specialtype(""," ");}
else if(asty==12)
{specialtype(""," ");}
else if(asty==13)
{specialtype(""," ");}
else if(asty==21)
{specialtype(""," ");}
else if(asty==22)
{specialtype(""," ");}
else if(asty==23)
{specialtype(""," ");}
else if(asty==24)
{specialtype("","
");}
else if(asty==25)
{specialtype(""," ");}
else if(asty==26)
{specialtype(""," ");}
else if(asty==27)
{specialtype(""," ");}
else if(asty==28)
{specialtype(""," ");}
else if(asty==29)
{specialtype(""," ");}
else if(asty==30)
{specialtype(""," ");}
else if(asty==31)
{specialtype(""," ");}
else if(asty==32)
{specialtype(""," ");}
else if(asty==33)
{specialtype(""," ");}
else if(asty==91)
{specialtype("","
");}
else if(asty==92)
{specialtype("","
");}
else if(asty==93)
{specialtype("");}
}
//字体大小
function FontHsize(asty)
{
if(asty>7)
{specialtype(""," ");}
else
{specialtype(""," ");}
}
//字体颜色
function foreColor()
{
if (!validateMode()) return;
if (bIsIE5)
{
var arr = showModalDialog(""+Sm+""+Se+"meun/selcolor.htm", "", "dialogWidth:299px; dialogHeight:300px; status:0; help:0");
if (arr != null) FormatText('forecolor', arr);
else IFrame.focus();
}
else
{FormatText('forecolor', '');}
}
//字体背景
function backColor()
{
if (!validateMode()) return;
if (bIsIE5)
{
var arr = showModalDialog(""+Sm+""+Se+"meun/selcolor.htm", "", "dialogWidth:299px; dialogHeight:300px; status:0; help:0");
if (arr != null) FormatText('backcolor', arr);
else IFrame.focus();
}
else
{FormatText('backcolor', '');}
}
// 粘贴纯文本
function PasteText()
{
if (!validateMode()) return;
IFrame.focus();
var sText = HTMLEncode(clipboardData.getData("TEXT"));
IFrame.document.body.innerHTML+=sText;
IFrame.focus();
}
// HTMLEncode文本格式化
function HTMLEncode(text)
{
text = text.replace(/&/g, "&") ;
text = text.replace(/"/g, """) ;
text = text.replace(/
text = text.replace(/>/g, ">") ;
text = text.replace(/'/g, "") ;
text = text.replace(/\ /g," ");
text = text.replace(/\n/g," ");
text = text.replace(/\t/g," ");
return text;
}
//FLASH
function forswf()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/swf.htm", "", "dialogWidth:345px; dialogHeight:220px; status:0; help:0");
if (arr != null)
{
var ss;
ss=arr.split("*")
path=ss[0];
row=ss[1];
col=ss[2];
var string;
string=" "
IFrame.document.body.innerHTML+=string;
}
else IFrame.focus();
}
//wmv
function forwmv()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/wmv.htm", "", "dialogWidth:345px; dialogHeight:234px; status:0; help:0");
if (arr != null)
{
var ss;
ss=arr.split("*")
path=ss[0];
autostart=ss[1];
width=ss[2];
height=ss[3];
ran=rand();
var string;
var ubbstring;
string=" ";
string="
";
IFrame.document.body.innerHTML+=string;
}
else IFrame.focus();
}
//rm
function forrm()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/rm.htm", "", "dialogWidth:345px; dialogHeight:234px; status:0; help:0");
if (arr != null)
{
var ss;
ss = arr.split("*")
path = ss[0];
row = ss[1];
col = ss[2];
autostart = ss[3];
ran = rand();
var string;
string=" ";
IFrame.document.body.innerHTML+=string;
}
else IFrame.focus();
}
//emot表情
function foremot()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/emot.htm", "", "dialogWidth:480px; dialogHeight:480px; status:0; help:0");
if (arr != null)
{InsertSymbol(arr);IFrame.focus();}
else IFrame.focus();
}
//link
function forlink()
{
if (bIsIE5)
{
var arr=showModalDialog(""+Sm+""+Se+"meun/link.htm","","dialogWidth:24em;dialogHeight:12em;status:0;help:0");
IFrame.focus();
if (arr != null)
{InsertSymbol(arr);IFrame.focus();}
else IFrame.focus();
}
else
{UserDialog('CreateLink');}
}
//关于我们
function about()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/about.htm", window, "dialogWidth:555px; dialogHeight:282px; status:0; help:0");
if (arr)
{IFrame.document.body.innerHTML+=arr;}
IFrame.focus();
}
//查找替换
function replace()
{
var arr=showModalDialog(""+Sm+""+Se+"meun/replace.htm","","dialogWidth:300px;dialogHeight:180px;status:0;help:0");
if (arr != null)
{
var ss;
ss = arr.split("*")
a = ss[0];
b = ss[1];
i = ss[2];
con = IFrame.document.body.innerHTML;
if (i == 1)
{con = rCode(con,a,b,true);}
else
{con = rCode(con,a,b);}
IFrame.document.body.innerHTML = con;
}
else IFrame.focus();
}
//插入图片
function Img()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/img.htm", window, "dialogWidth:345px; dialogHeight:345px; status:0; help:0");
if (arr != null)
{
var ss;
ss=arr.split("*")
a=ss[0];//地址.
b=ss[1];//alt.
c=ss[2];//提示
d=ss[3];//效果.
e=ss[4];//位置.
f=ss[5];//长.
g=ss[6];//宽.
h=ss[7];//上下.
i=ss[8];//左右.
j=ss[9];//边框.
k=ss[10];//颜色.
var strpic;
strpic=""
if(e.value!="")strpic=strpic+""
strpic=strpic+"
strpic=strpic+" style='"
if(h.value!='')strpic=strpic+"padding-top:"+h+"px;padding-bottom:"+h+"px;"
if(i.value!='')strpic=strpic+"padding-top:"+i+"px;padding-bottom:"+i+"px;"
if(j.value!='')strpic=strpic+"border:"+j+"px "+k+" solid;"
if(f.value!='')strpic=strpic+"width:"+f+"px;"
if(g.value!='')strpic=strpic+"height:"+g+"px;"
if(d.value!='')strpic=strpic+""+d+";"
strpic=strpic+"'"
if(b.value!="")strpic=strpic+" alt='"+b+"' "
strpic=strpic+">"
if(c.value!="")strpic=strpic+" "+c+""
if(e.value!="")strpic=strpic+"
"
//IFrame.document.body.innerHTML+=strpic; //插入的图片在尾部,以下的插入图片插入在光标位置
if (arr != null)
{InsertSymbol(strpic);IFrame.focus();}
else IFrame.focus();
}
IFrame.focus();
}
//插入特殊符号
function insertSpecialChar()
{
var arr = showModalDialog(""+Sm+""+Se+"meun/specialchar.htm", "","dialogWidth:600px; dialogHeight:444px; status:0; help:0");
if (arr != null) InsertSymbol(arr);
IFrame.focus() ;
}
//插入表格
function fortable()
{
if (!validateMode()) return;
IFrame.focus();
var arr = showModalDialog(""+Sm+""+Se+"meun/table.htm", window, "dialogWidth:345px; dialogHeight:234px; status:0; help:0;scroll:no;");
if (arr)
{IFrame.document.body.innerHTML+=arr;}
IFrame.focus();
}
//修改表格、插入列+行等 begin
function InsertRow()
{
editor = IFrame;
objReference = GetRangeReference(editor);
objReference = CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');
switch(objReference.tagName)
{
case 'TABLE' :
var newTable = objReference.cloneNode(true);
var newRow = newTable.insertRow();
for(x = 0; x
{var newCell = newRow.insertCell();}
objReference.outerHTML = newTable.outerHTML;
break;
case 'TBODY' :
var newTable = objReference.cloneNode(true);
var newRow = newTable.insertRow();
for(x = 0; x
{var newCell = newRow.insertCell();}
objReference.outerHTML=newTable.outerHTML;
break;
case 'TR' :
var rowIndex = objReference.rowIndex;
var parentTable = objReference.parentElement.parentElement;
var newTable = parentTable.cloneNode(true);
var newRow = newTable.insertRow(rowIndex+1);
for(x = 0; x< newTable.rows[0].cells.length; x++)
{var newCell = newRow.insertCell();}
parentTable.outerHTML = newTable.outerHTML;
break;
case 'TD' :
var parentRow = objReference.parentElement;
var rowIndex = parentRow.rowIndex;
var cellIndex = objReference.cellIndex;
var parentTable = objReference.parentElement.parentElement.parentElement;
var newTable = parentTable.cloneNode(true);
var newRow = newTable.insertRow(rowIndex+1);
for(x = 0; x< newTable.rows[0].cells.length; x++)
{
var newCell = newRow.insertCell();
if (x == cellIndex)newCell.id='ura';
}
parentTable.outerHTML = newTable.outerHTML;
var r = editor.document.body.createTextRange();
var item = editor.document.getElementById('ura');
item.id = '';
r.moveToElementText(item);
r.moveStart('character',r.text.length);
r.select();
break;
default :
return;
}
}
//删除行
function DeleteRow()
{
editor=IFrame;
objReference=GetRangeReference(editor);
objReference=CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');
switch(objReference.tagName)
{
case 'TR' :var rowIndex = objReference.rowIndex;
var parentTable=objReference.parentElement.parentElement;
parentTable.deleteRow(rowIndex);
break;
case 'TD' :var cellIndex=objReference.cellIndex;
var parentRow=objReference.parentElement;
var rowIndex = parentRow.rowIndex;
var parentTable=objReference.parentElement.parentElement.parentElement;
parentTable.deleteRow(rowIndex);
if (rowIndex>=parentTable.rows.length)
{rowIndex=parentTable.rows.length-1;}
if (rowIndex>=0)
{
var r = editor.document.body.createTextRange();
r.moveToElementText(parentTable.rows[rowIndex].cells[cellIndex]);
r.moveStart('character',r.text.length);
r.select();
}
else
{parentTable.removeNode(true);}
break;
default :return;
}
}
//插入列
function InsertColumn()
{
editor = IFrame;
objReference= GetRangeReference(editor);
objReference=CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');
switch(objReference.tagName)
{
case 'TABLE' :
var newTable=objReference.cloneNode(true);
for(x=0; x
{var newCell = newTable.rows[x].insertCell();}
newCell.focus();
objReference.outerHTML=newTable.outerHTML;
break;
case 'TBODY' :
var newTable=objReference.cloneNode(true);
for(x=0; x
{var newCell = newTable.rows[x].insertCell();}
objReference.outerHTML=newTable.outerHTML;
break;
case 'TR' :
objReference=objReference.parentElement.parentElement;
var newTable=objReference.cloneNode(true);
for(x=0; x
{var newCell = newTable.rows[x].insertCell();}
objReference.outerHTML=newTable.outerHTML;
break;
case 'TD' :
var cellIndex = objReference.cellIndex;
var rowIndex=objReference.parentElement.rowIndex;
var parentTable=objReference.parentElement.parentElement.parentElement;
var newTable=parentTable.cloneNode(true);
for(x=0; x
{
var newCell = newTable.rows[x].insertCell(cellIndex+1);
if (x==rowIndex)newCell.id='ura';
}
parentTable.outerHTML=newTable.outerHTML;
var r = editor.document.body.createTextRange();
var item=editor.document.getElementById('ura');
item.id='';
r.moveToElementText(item);
r.moveStart('character',r.text.length);
r.select();
break;
default :
return;
}
}
//删除列
function DeleteColumn()
{
editor = IFrame;
objReference=GetRangeReference(editor);
objReference=CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');
switch(objReference.tagName)
{
case 'TD' :var rowIndex=objReference.parentElement.rowIndex;
var cellIndex = objReference.cellIndex;
var parentTable=objReference.parentElement.parentElement.parentElement;
var newTable=parentTable.cloneNode(true);
if (newTable.rows[0].cells.length==1)
{parentTable.removeNode(true);return;}
for(x=0; x
{
if (newTable.rows[x].cells[cellIndex]=='[object]')
{newTable.rows[x].deleteCell(cellIndex);}
}
if (cellIndex>=newTable.rows[0].cells.length)
{cellIndex=newTable.rows[0].cells.length-1;}
if (cellIndex>=0) newTable.rows[rowIndex].cells[cellIndex].id='ura';
parentTable.outerHTML=newTable.outerHTML;
if (cellIndex>=0)
{
var r = editor.document.body.createTextRange();
var item=editor.document.getElementById('ura');
item.id='';
r.moveToElementText(item);
r.moveStart('character',r.text.length);
r.select();
}
break;
default :return;
}
}
//修改表格、插入列+行等 end
//直接用到的过程 begin
// 插入换行
function InBR()
{
if (!validateMode()) return;
InsertSymbol(' ');
}
// 插入当前时间
function InDATE()
{
if (!validateMode()) return;
InsertSymbol(new Date().toLocaleString()+''.charAt(new Date().getDay()));
}
//清空
function ClearReset()
{IFrame.document.body.innerHTML='';IFrame.focus();}
//增加、减小编辑器大小
function Size(num)
{
var obj=document.getElementById("Composition");
if (parseInt(obj.offsetHeight)+num>=100)
{obj.height = (parseInt(obj.offsetHeight) + num);}
if (num>0)
{obj.width="100%";}
}
//编辑器的设计、预览、源码模式切换
function setMode(n)
{
setStyle();
var cont;
var arsty=document.getElementById("Ar");
switch (n)
{
case 1:
arsty.style.display="";
if (document.getElementById("TabHtml").className=="Aba")
{
if (bIsIE5)
{
cont=IFrame.document.body.innerText;
cont=correctUrl(cont);
if (filterScript)
cont=FilterScript(cont);
IFrame.document.body.innerHTML=" "+cont;
}
else
{
var html = IFrame.document.body.ownerDocument.createRange();
html.selectNodeContents(IFrame.document.body);
IFrame.document.body.innerHTML = html.toString();
}
}
break;
case 2:
arsty.style.display="none";
cleanHtml();
cont=IFrame.document.body.innerHTML;
cont=rCode(IFrame.document.body.innerHTML," ","");
cont=correctUrl(cont);
if (filterScript)
{cont=FilterScript(cont);}
if (bIsIE5)
{IFrame.document.body.innerText=cont;}
else
{
var html=document.createTextNode(cont);
IFrame.document.body.innerHTML = "";
IFrame.document.body.appendChild(html);
}
break;
}
setTab(n);
bTextMode=n
}
//选择后的样式变化
function setTab(n)
{
var mhtml=document.getElementById("TabHtml");
var mdesign=document.getElementById("TabDesign");
if (n==1)
{mhtml.className="Ab";mdesign.className="Aba";}
else if (n==2)
{mhtml.className="Aba";mdesign.className="Ab";}
}
//基本的格式化文本命令
function FormatText(command, option)
{
var codewrite
if (bIsIE5)
{
if (option=="removeFormat")
{command=option;option=null;}
IFrame.focus();
IFrame.document.execCommand(command, false, option);
pureText = false;
IFrame.focus();
}
else
{
if ((command == 'forecolor') || (command == 'backcolor'))
{
parent.command = command;
buttonElement = document.getElementById(command);
IFrame.focus();
document.getElementById("colourPalette").style.left = getOffsetLeft(buttonElement) + "px";
document.getElementById("colourPalette").style.top = (getOffsetTop(buttonElement) + buttonElement.offsetHeight) + "px";
if (document.getElementById("colourPalette").style.visibility=="hidden")
{document.getElementById("colourPalette").style.visibility="visible";}
else
{document.getElementById("colourPalette").style.visibility="hidden";}
var sel = IFrame.document.selection;
if (sel != null)
{colour = sel.createRange();}
}
else
{
IFrame.focus();
IFrame.document.execCommand(command, false, option);
pureText = false;
IFrame.focus();
}
}
}
//清理编辑器内代码
function CleanCode()
{
var editor=IFrame;
editor.focus();
if (bIsIE5)
{
var body = editor.document.body;
for (var index = 0; index < body.all.length; index++)
{
tag = body.all[index];
tag.removeAttribute("className","",0);
tag.removeAttribute("style","",0);
}
var html = editor.document.body.innerHTML;
html = html.replace(/ /g," ");
html = html.replace(/\[\$br\]/gi," ");
editor.document.body.innerHTML = html;
}
else
{
var html = IFrame.document.body.ownerDocument.createRange();
html.selectNodeContents(IFrame.document.body);
IFrame.document.body.innerHTML = html.toString();
}
}
//
function correctUrl(cont)
{
var regExp;
var url=location.href.substring(0,location.href.lastIndexOf("/")+1);
cont=rCode(cont,location.href+"#","#");
cont=rCode(cont,url,"");
cont=rCode(cont," ","");
return cont;
}
//
function cleanHtml()
{
if (bIsIE5)
{var fonts = IFrame.document.body.all.tags("FONT");}
else
{var fonts = IFrame.document.all("FONT");}
var curr;
for (var i = fonts.length - 1; i >= 0; i--)
{curr = fonts[i];if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;}
}
//
function InsertSymbol(str1)
{
IFrame.focus();
if (bIsIE5) selectRange();
edit.pasteHTML(str1);
}
//
function selectRange()
{
selection =IFrame.document.selection;
edit=selection.createRange();
RangeType =selection.type;
}
//编辑器里面插入内容用
function specialtype(Mark1, Mark2)
{
var strHTML;
if (bIsIE5)
{
selectRange();
if (RangeType == "Text")
{
if (Mark2==null)
{strHTML = "<" + Mark1 + ">" + edit.htmlText + "" + Mark1 + ">"; }
else
{strHTML = Mark1 + edit.htmlText + Mark2; }
edit.pasteHTML(strHTML);
IFrame.focus();
edit.select();
}
else
{window.alert("请选择相应内容!")}
}
else
{
if (Mark2==null)
{strHTML="<" + Mark1 + ">" + IFrame.document.body.innerHTML + "" + Mark1 + ">"; }
else
{strHTML = Mark1 + IFrame.document.body.innerHTML + Mark2; }
IFrame.document.body.innerHTML=strHTML
IFrame.focus();
}
}
//
function getText()
{
if (bTextMode==2)
return IFrame.document.body.innerText;
else
{cleanHtml();return IFrame.document.body.innerHTML;}
}
//
function getOffsetTop(elm)
{
var mOffsetTop = elm.offsetTop;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent)
{
mOffsetTop += mOffsetParent.offsetTop;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetTop;
}
//
function getOffsetLeft(elm)
{
var mOffsetLeft = elm.offsetLeft;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent)
{
mOffsetLeft += mOffsetParent.offsetLeft;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetLeft;
}
//
function rand()
{return parseInt((1000)*Math.random()+1);}
//检验连接地址是不是已经输入了
function UserDialog(what)
{
if (!validateMode()) return;
IFrame.focus();
if (what == "CreateLink")
{
if (bIsNC)
{
insertLink = prompt("请填写超级链接地址信息:", "http://");
if ((insertLink != null) && (insertLink != "") && (insertLink != "undefined"))
{IFrame.document.execCommand('CreateLink', false, insertLink);}
else
{IFrame.document.execCommand('unlink', false, null);}
}
else
{IFrame.document.execCommand(what, true, null);}
}
if(what == "InsertImage")
{
imagePath = prompt('请填写图片链接地址信息:', 'http://');
if ((imagePath != null) && (imagePath != ""))
{IFrame.document.execCommand('InsertImage', false, imagePath);}
IFrame.document.body.innerHTML = (IFrame.document.body.innerHTML).replace("src=\"file://","src=\ "");
}
pureText = false;
IFrame.focus();
}
//
function GetRangeReference(editor)
{
editor.focus();
var objReference = null;
var RangeType = editor.document.selection.type;
var selectedRange = editor.document.selection.createRange();
switch(RangeType)
{
case 'Control' :
if (selectedRange.length > 0 )
{objReference = selectedRange.item(0);}
break;
case 'None' :
objReference = selectedRange.parentElement();
break;
case 'Text' :
objReference = selectedRange.parentElement();
break;
}
return objReference
}
//
function CheckTag(item,tagName)
{
if (item.tagName.search(tagName)!= -1)
{return item;}
if (item.tagName == 'BODY')
{return false;}
item=item.parentElement;
return CheckTag(item,tagName);
}
//自动排版
function AutoPB()
{var oBody= IFrame.document.body;}
//超级自动排版
function AsaiPB()
{PasteText();AutoPB();}
//
function rCode(s,a,b,i)
{
a = a.replace("?","\\?");
if (i==null)
{var r = new RegExp(a,"gi");}
else if (i)
{var r = new RegExp(a,"g");}
else
{var r = new RegExp(a,"gi");}
return s.replace(r,b);
}
//编辑器内容check和提交代码 beging
//判断提交时候的状态
function validateMode()
{
if (bTextMode!=2) return true;
alert("请取消查看“源码”状态,调至“设计”状态再行提交,谢谢!");
IFrame.focus();
return false;
}
//编辑器内容预览
function View()
{
if (bTextMode==2)
{cont=IFrame.document.body.innerText;}
else
{cont=IFrame.document.body.innerHTML;}
cont=correctUrl(cont);
bodyTag="
";
if (filterScript)
cont=FilterScript(cont);
preWin=window.open('','','');
preWin.document.open();
preWin.document.write(bodyTag);
preWin.document.write(cont);
preWin.document.close();
preWin.document.title="提示:您正在预览编辑器中的内容......";
preWin.document.charset=charset;
}
//编辑器区域整体样式表现
function InitDocument(hiddenid, charset)
{
if (charset!=null)
charset=charset;
var bodyTag="";
if (navigator.appVersion.indexOf("MSIE 6.0",0)==-1)
{IFrame.document.designMode="On"}
IFrame.document.open();
IFrame.document.write ('');
if (bIsIE5)
{}
IFrame.document.write(bodyTag);
IFrame.document.write("");
IFrame.document.write("");
IFrame.document.close();
IFrame.document.body.contentEditable = "True";
IFrame.document.charset=charset;
bLoad=true;
setStyle();
}
//编辑器区域滚动条样式
function setStyle()
{
var bs = IFrame.document.body.style;
if (bTextMode==2)
{
//bs.fontFamily="Verdana";
bs.fontSize="12px";
}
else
{
//bs.fontFamily="Verdana";
bs.fontSize="12px";
}
bs.scrollbarShadowColor= '#'+sy+'';//立体滚动条阴影的颜色
bs.scrollbar3dLightColor= '#'+by+'';//滚动条亮边的颜色
bs.scrollbarArrowColor= '#'+sy+'';//上下按钮上三角箭头的颜色
bs.scrollbarBaseColor= '#'+by+'';//滚动条的基本颜色
bs.scrollbarDarkShadowColor= '#'+by+'';//滚动条强阴影的颜色
bs.scrollbarFaceColor= '#'+by+'';//滚动条凸出部分的颜色
bs.scrollbarHighlightColor= '#'+sy+'';//滚动条空白部分的颜色
bs.scrollbarTrackColor= '#'+qy+'';//滚动条的背景颜色
bs.border='0';}
//
function submits()
{
var html;
html=getText();
html=rCode(html," ","");
document.getElementById(""+an+"").value=html;
}
//提交验空
function load_content()
{
if(!validateMode())
{return false;}
if(chkdiv("title"))
{
if(form1.title.value=="")
{alert("标题不能不写呀!");form1.title.focus();return false;}
}
document.getElementById(""+an+"").value=IFrame.document.body.innerHTML;
if(IFrame.document.body.innerHTML=="")
{
if(window.confirm('内容不能为空哦'))
{return true;}
else
{IFrame.document.body.focus();return false;}
}
if(chkdiv("CodeStr"))
{
if(form1.CodeStr.value=="")
{alert("验证码还没有填写,请先填写!");form1.CodeStr.focus();return false;}
}
return true;
}
//检测是否有指定的对象
function chkdiv(divid)
{
var chkid=document.getElementById(divid);
if(chkid != null)
{return true;}
else
{return false; }
}
//去掉所有HTML符号检验是否为空值
function ChekEmptyCode(html)
{
html = html.replace(/\<[^>]*>/g,"");
html = html.replace(/ /gi, "");
html = html.replace(/o:/gi, "");
html = html.replace(/\s/gi, "");
return html;
}
//
function getHTML()
{
var html;
if (!bTextMode)
{html = IFrame.document.body.innerHTML}
else
{html = IFrame.document.body.innerText}
return html;
}
//编辑器内容check和提交代码 end
var ONMT='class="as2" onMouseOver="this.className=\'as1\';" onMouseOut="this.className=\'as2\';"'
var ONDR=Sm+Se+'SysImg/'
if(Sk!==5)
{
document.write('');//菜单宽度
if((Sk==0)||(Sk==1)||(Sk==2))
{
document.write('
')
document.write('')
document.write('样式表 普通格式 ')
document.write('标题 1 ')
document.write('标题 2 ')
document.write('标题 3 ')
document.write('标题 4 ')
document.write('标题 5 ')
document.write('标题 6 ')
document.write('标题 7 ')
document.write('段落 ')
document.write('定义 ')
document.write('术语定义 ')
document.write('目录列表 ')
document.write('菜单列表 ')
document.write('已编格式 ')
document.write('模糊文字 ')
document.write('文字加亮 ')
document.write('阴影文字 ')
document.write('图底文字 ')
document.write('文字微缩 ')
document.write('文字左倒 ')
document.write('古书文字 ')
document.write('文字加亮 ')
document.write('光晕 ')
document.write('模糊 ')
document.write('阴影 ')
document.write('透明 ')
document.write('立体 ')
document.write('设为代码 ')
document.write('设为引用 ')
document.write('设为隐藏 ')
document.write(' ')
document.write('')
document.write('字体 ')
document.write('宋体 ')
document.write('黑体 ')
document.write('楷体 ')
document.write('仿宋 ')
document.write('隶书 ')
document.write('幼圆 ')
document.write('新宋体 ')
document.write('细明体 ')
document.write('Arial ')
document.write('Arial Black ')
document.write('Arial Narrow ')
document.write('Bradley Hand ITC ')
document.write('Brush Script MT ')
document.write('Century Gothic ')
document.write('Comic Sans MS ')
document.write('Courier ')
document.write('Courier New ')
document.write('MS Sans Serif ')
document.write('Script ')
document.write('System ')
document.write('Times New Roman ')
document.write('Viner Hand ITC ')
document.write('Verdana ')
document.write('Wide Latin ')
document.write('Wingdings ')
document.write(' ')
document.write('')
document.write('字号 一号 ')
document.write('二号 ')
document.write('三号 ')
document.write('四号 ')
document.write('五号 ')
document.write('六号 ')
document.write('七号 ');
for(i=1;i<29;i++)document.write(""+i+" pt\n")
document.write(' 30 pt ')
document.write('35 pt ')
document.write('40 pt ')
document.write('45 pt ')
document.write('50 pt ')
document.write('60 pt ')
document.write('70 pt ')
document.write('85 pt ')
document.write('100 pt ')
document.write('120 pt ')
document.write('150 pt ')
document.write('200 pt ')
document.write('250 pt ')
document.write('300 pt ')
document.write('500 pt ')
document.write('900 pt ')
document.write('2000 pt ')
document.write('
');
}
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
');
if(Sk!==3)
{
if(Sk!==4)
{
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
')
document.write('
');
if(Sk!==2)
{
document.write('
')
document.write('
')
document.write('
')
document.write('
');
}
}
}
document.write('
');
}
document.write('
');//编辑器框
if(Sk!==4)
{if(Sk!==5)
{
document.write('')
document.write('
设 计<\/div>')
document.write('
预 览<\/div>')
document.write('
源 码<\/div>')
document.write('
清 空<\/div>')
document.write('
╋<\/div>')
document.write('
━<\/div>')
document.write('<\/div>');
}
}
var bIsIE5=document.all;
var canusehtml='1';
var PostType=1;
if (bIsIE5)
{var IFrame=frames["Composition"];}
else
{
var IFrame=document.getElementById("Composition").contentWindow;
var bIsNC=true;
}
if (bLoad==false)
{InitDocument("Body",charset);}