Ptty is a jQuery plugin that creates an expansible terminal emulator.
JavaScript HTML
Latest commit 58c8f56 Jun 21, 2016 @pachanka Readme update
Permalink
Failed to load latest commit information.
README.md
example.html added example file Apr 25, 2016
ptty.jquery.js Temp-fixed the loading element. Apr 28, 2016
ptty.jquery.min.js Temp-fixed the loading element. Apr 28, 2016

README.md

ptty.jquery.js

Ptty is a jQuery plugin that creates an expansible terminal emulator. It is small, it is fast and it is fully customizable by adding commands and callbacks.

  • Current version 0.0.5
  • Size 12 Kb (minified)

Features

Ptty comes with a set of little helpers so to be as light and scalable as possible, It can:

  • Expand on demand using the $ptty.register() method.
  • Build auto-documenting commands using the help feature.
  • Add callbacks and callbefores.
  • Texts can be translated through the settings and changed at any time.
  • Fully CSS themable.
  • Its not perfect but its readable.
  • Commands: history, help and clear are built in.

Usage

To start Ptty simply do the following:

$(document).ready(function(){
    var $ptty = $('#terminal').Ptty();
});

Or you can use settings:

$(document).ready(function(){
    var $ptty = $('#terminal').Ptty({
        ps     : '$',
        theme  : 'boring',
        i18n   : {
            welcome: 'Welcome to the matrix.'
        }
    });
});

After initiation you can use methods like so:

$ptty.register('command', { 
    name : 'hello', 
    method : function(cmd){
        cmd.out = 'Hello World!';
        return cmd;
    } 
});

// Or:
$ptty.echo('Hello World!');

Demo & Docs

Please see the online documentation to learn about the plugin options and response structure or look at the Demo for a full screen example.