├── .editorconfig ├── .gitignore ├── .jshintignore ├── .jshintrc ├── changelog.markdown ├── dist ├── horsey.css ├── horsey.js ├── horsey.min.css └── horsey.min.js ├── example ├── example.css ├── example.js └── fruits │ ├── apple.png │ ├── banana.png │ ├── lemon.png │ └── orange.png ├── horsey.es5.js ├── horsey.js ├── horsey.styl ├── index.html ├── license ├── package.json └── readme.markdown /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .DS_Store 4 | Thumbs.db 5 | -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | example 4 | *.es5.js 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "newcap": true, 5 | "noarg": true, 6 | "noempty": true, 7 | "nonew": true, 8 | "sub": true, 9 | "undef": true, 10 | "unused": false, 11 | "trailing": true, 12 | "boss": true, 13 | "eqnull": true, 14 | "strict": true, 15 | "immed": true, 16 | "expr": true, 17 | "latedef": "nofunc", 18 | "quotmark": "single", 19 | "validthis": true, 20 | "indent": 2, 21 | "node": true, 22 | "browser": true, 23 | "esnext": true 24 | } 25 | -------------------------------------------------------------------------------- /changelog.markdown: -------------------------------------------------------------------------------- 1 | # 4.2.1 Vampire 2 | 3 | - Completely revamped, see API documentation 4 | 5 | # 3.0.0 Live from Liverpool 6 | 7 | - Introduced live suggestions 8 | - Introduced fixes for Internet Explorer 9 | 10 | # 2.6.1 Bullying 11 | 12 | - Updated `bullseye@1.4.6` 13 | 14 | # 2.6.0 Emancipation 15 | 16 | - Decoupled `horsey` from `woofmark`, extracted bridge into `banksy` module 17 | 18 | # 2.5.4 Polypony 19 | 20 | - Use latest `bullseye`, which uses `getSeleccion` polyfill 21 | 22 | # 2.5.3 Area 51 23 | 24 | - Handle retargetting for `woofmark` editors 25 | 26 | # 2.5.2 Insensitive Animal 27 | 28 | - Case insensitive fuzzy searching 29 | - Fixed a bug where non-string suggestions would be displayed as `undefined` 30 | 31 | # 2.5.1 Toggle Bobble 32 | 33 | - Exposed `toggle` method to toggle visibility of horsey autocomplete suggestion list 34 | 35 | # 2.5.0 Woof woof 36 | 37 | - Example on how to use in a ` 105 |
106 |       
107 | horsey(document.querySelector('textarea'), {
108 |   source: [{ list: [
109 |     { value: '@michael', text: 'Michael Jackson' },
110 |     { value: '@jack', text: 'Jack Johnson' },
111 |     { value: '@ozzy', text: 'Ozzy Osbourne' }
112 |   ]}],
113 |   getText: 'text',
114 |   getValue: 'value',
115 |   anchor: '@'
116 | });
117 |       
118 |     
119 | 120 |
121 | 122 |
Click here to set fruity treat type
123 |
124 |       
125 | horsey(document.querySelector('div'), {
126 |   source: [{ list: [
127 |     { value: 'banana', text: 'Bananas from Amazon Rainforest' },
128 |     { value: 'banana-boat', text: 'Banana Boat' },
129 |     { value: 'apple', text: 'Red apples from New Zealand' },
130 |     { value: 'apple-cider', text: 'Red apple cider beer' },
131 |     { value: 'orange', text: 'Oranges from Moscow' },
132 |     { value: 'orange-vodka', text: 'Classic orange vodka cocktail' },
133 |     { value: 'lemon', text: 'Juicy lemons from Amalfitan Coast' }
134 |   ]}],
135 |   getText: 'text',
136 |   getValue: 'value'
137 | });
138 |       
139 |     
140 |
141 | 142 |

Get it on GitHub! bevacqua/horsey

143 | 144 | 145 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2015 Nicolas Bevacqua 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "horsey", 3 | "version": "4.2.2", 4 | "description": "Progressive and customizable autocomplete component", 5 | "main": "horsey.es5.js", 6 | "scripts": { 7 | "build": "npm run scripts && npm run styles", 8 | "deploy": "npm run build && npm run deployment && npm run sync", 9 | "deployment": "git add dist ; git add horsey.es5.js ; npm version ${BUMP:-\"patch\"} ; git add package.json ; git commit -am \"Release $(cat package.json | jq -r .version)\" ; git push --tags ; npm publish ; git push", 10 | "scripts": "jshint . && babel --presets es2015 --out-file horsey.es5.js horsey.js && browserify -s horsey -t [ babelify --presets [ es2015 ] ] -do dist/horsey.js horsey.js && uglifyjs -m -c -o dist/horsey.min.js dist/horsey.js", 11 | "start": "watchify -vs horsey -t [ babelify --presets [ es2015 ] ] -do dist/horsey.js horsey.js & stylus -w horsey.styl -o dist", 12 | "styles": "stylus horsey.styl -o dist && cleancss dist/horsey.css -o dist/horsey.min.css", 13 | "sync": "git checkout gh-pages ; git merge master ; git push ; git checkout master" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/bevacqua/horsey.git" 18 | }, 19 | "author": "Nicolas Bevacqua (http://bevacqua.io/)", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/bevacqua/horsey/issues" 23 | }, 24 | "homepage": "https://github.com/bevacqua/horsey", 25 | "dependencies": { 26 | "bullseye": "1.5.0", 27 | "contra": "1.9.4", 28 | "crossvent": "1.5.4", 29 | "fuzzysearch": "1.0.3", 30 | "hash-sum": "1.0.2", 31 | "lodash": "4.13.1", 32 | "sektor": "1.1.4", 33 | "sell": "1.0.0" 34 | }, 35 | "devDependencies": { 36 | "babel-cli": "6.10.1", 37 | "babel-preset-es2015": "6.9.0", 38 | "babelify": "7.3.0", 39 | "browserify": "13.0.1", 40 | "clean-css": "3.0.4", 41 | "jshint": "2.9.2", 42 | "nib": "1.0.4", 43 | "stylus": "0.49.3", 44 | "uglify-js": "2.4.16", 45 | "watchify": "2.2.1" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /readme.markdown: -------------------------------------------------------------------------------- 1 | # Horsey 2 | 3 | > Progressive and customizable autocomplete component 4 | 5 | Browser support includes every sane browser and **IE7+**. 6 | 7 | # Demo! 8 | 9 | You can see a [live demo here][3]. 10 | 11 | [![screenshot.png][5]][3] 12 | 13 | # Inspiration 14 | 15 | I needed a fast, easy to use, and reliable autocomplete library. The ones I stumbled upon were too bloated, too opinionated, or provided an unfriendly human experience. 16 | 17 | The goal is to produce a framework-agnostic autocomplete that is easily integrated into your favorite MVC framework, that doesn't translate into a significant addition to your codebase, and that's **enjoyable to work with**. Horsey shares the modular design philosophy of [Rome, the datetime picker][1]. Furthermore, it plays well with [Insignia, the tag editor][2] component, and pretty much any other well-delimited component out there. 18 | 19 | # Features 20 | 21 | - Small and focused 22 | - Natural keyboard navigation 23 | - Progressively enhanced 24 | - Extensive browser support 25 | - Fuzzy searching 26 | - Supports `` and `