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
- Host: GitHub
- URL: https://github.com/cldwalker/readline.js
- Owner: cldwalker
- License: mit
- Created: 2010-10-19T12:46:01.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-12-06T00:39:21.000Z (over 15 years ago)
- Last Synced: 2025-03-20T10:44:16.515Z (about 1 year ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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