diff --git a/extra/webapps/fjsc/www/termlib/faq.html b/extra/webapps/fjsc/www/termlib/faq.html index 5adb516b07..92245e4412 100644 --- a/extra/webapps/fjsc/www/termlib/faq.html +++ b/extra/webapps/fjsc/www/termlib/faq.html @@ -1,356 +1,356 @@ - - - mass:werk termlib faq - - - - - - - - - - - - - - - - - - - -
termlib.js home|multiple terminal test|sample parser|faq|documentation
- - - - - - - - - - - - - - - - -
-

frequently asked questions

-

- -

-Can I add chrome to the terminal? (e.g. a window header, a close box)

- -Not by the means of the Terminal object's interface (since there are way too many things that you may possibly want to add).
-The Terminal object allows you to specify the background color, the frame color, the frame's width and the font class used. If you want to add more chrome, you must align this in a separate division element.

- -To calculate the dimensions of the terminal use this formula:

- -width:  2 * frameWidth + conf.cols * <width of  > + 2 * 2px padding (left and right)
-height: 2 * frameWidth + conf.rows * conf.rowHeight + 2 * 2px padding (top and bottom).

- -Or you could get the empirical values for width and height by calling a terminal's `getDimensions()' method, once the terminal is open. (see documentation in "readme.txt").

- -Finnally, you could obviously embed the terminal's division element in your custom chrome layout (see below). [This will not be compatible to Netscape 4.]

- -p.e.:
-  <div id="myTerminal1" style="position:absolute; top:100px; left:100px;">
-     <table class="termChrome">
-     	<tbody>
-        <tr>
-           <td class="termTitle">terminal 1</td>
-        </tr>
-        <tr>
-           <td class="termBody"><div id="termDiv1" style="position:relative"></div></td>
-        </tr>
-     	</tbody>
-     </table>
-   </div>
-
-   // get a terminal for this
-
-   var term1 = new Terminal(
-                 {
-                   x: 0,
-                   y: 0,
-                   id: 1,
-                   termDiv: "termDiv1",
-                   handler: myTermHandler
-                 }
-              );
-   term1.open();
-   
-   // and this is how to move the chrome and the embedded terminal
-
-   TermGlobals.setElementXY( "myTerminal1", 200, 80 );
-
-To keep track of the instance for any widgets use the terminal's `id' property. (You must set this in the configuration object to a unique value for this purpose.)

- -For a demonstration see the Chrome Sample Page. -

-How can I embed a terminal relative to my HTML layout?

- -Define your devision element with attribute "position" set to "relative" and place this inside your layout. Call "new Terminal()" with config-values { x: 0, y: 0 } to leave it at its relative origin. -

-I pasted your sample code and just got an error. - ???

- -The short examples are kept arbitrarily simple to show the syntax.
-Make sure that your divison element(s) is/are rendered by the browser before `Terminal.open()' is called.

- -Does not work: -
  <head>
-  <script>
-    var term = new Terminal();
-    term.open();
-  </script>
-  </head>
-
-Does work: -
  <head>
-  <script>
-    var term;
-    
-    function termOpen() {
-       // to be called from outside after compile time
-       term = new Terminal();
-       term.open();
-    }
-  </script>
-  </head>
-
-c.f. "readme.txt"
-(Opening a terminal by clicking a link implies also that the page has currently focus.)

-With v.1.01 and higher this doesn't cause an error any more.
`Terminal.prototype.open()' now returns a value for success. -

-I can't get any input, but I don't get any erros too.

- -The Terminal object's functionality relies on the browsers ability to generate and handle keyboard events.
-Sadly some browsers lack a full implementation of the event model. (e.g. Konquerer [khtml] and early versions of Apple Safari, which is a descendant of khtml.) -

-How can I temporary disable the keyboard handlers?
-(The terminal is blocking my HTML form fields, etc.)

- -With version 1.03 there's a global property `TermGlobals.keylock'. Set this to `true' to disable the keyboard handlers without altering any other state. Reset it to `false' to continue with your terminal session(s). -

