时间:2021-05-18
http://www.masswerk.at/jsuix/
//JS/UIXv0.44
//(c)mass:werk(N.Landsteiner)2003
//allrightsreserved
//termgui
varconf_term_x=102;
varconf_term_y=34;
varconf_kbd_offset=34;
vartermImgPath='jsuix_support/';
vartermDiv='termDiv';
vartermBgColor='#181818';
vartermFrameColor='#555555';
vartermPageColor='#222222';
varconf_repeat_delay1=320;
varconf_repeat_delay2=170;
vartermKbdDiv='termKbdDiv';
vartermKbdBgColor='#222222';
varkeycapspath='jsuix_support/keycaps/';
vartermSubDivs=false;
vartermLayers=false;
vartermDocNS4=null;
vartermStringStart='';
vartermStringEnd='';
vartermKbdDocNS4=null;
vartermKbdOn=false;
varkeycapsShift=false;
varkeycapsCpslk=false;
varkeycapsShiftRef=newArray();
varkeycapsCpslkRef=newArray();
vartermSpecials=newArray();
termSpecials[0]=' ';
termSpecials[1]='$';
termSpecials[2]=' ';
termSpecials[3]='?';
termSpecials[4]='#';
termSpecials[32]=' ';
termSpecials[34]='"';
termSpecials[38]='&';
termSpecials[60]='<';
termSpecials[62]='>';
termSpecials[127]='◊';
vartermStyles=newArray(1,2,4,8);
vartermStyleOpen=newArray();
vartermStyleClose=newArray();
termStyleOpen[1]='<SPANCLASS="termReverse">';
termStyleClose[1]='<\/SPAN>';
termStyleOpen[2]='<U>';
termStyleClose[2]='<\/U>';
termStyleOpen[4]='<I>';
termStyleClose[4]='<\/I>';
termStyleOpen[8]='<STRIKE>';
termStyleClose[8]='<\/STRIKE>';
//buttonsUI
vartermImgNames=newArray('left_lo','left_hi','right_lo','right_hi','delete_lo','delete_hi','esc_lo','esc_hi','kbd_show_lo','kbd_show_hi','kbd_hide_lo','kbd_hide_hi');
vartermImages=newArray();
functiontermImgPreload(path,imgnames){
for(vari=0;i<imgnames.length;i++){
varn=imgnames[i];
termImages[n]=newImage();
termImages[n].src=path+n+'.gif'
}
}
if(document.images)termImgPreload(termImgPath,termImgNames);
functiontermSetImg(n,v){
if(document.images){
varimg=(termLayers)?termDocNS4.images['term_'+n]:document.images['term_'+n];
varstat=(v)?'_hi':'_lo';
img.src=termImages[n+stat].src
}
}
//UIkeyboard
//keymaps(200=leftshift,202=rightshift,204=CpsLock)
vartermKeyMap=[
[96,49,50,51,52,53,54,55,56,57,48,45,61,8],
[27,113,119,101,114,116,121,117,105,111,112,91,93,13],
[204,97,115,100,102,103,104,106,107,108,59,39,35],
[200,92,122,120,99,118,98,110,109,44,46,47,30,202],
[32,28,31,29]
];
vartermKeyMapShift=[
[126,33,34,35,36,37,94,38,42,40,41,95,43,8],
[27,81,87,69,82,84,89,85,73,79,80,123,125,13],
[204,65,83,68,70,71,72,74,75,76,58,34,64],
[200,124,90,88,67,86,66,78,77,60,62,63,30,202],
[32,28,31,29]
];
vartermKeyMapCpslk=[
[96,49,50,51,52,53,54,55,56,57,48,45,61,8],
[27,81,87,69,82,84,89,85,73,79,80,91,93,13],
[204,65,83,68,70,71,72,74,75,76,59,39,35],
[200,92,90,88,67,86,66,78,77,44,46,47,30,202],
[32,28,31,29]
];
vartermKeyWdth=[
[35,35,35,35,35,35,35,35,35,35,35,35,35,69],
[55,35,35,35,35,35,35,35,35,35,35,35,35,0],
[65,35,35,35,35,35,35,35,35,35,35,35,35],
[49,35,35,35,35,35,35,35,35,35,35,35,35,54],
[252,35,35,35]
];
varkeycapsImgNames=newArray(200,201,202,203,204,205);
functiontermKeyCaps(k){
if((k<28)&&(k>=32)&&(repeatTimer))clearTimeout(repeatTimer);
if(k==204){
keycapsCpslk=(!keycapsCpslk);
varcnr=(keycapsCpslk)?205:204;
termKbdSetImg(204,cnr)
}
elseif((k==200)||(k==202)){
keycapsShift=(!keycapsShift);
varm=(keycapsShift)?1:0;
termKbdSetImg(200,200+m);
termKbdSetImg(202,202+m)
}
else{
varch=0;
if(keycapsShift){
ch=keycapsShiftRef[k]
keycapsShift=false;
termKbdSetImg(200,200);
termKbdSetImg(202,202)
}
elseif(keycapsCpslk)ch=keycapsCpslkRef[k]
elsech=k;
keyHandler({which:ch,jsuix_remapped:true})
}
}
functiontermKbdSetImg(n,v){
if(document.images){
varimg=(termLayers)?termKbdDocNS4.images['key'+n]:document.images['key'+n];
img.src=termImages[v].src
}
}
functiontermSetKbdButton(v){
if(document.images){
varimg=(termLayers)?termDocNS4.images.term_kbd_show:document.images.term_kbd_show;
varn=(termKbdOn)?'kbd_hide':'kbd_show';
varstat=(v)?'_hi':'_lo';
img.src=termImages[n+stat].src
}
}
functiontermKbdShow(){
if(termKbdOn){
setDivVisibility(termKbdDiv,0);
termKbdOn=false;
termSetKbdButton(0)
}
else{
termImgPreload(keycapspath,keycapsImgNames);
keycapsShift=false;
keycapsCpslk=false;
vars='<TABLEBORDER="0"CELLSPACING="0"CELLPADDING="0">\n';
s+='<TR><TDWIDTH="7"BGCOLOR="'+termPageColor+'"><IMGSRC="'+keycapspath+'spacer.gif"WIDTH="7"HEIGHT="2"><\/TD>\n';
s+='<TDBGCOLOR="'+termPageColor+'">'+termMakeKbd()+'</TD>\n';
s+'<TDWIDTH="7"BGCOLOR="'+termPageColor+'"><IMGSRC="'+keycapspath+'spacer.gif"WIDTH="7"HEIGHT="2"><\/TD><\TR>\n';
s+='<TR><TDHEIGHT="10"COLSPAN="3"BGCOLOR="'+termPageColor+'"><IMGSRC="'+keycapspath+'spacer.gif"WIDTH="2"HEIGHT="10"><\/TD><\/TR>\n';
s+='<\/TABLE>';
writeElement(termKbdDiv,s);
setDivXY(termKbdDiv,conf_term_x,conf_term_y+conf_kbd_offset+conf_rows*conf_rowheigt);
if(termLayers)termKbdDocNS4=document.layers[termKbdDiv].document;
termKbdOn=true;
setDivVisibility(termKbdDiv,1);
termSetKbdButton(0)
}
}
functiontermMakeKbd(){
vars='<TABLEBORDER="0"CELLSPACING="0"CELLPADDING="0">\n';
for(vari=0;i<termKeyMap.length;i++){
s+='<TR><TDNOWRAPHEIGHT="39"VALIGN="top"NOWRAPBGCOLOR="'+termKbdBgColor+'">';
for(vark=0;k<termKeyMap[i].length;k++){
varkc=termKeyMap[i][k];
keycapsShiftRef[kc]=termKeyMapShift[i][k];
keycapsCpslkRef[kc]=termKeyMapCpslk[i][k];
if(kc==13){
s+='<AHREF="javas'+'cript:termKeyCaps(13)"onfocus="if(this.blur)this.blur()"><IMGSRC="'+keycapspath+'13_1.gif"HSPACE="0"VSPACE="0"ALIGN="top"BORDER="0"WIDTH="47"HEIGHT="39"><\/A>';
continue
};
if(kc==32)s+='<IMGSRC="'+keycapspath+'spacer.gif"WIDTH="139"HEIGHT="35"HSPACE="1"VSPACE="1"ALIGN="top">'
elseif(kc==28){
s+='<IMGSRC="'+keycapspath+'spacer.gif"WIDTH="23"HEIGHT="35"HSPACE="1"VSPACE="1"ALIGN="top">';
s+='<AHREF="javasc'+'ript:cursorKbdLeft()"onfocus="if(this.blur)this.blur()"onmousedown="repeatSet(\'left\',1)"onmouseup="repeatClear()"><IMGSRC="'+keycapspath+kc+'.gif"NAME="key'+kc+'"HSPACE="1"VSPACE="1"ALIGN="top"BORDER="0"WIDTH="'+termKeyWdth[i][k]+'"HEIGHT="35"><\/A>';
continue
}
elseif(kc==29){
s+='<AHREF="javasc'+'ript:cursorKbdRight()"onfocus="if(this.blur)this.blur()"onmousedown="repeatSet(\'right\',1)"onmouseup="repeatClear()"><IMGSRC="'+keycapspath+kc+'.gif"NAME="key'+kc+'"HSPACE="1"VSPACE="1"ALIGN="top"BORDER="0"WIDTH="'+termKeyWdth[i][k]+'"HEIGHT="35"><\/A>';
continue
}
elseif(kc==8){
s+='<AHREF="javasc'+'ript:termKbdBackspace()"onfocus="if(this.blur)this.blur()"onmousedown="repeatSet(\'backspace\',1)"onmouseup="repeatClear()"><IMGSRC="'+keycapspath+kc+'.gif"NAME="key'+kc+'"HSPACE="1"VSPACE="1"ALIGN="top"BORDER="0"WIDTH="'+termKeyWdth[i][k]+'"HEIGHT="35"><\/A>';
continue
}
s+='<AHREF="javas'+'cript:termKeyCaps('+kc+')"onfocus="if(this.blur)this.blur()"><IMGSRC="'+keycapspath+kc+'.gif"NAME="key'+kc+'"HSPACE="1"VSPACE="1"ALIGN="top"BORDER="0"WIDTH="'+termKeyWdth[i][k]+'"HEIGHT="35"><\/A>';
if(kc==35)s+='<AHREF="javas'+'cript:termKeyCaps(13)"onfocus="if(this.blur)this.blur()"><IMGSRC="'+keycapspath+'13_2.gif"HSPACE="0"VSPACE="0"ALIGN="top"BORDER="0"WIDTH="37"HEIGHT="36"><\/A>';
};
s+='<\/TD><\/TR>\n';
};
s+='<\/TABLE>';
returns
}
//termUI
functiontermHide(){
if(repeatTimer)clearTimeout(repeatTimer);
if(termKbdOn)termKbdShow();
setDivVisibility(termDiv,0)
}
functionmakeTerm(){
window.status='Buildingterminal...';
termLayers=(document.layers)?true:false;
termSubDivs=(navigator.userAgent.indexOf('Gecko')<0);
vars='';
s+='<TABLEBORDER="0"CELLSPACING="0"CELLPADDING="1">\n';
s+='<TR><TDBGCOLOR="'+termFrameColor+'"COLSPAN="2"><TABLEBORDER="0"CELLSPACING="0"CELLPADDING="2"><TR><TDBGCOLOR="'+termBgColor+'"><TABLEBORDER="0"CELLSPACING="0"CELLPADDING="0">\n';
varrstr='';
for(varc=0;c<conf_cols;c++)rstr+=' ';
for(varr=0;r<conf_rows;r++){
varid=((termLayers)||(termSubDivs))?'':'ID="term_'+r+'"';
s+='<TR><TDNOWRAPHEIGHT="'+conf_rowheigt+'"'+id+'CLASS="term">'+rstr+'<\/TD><\/TR>\n';
};
s+='<\/TABLE><\/TD><\/TR>\n';
s+='<\/TABLE><\/TD><\/TR>\n';
s+='<TR>\n<TDVALIGN="middle"BGCOLOR="'+termPageColor+'"><TABLEBORDER="0"CELLSPACING="0"CELLPADDING="1"><TR>\n';
s+='<TD><AHREF="javasc'+'ript:termKbdShow()"onmouseover="termSetKbdButton(1);window.status=\'show/hidefullgraphickeyboard\';returntrue"onmouseout="termSetKbdButton(0);window.status=\'\';returntrue"onfocus="if(this.blur)this.blur()"><IMGSRC="'+termImgPath+'kbd_show_lo.gif"NAME="term_kbd_show"WIDTH="73"HEIGHT="19"BORDER="0"HSPACE="5"ALT="show/hidekeyboard"><\/A><\/TD><\/TR><\/TABLE><\/TD>\n';
s+='<TDALIGN="right"><TABLEBORDER="0"CELLSPACING="0"CELLPADDING="1"><TR>\n';
s+='<TD><AHREF="javasc'+'ript:cursorKbdLeft()"onmouseover="termSetImg(\'left\',1);window.status=\'left\';returntrue"onmouseout="termSetImg(\'left\',0);window.status=\'\';returntrue"onfocus="if(this.blur)this.blur()"TITLE="cursorleft"onmousedown="repeatSet(\'left\',1)"onmouseup="repeatClear()"><IMGSRC="'+termImgPath+'left_lo.gif"NAME="term_left"WIDTH="23"HEIGHT="23"ALT="cursorleft"BORDER="0"><\/A><\/TD>\n';
s+='<TD><AHREF="javasc'+'ript:cursorKbdRight()"onmouseover="termSetImg(\'right\',1);window.status=\'right\';returntrue"onmouseout="termSetImg(\'right\',0);window.status=\'\';returntrue"onfocus="if(this.blur)this.blur()"TITLE="cursorright"onmousedown="repeatSet(\'right\',1)"onmouseup="repeatClear()"><IMGSRC="'+termImgPath+'right_lo.gif"NAME="term_right"WIDTH="23"HEIGHT="23"ALT="cursorright"BORDER="0"><\/A><\/TD>\n';
s+='<TD><AHREF="javasc'+'ript:termKbdBackspace()"onmouseover="termSetImg(\'delete\',1);window.status=\'backspace\';returntrue"onmouseout="termSetImg(\'delete\',0);window.status=\'\';returntrue"onfocus="if(this.blur)this.blur()"TITLE="backspace"onmousedown="repeatSet(\'backspace\',1)"onmouseup="repeatClear()"><IMGSRC="'+termImgPath+'delete_lo.gif"NAME="term_delete"WIDTH="23"HEIGHT="23"ALT="backspace"BORDER="0"><\/A><\/TD>\n';
s+='<TD><AHREF="javasc'+'ript:termKbdEsc()"onmouseover="termSetImg(\'esc\',1);window.status=\'esc\';returntrue"onmouseout="termSetImg(\'esc\',0);window.status=\'\';returntrue"onfocus="if(this.blur)this.blur()"TITLE="esc"><IMGSRC="'+termImgPath+'esc_lo.gif"NAME="term_esc"WIDTH="23"HEIGHT="23"ALT="esc"BORDER="0"><\/A><\/TD>\n';
s+='<\/TR><\/TABLE><\/TD><\/TR>\n';
s+='<\/TABLE>\n';
if(termLayers){
for(varr=0;r<conf_rows;r++){
s+='<LAYERNAME="term_'+r+'"TOP="'+(3+r*conf_rowheigt)+'"LEFT="3"CLASS="term"><\/LAYER>\n'
};
termDocNS4=document.layers[termDiv].document;
termStringStart='<TABLEBORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDNOWRAPHEIGHT="'+conf_rowheigt+'"CLASS="term">';
termStringEnd='<\/TD><\/TR><\/TABLE>';
}
elseif(termSubDivs){
for(varr=0;r<conf_rows;r++){
s+='<DIVID="term_'+r+'"STYLE="position:absolute;top:'+(3+r*conf_rowheigt)+'px;left:3px;"CLASS="term"><\/DIV>\n'
};
termStringStart='<TABLEBORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDNOWRAPHEIGHT="'+conf_rowheigt+'"CLASS="term">';
termStringEnd='<\/TD><\/TR><\/TABLE>';
};
writeElement(termDiv,s);
setDivXY(termDiv,conf_term_x,conf_term_y);
setDivVisibility(termDiv,1);
window.status=''
}
functiontermDisplay(r){
vars=termStringStart;
varcurStyle=0;
for(vari=0;i<conf_cols;i++){
varc=term[r][i];
varcs=termStyle[r][i];
if(cs!=curStyle){
if(curStyle){
for(vark=termStyles.length-1;k>=0;k--){
varst=termStyles[k];
if(curStyle&st)s+=termStyleClose[st];
}
};
curStyle=cs;
for(vark=0;k<termStyles.length;k++){
varst=termStyles[k];
if(curStyle&st)s+=termStyleOpen[st];
}
};
s+=(termSpecials[c])?termSpecials[c]:String.fromCharCode(c);
};
if(curStyle>0){
for(vark=termStyles.length-1;k>=0;k--){
varst=termStyles[k];
if(curStyle&st)s+=termStyleClose[st];
}
};
s+=termStringEnd;
writeElement('term_'+r,s,termDocNS4)
}
functiontermGuiReady(){
ready=true;
if(termGuiElementReady(termDiv,self.document)){
for(varr=0;r<conf_rows;r++){
if(termGuiElementReady('term_'+r,termDocNS4)==false){
ready=false;
break
}
}
}
elseready=false;
returnready
}
functioncursorKbdLeft(){
keyHandler({which:28})
}
functioncursorKbdRight(){
keyHandler({which:29})
}
functiontermKbdBackspace(){
keyHandler({which:8})
}
functiontermKbdEsc(){
keyHandler({which:27})
}
functiontermKbdClear(){
if((!cnslLock)&&(!cnslRawMode))cnslReset();
}
//UI-buttonrepeat
functionrepeatSet(cmd,on){
if(repeatTimer)clearTimeout(repeatTimer);
repeatTimer=setTimeout('repeatDo("'+cmd+'")',conf_repeat_delay1);
}
functionrepeatClear(){
if(repeatTimer)clearTimeout(repeatTimer);
}
functionrepeatDo(cmd){
if(repeatTimer)clearTimeout(repeatTimer);
if(cmd=='left')cursorKbdLeft()
elseif(cmd=='right')cursorKbdRight()
elseif(cmd=='backspace')termKbdBackspace();
repeatTimer=setTimeout('repeatDo("'+cmd+'")',conf_repeat_delay2);
}
//basicdynamics
functionwriteElement(e,t,d){
if(document.layers){
vardoc=(d)?d:self.document;
doc.layers[e].document.open();
doc.layers[e].document.write(t);
doc.layers[e].document.close()
}
elseif(document.getElementById){
varobj=document.getElementById(e);
obj.innerHTML=t
}
elseif(document.all){
document.all[e].innerHTML=t
}
}
functionsetDivXY(d,x,y){
if(document.layers){
document.layers[d].moveTo(x,y)
}
elseif(document.getElementById){
varobj=document.getElementById(d);
obj.style.left=x+'px';
obj.style.top=y+'px'
}
elseif(document.all){
document.all[d].style.left=x+'px';
document.all[d].style.top=y+'px'
}
}
functionsetDivVisibility(d,v){
if(document.layers){
document.layers[d].visibility=(v)?'show':'hide';
}
elseif(document.getElementById){
varobj=document.getElementById(d);
obj.style.visibility=(v)?'visible':'hidden';
}
elseif(document.all){
document.all[d].style.visibility=(v)?'visible':'hidden';
}
}
functiontermGuiElementReady(e,d){
if(document.layers){
vardoc=(d)?d:self.document;
return((doc)&&(doc.layers[e]))?true:false
}
elseif(document.getElementById){
return(document.getElementById(e))?true:false
}
elseif(document.all){
return(document.all[e])?true:false
}
elsereturnfalse
}
//eof
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
网上买的电脑基本上系统是已经安装好的,但是操作系统如果写freedos的就是不含操作系统,这种情况下是要自己安装。苹果电脑都是含操作系统的,无须自己安装。 操
我想大多数人听说过Node.js,但是你听说过NodeOS吗?没错,NodeOS,一个用Node.js写的操作系统。好吧,实话说,NodeOS用Linux内核来
系统软件分为操作系统、语言处理程序、数据库管理、辅助程序四类。常用的系统有DOS操作系统、WINDOWS操作系统、UNIX操作系统和Linux、Netware等
本文介绍了用Node.js写一个简单的命令行工具,分享给大家,具体如下:操作系统需要为Linux1.目标在命令行输入自己写的命令,完成目标任务命令行要求全局有效
无论是MacOS还是iOS,苹果的操作系统总是被认为足够安全,但近来事实证明也不尽然。国外媒体最新报道称,安全研究人员最新发现了iOS系统漏洞,该漏洞可被利用,