Skip to content

Instantly share code, notes, and snippets.

@jharding
jharding / README.md
Last active December 19, 2015 18:09
Help beta test typeahead.js v0.10.0! Please direct all feedback here: https://github.com/twitter/typeahead.js/pull/335

build status

[typeahead.js][gh-page]

Inspired by [twitter.com]'s autocomplete search functionality, typeahead.js is a flexible JavaScript library that provides a strong foundation for building robust typeaheads.

The typeahead.js library is built on top of 2 components: the data component,

@jharding
jharding / option-a.js
Last active December 20, 2015 04:08
I'm trying to work out the new typeahead.js API for v0.10 and I'm looking for some feedback. The issue is that due to the amount of flexibility added in v0.10, designing a clean, intuitive API is proving to be a challenge. This gist contains 2 possible APIs I've been kicking around. I'm not really a big fan of either of them so if you have any i…
// simple
// ------
$('.typeahead').typeahead({
autoselect: true,
hightlight: true,
hint: true
}).typeahead('add', {
name: 'films',
source: {
<div class="example-countries">
<input class="typeahead" type="text" placeholder="countries">
</div>
<div class="example-twitter-oss">
<input class="typeahead" type="text" placeholder="open source projects by Twitter">
</div>
.example-arabic .tt-dropdown-menu {
text-align: right;
}
<div class="example-sports">
<input class="typeahead" type="text" placeholder="NBA and NHL teams">
</div>
<div class="example-films">
<input class="typeahead" type="text" placeholder="best picture winner">
</div>
<div class="example-exclaimation">
<input class="typeahead" type="text" placeholder="try it out">
</div>
<div class="example-numbers">
<input class="typeahead" type="text" placeholder="numbers (one through ten)">
</div>
@jharding
jharding / npm-debug.log
Created February 14, 2014 01:29
trying to publish grunt-exec@0.4.3
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish' ]
2 info using npm@1.3.24
3 info using node@v0.10.25
4 verbose publish [ '.' ]
5 verbose cache add [ '.', null ]
6 verbose cache add name=undefined spec="." args=[".",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,