This is a small coding assignment regarding Algolia Search and [login to view URL] ([login to view URL], [login to view URL]).
The attached file shows how Algolia's autocomplete works. I need a selfcontained jQuery plugin which will:
1) extend Algolia's autocomplete with an initialization option we'll call legitInput, and which will contain a regular expression to validate user input before actually querying the Algolia Index. If we have legitInput: [a-zA-z\s], and the user starts typing numerals or non-English characters, no query of the Algolia index (source) should take place;
2) extend Algolia's autocomplete templates with an illegit hash, which will override the default templates, so that we can display a customized message to the user that they are using illegitimate characters:
illegit: function() {
return "You can search only using such and such characters ";
}