📄 newsedit.asp
字号:
}
}
if(rowarray[ra2][ra3-1]!=ra3+rowarray2[ra2]){
rowarray[ra2][ra3]=ra3+rowarray2[ra2];
}else{
rowarray[ra2][ra3]=555;
}
ra2++;
}
}
var samx="";
var samcount=0;
for(rx1=0;rx1<=myrowcount-1;rx1++){
samcount=rowarray[rx1].length;
for(rx2=0;rx2<=samcount-1;rx2++){
samx+="-"+rowarray[rx1][rx2];
}
samx+="\n";
}
var j=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan);
var jcount=rowarray[rowindex].length;
var jval=0;
for(jc1=0;jc1<=jcount-1;jc1++){
if(rowarray[rowindex][jc1]==cellindex){jval=jc1;}
}
if(xsel.rows[rowindex+j]){
var cellindex2=rowarray[rowindex+j][jval];
var x=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan)+parseInt(xsel.rows[rowindex+j].cells[cellindex2].rowSpan);
var y=xsel.rows[rowindex].cells[cellindex].innerHTML+" "+xsel.rows[rowindex+j].cells[cellindex2].innerHTML;
xsel.rows[rowindex+j].deleteCell(cellindex2);
xsel.rows[rowindex].cells[cellindex].rowSpan=x;
xsel.rows[rowindex].cells[cellindex].innerHTML=y;
}
}else if(command==7){
var getrowspan=parseInt(xsel.rows[rowindex].cells[cellindex].rowSpan);
var getcolspan=parseInt(xsel.rows[rowindex].cells[cellindex].colSpan);
if(getrowspan>1){
var xr1=getrowspan-1;
var xrposit=rowindex;
var xrcposit=cellindex;
var xrholder;xsel.rows[rowindex].cells[cellindex].rowSpan=1;
for(xr2=1;xr2<=xr1;xr2++){
xrholder=xsel.rows[xrposit+xr2].insertCell(xrcposit);
xrholder.colSpan=xsel.rows[rowindex].cells[cellindex].colSpan;
}
}
if(getcolspan>1){
var yr1=getcolspan-1;
var yrposit=rowindex;
var yrcposit=cellindex;
var yrholder;xsel.rows[rowindex].cells[cellindex].colSpan=1;
for(yr2=1;yr2<=yr1;yr2++){
yrholder=xsel.rows[yrposit].insertCell(yrcposit);
yrholder.rowSpan=xsel.rows[rowindex].cells[cellindex].rowSpan;
}
}
}
}
}
function tableProp(){
var tableflag=false;
message.focus();
var xsel=message.document.selection;
var xobj=message.document.selection.createRange();
if(xsel.type=="None"||xsel.type=="Text"){
xsel=xobj.parentElement();
while(xsel.tagName!="BODY"&&tableflag==false){
if(xsel.tagName=="TABLE"){tableflag=true;}
if(tableflag==false){xsel=xsel.parentElement;}
}
}else if(xsel.type=="Control"){
xsel=xobj.item(0);
if(xsel.tagName=="TABLE"){
tableflag=true;
}else{
while(xsel.tagName!="BODY"&&tableflag==false){
if(xsel.tagName=="TABLE"){tableflag=true;}
if(tableflag==false){xsel=xsel.parentElement;}
}
}
}
if(tableflag==true){
if(xsel.className!=""&&xsel.className!=null){tableclass=xsel.className;}else{tableclass="";}
if(xsel.width!=""&&xsel.width!=null){tablewidthspecified="yes";tablewidth=xsel.width;}else{tablewidthspecified="no";tablewith="";}
if(xsel.align!=""&&xsel.align!=null){tablealign=xsel.align;}else{tablealign="";}
if(xsel.border!=""&&xsel.border!=null){tablebordersize=xsel.border;}else{tablebordersize="";}
if(xsel.cellPadding!=""&&xsel.cellPadding!=null){tablecellpadding=xsel.cellPadding;}else{tablecellpadding="";}
if(xsel.cellSpacing!=""&&xsel.cellSpacing!=null){tablecellspacing=xsel.cellSpacing;}else{tablecellspacing="";}
if(xsel.borderColor!=""&&xsel.borderColor!=null){tablebordercolor=xsel.borderColor;}else{tablebordercolor="";}
if(xsel.bgColor!=""&&xsel.bgColor!=null){tablebackgroundcolor=xsel.bgColor;}else{tablebackgroundcolor="";}
tableiscancel="";
window.showModalDialog("editor_tableprops.asp",window," dialogWidth: 350px; dialogHeight: 310px; help: no;scroll: no; status: no");
if(tableiscancel=="no"){
if(tablewidthspecified=="yes"){
var tw1="";
if(tablewidthtype=="percentage"){
tw1=tablewidth+"%";
}else{
tw1=tablewidth;
}
xsel.width=tw1;
}else{
xsel.removeAttribute("width",0);
}
if(tablealign!=""&&tablealign!="Default"){xsel.align=tablealign;}else{xsel.removeAttribute("align",0);}
if(tableclass!=""&&tableclass!="Default"){xsel.className=tableclass;}else{xsel.removeAttribute("className",0);}
if(tablebordersize!=""&&tablebordersize!=null){xsel.border=tablebordersize;}else{xsel.removeAttribute("border",0);}
if(tablecellpadding!=""&&tablecellpadding!=null){xsel.cellPadding=tablecellpadding;}else{xsel.removeAttribute("cellPadding",0);}
if(tablecellspacing!=""&&tablecellspacing!=null){xsel.cellSpacing=tablecellspacing;}else{xsel.removeAttribute("cellSpacing",0);}
if(tablebordercolor!=""&&tablebordercolor!="Default"){xsel.borderColor=tablebordercolor;}else{xsel.removeAttribute("borderColor",0);}
if(tablebackgroundcolor!=""&&tablebackgroundcolor!="Default"){xsel.bgColor=tablebackgroundcolor;}else{xsel.removeAttribute("bgColor",0);}
}
}
}
function cellProp(){
var cellflag=false;
message.focus();
var xsel=message.document.selection;
var xobj=message.document.selection.createRange();
if(xsel.type=="None"||xsel.type=="Text"){
xsel=xobj.parentElement();
while(xsel.tagName!="BODY"&&cellflag==false){
if(xsel.tagName=="TD"){cellflag=true;}
if(cellflag==false){xsel=xsel.parentElement;}
}
}else if(xsel.type=="Control"){
xsel=xobj.item(0);
if(xsel.tagName=="TD"){
cellflag=true;
}else{
while(xsel.tagName!="BODY"&&cellflag==false){
if(xsel.tagName=="TD"){cellflag=true;}
if(cellflag==false){xsel=xsel.parentElement;}
}
}
}
if(cellflag==true){
if(xsel.width!=""&&xsel.width!=null){tablewidthspecified="yes";tablewidth=xsel.width;}else{tablewidthspecified="no";tablewith="";}
if(xsel.align!=""&&xsel.align!=null){tablealign=xsel.align;}else{tablealign="";}
if(xsel.className!=""&&xsel.className!=null){tablecellclass=xsel.className;}else{tablecellclass="";}
if(xsel.vAlign!=""&&xsel.vAlign!=null){tablevalign=xsel.vAlign;}else{tablevalign="";}
if(xsel.borderColor!=""&&xsel.borderColor!=null){tablebordercolor=xsel.borderColor;}else{tablebordercolor="";}
if(xsel.bgColor!=""&&xsel.bgColor!=null){tablebackgroundcolor=xsel.bgColor;}else{tablebackgroundcolor="";}
tableiscancel="";
window.showModalDialog("editor_cellprops.asp",window,"dialogWidth: 400px; dialogHeight: 240px;help: no;scroll: no; status: no");
if(tableiscancel=="no"){
if(tablewidthspecified=="yes"){
var tw1="";
if(tablewidthtype=="percentage"){tw1=tablewidth+"%";}else{tw1=tablewidth;}
xsel.width=tw1;
}else{
xsel.removeAttribute("width",0);
}
if(tablealign!=""&&tablealign!="Default"){xsel.align=tablealign;}else{xsel.removeAttribute("align",0);}
if(tablevalign!=""&&tablevalign!="Default"){xsel.vAlign=tablevalign;}else{xsel.removeAttribute("vAlign",0);}
if(tablecellclass!=""&&tablecellclass!="Default"){xsel.className=tablecellclass;}else{xsel.removeAttribute("className",0);}
if(tablebordercolor!=""&&tablebordercolor!="Default"){xsel.borderColor=tablebordercolor;}else{xsel.removeAttribute("borderColor",0);}
if(tablebackgroundcolor!=""&&tablebackgroundcolor!="Default"){xsel.bgColor=tablebackgroundcolor;}else{xsel.removeAttribute("bgColor",0);}
}
}
}
function table_ir()
{
tablecommand("ir");
}
function table_dr()
{
tablecommand("dr");
}
function table_ic()
{
tablecommand("ic");
}
function table_dc()
{
tablecommand("dc");
}
function table_mc()
{
tablecommand("mc");
}
function table_md()
{
tablecommand("md");
}
function table_sc()
{
tablecommand("sc");
}
function InsertTable()
{
if (! validateMode()) return;
message.focus();
var range = message.document.selection.createRange();
var arr = showModalDialog("editor_inserttable.asp", "", "dialogWidth:450px;dialogHeight:200px;help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML(arr);
}
message.focus();
}
function about()
{
window.showModalDialog("about.htm","","dialogWidth:420px;dialogHeight:240px;scroll:no;status:no;help:no");
}
function validateMode()
{
if (!bTextMode) return true;
alert("请先取消查看HTML源代码,进入“编辑”状态,然后再使用系统编辑功能!");
message.focus();
return false;
}
function validateModea()
{
if (!bTextMode) return true;
alert("请先取消查看HTML源代码!");
message.focus();
return false;
}
function InsertChars(CharIndex)
{
if (! validateMode()) return;
message.focus();
var range =message.document.selection.createRange();
var Chars=new Array("<br>","©","®","™","•");
range.pasteHTML(Chars[CharIndex]);
message.focus();
}
function Insertface(faceIndex)
{
if (! validateMode()) return;
message.focus();
var range =message.document.selection.createRange();
var Chars=new Array("<IMG src='images/newsface/1.gif' border=0>","<IMG src='images/newsface/2.gif' border=0>","<IMG src='images/newsface/3.gif' border=0>","<IMG src='images/newsface/4.gif' border=0>","<IMG src='images/newsface/5.gif' border=0>","<IMG src='images/newsface/6.gif' border=0>","<IMG src='images/newsface/7.gif' border=0>","<IMG src='images/newsface/8.gif' border=0>","<IMG src='images/newsface/9.gif' border=0>","<IMG src='images/newsface/10.gif' border=0>");
range.pasteHTML(Chars[faceIndex]);
message.focus();
}
function InsertEQ()
{
if (! validateMode()) return;
message.focus();
var range =message.document.selection.createRange();
var arr = showModalDialog("editor_inserteq.asp", "", "dialogWidth:40em; dialogHeight:20em; status:0;help:0");
if (arr != null){
var ss;
ss=arr.split("*")
a=ss[0];
b=ss[1];
var str1;
str1="<applet codebase='./' code='webeq3.ViewerControl' WIDTH=320 HEIGHT=100>"
str1=str1+"<PARAM NAME='parser' VALUE='mathml'><param name='color' value='"+b+"'><PARAM NAME='size' VALUE='18'>"
str1=str1+"<PARAM NAME=eq id=eq VALUE='"+a+"'></applet>"
range.pasteHTML(str1);
}
message.focus();
}
function InstallEQ()
{
window.open ("editor_inserteq.asp?Action=Install", "", "height=200, width=300,left="+(screen.AvailWidth-300)/2+",top="+(screen.AvailHeight-200)/2+", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
}
function help()
{
var helpmess;
helpmess="---------------填写帮助---------------\r\n\r\n"+
"1.请不要发表有危险性的脚本。\r\n\r\n"+
"2.如果要书写源代码,请选中\r\n\r\n"+
" 查看HTML源代码书写.\r\n\r\n"+
"3.需要你自己运行,才能看效果.\r\n\r\n"+
"4.如果书写js,尽量不要在这儿书写.\r\n\r\n";
alert(helpmess);
}
</script><script language="JavaScript">
function Check(t,n)
{
if(n==1) t.className ="Up"
else
if(n==2) t.className ="Down"
else t.className ="None"
}
function findstr()
{
if (! validateMode()) return;
var arr = showModalDialog("editor_find.asp", window, "dialogWidth:420px; dialogHeight:150px; help: no; scroll: no; status: no");
}
function calculator()
{
message.focus();
var range =message.document.selection.createRange();
var arr = showModalDialog("editor_calculator.asp", "", "dialogWidth:207px; dialogHeight:216px; status:0;help:0");
if (arr != null){
var ss;
ss=arr.split("*")
a=ss[0];
b=ss[1];
var str1;
str1=""+a+""
range.pasteHTML(str1);
}
message.focus();
}
function nowdate()
{
if (! validateMode()) return;
message.focus();
var range =message.document.selection.createRange();
var d = new Date();
var str1=d.getYear()+"年"+(d.getMonth() + 1)+"月"+d.getDate() +"日";
range.pasteHTML(str1);
message.focus();
}
function nowtime()
{
if (! validateMode()) return;
message.focus();
var range =message.document.selection.createRange();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -