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