Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leifwalsh/readline.js
readline implementation in javascript
https://github.com/leifwalsh/readline.js
Last synced: 7 days ago
JSON representation
readline implementation in javascript
- Host: GitHub
- URL: https://github.com/leifwalsh/readline.js
- Owner: leifwalsh
- Created: 2009-12-10T12:49:34.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2009-12-10T13:18:07.000Z (almost 15 years ago)
- Last Synced: 2024-04-23T14:10:46.038Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Readline.js
===========A simple javascript library that tries to act like [readline][].
Given a DOM element for showing the current command and a callback function, you
can introduce a commandline prompt into your webpage, if that is something you
would like.[readline]: http://tiswww.case.edu/php/chet/readline/rltop.html
USAGE
-----new Readline($('#input'), this, this.execline)
or
new Readline($('#input'), this, this.execline, $('#term'))
### This means: ###
"Make a new `Readline` object, using the `#input` DOM element as the command
buffer, sending completed commands to `this.execline`, with `this` as the object
to be referenced by "`this`" inside that function (see [`Function.call`][call]).
Optionally, only accept input when the `#term` DOM element has focus."See [adlaiff6@github:jsh][jsh] for an example of its usage. There is also an
example, if you just want to see the end result, [here][example].[jsh]: http://github.com/adlaiff6/jsh/
[example]: http://adlaiff6.github.com/
[call]: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Function/callDEPENDENCIES
------------* [jQuery][]
[jquery]: http://jquery.com/
BUGS
----Yes. Email me ().
I have only tested this on Firefox and Chromium (latest-ish Gentoo build). I
also tried it on [Uzbl][], and couldn't get Backspace to work right. I think
it's the same problem I found with Chromium (they're both WebKit-based), but I
have yet to confirm that. If you find problems in other browsers, please let me
know, but also know that I probably won't be able to reproduce or fix them, so
you might have to provide me with a solution on your own.[uzbl]: http://uzbl.org/
Contributing
------------Fork and send pull requests.