An open API service indexing awesome lists of open source software.

https://github.com/cldwalker/readline.js

jquery plugin to bring readline to the hoi polloi
https://github.com/cldwalker/readline.js

Last synced: 21 days ago
JSON representation

jquery plugin to bring readline to the hoi polloi

Awesome Lists containing this project

README

          

Description
===========
jQuery plugin which adds basic readline functionality to any html element. Goal is to mimic
essential readline behavior from the [original](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html).
Uses jquery UI 1.8.5 autocomplete widget and the hotkeys.js plugin for keybindings.

Setup
=====

Add javascript tags:




Assuming you have an html element with id #input:


$(document).ready( function(){ $('#input').readline() });

For options to pass to $.fn.readline(), see documentation in the source.

Once an element is readline-enabled, it needs to have some event (i.e. submit) that adds
to the history with $.readline.addHistory(). See demo.html for an example.

Keybindings
===========
* previous line: control-p, up arrow
* next line: control-n, down arrow
* clear line: control-u
* start search history: control-r
* stop search history: control-g
* custom autocompletion: tab

Demo
====
For a simple demo, simply open demo.html in a browser and enter a few lines.
For a more advanced example, see jrepl.

Todo
====
* Fix history not saving element's current text
* Forward/backward word keybindings
* Fix exiting search history on an active menu item
* Display tab completion in multiple columns
* Deal with autocompletion dependence on images