-How can I set the cusor to the start / the end of the command line?

- -In case you need to implement a shortcut (like ^A of some UN*X-shells) to jump to the beginning or the end of the current input line, there are two private instance methods you could utilize:

-`_getLineEnd(<row>, <col>)' returns an array [<row>, <col>] with the position of the last character in the logical input line with ASCII value >= 32 (0x20).

-`_getLineStart(<row>, <col>)' returns an array [<row>, <col>] with the position of the first character in the logical input line with ASCII value >= 32 (0x20).

-Both take a row and a column of a cursor position as arguments.

- -p.e.: -
-  // jump to the start of the input line
-
-  myCtrlHandler() {
-     // catch ^A and jump to start of the line
-     if (this.inputChar == 1) {
-        var firstChar = this._getLineStart(this.r, this.c);
-        this.cursorSet(firstChar[0], firstChar[1]);
-     }
-  }
-(Keep in mind that this is not exactly a good example, since some browser actually don't issue a keyboard event for -"^A". And other browsers, which do catch such codes, are not very reliable in that.) -

-How can I limit the command history to unique entries only?
- (My application effords commands to be commonly repeated.)

- -With version 1.05 there is a new configuration and control flag `historyUnique'. All you need is setting this to `true' in your terminal's configuration object. -

-How can I change my color theme on the fly?

- -With version 1.07 there is a new method `Terminal.rebuild()'.
-This method updates the GUI to current config settings while preserving all other state.

-p.e.: -
-   // change color settings on the fly
-   // here: set bgColor to white and font style to class "termWhite"
-   // method rebuild() updates the GUI without side effects
-   // assume var term holds a referene to a Terminal object already active
-
-   term.conf.bgColor = '#ffffff';
-   term.conf.fontClass = 'termWhite';
-   term.rebuild();
-

-How can I connect to a server?

- -The Terminal object only provides an interface to handle console input and output.
-External connections have to be handled outside the Terminal object. You could use the XMLHttpRequest-Object (and use a communication model like AJAX or JSON) or connect via a frame or iframe element to a foreign host.

-Handling connections is considered to be out of the realm of the "termlib.js" library.
-The code you need is in fact quite simple: -
-  function connectToHost(url) {
-     if (window.XMLHttpRequest) {
-        request = new XMLHttpRequest();
-     }
-     else if (window.ActiveXObject) {
-         request = new ActiveXObject('Microsoft.XMLHTTP');
-     }
-     if (request) {
-         request.onreadystatechange = requestChangeHandler;
-         request.open('GET', url);
-         request.send('');
-     }
-     else {
-        // XMLHttpRequest not implemented
-     }
-  }
-  
-  function requestChangeHandler() {
-     if (request.readyState == 4) {
-        // readyState 4: complete; now test for server's response status
-        if (request.status == 200) {
-           // response in request.responseText or request.responseXML if XML-code
-           // if it's JS-code we could get this by eval(request.responseText)
-           // by this we could import whole functions to be used via the terminal
-        }
-        else {
-           // connection error
-           // status code and message in request.status and request.statusText
-        }
-     }
-  }
-
-You should use this only together with a timer (window.setTimeout()) to handle connection timeouts.
-Additionally you would need some syntax to authenticate and tell the server what you want.
-For this purpose you could use the following methods of the XMLHttpRequest object:

- - - - - - - -
setRequestHeader("headerLabel", "value")set a HTTP header to be sent to the server
getResponseHeader("headerLabel")get a HTTP header sent from the server
open(method, "url" [, asyncFlag [,
  "userid" [, "password"]]])
assign the destination properties to the request.
be aware that userid and password are not encrypted!
send(content)transmit a message body (post-string or DOM object)
abort()use this to stop a pending connection
- -
-  
- Norbert Landsteiner - August 2005
- http://www.masswerk.at -
-  
- > top of page -
-   -
- -
- - + + + mass:werk termlib faq + + + + + + + + + + + + + + + + + + + +
termlib.js home|multiple terminal test|sample parser|faq|documentation
+ + + + + + + + + + + + + + + + +
+

frequently asked questions

+

+ +

+Can I add chrome to the terminal? (e.g. a window header, a close box)

+ +Not by the means of the Terminal object's interface (since there are way too many things that you may possibly want to add).
+The Terminal object allows you to specify the background color, the frame color, the frame's width and the font class used. If you want to add more chrome, you must align this in a separate division element.

+ +To calculate the dimensions of the terminal use this formula:

+ +width:  2 * frameWidth + conf.cols * <width of  > + 2 * 2px padding (left and right)
+height: 2 * frameWidth + conf.rows * conf.rowHeight + 2 * 2px padding (top and bottom).

+ +Or you could get the empirical values for width and height by calling a terminal's `getDimensions()' method, once the terminal is open. (see documentation in "readme.txt").

+ +Finnally, you could obviously embed the terminal's division element in your custom chrome layout (see below). [This will not be compatible to Netscape 4.]

+ +p.e.:
+  <div id="myTerminal1" style="position:absolute; top:100px; left:100px;">
+     <table class="termChrome">
+     	<tbody>
+        <tr>
+           <td class="termTitle">terminal 1</td>
+        </tr>
+        <tr>
+           <td class="termBody"><div id="termDiv1" style="position:relative"></div></td>
+        </tr>
+     	</tbody>
+     </table>
+   </div>
+
+   // get a terminal for this
+
+   var term1 = new Terminal(
+                 {
+                   x: 0,
+                   y: 0,
+                   id: 1,
+                   termDiv: "termDiv1",
+                   handler: myTermHandler
+                 }
+              );
+   term1.open();
+   
+   // and this is how to move the chrome and the embedded terminal
+
+   TermGlobals.setElementXY( "myTerminal1", 200, 80 );
+
+To keep track of the instance for any widgets use the terminal's `id' property. (You must set this in the configuration object to a unique value for this purpose.)

+ +For a demonstration see the Chrome Sample Page. +

+How can I embed a terminal relative to my HTML layout?

+ +Define your devision element with attribute "position" set to "relative" and place this inside your layout. Call "new Terminal()" with config-values { x: 0, y: 0 } to leave it at its relative origin. +

+I pasted your sample code and just got an error. - ???

+ +The short examples are kept arbitrarily simple to show the syntax.
+Make sure that your divison element(s) is/are rendered by the browser before `Terminal.open()' is called.

+ +Does not work: +
  <head>
+  <script>
+    var term = new Terminal();
+    term.open();
+  </script>
+  </head>
+
+Does work: +
  <head>
+  <script>
+    var term;
+    
+    function termOpen() {
+       // to be called from outside after compile time
+       term = new Terminal();
+       term.open();
+    }
+  </script>
+  </head>
+
+c.f. "readme.txt"
+(Opening a terminal by clicking a link implies also that the page has currently focus.)

+With v.1.01 and higher this doesn't cause an error any more.
`Terminal.prototype.open()' now returns a value for success. +

+I can't get any input, but I don't get any erros too.

+ +The Terminal object's functionality relies on the browsers ability to generate and handle keyboard events.
+Sadly some browsers lack a full implementation of the event model. (e.g. Konquerer [khtml] and early versions of Apple Safari, which is a descendant of khtml.) +

+How can I temporary disable the keyboard handlers?
+(The terminal is blocking my HTML form fields, etc.)

+ +With version 1.03 there's a global property `TermGlobals.keylock'. Set this to `true' to disable the keyboard handlers without altering any other state. Reset it to `false' to continue with your terminal session(s). +

+How can I set the cusor to the start / the end of the command line?

+ +In case you need to implement a shortcut (like ^A of some UN*X-shells) to jump to the beginning or the end of the current input line, there are two private instance methods you could utilize:

+`_getLineEnd(<row>, <col>)' returns an array [<row>, <col>] with the position of the last character in the logical input line with ASCII value >= 32 (0x20).

+`_getLineStart(<row>, <col>)' returns an array [<row>, <col>] with the position of the first character in the logical input line with ASCII value >= 32 (0x20).

+Both take a row and a column of a cursor position as arguments.

+ +p.e.: +
+  // jump to the start of the input line
+
+  myCtrlHandler() {
+     // catch ^A and jump to start of the line
+     if (this.inputChar == 1) {
+        var firstChar = this._getLineStart(this.r, this.c);
+        this.cursorSet(firstChar[0], firstChar[1]);
+     }
+  }
+(Keep in mind that this is not exactly a good example, since some browser actually don't issue a keyboard event for +"^A". And other browsers, which do catch such codes, are not very reliable in that.) +

+How can I limit the command history to unique entries only?
+ (My application effords commands to be commonly repeated.)

+ +With version 1.05 there is a new configuration and control flag `historyUnique'. All you need is setting this to `true' in your terminal's configuration object. +

+How can I change my color theme on the fly?

+ +With version 1.07 there is a new method `Terminal.rebuild()'.
+This method updates the GUI to current config settings while preserving all other state.

+p.e.: +
+   // change color settings on the fly
+   // here: set bgColor to white and font style to class "termWhite"
+   // method rebuild() updates the GUI without side effects
+   // assume var term holds a referene to a Terminal object already active
+
+   term.conf.bgColor = '#ffffff';
+   term.conf.fontClass = 'termWhite';
+   term.rebuild();
+

+How can I connect to a server?

+ +The Terminal object only provides an interface to handle console input and output.
+External connections have to be handled outside the Terminal object. You could use the XMLHttpRequest-Object (and use a communication model like AJAX or JSON) or connect via a frame or iframe element to a foreign host.

+Handling connections is considered to be out of the realm of the "termlib.js" library.
+The code you need is in fact quite simple: +
+  function connectToHost(url) {
+     if (window.XMLHttpRequest) {
+        request = new XMLHttpRequest();
+     }
+     else if (window.ActiveXObject) {
+         request = new ActiveXObject('Microsoft.XMLHTTP');
+     }
+     if (request) {
+         request.onreadystatechange = requestChangeHandler;
+         request.open('GET', url);
+         request.send('');
+     }
+     else {
+        // XMLHttpRequest not implemented
+     }
+  }
+  
+  function requestChangeHandler() {
+     if (request.readyState == 4) {
+        // readyState 4: complete; now test for server's response status
+        if (request.status == 200) {
+           // response in request.responseText or request.responseXML if XML-code
+           // if it's JS-code we could get this by eval(request.responseText)
+           // by this we could import whole functions to be used via the terminal
+        }
+        else {
+           // connection error
+           // status code and message in request.status and request.statusText
+        }
+     }
+  }
+
+You should use this only together with a timer (window.setTimeout()) to handle connection timeouts.
+Additionally you would need some syntax to authenticate and tell the server what you want.
+For this purpose you could use the following methods of the XMLHttpRequest object:

+ + + + + + + +
setRequestHeader("headerLabel", "value")set a HTTP header to be sent to the server
getResponseHeader("headerLabel")get a HTTP header sent from the server
open(method, "url" [, asyncFlag [,
  "userid" [, "password"]]])
assign the destination properties to the request.
be aware that userid and password are not encrypted!
send(content)transmit a message body (post-string or DOM object)
abort()use this to stop a pending connection
+ +
+  
+ Norbert Landsteiner - August 2005
+ http://www.masswerk.at +
+  
+ > top of page +
+   +
+ +
+ + \ No newline at end of file diff --git a/extra/webapps/fjsc/www/termlib/index.html b/extra/webapps/fjsc/www/termlib/index.html index 1770b2ca13..f38f6e1580 100644 --- a/extra/webapps/fjsc/www/termlib/index.html +++ b/extra/webapps/fjsc/www/termlib/index.html @@ -1,207 +1,207 @@ - - - mass:werk termlib - - - - - - - - - - - - - - - - - - - -
termlib.js home|multiple terminal test|sample parser|faq|documentation
- - - - - - - - - - - - - -
-

mass:werk termlib.js

-
- The JavaScript library "termlib.js" provides a `Terminal' object, which - facillitates a simple and object oriented approach to generate and control a - terminal-like interface for web services.

- - "termlib.js" features direct keyboard input and powerful output methods - for multiple and simultanious instances of the `Terminal' object.

- - The library was written with the aim of simple usage and a maximum of compatibility - with minimal foot print in the global namespace.


- - - A short example:
-
-  var term = new Terminal( {handler: termHandler} );
-  term.open();
-
-  function termHandler() {
-     this.newLine();
-     var line = this.lineBuffer;
-     if (line != "") {
-        this.write("You typed: "+line);
-     }
-     this.prompt();
-  }
-  
-
- License

- - This JavaScript-library is free for private and academic use. - Please include a readable copyright statement and a backlink to <http://www.masswerk.at> in the - web page. The library should always be accompanied by the "readme.txt" and the sample HTML-documents.

- - The term "private use" includes any personal or non-commercial use, which is not related - to commercial activites, but excludes intranet, extranet and/or public net applications - that are related to any kind of commercial or profit oriented activity.

- - For commercial use see <http://www.masswerk.at> for contact information. -
- Distribution

- - This JavaScript-library may be distributed freely as long it is distributed together with the "readme.txt" and the sample HTML-documents and this document.

- - Any changes to the library should be commented and be documented in the readme-file.
- Any changes must be reflected in the `Terminal.version' string as "Version.Subversion (compatibility)". -
- Disclaimer

- - This software is distributed AS IS and in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. The entire risk as to the quality and performance of the product is borne by the - user. No use of the product is authorized hereunder except under this disclaimer. -
- History

- - This library evolved from the terminal script "TermApp" ((c) N. Landsteiner 2003) and is in its - current form a down scaled spinn-off of the "JS/UIX" project. (JS/UIX is not a free software by now.) - c.f.: <http://www.masswerk.at/jsuix>

- - For version history: see the readme.txt. -
-  
- Download

- Be sure to have read the license information and the disclamer and that you are willing to respect copyrights.

- - Download: termlib.zip (~ 40 KB, incl. docs)

- Current version is "1.07 (original)".
- The files are now provided with line breaks in format <CRLF>.
-   -
- Author

- © Norbert Landsteiner 2003-2005
- mass:werk – media environments
- http://www.masswerk.at -
-  
- Author's note:
- Please do not contact me on questions of simple usage. There is an extensive documentation (readme.txt) including plenty of sample code that should provide all information you need. -
-  
- > top of page -
-   -
- -
- - + + + mass:werk termlib + + + + + + + + + + + + + + + + + + + +
termlib.js home|multiple terminal test|sample parser|faq|documentation
+ + + + + + + + + + + + + +
+

mass:werk termlib.js

+
+ The JavaScript library "termlib.js" provides a `Terminal' object, which + facillitates a simple and object oriented approach to generate and control a + terminal-like interface for web services.

+ + "termlib.js" features direct keyboard input and powerful output methods + for multiple and simultanious instances of the `Terminal' object.

+ + The library was written with the aim of simple usage and a maximum of compatibility + with minimal foot print in the global namespace.


+ + + A short example:
+
+  var term = new Terminal( {handler: termHandler} );
+  term.open();
+
+  function termHandler() {
+     this.newLine();
+     var line = this.lineBuffer;
+     if (line != "") {
+        this.write("You typed: "+line);
+     }
+     this.prompt();
+  }
+  
+
+ License

+ + This JavaScript-library is free for private and academic use. + Please include a readable copyright statement and a backlink to <http://www.masswerk.at> in the + web page. The library should always be accompanied by the "readme.txt" and the sample HTML-documents.

+ + The term "private use" includes any personal or non-commercial use, which is not related + to commercial activites, but excludes intranet, extranet and/or public net applications + that are related to any kind of commercial or profit oriented activity.

+ + For commercial use see <http://www.masswerk.at> for contact information. +
+ Distribution

+ + This JavaScript-library may be distributed freely as long it is distributed together with the "readme.txt" and the sample HTML-documents and this document.

+ + Any changes to the library should be commented and be documented in the readme-file.
+ Any changes must be reflected in the `Terminal.version' string as "Version.Subversion (compatibility)". +
+ Disclaimer

+ + This software is distributed AS IS and in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. The entire risk as to the quality and performance of the product is borne by the + user. No use of the product is authorized hereunder except under this disclaimer. +
+ History

+ + This library evolved from the terminal script "TermApp" ((c) N. Landsteiner 2003) and is in its + current form a down scaled spinn-off of the "JS/UIX" project. (JS/UIX is not a free software by now.) + c.f.: <http://www.masswerk.at/jsuix>

+ + For version history: see the readme.txt. +
+  
+ Download

+ Be sure to have read the license information and the disclamer and that you are willing to respect copyrights.

+ + Download: termlib.zip (~ 40 KB, incl. docs)

+ Current version is "1.07 (original)".
+ The files are now provided with line breaks in format <CRLF>.
+   +
+ Author

+ © Norbert Landsteiner 2003-2005
+ mass:werk – media environments
+ http://www.masswerk.at +
+  
+ Author's note:
+ Please do not contact me on questions of simple usage. There is an extensive documentation (readme.txt) including plenty of sample code that should provide all information you need. +
+  
+ > top of page +
+   +
+ +
+ + \ No newline at end of file diff --git a/extra/webapps/fjsc/www/termlib/multiterm_test.html b/extra/webapps/fjsc/www/termlib/multiterm_test.html index 0a4e1ec63a..23aaaefb72 100644 --- a/extra/webapps/fjsc/www/termlib/multiterm_test.html +++ b/extra/webapps/fjsc/www/termlib/multiterm_test.html @@ -1,188 +1,188 @@ - - - termlib Multiple Terminal Test - - - - - - - - - - - - - - - - - - - - - - -
termlib.js home|multiple terminal test|sample parser|faq|documentation
- - - - - - -
- Multiple Terminal Test
  -
- > open terminal 1   -
- > open terminal 2   -
-  
- (c) mass:werk,
N. Landsteiner 2003-2005
- http://www.masswerk.at -
- -
-
- - + + + termlib Multiple Terminal Test + + + + + + + + + + + + + + + + + + + + + + +
termlib.js home|multiple terminal test|sample parser|faq|documentation
+ + + + + + +
+ Multiple Terminal Test
  +
+ > open terminal 1   +
+ > open terminal 2   +
+  
+ (c) mass:werk,
N. Landsteiner 2003-2005
+ http://www.masswerk.at +
+ +
+
+ + \ No newline at end of file diff --git a/extra/webapps/fjsc/www/termlib/parser_sample.html b/extra/webapps/fjsc/www/termlib/parser_sample.html index b332af1818..41b4c5ef62 100644 --- a/extra/webapps/fjsc/www/termlib/parser_sample.html +++ b/extra/webapps/fjsc/www/termlib/parser_sample.html @@ -1,293 +1,293 @@ - - - termlib Sample Parser - - - - - - - - - - - - - - - - - - - - - - - -
termlib.js home|multiple terminal test|sample parser|faq|documentation
- - - - - - -
- Sample Parser Test
  -
- > open terminal   -
-   -
-  
- (c) mass:werk,
N. Landsteiner 2003-2005
- http://www.masswerk.at -
- -
- - + + + termlib Sample Parser + + + + + + + + + + + + + + + + + + + + + + + +
termlib.js home|multiple terminal test|sample parser|faq|documentation
+ + + + + + +
+ Sample Parser Test
  +
+ > open terminal   +
+   +
+  
+ (c) mass:werk,
N. Landsteiner 2003-2005
+ http://www.masswerk.at +
+ +
+ + \ No newline at end of file