Skip to content
A light-weight widget for simple autocompletion.
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
src
test
.codoopts
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
bower.json
gulpfile.js
index.html
package-lock.json
package.json

README.md

Neat Complete

Build Status

A light-weight and library-less widget for simple autocompletion.

Integrating

Simple example using jQuery:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <link href="./lib/neat_complete.css" rel='stylesheet'>
</head>
<body>
  <input type='text' id='ac_field' />

  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  <script type="text/javascript" src='./lib/neat-complete.min.js'></script>
  <script type="text/javascript">
    var widget;

    $(document).ready(function(){
      widget = new NeatComplete.Widget(document.getElementById('ac_field'));
      widget.addService('demo',function(query, callback_fn){
        $.getJSON("/path/to/service.json", function(data){
          var results = $.map(data, function(result){
            return { value: result.name, data: result }
          });
          callback_fn(query, results);
        });
      });
    });
  </script>
</body>
</html>

See more examples.

Contributing

Prerequisites

Setup

$ npm install
$ bower install

Development Compiling

$ gulp serve

Production Compiling

$ gulp

Running Tests

$ gulp test

Deploying to Rails Assets

  1. Create a release on github, tagged with the version number
  2. Bower will automatically pick up the new version
  3. Make the new version available to Bundler by entering it on https://rails-assets.org/components/new
You can’t perform that action at this time.