]> gitweb.factorcode.org Git - factor.git/blob - extra/webapps/fjsc/www/termlib/multiterm_test.html
core: Add the shuffler words but without primitives.
[factor.git] / extra / webapps / fjsc / www / termlib / multiterm_test.html
1 <HTML>
2 <HEAD>
3         <TITLE>termlib Multiple Terminal Test</TITLE>
4         <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="termlib.js"></SCRIPT>
5
6 <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
7 <!--
8
9 /*
10   multiple terminal test for termlib.js
11
12   (c) Norbert Landsteiner 2003-2005
13   mass:werk - media environments
14   <http://www.masswerk.at>
15
16 */
17
18 var term=new Array();
19
20 var helpPage=[
21         '%CS%+r Terminal Help %-r%n',
22         '  This is just a tiny test for multiple terminals.',
23         '  use one of the following commands:',
24         '     clear .... clear the terminal',
25         '     exit ..... close the terminal (or <ESC>)',
26         '     id ....... show terminal\'s id',
27         '     switch ... switch to other terminal',
28         '     help ..... show this help page',
29         '  other input will be echoed to the terminal.',
30         ' '
31 ];
32
33 function termOpen(n) {
34         if (!term[n]) {
35                 var y=(n==1)? 70: 280;
36                 term[n]=new Terminal(
37                         {
38                                 x: 220,
39                                 y: y,
40                                 rows: 12,
41                                 greeting: '%+r +++ Terminal #'+n+' ready. +++ %-r%nType "help" for help.%n',
42                                 id: n,
43                                 termDiv: 'termDiv'+n,
44                                 crsrBlinkMode: true,
45                                 handler: termHandler,
46                                 exitHandler: termExitHandler
47                         }
48                 );
49                 if (term[n]) term[n].open();
50         }
51         else if (term[n].closed) {
52                 term[n].open();
53         }
54         else {
55                 term[n].focus();
56         }
57 }
58
59 function termHandler() {
60         // called on <CR> or <ENTER>
61         this.newLine();
62         var cmd=this.lineBuffer;
63         if (cmd!='') {
64                 if (cmd=='switch') {
65                         var other=(this.id==1)? 2:1;
66                         termOpen(other);
67                 }
68                 else if (cmd=='clear') {
69                         this.clear();
70                 }
71                 else if (cmd=='exit') {
72                         this.close();
73                 }
74                 else if (cmd=='help') {
75                         this.write(helpPage);
76                 }
77                 else if (cmd=='id') {
78                         this.write('terminal id: '+this.id);
79                 }
80                 else {
81                         this.type('You typed: '+cmd);
82                         this.newLine();
83                 }
84         }
85         this.prompt();
86 }
87
88 function termExitHandler() {
89         // optional handler called on exit
90         // activate other terminal if open
91         var other=(this.id==1)? 2:1;
92         if ((term[other]) && (term[other].closed==false)) term[other].focus();
93 }
94
95 //-->
96 </SCRIPT>
97
98 <STYLE TYPE="text/css">
99 body,p,a,td {
100         font-family: courier,fixed,swiss,sans-serif;
101         font-size: 12px;
102         color: #cccccc;
103 }
104 .lh15 {
105         line-height: 15px;
106 }
107 .term {
108         font-family: courier,fixed,swiss,sans-serif;
109         font-size: 12px;
110         color: #33d011;
111         background: none;
112 }
113 .termReverse {
114         color: #111111;
115         background: #33d011;
116 }
117 a,a:link,a:visited {
118         text-decoration: none;
119         color: #77dd11;
120 }
121 a:hover {
122         text-decoration: underline;
123         color: #77dd11;
124 }
125 a:active {
126         text-decoration: underline;
127         color: #dddddd;
128 }
129
130 a.termopen,a.termopen:link,a.termopen:visited {
131         text-decoration: none;
132         color: #77dd11;
133         background: none;
134 }
135 a.termopen:hover {
136         text-decoration: none;
137         color: #222222;
138         background: #77dd11;
139 }
140 a.termopen:active {
141         text-decoration: none;
142         color: #222222;
143         background: #dddddd;
144 }
145
146 </STYLE>
147 </HEAD>
148
149
150 <BODY BGCOLOR="#222222" LINK="#77dd11" TEXT="#cccccc" ALINK="#dddddd" VLINK="#77dd11"
151 TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
152
153 <TABLE BORDER="0" CELLSPACING="20" CELLPADDING="0" ALIGN="center">
154 <TR>
155         <TD NOWRAP><A HREF="index.html">termlib.js home</A></TD>
156         <TD>|</TD>
157         <TD NOWRAP>multiple terminal test</TD>
158         <TD>|</TD>
159         <TD NOWRAP><A HREF="parser_sample.html">sample parser</A></TD>
160         <TD>|</TD>
161         <TD NOWRAP><A HREF="faq.html">faq</A></TD>
162         <TD>|</TD>
163         <TD NOWRAP><A HREF="readme.txt" TITLE="readme.txt (text/plain)">documentation</A></TD>
164 </TR>
165 </TABLE>
166
167 <TABLE BORDER="0" CELLSPACING="20" CELLPADDING="0">
168         <TR><TD NOWRAP>
169                 Multiple Terminal Test<BR>&nbsp;
170         </TD></TR>
171         <TR><TD NOWRAP>
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">&gt; open terminal 1 &nbsp;</A>
173         </TD></TR>
174         <TR><TD NOWRAP>
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">&gt; open terminal 2 &nbsp;</A>
176         </TD></TR>
177         <TR><TD NOWRAP CLASS="lh15">
178                 &nbsp;<BR>
179                 (c) mass:werk,<BR>N. Landsteiner 2003-2005<BR>
180                 <A HREF="http://www.masswerk.at/" TARGET="_blank">http://www.masswerk.at</A>
181         </TD></TR>
182 </TABLE>
183
184 <DIV ID="termDiv1" STYLE="position:absolute; top:20px; left:100px;"></DIV>
185 <DIV ID="termDiv2" STYLE="position:absolute; top:20px; left:100px;"></DIV>
186
187 </BODY>
188 </HTML>