Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cades/auto-complete-widget
https://github.com/cades/auto-complete-widget
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cades/auto-complete-widget
- Owner: cades
- Created: 2014-10-15T06:49:53.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-15T06:52:40.000Z (about 10 years ago)
- Last Synced: 2024-11-09T09:11:45.735Z (2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Auto Complete Plugin
====================This plugin is an answer to Mozilla's F2E Pre-test, written by Hong-Ken Kao (cades).
The plugin is under `dist/` folder.
Usage
=====Include `dist/auto-complete.js`, then setup the plugin:
```js
var elem = document.getElementById('myInput'),
items = ['many', 'menu', 'items'];
AutoComplete.bind(elem, items);```
- `elem` is an input DOM element.
- This element's type will be changed to `hidden`.
- When a tag is added or removed, this element's value would be updated accordingly.
- `items` is an array of string.Open example.html to see the demo.
Build
=====Make sure npm and gulp are globally available on your machine, then run the following command:
```
npm install
gulp
```That generates 3 files:
- dist/auto-complete.js
- dist/auto-complete.min.js
- test/auto-complete.jsTest
====Mocha and chai are used as unit testing framework. Simply run `npm install` to install them. Then open test.html to see the result.