jquery.terminal is a jQuery plugin which displays an interactive terminal in your pages.
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 and operators
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.
Handles asynchronous requests
Commands can give result either synchronously or asynchronously, which comes in handy when they deal with AJAX requests. Works for completion too!
Interfaceable with other jQuery plugins
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:
- 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
- Changes arrow style (#2).
- Fixes input problem on WebKit when selecting string (#3).
- Adds built-in listener
jsonrpcwhen jQuery JSON RPC is available.
- Adds an example
- Adds the command
- Adds action call:
$().terminal(string action, ...).
- Replaces execution call with action call
- Adds action calls
- Fixes a compatibility bug with Internet Explorer and Opera.
- Changes position magic sequence.
- Attaches event handlers to prompt and welcome message.
- Adds help link in example
- Embeds caret plugin, no
jquery.caret.jsfile to include anymore.
- Adds links in help function.
- Puts the links in orange by default.
popupoption 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.
Official site: https://github.com/Bloutiouf/jquery.terminal