jquery.terminal is a jQuery plugin which displays an interactive terminal in your pages.
It is not a SSH or Linux terminal! See Anyterm or Ajaxterm for that. Instead, jquery.terminal allows you to use custom commands.
I wrote this plugin to easily communicate with my systems without building HTML interfaces. And I wouldn't recommend you to use it as public front-end: the purpose of this plugin is to build administration interfaces.
Even if you don't have this need, you may still like this geeky stuff.
Add custom commands with listeners.
The default style displays white texts on black background, you may change it either by editing jquery.terminal.css
(global change) or by adding CSS in your page.
Command flow is the root concept of the terminal. Arguments are values given to a command, which in return gives output values.
Operators bind commands together, manipulating arguments and outputs of each two operands. Each operator has its own way to execute commands.
At any moment, press TAB and you will see suggestions which fit well in the context.
Commands can give result either synchronously or asynchronously, which comes in handy when they deal with AJAX requests. Works for completion too!
With the jQuery cookie plugin, the command history and variables will be automatically saved and restored. You may need clear
to erase these variables.
The jQuery JSON RPC plugin provides a built-in listener jsonrpc
to easily call server-side functions.
Simply include the files before jquery.terminal.js
and that's it.
The examples directory contains some examples:
- cookies.html shows the independence of different terminals, and to customize CSS
- github.html adds commands to access to GitHub
- simple.html is a basic example, with examples of commandes
The wiki contains a lot of additional information. You may be interested in reading:
- How to integrate the plugin to your site
- How the commands and operators work
- Fixes magic sequences escape.
- Fixes an error with search commands in GitHub example (#1).
- Fixes a missing style with non-fullscreen terminals.
- Fixes mousescroll event propagation (#2, #3).
- Adds an example of non-fullscreen terminal.
- Adds built-in listener
command
. - Changes arrow style (#2).
- Fixes input problem on WebKit when selecting string (#3).
- Adds built-in listener
jsonrpc
when jQuery JSON RPC is available. - Adds an example
jsonrpc
. - Adds the command
sum
.
- Adds action call:
$().terminal(string action, ...)
. - Replaces execution call with action call
execute
. - Adds action calls
addListeners
,removeListeners
andoptions
. - Adds
listeners
andvariables
to theoptions
.
- Fixes a compatibility bug with Internet Explorer and Opera.
- Changes position magic sequence.
- Adds
$LAST
variable. - Attaches event handlers to prompt and welcome message.
- Adds help link in example
simple.html
.
- Embeds caret plugin, no
jquery.caret.js
file to include anymore. - Embeds
$.getJSONP
. - Adds links in help function.
- Puts the links in orange by default.
popup
option can be set to null to never show popup.- Fixes scroll, which now works only if the cursor is over the terminal.
Considered as the first version, you don't want to see version 1 :)
Warm thanks to shitwizard improving the plugin.
Refer to links to issues within the changelog or commit messages.
Licensed under a MIT license, see the LICENSE file.
Uses the jQuery caret plugin by C. F., Wong (Cloudgen Examplet Store), licensed under MIT license.
Official site: https://github.com/Bloutiouf/jquery.terminal