3 <TITLE>termlib Multiple Terminal Test</TITLE>
\r
4 <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="termlib.js"></SCRIPT>
\r
6 <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
\r
10 multiple terminal test for termlib.js
\r
12 (c) Norbert Landsteiner 2003-2005
\r
13 mass:werk - media environments
\r
14 <http://www.masswerk.at>
\r
18 var term=new Array();
\r
21 '%CS%+r Terminal Help %-r%n',
\r
22 ' This is just a tiny test for multiple terminals.',
\r
23 ' use one of the following commands:',
\r
24 ' clear .... clear the terminal',
\r
25 ' exit ..... close the terminal (or <ESC>)',
\r
26 ' id ....... show terminal\'s id',
\r
27 ' switch ... switch to other terminal',
\r
28 ' help ..... show this help page',
\r
29 ' other input will be echoed to the terminal.',
\r
33 function termOpen(n) {
\r
35 var y=(n==1)? 70: 280;
\r
36 term[n]=new Terminal(
\r
41 greeting: '%+r +++ Terminal #'+n+' ready. +++ %-r%nType "help" for help.%n',
\r
43 termDiv: 'termDiv'+n,
\r
44 crsrBlinkMode: true,
\r
45 handler: termHandler,
\r
46 exitHandler: termExitHandler
\r
49 if (term[n]) term[n].open();
\r
51 else if (term[n].closed) {
\r
59 function termHandler() {
\r
60 // called on <CR> or <ENTER>
\r
62 var cmd=this.lineBuffer;
\r
64 if (cmd=='switch') {
\r
65 var other=(this.id==1)? 2:1;
\r
68 else if (cmd=='clear') {
\r
71 else if (cmd=='exit') {
\r
74 else if (cmd=='help') {
\r
75 this.write(helpPage);
\r
77 else if (cmd=='id') {
\r
78 this.write('terminal id: '+this.id);
\r
81 this.type('You typed: '+cmd);
\r
88 function termExitHandler() {
\r
89 // optional handler called on exit
\r
90 // activate other terminal if open
\r
91 var other=(this.id==1)? 2:1;
\r
92 if ((term[other]) && (term[other].closed==false)) term[other].focus();
\r
98 <STYLE TYPE="text/css">
\r
100 font-family: courier,fixed,swiss,sans-serif;
\r
108 font-family: courier,fixed,swiss,sans-serif;
\r
115 background: #33d011;
\r
117 a,a:link,a:visited {
\r
118 text-decoration: none;
\r
122 text-decoration: underline;
\r
126 text-decoration: underline;
\r
130 a.termopen,a.termopen:link,a.termopen:visited {
\r
131 text-decoration: none;
\r
136 text-decoration: none;
\r
138 background: #77dd11;
\r
140 a.termopen:active {
\r
141 text-decoration: none;
\r
143 background: #dddddd;
\r
150 <BODY BGCOLOR="#222222" LINK="#77dd11" TEXT="#cccccc" ALINK="#dddddd" VLINK="#77dd11"
\r
151 TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
\r
153 <TABLE BORDER="0" CELLSPACING="20" CELLPADDING="0" ALIGN="center">
\r
155 <TD NOWRAP><A HREF="index.html">termlib.js home</A></TD>
\r
157 <TD NOWRAP>multiple terminal test</TD>
\r
159 <TD NOWRAP><A HREF="parser_sample.html">sample parser</A></TD>
\r
161 <TD NOWRAP><A HREF="faq.html">faq</A></TD>
\r
163 <TD NOWRAP><A HREF="readme.txt" TITLE="readme.txt (text/plain)">documentation</A></TD>
\r
167 <TABLE BORDER="0" CELLSPACING="20" CELLPADDING="0">
\r
169 Multiple Terminal Test<BR>
\r
172 <A HREF="javascript:termOpen(1)" onfocus="if(this.blur)this.blur();" onmouseover="window.status='terminal 1'; return true" onmouseout="window.status=''; return true" CLASS="termopen">> open terminal 1 </A>
\r
175 <A HREF="javascript:termOpen(2)" onfocus="if(this.blur)this.blur();" onmouseover="window.status='terminal 2'; return true" onmouseout="window.status=''; return true" CLASS="termopen">> open terminal 2 </A>
\r
177 <TR><TD NOWRAP CLASS="lh15">
\r
179 (c) mass:werk,<BR>N. Landsteiner 2003-2005<BR>
\r
180 <A HREF="http://www.masswerk.at/" TARGET="_blank">http://www.masswerk.at</A>
\r
184 <DIV ID="termDiv1" STYLE="position:absolute; top:20px; left:100px;"></DIV>
\r
185 <DIV ID="termDiv2" STYLE="position:absolute; top:20px; left:100px;"></DIV>
\r