JQuery Terminal Emulator Plugin

      __ _____                     ________                              __
     / // _  /__ __ _____ ___ __ _/__  ___/__ ___ ______ __ __  __ ___  / /
 __ / // // // // // _  // _// // / / // _  // _//     // //  \/ // _ \/ /
/  / // // // // // ___// / / // / / // ___// / / / / // // /\  // // / /__
\___//____ \\___//____//_/ _\_  / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
          \/              /____/                                     0.8.8

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Fork JQuery Terminal Emulator on GitHub

Summary

JQuery Terminal Emulator is a plugin for creating command line interpreters in your applications. It can automatically call JSON-RPC service when user type commands or you can provide an object with methods, each method will be invoke on user command. Object can have nested objects which will create nested interpreter. You can also use a function in which you can parse user command by your own. It′s ideal if you want to provide additional functionality for power users. It can also be used as debuging tool.

Features

Demo

This is simple demo using javascript interpreter. (If cursor is not blinking - click on terminal to activate it) You can type any javascript expression, there are two debug function dir (like in python).

You can use JQuery ‘$’ function to manipulate the page. You also have access to this terminal in ‘term’ variable. Try ‘dir(term)’ or ‘term.signature()’.

Javascript code:

jQuery(function($, undefined) {
    $('#term_demo').terminal(function(command, term) {
        if (command !== '') {
            try {
                var result = window.eval(command);
                if (result !== undefined) {
                    term.echo(new String(result));
                }
            } catch(e) {
                term.error(new String(e));
            }
        } else {
           term.echo('');
        }
    }, {
        greetings: 'Javascript Interpreter',
        name: 'js_demo',
        height: 200,
        prompt: 'js> '});
});

Download

Complete source with examples from github

Or just the files:

License

JQuery Terminal Emulator plugin is released under GNU LGPL3 license.

It contains:

Comments

Use terminal to leave a comment. Click to active. If you have a question you can create an issue on github, ask on stackoverflow (you can use jquery-terminal tag) or send email to jcubic@jcubic.pl. You can also send email with SO question or jump to the chat.

If you have feature request you can also add GitHub issue.