{"_id":"jquery-plugin-w3w-autosuggest","_rev":"46-217631fd7c7a463e1bd30ccf4552dd6f","name":"jquery-plugin-w3w-autosuggest","dist-tags":{"latest":"1.5.0"},"versions":{"1.2.1":{"name":"jquery-plugin-w3w-autosuggest","version":"1.2.1","author":"","license":"MIT","_id":"jquery-plugin-w3w-autosuggest@1.2.1","maintainers":[{"name":"what3words","email":"development@what3words.com"}],"homepage":"https://github.com/what3words/jquery-plugin-w3w-autosuggest#readme","bugs":{"url":"https://github.com/what3words/jquery-plugin-w3w-autosuggest/issues"},"dist":{"shasum":"cd11a7f8595dd1bb4d3e45d05589a28ff2594498","tarball":"https://registry.npmjs.org/jquery-plugin-w3w-autosuggest/-/jquery-plugin-w3w-autosuggest-1.2.1.tgz","integrity":"sha512-4u3pfULXCctdkd4WYJuX+Ozfu3RvXHO8a9Rz0j9pm+en+KY4Rt6pVaV0HI/6E3t3X86tkm2l0Zn8FhoRq9JP3A==","signatures":[{"sig":"MEYCIQCq98bL7NrBFAkf5ke/F0WjsA8CUy8njLCHktX8W8BseAIhAN/8Ti27xipeIzNkJb/jBHnCoWf2qlhw/8rLRY4dR9uD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"jquery-plugin-w3w-autosuggest.js","_from":".","_shasum":"cd11a7f8595dd1bb4d3e45d05589a28ff2594498","gitHead":"8f38ddfc6f338d91cd75ac7d837aad22e612dad9","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"what3words","email":"development@what3words.com"},"deprecated":"Package no longer supported. Please use https://developer.what3words.com/public-api/autosuggest-component","repository":{"url":"git+https://github.com/what3words/jquery-plugin-w3w-autosuggest.git","type":"git"},"_npmVersion":"4.4.1","description":"Easily capture 3 word addresses on your website with the 3 word address JQuery plugin by what3words","directories":{},"_nodeVersion":"7.7.4","dependencies":{"jquery":"2.1.1","jquery-typeahead":"^2.8.0","jquery-validation":"^1.16.0"},"devDependencies":{"del":"^2.2.2","gulp":"^3.9.1","yargs":"^6.6.0","eslint":"^3.16.1","gulp-bump":"^2.7.0","gulp-sass":"latest","gulp-util":"latest","gulp-clean":"^0.3.2","gulp-concat":"^2.6.1","gulp-eslint":"^3.0.1","gulp-rename":"^1.2.2","gulp-uglify":"latest","require-dir":"^0.3.1","gulp-changed":"^1.3.2","gulp-clean-css":"^3.0.3","gulp-sourcemaps":"^1.9.1","gulp-autoprefixer":"^3.1.1","vinyl-source-stream":"^1.1.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^7.0.0","eslint-plugin-standard":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/jquery-plugin-w3w-autosuggest-1.2.1.tgz_1490783642877_0.9411155434790999","host":"packages-18-east.internal.npmjs.com"}},"1.4.0":{"name":"jquery-plugin-w3w-autosuggest","version":"1.4.0","author":"","license":"MIT","_id":"jquery-plugin-w3w-autosuggest@1.4.0","maintainers":[{"name":"what3words-admin","email":"development@what3words.com"},{"name":"tsamaya","email":"tsamayanet@gmail.com"}],"homepage":"https://github.com/what3words/jquery-plugin-w3w-autosuggest#readme","bugs":{"url":"https://github.com/what3words/jquery-plugin-w3w-autosuggest/issues"},"dist":{"shasum":"8ba499ddfaa9d86c5bd0d02034fee5fa08649918","tarball":"https://registry.npmjs.org/jquery-plugin-w3w-autosuggest/-/jquery-plugin-w3w-autosuggest-1.4.0.tgz","integrity":"sha512-X6ETPDgK6WM5DbRpQKg9nEZIk9p518KWxtn1qLvW9hO+ysqwSZFP8zUOLznY23kO+jIkyqTi0Xos/4IcRfTdsQ==","signatures":[{"sig":"MEUCIQDiteCgcSnPu6bIDCk/vje4PvYM/wqrVXWQYFN9D7BZjAIgX5TwDdKzjoK/Ox94oEb4NMac5QsSrDE8msJ4slNgRXo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"jquery-plugin-w3w-autosuggest.js","gitHead":"926e5ac932620527af618fbba5c24e65b31a127a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"gulp build","clean":"gulp clean"},"_npmUser":{"name":"what3words-admin","email":"development@what3words.com"},"deprecated":"Package no longer supported. Please use https://developer.what3words.com/public-api/autosuggest-component","repository":{"url":"git+https://github.com/what3words/jquery-plugin-w3w-autosuggest.git","type":"git"},"_npmVersion":"5.6.0","description":"Easily capture 3 word addresses on your website with the 3 word address JQuery plugin by what3words","directories":{},"_nodeVersion":"9.4.0","dependencies":{"jquery":"3.3.1","jquery-typeahead":"2.8.0","jquery-validation":"1.16.0"},"devDependencies":{"del":"2.2.2","gulp":"3.9.1","yargs":"6.6.0","eslint":"3.19.0","gulp-bump":"2.7.0","gulp-sass":"3.1.0","gulp-util":"3.0.8","gulp-clean":"0.3.2","gulp-concat":"2.6.1","gulp-eslint":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"2.1.2","require-dir":"0.3.2","gulp-changed":"1.3.2","gulp-clean-css":"3.0.3","gulp-sourcemaps":"1.9.1","gulp-autoprefixer":"3.1.1","vinyl-source-stream":"1.1.0","eslint-plugin-promise":"3.5.0","eslint-config-standard":"7.1.0","eslint-plugin-standard":"2.3.1"},"_npmOperationalInternal":{"tmp":"tmp/jquery-plugin-w3w-autosuggest-1.4.0.tgz_1517915546687_0.48384071234613657","host":"s3://npm-registry-packages"}},"1.5.0":{"name":"jquery-plugin-w3w-autosuggest","version":"1.5.0","author":"","license":"MIT","_id":"jquery-plugin-w3w-autosuggest@1.5.0","maintainers":[{"name":"tsamaya","email":"tsamayanet@gmail.com"},{"name":"what3words-admin","email":"development@what3words.com"}],"homepage":"https://github.com/what3words/jquery-plugin-w3w-autosuggest#readme","bugs":{"url":"https://github.com/what3words/jquery-plugin-w3w-autosuggest/issues"},"dist":{"shasum":"bf118cd09f0ed476b0133574a44792e4e8fb5b84","tarball":"https://registry.npmjs.org/jquery-plugin-w3w-autosuggest/-/jquery-plugin-w3w-autosuggest-1.5.0.tgz","fileCount":295,"integrity":"sha512-/eUB6AXKyNJqR9ap2zhUVJvBq6lt7Djv37qQ8ou70Luyl/hqJs4ifhsQLtotiO1xHFXNGS8AUWEsSEQ2CNNGEg==","signatures":[{"sig":"MEUCIEgGosczkfg+bLrrV0ihES6ec3WSG45lt3O35MOCopLvAiEAyqxOivfi3sO0NEepYiRzmZqHRjelNBHBQLwKgRDtOX8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4509933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6I96CRA9TVsSAnZWagAAMmsP/jGgOmog0yGxHwDPS/hX\nWT0fNEcaWsAK9u37TqP9T+kF3w3jBfkZQpPgWr3yxGBfAo05/jnkEuKsn6kQ\nKQ2t+rFEpttndNf2tTNz4p5e4A2RbW8WddXZgGQ3QlU0uwAlKpAHFz9n87rZ\n3s35yfuSH1r0LhW752wRWFBlZB8NzIQ/Vz2FvetAcmx+Dbtz6tkDdYZ9Ba++\nUjblEfiTsurpQIMwLcpkccQ9HldXMIRM5JBTHn0WZXvLhels2+ZhPZP0mMBZ\nh4xtaYp32l16t7JK7hvBBHhwWUyAnRhEFJnuRQU/DwrsmBokeMdXQXPH1g7o\n7avfHjYNJXA/S8xmX7CHvha3+jry9VP3qt41fHdsUIrFxbuyox8NZTD4vBOC\nNobQ3iC4f0ykrFOc3WjF9kcx2d+q/IoHOI+B3kyMCkpr5D0kTYc7xooKY9bT\nSWQdzCCbxZGI/LeBgUzim3av6vEFQRUq29T9t+NhTH1MI7QjM4SitB6b5Wih\nyJvZAZYa3HYwsEv5/xgKWkQGKYvLBHFeO06SM1cbKsUWmDKsLDjiRp4kwYqj\n+QEfF6QpzlWH8haGx37H97o7xqpIhbh2HRJb02HQKFHfbhNNGGOmYDqCSeGv\nhLpS3UQCCPE+vuVnaLeg5dtowzEOtz/ZJhyZ2AaAjDtyQ1OOBF0ba11oP+7s\na3Fu\r\n=xHyX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"jquery-plugin-w3w-autosuggest.js","gitHead":"2cfd79272674d3bc685953d1e9d71439ab8cf31a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"gulp build","clean":"gulp clean"},"_npmUser":{"name":"what3words-admin","email":"development@what3words.com"},"deprecated":"Package no longer supported. Please use https://developer.what3words.com/public-api/autosuggest-component","repository":{"url":"git+https://github.com/what3words/jquery-plugin-w3w-autosuggest.git","type":"git"},"_npmVersion":"6.0.0","description":"Easily capture 3 word addresses on your website with the 3 word address JQuery plugin by what3words","directories":{},"_nodeVersion":"10.0.0","dependencies":{"jquery":"3.3.1","jquery-typeahead":"2.8.0","jquery-validation":"1.16.0"},"_hasShrinkwrap":false,"devDependencies":{"del":"2.2.2","gulp":"3.9.1","yargs":"6.6.0","eslint":"3.19.0","gulp-bump":"2.7.0","gulp-sass":"3.1.0","gulp-util":"3.0.8","gulp-clean":"0.3.2","gulp-concat":"2.6.1","gulp-eslint":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"2.1.2","require-dir":"0.3.2","gulp-changed":"1.3.2","gulp-clean-css":"3.0.3","gulp-sourcemaps":"1.9.1","gulp-autoprefixer":"3.1.1","vinyl-source-stream":"1.1.0","eslint-plugin-promise":"3.5.0","eslint-config-standard":"7.1.0","eslint-plugin-standard":"2.3.1"},"_npmOperationalInternal":{"tmp":"tmp/jquery-plugin-w3w-autosuggest_1.5.0_1525190520815_0.8428551343916844","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-03-29T10:34:03.554Z","modified":"2026-08-26T03:14:03.120Z","1.2.1":"2017-03-29T10:34:03.554Z","1.4.0":"2018-02-06T11:12:29.310Z","1.5.0":"2018-05-01T16:02:01.069Z"},"bugs":{"url":"https://github.com/what3words/jquery-plugin-w3w-autosuggest/issues"},"license":"MIT","homepage":"https://github.com/what3words/jquery-plugin-w3w-autosuggest#readme","repository":{"url":"git+https://github.com/what3words/jquery-plugin-w3w-autosuggest.git","type":"git"},"description":"Easily capture 3 word addresses on your website with the 3 word address JQuery plugin by what3words","maintainers":[{"email":"vibha@what3words.com","name":"vibha_w3w"},{"email":"cloud@what3words.com","name":"what3words-admin"},{"email":"frances@what3words.com","name":"frances-w3w"},{"email":"omid.ocean@gmail.com","name":"electather"},{"email":"frederickrichard.lee@gmail.com","name":"chaddgrimm"},{"email":"w.ndaiga@gmail.com","name":"ndaiga"},{"email":"alice.tanase@what3words.com","name":"alicetanasew3w"},{"email":"chris+2@what3words.com","name":"ctd101"},{"email":"trong.vo@what3words.com","name":"trongvow3w"},{"email":"tuannm072090@gmail.com","name":"tuan072090"}],"readme":"# <img src=\"https://what3words.com/assets/images/w3w_square_red.png\" width=\"32\" height=\"32\" alt=\"what3words\">&nbsp;what3words autosuggest jQuery plugin\n\n[![Build Status](https://travis-ci.org/what3words/jquery-plugin-w3w-autosuggest.svg?branch=master)](https://travis-ci.org/what3words/jquery-plugin-w3w-autosuggest)\n\nEasily capture 3 word addresses on your website with the *3 word address validation* JQuery plugin by what3words.\n\nwhat3words is a global addressing system. It has divided the world into a grid of 3m x 3m squares and assigned each one a unique 3 word address. what3words is more accurate than traditional street addressing, and even allows location information to be captured for places without addresses, such as parks or beaches.\nThe 3 word address validation plugin created by what3words allows you to easily integrate 3 word addresses into your site by applying what3words AutoSuggest on an input field, including default styling.\n\n\n## AutoSuggest jQuery Plugin\n\nThe plugin provides a simple way to get started using AutoSuggest on your website. It has been designed to be used when you want a user to input a 3 word address in a form field.\nBased on a full or partial address, it returns a list of the most relevant 3 word address candidates. Corrections are provided for input errors.\n\n### Visualising the results\nThe `autosuggest` results are displayed in the same way as the search box on [map.what3words.com](https://map.what3words.com/) and in the what3words mobile apps.\n\nThe resulting candidate list contains the 3 word address, the nearest place to that address.\n\nWhile `autosuggest` uses the `clipping` parameter to determine the geographical boundary of results, the plugin makes use of a `country_filter` This allows you to more easily limit results to a specific country. Please note that using the `country_filter` may impact the number of results returned to the user.\n\n\n# Getting Started\n\n### Prerequisites\n- jQuery 1.7.2 and above because of .on event handler\n\n### Dependencies\nThe plugin uses these dependencies.\n- jquery-Typeahead plugin 2.8.0 https://www.npmjs.com/package/jquery-typeahead\n- jquery-validation plugin  1.16.0 https://www.npmjs.com/package/jquery-validation\nDistribution contains a bundle version including these libraries:\n\n### Using the plugin\nMake sure to include jQuery in your page, for example:\n```html\n<script src=\"https://code.jquery.com/jquery-2.2.4.min.js\"></script>\n```\n\nInclude the what3words plugin files from the `./dist` folder into your HTML source:\n\nInclude JQuery plugin bundled with jquery-typeahead and jquery-validation plugins\n```html\n<script src=\"[path-to-plugin]/js/jquery.w3w-autosuggest-plugin.bundle.min.js\"></script>\n```\n\nor separately\n```html\n<script src=\"path/to/jquery.typeahead\"></script>\n<script src=\"path/to/jquery.validation\"></script>\n<script src=\"[path-to-plugin]/js/jquery.w3w-autosuggest-plugin.min.js\"></script>\n```\n\nAdd the CSS to the  `<header>`:\n```html\n<link rel=\"stylesheet\" href=\"[path-to-plugin]/css/jquery.w3w-autosuggest-plugin.bundle.min.css\">\n```\n\nor separately\n```html\n<link rel=\"stylesheet\" href=\"path/to/jquery.typeahead.css\">\n<link rel=\"stylesheet\" href=\"[path-to-plugin]/css/jquery.w3w-autosuggest-plugin.min.css\">\n```\n\n\nYou'll need to [register](https://what3words.com/register?dev=true) for a what3words API key to access AutoSuggest. The key should be passed to a new instance of the plugin which is initialised on an input field. Initialisation should preferably occur after jQuery and before the </body> tag.\n\n\n```javascript\n<script>\n $('#w3w-address').w3wAddress({\n  key: 'YOUR-API-KEY-HERE'\n });\n</script>\n```\n\n## AutoSuggest\n\nThe plugin authenticates and interacts with the [what3words RESTful API](https://docs.what3words.com/api/v2/) `autosuggest` method.\nIt returns a list of 3 word addresses based on user input and other parameters.\nThis method provides corrections for the following types of input error:\n\n- typing errors\n- spelling errors\n- misremembered words (e.g. singular vs. plural) words in the wrong order\n\nThe `autosuggest` method determines possible corrections to the supplied 3 word address string based on the probability of the input errors listed above and returns a ranked list of suggestions.\n\nSee also the [what3words API AutoSuggest documentation](https://docs.what3words.com/api/v2/#autosuggest) for more detailed information.\n\n\n### Input 3 word address\n\nYou will only receive results back if the partial 3 word address string you submit contains the first two words and at least the first character of the third word; otherwise an error message will be returned.\n\n### Language\n\nThe `lang` parameter is mandatory for `autosuggest`; we recommend that you set this according to the language of your user interface, or the browser/device language of your user. If your software displays 3 word addresses to users (in addition to accepting 3 words as a search/input) then we recommend you set the `lang` parameter for this method to the same language that 3 word addresses are displayed to your users.\n\nYou can use the what3words API [Get Languages](https://docs.what3words.com/api/v2/#lang) method for a list of all currently loaded and available 3 word address languages.\n\n### Results\n By default, 3 results are displayed with a 50 background suggestions available to filter by country.\n\n\n## Options\n\nParameters to be passed to the AutoSuggest plugin.\n\n| Option         | Type       | Optional? | Default | Description |\n| ---------------|------------|-----------|---------|----------------------|\n| `key`          | `String`   | mandatory | | Your API key, mandatory unless you bring your proxy page as `api_end_point` to hide your key |\n| `debug`        | `Boolean`  |  optional | false | Enables debug info in console |\n| `hint`         | `Boolean`  |  optional | true | Displays hint result (default is `false` for Arabic) |\n| `logo`         | `Boolean`  |  optional | true | displays what3words logo on the input as a svg image |\n| `multilingual` | `Boolean`  |  optional | true |  Enables the multilingual variant of autosuggest |\n| `lang`         | `String`   |  optional | `en` | A supported 3 word address language as an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 2 letter code. |\n| `results`        | `Number`   |  optional | 3 | Number of items to show in the result list |\n| `country_filter` | `String`   |  optional | null | Set country code as an [ISO 3166-1 alpha-2]https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 2 letter code  |\n| `count`          | `Number`   |  optional | 50 | Number of items to retrieve from API |\n| `direction`      | `String`   |  optional | ltr | default is `ltr`, can be set to `rtl` e.g. for Arabic |\n| `placeholder`    | `String`   |  optional |  | Sets the placeholder text of the input field (default is `placeholder: 'e.g. lock.spout.radar'). |\n| `validation`       | `Boolean`  |  optional | true | Adds UI validation result using [jquery-validation](https://www.npmjs.com/package/jquery-validation) |\n| `typeaheadDelay`       | `Number`  |  optional | 100 | delay in ms before sending new API request  |\n| `api_end_point`       | `String`  |  optional |  | for advanced integration, allow you to proxy request to our API and then hide your key  |\n\n## NOTES\n#### aria-invalid\nThe attribute `aria-invalid` is used even if validation is set to false. Without `validation`, selecting a 3 word address from the result list ensure the address is valid.\nFor references see:\n- 1 : https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-invalid_attribute\n- 2 : https://www.w3.org/TR/wai-aria/states_and_properties#aria-invalid\n\n#### api_end_point\nthis new feature (since version 1.5) allow you to proxy requests to your own server and then hide your what3words API key from your endusers.\n\nThe trailing `/` is needed as the plugin append `autosuggest-ml` or `autosuggest` regarding your constructor options.\n\nThis API endpoint must then provide a rest endpoint with the desired operations `autosuggest-ml` and/or `autosuggest` according your needs.\n\n## Building\n\n### Prerequisites\n- node, gulp\n\n### Set up\n```\n$ npm install\n\n```\n\n>Recommended : install gulp as global\n\n> `$ npm install --global gulp-cli`\n\n#### Build\n```\n$ gulp build\n```\n\n#### Clean Dist folder\n```\n$ gulp clean\n```\n\n#### Watch for Development\n```\n$ gulp\n```\n\nThe build process is automatic using `gulp watch`. Gulp is watching for Javascript & CSS changes and processing final files to the `./dist` folder automatically.\n\nTo add or customise styling, set up the development environment, and simply edit / add SCSS files in `./src` folder.\n\n\n### sprite\nWhat was done:\n- upload images from ./src/images/flags into http://responsive-css.us/ ,\n- save sprite and css in src/images/sprite\n- use https://tinypng.com/ to shrink image weight\n\n#### Use sample\n\nThe sample page uses the browser localStorage to store your API key. You can find it [here](./demo/sample.html) where multiple configurations can be found.\n\nTry it live : [sample.html](https://what3words.github.io/demo/sample.html)\n\n# Revision History\n\n| Version  | Date     | Description |\n| -------- | -------- | ----------- |\n| `v1.5.0` | 01/05/18 | update 3 word address validation for Japanese with interpunct |\n| `v1.4.0` | 06/02/18 | bump jquery version to prevent security issues |\n| `v1.3.1` | 27/09/17 | change w3w svg logo url |\n| `v1.3.0` | 24/04/17 | fixes conflict with standard jquery-typeahead css, adds searched, selection and cancel events |\n| `v1.2.1` | 29/03/17 | prevent warning message on ajax request and test closest form for validation |\n| `v1.2.0` | 10/03/17 | refactoring plugin : tidying up dependencies, building single and bundle distribution files. Parameters : `multilingual` replace `auto_detect_lang`, `country_filter` replaces `country_selector` using only an ISO_3166-1_alpha-2 code |\n| `v1.1.0` | 13/02/17 | uses API method `autosuggest-ml` with number of background results increased to 50 |\n| `v1.0.0` | 07/02/17 | Initial release |\n\n**Nb** Using European Date Format :smile: sorry :us:\n","readmeFilename":"README.md"}