这段时间,我热衷于象棋电子书的制作当中,现有一些不明白的地方请老师们指点。
方法一:制作普通的断网象棋电子书,我涉及到的软件主要有:象棋演播室。
制作工具.
1.中国象棋伴侣
2.东萍象棋网上下载的动态棋盘文件中的DhtmlXQ_www_dpxq_com.htm和DhtmlXQ_www_dpxq_com.js
3.SuperTextReplace 超级批量文本替换
4.easy chm
当然,这种这种方法我通过多方面的学习,已经没有问题了。
由于,我偶尔在电脑上面看到一个chm棋谱,他的背景及界面太漂亮了,使我又萌生了想制作的意向,在网上百般搜索制作工具,我终于找到了。
方法二:下载电子书制作生成器2010,东萍动态棋盘万能打谱器,另外我同时试用了制作工具.
.东萍象棋网上下载的动态棋盘文件中的DhtmlXQ_www_dpxq_com.htm和DhtmlXQ_www_dpxq_com.js
.SuperTextReplace 超级批量文本替换等工具。
电子书是制作出来了,而且界面也漂亮,也支持动态棋谱外的文字说明。但是,紧接着问题就出来了,所制作的电子书无法断网阅读。
请各位老师指导指导!
我该怎么操作才可以制作成断网阅读的电子书?
另外:
1..有没有什么更好的软件制作电子书?
2..辅助软件需要哪些?
3..如何详细制作?
谢谢!
一句话是说不明白
我的建议你用CHM反编译工具,来回操作一遍就很清楚了。
所制作的电子书无法断网阅读一般来说是CodeBase问题.
您可尝试CodeBase改写为:
src=../DhtmlXQ_www_dpxq_com/DhtmlXQ_www_dpxq_com.htm
同时把文件夹/DhtmlXQ_www_dpxq_com/打包到象棋电子书中
建议您使用百变棋星ChessStar 或是网页浏览器ccmmBrowser制作象棋电子书
非常简单!
多谢支持!
包世贤
谢谢!我试试看哈!
其实,我不懂这些代码意思的,就爱瞎琢磨。
还是不会操作啊!
老师能否介绍详细点?
if (typeof(DhtmlXQimgpath) == 'undefined')
{
var DhtmlXQimgpath=(location.hostname == 'localhost')?'':'';
var ads_dpxq='';
}
var backgroundimg='background.gif';
var boardimg="board.gif";
var copyrightimg="DhtmlXQ.gif";
document.getElementsByTagName("body").item(0).style.backgroundImage='url('+backgroundimg+')';
var dpxq_search_url=(location.hostname == 'localhost')?'':'';
var getdata=parent.document.getElementById(self.name.substr(5)).innerHTML;
getdata=getdata.replace(/<br\/?><br\/?>/gi,'<br>').replace(/<br\/?>/gi,'\r\n').replace(/&/gi,'&').replace(/ /gi,' ');
document.onkeydown = Xnc_KEvent;
var timer;
var canauto=1;
var tempstr;
var temp;
var position;
var lx=1;
var dellist=new Array(400);
dellist[400]='';
var poslist=new Array(99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99);
var qzdx=25;
var qgdx=25;
var nownum=0;
var firstnum=0;
var lastnum=0;
var qzimg=new Array("r1.gif","r2.gif","r3.gif","r4.gif","r5.gif","r4.gif","r3.gif","r2.gif","r1.gif","r6.gif","r6.gif","r7.gif","r7.gif","r7.gif","r7.gif","r7.gif","b1.gif","b2.gif","b3.gif","b4.gif","b5.gif","b4.gif","b3.gif","b2.gif","b1.gif","b6.gif","b6.gif","b7.gif","b7.gif","b7.gif","b7.gif","b7.gif");
var bimgx=232;
var bimgy=291;
var bimgtop=22;
var bimgleft=5;
var w0=500;
var viewtype='img';
var w1=getvar('init').split(',')[0]-6;
var w2=106;
var w3=144;
var w4=124;
var h0=350;
var h1=344;
if (isNaN(w1))
w1=494;
else if (w1<=236)
w1=236;
else if (w1<=346)
w1=346;
else
w1=(w1>494)?494:w1;
w0=parseInt(parent.document.getElementById('id_'+self.name.substr(5)).style.width);
h0=parseInt(parent.document.getElementById('id_'+self.name.substr(5)).style.height);
parent.document.getElementById('id_'+self.name.substr(5)).style.width=(w1+6);
parent.document.getElementById('id_'+self.name.substr(5)).style.height=(h1+6);
var h2=26;
var h3=24;
var h4=24;
var h5=258;
var h6=175;
var h7=65;
var i;
var j;
var x;
var y;
var x0;
var y0;
var china_vartext=new Array();
var nowqz;
var topos;
var title;
var moveparameter;
moveparameter=getvar('movelist').replace(/[^A-Za-z0-9]/gi,'');
position=getvar('binit').replace(/\D/gi,'9');
if (position.length<64)
position="8979695949392919097717866646260600102030405060708012720323436383";
var posArray=position.match(/\d\d/gi);
title=getvar('title');
var hits=getvar('hits');
if (hits != '') hits = '浏览 ' + hits + ' 次';
var changecss=1;
var movelist="";
var totalmove=0;
var chessmannumber=32;
totalmove = parseInt(moveparameter.length/12);
var commentlist = new Array(totalmove);
var move_text = new Array(totalmove);
var havevar = new Array(totalmove);
var havecomment = new Array(totalmove);
var varlist = new Array(totalmove);
var m_list=new Array(totalmove);
var truemoveindex=new Array();
var movenumber=new Array();
var m_list_swap=new Array(totalmove);
var move_text_swap=new Array(totalmove);
var swap_temp=new Array(totalmove);
var get_arg=getdata.match(/\[DhtmlXQ_comment\d+\][^\]\n]+\[\/DhtmlXQ_comment\d+\]/gi);
if (get_arg!=null)
{
for (i=0;i<get_arg.length;i++)
commentlist[parseInt(get_arg[i].split('DhtmlXQ_comment')[1],10)]=get_arg[i].replace(/\[\/?DhtmlXQ_comment\d{1,4}\]/gi,'').replace(/\|\|/gi,'<br>');
}
if (lastnum==0)
{
havevar[0]='';
havecomment[0]='';
}
function Xnc_KEvent()
{
var Xnc_KEvent = window.event;
if ((Xnc_KEvent.keyCode == 13) || (Xnc_KEvent.keyCode == 39)) gotonum('Next');
if ((Xnc_KEvent.keyCode == 37)) gotonum('Prev');
}
function getvar(varname)
{
var str;
var varstr=getdata.replace('[DhtmlXQ_'+varname+']','\x01\x02\x01');
if (varstr==getdata)
return '';
else
{
str=varstr.split('\x01\x02\x01')[1];
varstr=str.replace('[/DhtmlXQ_'+varname+']','\x01\x02\x01');
if (varstr==str)
return '';
else
return varstr.split('\x01\x02\x01')[0].replace(/\|\|/gi,'\r\n ');
}
}
function initdata()
{
for (i=0;i<totalmove;i++)
{
if (commentlist[i]!=null)
havecomment[i]="*";
else
{
havecomment[i]=" ";
commentlist[i]="";
}
havevar[i]=" ";
varlist[i]=i;
m_list[i] = moveparameter.substring(i*12,i*12+4);
move_text[i] = china_move(moveparameter.substring(i*12+4,i*12+8));
movenumber[i] = parseInt(moveparameter.substring(i*12+8,i*12+12),10);
if (i!=movenumber[i])
{
varlist[movenumber[i]]+=('|'+i);
havevar[movenumber[i]]="m";
lastnum=i;
}
if (lastnum==0)
{
movelist+=m_list[i];
truemoveindex[i]=movenumber[i];
}
}
if (commentlist[i]!=null)
havecomment[i]="*";
else
{
havecomment[i]=" ";
commentlist[i]="";
}
var movestr='一1二2三3四4五5六6七7八8九9';
movestr="\u4E00\uFF11\u4E8C\uFF12\u4E09\uFF13\u56DB\uFF14\u4E94\uFF15\u516D\uFF16\u4E03\uFF17\u516B\uFF18\u4E5D\uFF19";
for (i=0;i<totalmove;i++)
{
var variation = varlist[i].toString().split('|');
if (variation.length>1)
{
for (j=0;j<variation.length;j++)
{
varlist[variation[j]] = varlist[i];
havevar[variation[j]] = 'm';
}
}
temp=m_list[i];
m_list_swap[i]=(" "+(8-temp.substr(0,1))+temp.substr(1,1)+(8-temp.substr(2,1))+temp.substr(3,1)).substr(1,4);
temp=move_text[i]
if ( (temp.search(/[\u9A6C\u76F8\u8C61\u4ED5\u58EB]+/gi)!=-1) || (temp.substr(2,1)=='\u5E73') )
move_text_swap[i]=temp.substr(0,1)+movestr.charAt(16+2*(movestr.indexOf(temp.substr(1,1))%2)-movestr.indexOf(temp.substr(1,1)))+temp.substr(2,1)+movestr.charAt(16+2*(movestr.indexOf(temp.substr(3,1))%2)-movestr.indexOf(temp.substr(3,1)));
else
move_text_swap[i]=temp.substr(0,1)+movestr.charAt(16+2*(movestr.indexOf(temp.substr(1,1))%2)-movestr.indexOf(temp.substr(1,1)))+temp.substr(2,1)+temp.substr(3,1);
}
lastnum=parseInt(movelist.length/4);
firstnum=parseInt(getvar('firstnum'));
if (isNaN(firstnum)) firstnum=0;
if (isNaN(lastnum)) lastnum=0;
if (lastnum<0) lastnum=0;
if (lastnum>400) lastnum=400;
if (firstnum>lastnum) firstnum=lastnum;
if (firstnum<0) firstnum=0;
}
function board()
{
if (w1 == 236) var title_fontsize = 'font-size:10pt;';
document.write('<div id="div1" style="width:'+w1+'px;height:'+h2+'px;'+title_fontsize+'">'+title+' '+hits+'</div>\r\n');
document.write('<div id="div2" style="top:'+h2+'px;background-image:url('+boardimg+');width:'+bimgx+'px;height:'+(bimgy+2)+'px;">\r\n');
document.write('<div id="blackcoordinate" style="left:'+bimgleft+'px;width:'+(qgdx*9+12)+'px;letter-spacing:'+(qgdx-12)+'px;">123456789</div>');
document.write('<div id="div3" style="top:'+bimgtop+'px;left:'+bimgleft+'px;width:'+qgdx*9+'px;height:'+(qgdx*10+2)+'px;">');
for(i=0;i<=31;i++)
{
x=position.charAt(i*2)-0;
y=position.charAt(i*2+1)-0;
if (x==9)
chessmannumber--;
if (viewtype=="img")
document.write('<img src="'+DhtmlXQimgpath+qzimg[i]+'" id="z'+i+'" style="position:absolute;margin:0;width:'+(qzdx-1)+'px;height:'+(qzdx-1)+'px;left:'+x*qgdx+'px;top:'+y*qgdx+'px;">');
else
document.write('<div id="z'+i+'" style="position:absolute;margin:0;width:'+qgdx+'px;height:'+qgdx+'px;left:'+(x*qgdx)+'px;top:'+y*qgdx+'px;">'+qztxt[i]+'</div>');
poslist[x*10+y]=i;
}
document.write('</div>');
document.write('<div id="redcoordinate" style="letter-spacing:'+(qgdx-12)+'px;left:'+bimgleft+'px;width:'+(qgdx*9+20)+'px;">九八七六五四三二一</div>');
document.write('</div>');
document.write('<div id="div4" style="top:'+(bimgy+h2)+'px;width:'+w1+'px;">');
document.write('<input type="button" value="开局" onMouseUp="gotonum(\'First\')">');
document.write('<input type="button" value="后退" onMouseUp="gotonum(\'Prev\')">');
document.write('<input type="button" value="前进" onMouseUp="gotonum(\'Next\')">');
document.write('<input type="button" value="终局" onMouseUp="gotonum(\'Last\')">');
document.write('<input type="button" value="0/'+lastnum+'" id="shownow" style="width:47px;">');
document.write('<input type="button" value="自动" id="autoplay" onMouseUp="AutoPlay()">');
document.write('<input type="button" value="旋转" id="turn_Board" onMouseUp="turnBoard()">');
document.write('<input type="button" value="对称" id="mirror_Board" onMouseUp="mirrorBoard()">');
document.write('<input type="button" value="交换" id="swap_Color" onMouseUp="swapColor()">');
document.write('<input type="button" value="导出" id="showsource" onMouseUp="ViewSource()">');
document.write('<input type="button" value="信息" id="showinfo" onMouseUp="ViewInfo()">');
document.write('<input type="button" value="棋谱搜索" id="showsearch" style="width:72px;color:#F00" onMouseUp="ViewSearch()">');
document.write('</div>');
}
function initboard()
{
var hldcg = (top.location.href.search(/((dpxq\.com)|(localhost))\/hldcg\/search/gi) != -1)?1:3;
document.write('<div id="div0" style="left:'+hldcg+'px;width:'+w1+'px;height:'+h1+'px;">');
board();
document.write('<div id="listtext" style="top:'+h2+'px;left:'+(bimgx+4)+'px;width:'+(w1-bimgx-4)+'px;height:'+bimgy+'px;">');
document.write(' <div id="div5" style="height:'+(bimgy+2)+';width:'+(w2+2)+'px;">');
document.write(' <div id="div6" style="height:'+bimgy+';width:'+w2+'px;">');
document.write(' <div id="div7" style="height:'+h4+'px;width:'+w2+'px;"> 棋谱序列</div>');
document.write(' <div id="movetext_scroll" style="background-image:url('+copyrightimg+');width:'+w2+'px;height:'+h5+'px;">');
document.write('<pre id="movetext" style="height:'+h5+'px;">');
document.write('<div id="move_index_0" onclick="gotonum(0)" style="background-color:#3366CC;color:#FFFFFF;">====棋局开始</div>');
get_movetext();
document.write('</pre>');
document.write(' </div>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div id="div8" style="left:'+(w2+4)+'px;height:'+(bimgy+2)+'px;width:'+(w3+2)+'px;">');
document.write(' <div id="div9" style="height:'+bimgy+'px;width:'+w3+'px;">');
document.write(' <div id="div10" style="height:'+h4+'px;width:'+w3+'px;"> 注解</div>');
document.write(' <div id="commenttext_scroll" style="background-image:url('+copyrightimg+');width:'+w3+'px;height:'+h6+'px;">');
document.write(' <div id="commenttext" style="height:'+h6+'px;">'+commentlist[0]+'</div>');
document.write(' </div>');
document.write(' <div id="div11" style="height:18px;width:'+w3+'px;"> 变着(单击选择)</div>');
document.write(' <div id="vartext_scroll" style="background-image:url('+copyrightimg+');width:'+w3+'px;height:'+h7+'px;">');
document.write(' <div id="vartext" style="height:'+h7+'px;">'+ads_dpxq+'</div>');
document.write(' </div>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div id="div12" style="height:'+h4+'px;width:'+w2+'px;"> 棋谱</div>');
document.write(' <div id="sourceText" style="display:none;width:'+(w1-bimgx-8)+'px;height:'+(bimgy+2)+'px;">');
document.write(' <div id="sourceText0" style="width:'+(w1-bimgx-8)+'px;height:'+bimgy+'px;">');
document.write(' <div id="div13" style="width:'+(w1-bimgx-8)+'px;height:'+h4+'px;"> 棋谱导出 <span onclick="getUBB()">UBB</span> <span onclick="getHTML()">HTML</span> <span onclick="getTEXT()">文本</span> <span onclick="getVARTEXT()">变着文本</span> <span onclick="getIMGTEXT()">文本图</span></div>');
document.write(' <textarea id="source_Text" onclick="this.select();" style="background-image:url('+copyrightimg+');top:'+h4+'px;width:'+(w1-bimgx-8)+'px;height:'+h5+'px;"></textarea>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div id="infoText" style="display:none;width:'+(w1-bimgx-8)+'px;height:'+(bimgy+2)+'px;">');
document.write(' <div id="infoText0" style="width:'+(w1-bimgx-8)+'px;height:'+bimgy+'px;">');
document.write(' <div id="div14" style="width:'+(w1-bimgx-8)+'px;height:'+h4+'px;"> 棋谱信息</div>');
document.write(' <textarea id="info_Text" onclick="this.select();" style="background-image:url('+copyrightimg+');top:'+h4+'px;width:'+(w1-bimgx-8)+'px;height:'+h5+'px;"></textarea>');
document.write(' </div>');
document.write(' </div>');
document.write(' <div id="searchText" style="display:none;width:'+(w1-bimgx-8)+'px;height:'+(bimgy+2)+'px;">');
document.write(' <div id="searchText0" style="width:'+(w1-bimgx-8)+'px;height:'+bimgy+'px;">');
document.write(' <div id="div15" style="width:'+(w1-bimgx-8)+'px;height:'+h4+'px;"> 棋谱搜索</div>');
document.write(' <div id="search_Text" style="background-image:url('+copyrightimg+');background-color:#ffffff;top:'+h4+'px;width:'+(w1-bimgx-8)+'px;height:'+h5+'px;"></div>');
document.write(' </div>');
document.write(' </div>');
document.write('</div>');
if (firstnum>0)
{
gotonum(firstnum);
document.getElementById("movetext_scroll").scrollTop=((firstnum>14)?(firstnum-14):0)*16;
}
document.write('</div>');
get_arg=getdata.match(/\[DhtmlXQ_\w+\].+\[\/DhtmlXQ_\w+\]/gi);
get_arg=('').replace(/<br><br>/gi,'<br>').replace(/<br>/gi,'\r\n');
getUBB();
getINFO();
getSEARCH();
if ((getvar('showtext') == 'search') || (movelist=='')) ViewSearch();
if ((getvar('showtext') == 'info')) ViewInfo();
if ((getvar('showtext') == 'source')) ViewSource();
}
function gotonum(num)
{
if ( (lastnum>0) && (nownum<=lastnum) )
{
canauto=0;
if (num=='Next')
{
Next();
movetext_Next(nownum-1,nownum);
}
else if (num=='Prev')
{
Prev();
movetext_Prev(nownum+1,nownum);
}
else if (num=='Last')
{
if (lastnum-nownum>chessmannumber)
changecss=0;
movetext_Next(nownum,lastnum);
while (nownum<lastnum)
Next();
}
else if (num=='First')
{
var tonum=0;
if (nownum>firstnum)
tonum=firstnum;
movetext_Prev(nownum,tonum);
if (nownum-tonum>chessmannumber)
changecss=0;
while (nownum>tonum)
Prev();
}
else
{
if (nownum<num)
{
if (num-nownum>chessmannumber)
changecss=0;
movetext_Next(nownum,num);
while (nownum<num)
Next();
}
if (nownum>num)
{
if (nownum-num>chessmannumber)
changecss=0;
movetext_Prev(nownum,num);
while (nownum>num)
Prev();
}
}
if (changecss==0)
{
for (i=0;i<32;i++)
{
document.getElementById("z"+i).style.left=((posArray[i]+'').charAt(0)-0)*qgdx;
document.getElementById("z"+i).style.top=((posArray[i]+'').charAt(1)-0)*qgdx;
}
changecss=1;
}
document.getElementById("shownow").value=nownum+'/'+lastnum;
ShowcommentText();
ShowVarText();
canauto=1;
hideSearch();
}
}
function movetext_Prev(oldnum,newnum)
{
document.getElementById("move_index_"+oldnum).style.backgroundColor='transparent';
document.getElementById("move_index_"+oldnum).style.color='#000000';
document.getElementById("move_index_"+newnum).style.backgroundColor='#3366CC';
document.getElementById("move_index_"+newnum).style.color='#FFFFFF';
if ( (document.getElementById("movetext_scroll").scrollTop>(newnum-2)*16) || (document.getElementById("movetext_scroll").scrollTop<(newnum-16)*16) )
document.getElementById("movetext_scroll").scrollTop=(newnum-1)*16;
}
function movetext_Next(oldnum,newnum)
{
document.getElementById("move_index_"+oldnum).style.backgroundColor='transparent';
document.getElementById("move_index_"+oldnum).style.color='#000000';
document.getElementById("move_index_"+newnum).style.backgroundColor='#3366CC';
document.getElementById("move_index_"+newnum).style.color='#FFFFFF';
if ( (document.getElementById("movetext_scroll").scrollTop<(newnum-14)*16) || (document.getElementById("movetext_scroll").scrollTop>(newnum-1)*16) )
document.getElementById("movetext_scroll").scrollTop=(newnum-14)*16;
}
function ShowcommentText()
{
if (nownum==0)
document.getElementById("commenttext").innerHTML=commentlist[0];
else
document.getElementById("commenttext").innerHTML=commentlist[truemoveindex[nownum-1]+1];
}
function ShowVarText()
{
if (nownum==0)
document.getElementById("vartext").innerHTML=ads_dpxq;
else
{
china_vartext=varlist[truemoveindex[nownum-1]].toString().split('|');
temp='';
for (i=0;i<china_vartext.length;i++)
{
temp+=('<div id="var_index_'+china_vartext[i]+'" onclick=getvarlist('+(nownum-1)+','+china_vartext[i]+')');
if (china_vartext[i]==truemoveindex[nownum-1])
temp+=' style="background-color:#3366CC;color:#FFFFFF;"';
temp+='>';
if (i<=10)
temp+=' ';
else if (i<=100)
temp+=' ';
else
temp+='';
temp+=((i+1)+'.'+move_text[china_vartext[i]]+' '+havecomment[(china_vartext[i]-0)+1]);
if (china_vartext[i]==truemoveindex[nownum-1])
temp+=' <--';
temp+='</div>';
}
document.getElementById("vartext").innerHTML=(china_vartext.length > 1)?temp:ads_dpxq;
}
}
function getvarlist(num,varnum)
{
document.getElementById("var_index_"+truemoveindex[nownum-1]).style.backgroundColor='transparent';
document.getElementById("var_index_"+truemoveindex[nownum-1]).style.color='#000000';
document.getElementById("var_index_"+varnum).style.backgroundColor='#3366CC';
document.getElementById("var_index_"+varnum).style.color='#FFFFFF';
Prev();
canauto=0;
movelist=movelist.substr(0,num*4);
lastnum=parseInt(movelist.length/4);
document.getElementById("shownow").value=nownum+'/'+lastnum;
truemoveindex=truemoveindex.slice(0,num);
if( varnum== (totalmove-1) )
{
movelist+=m_list[varnum];
truemoveindex[num]=varnum;
}
else
{
for (i=varnum;(( movenumber[i]<movenumber[i+1]) && ((i+1)<totalmove) );i++)
{
movelist+=m_list[i];
truemoveindex[num+i-varnum]=i;
}
movelist+=m_list[i];
truemoveindex[num+i-varnum]=i;
}
lastnum=parseInt(movelist.length/4);
document.getElementById("shownow").value=nownum+'/'+lastnum;
document.getElementById("movetext").innerHTML='<div id="move_index_0" onclick="gotonum(0)">====棋局开始</div>';
get_movetext();
canauto=1;
gotonum('Next');
}
function get_movetext()
{
temp='';
for(i=0,j=0;i<lastnum;i++)
{
temp+=('<div id="move_index_'+(i+1)+'" onclick="gotonum('+(i+1)+')">');
if (i%2==0)
{
j++;
if (j>=100)
temp+=(j+'.');
else if (j>=10)
temp+=(' '+j+'.');
else
temp+=(' '+j+'.');
}
else
temp+=(' ');
temp+=(move_text[truemoveindex[i]]+(havecomment[truemoveindex[i]+1]+havevar[truemoveindex[i]]).replace(/ /gi,' ')+'</div>');
}
document.getElementById("movetext").innerHTML+=temp;
}
function Prev()
{
if ((nownum>0)&&(nownum<=lastnum))
{
nownum--;
x0=movelist.charAt(nownum*4+2)-0;
y0=movelist.charAt(nownum*4+3)-0;
nowqz=x0*10+y0;
x=movelist.charAt(nownum*4+0)-0;
y=movelist.charAt(nownum*4+1)-0;
poslist[x*10+y]=poslist[nowqz];
if (changecss==1)
{
document.getElementById("z"+poslist[nowqz]).style.left=x*qgdx;
document.getElementById("z"+poslist[nowqz]).style.top=y*qgdx;
}
posArray[poslist[nowqz]]=x+''+y;
if (dellist[nownum+1]!=null)
{
if (changecss==1)
{
document.getElementById("z"+dellist[nownum+1]).style.left=x0*qgdx;
document.getElementById("z"+dellist[nownum+1]).style.top=y0*qgdx;
}
poslist[nowqz]=dellist[nownum+1];
posArray[dellist[nownum+1]]=x0+''+y0;
dellist[nownum+1]=null;
chessmannumber++;
}
else
poslist[nowqz]=99;
}
}
function Next()
{
if ((nownum>=0)&&(nownum<lastnum))
{
x0=movelist.charAt(nownum*4+0)-0;
y0=movelist.charAt(nownum*4+1)-0;
nowqz=x0*10+y0;
x=movelist.charAt(nownum*4+2)-0;
y=movelist.charAt(nownum*4+3)-0;
nownum++;
if (poslist[x*10+y]!=99)
{
dellist[nownum]=poslist[x*10+y];
if (changecss==1)
{
document.getElementById("z"+dellist[nownum]).style.left=9*qgdx;
document.getElementById("z"+dellist[nownum]).style.top=9*qgdx;
}
posArray[dellist[nownum]]=99;
chessmannumber--;
}
poslist[x*10+y]=poslist[nowqz];
posArray[poslist[nowqz]]=x+''+y;
if (changecss==1)
{
document.getElementById("z"+poslist[nowqz]).style.left=x*qgdx;
document.getElementById("z"+poslist[nowqz]).style.top=y*qgdx;
}
poslist[nowqz]=99;
}
}
function AutoPlay()
{
if(document.getElementById("autoplay").value=="自动")
{
document.getElementById("autoplay").value="停止";
timer=setInterval("StopPlay();",1000);
}
else
{
document.getElementById("autoplay").value="自动";
clearInterval(timer);
}
}
function StopPlay()
{
if( (nownum<lastnum) && (canauto==1) )
gotonum('Next');
else
{
clearInterval(timer);
document.getElementById("autoplay").value="自动";
}
}
function china_move(eng_move)
{
var bo = "车马相象仕士帅将炮 兵卒一1二2三3四4五5六6七7八8九9前中后进退平";
bo = "\u8F66\u9A6C\u76F8\u8C61\u4ED5\u58EB\u5E05\u5C06\u70AE\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5175\u5352\u4E00\uFF11\u4E8C\uFF12\u4E09\uFF13\u56DB\uFF14\u4E94\uFF15\u516D\uFF16\u4E03\uFF17\u516B\uFF18\u4E5D\uFF19\u524D\u4E2D\u540E\u8FDB\u9000\u5E73";
var notstr='';
var notnum;
for (x=0;x<4;x++)
{
notnum = eng_move.charCodeAt(x)-49;
notstr+=bo.charAt(notnum);
}
return notstr;
}
function turnBoard()
{
document.getElementById('turn_Board').style.color=(document.getElementById('turn_Board').style.color=='')?'#ff0000':'';
canauto=0;
for (i=0;i<totalmove;i++)
{
temp=m_list[i];
m_list[i]=(" "+(8-temp.substr(0,1))+(9-temp.substr(1,1))+(8-temp.substr(2,1))+(9-temp.substr(3,1))).substr(1,4);
}
for (i=0;i<32;i++)
{
temp=posArray[i]+'';
if (temp.charAt(0)<9)
posArray[i]=(8-temp.charAt(0))+''+(9-temp.charAt(1));
}
temp=movelist;
movelist=" ";
for (i=0;i<lastnum*4;i=i+2)
{
movelist+=(8-temp.substr(i,1));
movelist+=(9-temp.substr(i+1,1));
}
movelist=movelist.substr(1);
temp=poslist.toString().split(',');
for (i=0;i<90;i++)
{
poslist[i]=temp[89-i];
if (poslist[i]<32)
{
document.getElementById('z'+poslist[i]).style.left=(i-i%10)/10*qgdx;
document.getElementById('z'+poslist[i]).style.top=i%10*qgdx;
}
}
document.getElementById("blackcoordinate").innerHTML=(document.getElementById("blackcoordinate").innerHTML=='123456789'?'一二三四五六七八九':'123456789');
document.getElementById("redcoordinate").innerHTML=(document.getElementById("redcoordinate").innerHTML=='九八七六五四三二一'?'987654321':'九八七六五四三二一');
canauto=1;
}
function mirrorBoard()
{
document.getElementById('mirror_Board').style.color=(document.getElementById('mirror_Board').style.color=='')?'#ff0000':'';
canauto=0;
swap_temp=move_text;
move_text=move_text_swap;
move_text_swap=swap_temp;
swap_temp=m_list;
m_list=m_list_swap;
m_list_swap=swap_temp;
for (i=0;i<32;i++)
{
temp=posArray[i]+'';
if (temp.charAt(0)<9)
posArray[i]=(8-temp.charAt(0))+''+temp.charAt(1);
}
temp=movelist;
movelist=" ";
for (i=0;i<lastnum*4;i=i+2)
{
movelist=movelist+(8-temp.substr(i,1))+temp.substr(i+1,1);
}
movelist=movelist.substr(1);
if (lastnum==0)
temp=' style="background-color:#3366CC;color:#FFFFFF;"';
document.getElementById("movetext").innerHTML='<div id="move_index_0" onclick="gotonum(0)"'+temp+'>====棋局开始'+havecomment[0]+havevar[0]+'</div>';
temp=poslist.toString().split(',');
for (i=0;i<9;i++)
{
for (j=0;j<10;j++)
{
poslist[i*10+j]=temp[(8-i)*10+j];
if (poslist[i*10+j]<32)
{
document.getElementById('z'+poslist[i*10+j]).style.left=i*qgdx;
document.getElementById('z'+poslist[i*10+j]).style.top=j*qgdx;
}
}
}
get_movetext();
if (nownum==0)
{
Next();
gotonum('Prev');
}
else
{
Prev();
gotonum('Next');
}
canauto=1;
}
function swapColor()
{
document.getElementById('swap_Color').style.color=(document.getElementById('swap_Color').style.color=='')?'#ff0000':'';
for (i=0;i<16;i++)
{
if (viewtype=="img")
{
temp=document.getElementById('z'+i).src;
document.getElementById('z'+i).src=document.getElementById('z'+(i+16)).src;
document.getElementById('z'+(i+16)).src=temp;
}
else
{
temp=document.getElementById('z'+i).innerHTML;
document.getElementById('z'+i).innerHTML=document.getElementById('z'+(i+16)).innerHTML;
document.getElementById('z'+(i+16)).innerHTML=temp;
}
}
}
function ViewSource()
{
document.getElementById("sourceText").style.display=(document.getElementById("sourceText").style.display=='none'?'':'none');
document.getElementById("showsource").value=(document.getElementById("showsource").value=='导出'?'隐藏':'导出');
hideSearch();
hideInfo();
}
function ViewInfo()
{
document.getElementById("infoText").style.display=(document.getElementById("infoText").style.display=='none'?'':'none');
document.getElementById("showinfo").value=(document.getElementById("showinfo").value=='信息'?'隐藏':'信息');
hideSource();
hideSearch();
}
function ViewSearch()
{
document.getElementById("searchText").style.display=(document.getElementById("searchText").style.display=='none'?'':'none');
document.getElementById("showsearch").value=(document.getElementById("showsearch").value=='棋谱搜索'?'隐藏搜索':'棋谱搜索');
hideSource();
hideInfo();
}
function hideSearch()
{
document.getElementById("searchText").style.display='none';
document.getElementById("showsearch").value='棋谱搜索';
}
function hideInfo()
{
document.getElementById("infoText").style.display='none';
document.getElementById("showinfo").value='信息';
}
function hideSource()
{
document.getElementById("sourceText").style.display='none';
document.getElementById("showsource").value='导出';
}
function SearchTree()
{
if (top.search_end_pos != null)
top.search_end_pos.location.href = 'search.asp?t=' + posArray.join('');
else
window.open(dpxq_search_url + '?site=' + location.hostname + '&t=' + posArray.join('') + '&f=' + nownum + '&b=' + position + '&m=' + movelist,'','resizable=yes,status=yes');
}
function SearchPos()
{
if (top.search_end_pos != null)
top.search_end_pos.location.href = 'search.asp?p=' + posArray.join('');
else
window.open(dpxq_search_url + '?site=' + location.hostname + '&p=' + posArray.join('') + '&f=' + nownum + '&b=' + position + '&m=' + movelist,'','resizable=yes,status=yes');
}
function SearchEnd()
{
var notStr = '100000000000,10000000000,100000000,10000000,0,10000000,100000000,10000000000,100000000000,1000000000,1000000000,1000000,1000000,1000000,1000000,1000000,100000,10000,100,10,0,10,100,10000,100000,1000,1000,1,1,1,1,1'.split(',');
var tempstr = 8000000000000;
for (i=0;i<32;i++)
if (posArray[i] != '99') tempstr += parseInt(notStr[i]);
if (top.search_end_pos != null)
top.search_end_pos.location.href = 'search.asp?e=' + tempstr.toString().match(/[0-5]/gi).join('_');
else
window.open(dpxq_search_url + '?site=' + location.hostname + '&e=' + tempstr.toString().match(/[0-5]/gi).join('_') + '&f=' + nownum + '&b=' + position + '&m=' + movelist,'','resizable=yes,status=yes');
}
function SearchEndDiy()
{
if (top.search_diy != null)
{
var end = 877000000000000;
for (i=0;i<32;i++)
end += parseInt(top.search_diy.document.getElementsByTagName("div").item(i).style.backgroundImage.substr(4));
top.search_end_pos.location.href = 'search.asp?e=' + end.toString().match(/[0-5]/gi).join('_');
}
else
window.open(dpxq_search_url + '?site=' + location.hostname + '&f=' + nownum + '&b=' + position + '&m=' + movelist,'','resizable=yes,status=yes');
}
function getUBB()
{
document.getElementById("source_Text").value=get_arg;
}
function getHTML()
{
var DhtmlXQ_iframeID = parseInt(Math.random()*10000,10);
document.getElementById("source_Text").value='<div id="dhtmlxq' + DhtmlXQ_iframeID + '" style="display:none;">\r\n' + get_arg + '\r\n棋谱由<a href="http://www.dpxq.com/hldcg/dhtmlxq/" target="_blank">http://www.dpxq.com/hldcg/dhtmlxq/</a>生成\r\n</div>\r\n<iframe src="/DhtmlXQ_www_dpxq_com/DhtmlXQ_www_dpxq_com.htm" name="name_dhtmlxq' + DhtmlXQ_iframeID + '" id="id_dhtmlxq' + DhtmlXQ_iframeID + '" width="500" height="350" frameborder="0" allowTransparency="true" bgcolor="transparent" scrolling="no" marginwidth="0" marginheight="0"></iframe>';
}
function getTEXT()
{
var movelist = document.getElementById("movetext").innerText.substr(8).match(/.{10,20}/gi);
if (movelist != null)
movelist = movelist.join('\r\n');
else
movelist = '';
document.getElementById("source_Text").value=document.getElementById("info_Text").value + '\r\n\r\n' + movelist + '\r\n\r\n棋谱由http://dhtmlxq.dpxq.com/生成';
}
function getVARTEXT()
{
document.getElementById("source_Text").value='正在制作中!';
}
function getIMGTEXT()
{
var imgtemp1 = new Array();
imgtemp1[0] = ' │ │ │ │\│/│ │ │ │ ';
imgtemp1[1] = ' │ │ │ │/│\│ │ │ │ ';
imgtemp1[2] = ' │ │ │ │ │ │ │ │ │ ';
imgtemp1[3] = ' │ │ │ │ │ │ │ │ │ ';
imgtemp1[4] = ' │ │ ';
imgtemp1[5] = ' │ │ │ │ │ │ │ │ │ ';
imgtemp1[6] = ' │ │ │ │ │ │ │ │ │ ';
imgtemp1[7] = ' │ │ │ │\│/│ │ │ │ ';
imgtemp1[8] = ' │ │ │ │/│\│ │ │ │ ';
imgtemp1[9] = '';
var imgtemp2 = new Array();
imgtemp2[0] = ' ┌-,-┬-,-┬-,-┬-,-┬-,-┬-,-┬-,-┬-,-┐ '.split(',');
imgtemp2[1] = ' ├-,-┼-,-┼-,-┼-,-※-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[2] = ' ├-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[3] = ' ├-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[4] = ' ├-,-┴-,-┴-,-┴-,-┴-,-┴-,-┴-,-┴-,-┤ '.split(',');
imgtemp2[5] = ' ├-,-┬-,-┬-,-┬-,-┬-,-┬-,-┬-,-┬-,-┤ '.split(',');
imgtemp2[6] = ' ├-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[7] = ' ├-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[8] = ' ├-,-┼-,-┼-,-┼-,-※-,-┼-,-┼-,-┼-,-┤ '.split(',');
imgtemp2[9] = ' └-,-┴-,-┴-,-┴-,-┴-,-┴-,-┴-,-┴-,-┘ '.split(',');
var imgtemp3 = '(车),(马),(相),(士),(帅),(士),(相),(马),(车),(炮),(炮),(兵),(兵),(兵),(兵),(兵),[车],[马],[象],[士],[将],[士],[象],[马],[车],[炮],[炮],[卒],[卒],[卒],[卒],[卒]'.split(',');
var imgtext = ' 黑方 \r\n ';
for (i=0;i<9;i++)
{
for (j=0;j<10;j++)
if (poslist[i*10+j] < 32)
imgtemp2[j][i] = imgtemp3[poslist[i*10+j]];
}
for (i=0;i<10;i++)
imgtext += '\r\n ' + imgtemp2[i].join('') + ' \r\n' +imgtemp1[i];
imgtext += ' \r\n 红方 \r\n';
document.getElementById("source_Text").value = imgtext.replace(/ /gi,' ').replace(/\-\-/gi,'─');
}
function getFENTEXT()
{
document.getElementById("source_Text").value=posArray.join('|');
}
function getXQSTUDIOJAVA()
{
document.getElementById("source_Text").value=document.getElementById("info_Text").value + '\r\n\r\n' + document.getElementById("movetext").innerText.substr(8).match(/.{18}/gi).join('\r\n');
}
function getCCBRIDGEJAVA()
{
document.getElementById("source_Text").value=document.getElementById("info_Text").value + '\r\n\r\n' + document.getElementById("movetext").innerText.substr(8).match(/.{18}/gi).join('\r\n');
}
function getWEBCHESSJAVA()
{
document.getElementById("source_Text").value=document.getElementById("info_Text").value + '\r\n\r\n' + document.getElementById("movetext").innerText.substr(8).match(/.{18}/gi).join('\r\n');
}
function getSEARCH()
{
document.getElementById("search_Text").innerHTML='<div style="margin:6px 2px 2px 2px;"> 系统测试期间,功能有待完善,欢迎大家提建议<br><br>技术支持:弈天东邪 联系QQ:88081492<br>电子邮箱 和 MSN:hldcg@hotmail.com<br>动态棋盘生成页面 <a href="http://dhtmlxq.dpxq.com/" target="_blank" style="color:#0000FF">http://dhtmlxq.dpxq.com</a></div></div>';
}
function getINFO()
{
document.getElementById("info_Text").value='标题:'+getvar("title")+'\r\n赛事:'+getvar("event")+'\r\n轮次:'+getvar("round")+'\r\n日期:'+getvar("date")+'\r\n地点:'+getvar("place")+'\r\n时钟:'+getvar("timerule")+'\r\n布局:'+getvar("ecco")+'\r\n红方:'+getvar("red")+'\r\n黑方:'+getvar("black")+'\r\n结果:'+getvar("result")+'\r\n结束方式:'+getvar("endtype")+'\r\n红方用时:'+getvar("redtime")+'\r\n黑方用时:'+getvar("blacktime")+'\r\n红等级分:'+getvar("redrating")+'\r\n黑等级分:'+getvar("blackrating")+'\r\n棋局类型:'+getvar("type")+'\r\n棋局性质:'+getvar("gametype")+'\r\n评注:'+getvar("remark")+'\r\n作者:'+getvar("author")+'\r\n来源:'+unescape(getvar("refer")).split('\r')[0]+'\r\n其他:'+getvar("other");
}
function Copyright()
initdata();
initboard();
这个我就搞不懂了,不过我可以把我的代码贴出来看看,请老师给我改改。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY>
<P>
对兵局(01)</P>
<P>
由于仙人指路新式武器的狂轰滥炸,一些经典定式也在不断的更新和演化。稳健派希望能在和平环境下较量内功,以“进卒”迎战仙人指路当然是首选。可是“树欲静而风不止”,棋场依然惊涛骇浪,暗流汹涌。
</P>
<P>1. 兵七进一 卒7进1 2. 炮二平三 炮8平5 </P>
<P>
在11月9日苗永鹏VS董旭彬时走炮2平5,兵三进一,马2进3,兵三进一,马8进9,相七进五,车1平2,马二进一,炮5进4,仕六进五,炮5平8,终局和棋。
</P>
<P>3. 马八进七 马8进7 4. 炮三进三 ………… </P>
<P>炮打7卒既得实惠又可转换成屏风马阵势,是近年来新兴的战术,流行着法是相七进五。</P>
<P> 4. ………… 炮2平3</P>
<P> 针锋相对,准备冲卒欺马。</P>
<P> 5. 炮三进一 马2进1</P>
<P> 怪,为什么不走卒3进1冲卒呢?因为红可接走马七进六,炮5进4,马六进四,炮5退2,兵七进一,虽有空头炮,但因没有后续兵力支援而孤掌难鸣。</P>
<P> 6. 马二进三 车1平2 7. 炮八平九 卒3进1</P>
<P> 8. 马七进六 ………… </P><APPLET codeBase="http://www.dpxq.com/java/"
code=DhtmlXQ.class width=500 height=350 MAYSCRIPT><PARAM NAME="ubb" VALUE="[DhtmlXQJAVA][DhtmlXQ_ver]www_dpxq_com[/DhtmlXQ_ver][DhtmlXQ_init]500,350[/DhtmlXQ_init][DhtmlXQ_binit]0919293949596979891777062646668600102030405060708012720323436383[/DhtmlXQ_binit][DhtmlXQ_title]对兵局[/DhtmlXQ_title][DhtmlXQ_result]未知[/DhtmlXQ_result][DhtmlXQ_remark]梁文斌[/DhtmlXQ_remark][DhtmlXQ_movelist]262563647767724219277062676412226463100279670010170723242735242535542223070323630363101454734041897942226665222363230223294723350929[/DhtmlXQ_movelist][DhtmlXQ_move_0_16_1]4344074710136365222535565041897944454745134329472565666542454645434556646254647280700908[/DhtmlXQ_move_0_16_1][DhtmlXQ_comment0] 由于仙人指路新式武器的狂轰滥炸,一些经典定式也在不断的更新和演化。稳健派希望能在和平环境下较量内功,以“进卒”迎战仙人指路当然是首选。可是“树欲静而风不止”,棋场依然惊涛骇浪,暗流汹涌。[/DhtmlXQ_comment0][DhtmlXQ_comment4] 在11月9日苗永鹏VS董旭彬时走炮2平5,兵三进一,马2进3,兵三进一,马8进9,相七进五,车1平2,马二进一,炮5进4,仕六进五,炮5平8,终局和棋。[/DhtmlXQ_comment4][DhtmlXQ_comment7] 炮打7卒既得实惠又可转换成屏风马阵势,这是近年来新兴的战术,流行着法是相七进五。[/DhtmlXQ_comment7][DhtmlXQ_comment8] 针锋相对,准备冲卒欺马。[/DhtmlXQ_comment8][DhtmlXQ_comment10] 怪,为什么不走卒3进1冲卒呢?因为红可接走马七进六,炮5进4,马六进四,炮5退2,兵七进一,虽有空头炮,但因没有后续兵力支援而孤掌难鸣。[/DhtmlXQ_comment10][DhtmlXQ_comment15] 如图形势,黑方在比赛中有卒3进1和卒5进1两种下法。分述如下:||(一)卒3进1||(2000年11月9日赵国荣VS张江第二轮之战)[/DhtmlXQ_comment15][DhtmlXQ_comment20] 似可改走车9平8,车一平二,车8进9,马三退二,马7退9,尚可坚守。[/DhtmlXQ_comment20][DhtmlXQ_comment26] 如改走车2平7,车九平八,马1进2,兵三进一,红优。[/DhtmlXQ_comment26][DhtmlXQ_comment33] 红优。|| 小结:这是一个发展中的新兴战术,黑方急于冲卒欺马是造成落后的原因。||||(二)卒5进1||(2000年11月10日吕钦VS郑一泓第三轮之战)[/DhtmlXQ_comment33][DhtmlXQ_comment1_16] 挺进中卒为黑车捉炮开辟了一条通道,构思新奇。[/DhtmlXQ_comment1_16][DhtmlXQ_comment1_37] 红方稍优。|| 小结:黑方的改进效果明显优于上局,但总觉得这个布局是被动防守型,黑方反攻争胜的几率较小。[/DhtmlXQ_comment1_37][DhtmlXQ_refer]http%3A//www.dpxq.com/%0D%0Ahttp%3A//www.dpxq.com/hldcg/dhtmlxq/frame.htm[/DhtmlXQ_refer][DhtmlXQ_generator]www.dpxq.com[/DhtmlXQ_generator][/DhtmlXQJAVA]"></APPLET>
<P>如图形势,黑方在比赛中有卒3进1和卒5进1两种下法。分述如下:(一)卒3进1 (2000年11月9日赵国荣VS张江第二轮之战)</P>
<P> 8. ………… 卒3进1 9. 马六进四 炮3进1 </P>
<P>10. 炮九进四 炮3平7 </P>
<P>似可改走车9平8,车一平二,车8进9,马三退二,马7退9,尚可坚守。</P>
<P> 11. 炮九平三 车2进4 12. 马四进二 将5进1 </P>
<P>13. 车一平二 炮5平3</P>
<P> 如改走车2平7,车九平八,马1进2,兵三进一,红优。</P>
<P> 14. 兵三进一 炮3进1 15. 炮三平七 马1进3 </P>
<P>16. 相七进五 马3进4 17. 车九平七 </P>
<P>红优。 </P>
<P>小结:这是一个发展中的新兴战术,黑方急于冲卒欺马是造成落后的原因。 (二)卒5进1 (2000年11月10日吕钦VS郑一泓第三轮之战) </P>
<P>8. ………… 卒5进1 </P>
<P>挺进中卒为黑车捉炮开辟了一条通道,构思新奇。</P>
<P> 9. 炮九平五 车2进3 10. 炮三退二 炮3进3 </P>
<P>11. 马六退四 士6进5 12. 车一平二 卒5进1 </P>
<P>13. 炮五进二 车2平5 14. 相七进五 炮3平7 </P>
<P>15. 兵三进一 炮5进3 16. 兵五进一 车5进2</P>
<P> 17. 马四进三 马7进6 18. 前马进二 车9平8</P>
<P> 19. 车九进一</P>
<P> 红方稍优。 </P>
<P>小结:黑方的改进效果明显优于上局,但总觉得这个布局是被动防守型,黑方反攻争胜的几率较小。 </P></BODY></HTML>
现在遇到的问题就是,可以看见动态棋谱(当然可以打谱)可以看见文字说明,有背景。就是在断网的情况下看不见棋谱,两张照片随后附上。