Style changes and improvements in autocomplete

This commit is contained in:
Aviral Dasgupta 2016-06-20 13:52:55 +05:30
parent b9d7743e5a
commit 4af983ed90
10 changed files with 135 additions and 93 deletions

View file

@ -5,6 +5,8 @@ import 'whatwg-fetch';
const DDG_REGEX = /\/ddg\s+(.+)$/;
const REFERER = 'vector';
let instance = null;
export default class DuckDuckGoProvider extends AutocompleteProvider {
static getQueryUri(query: String) {
return `http://api.duckduckgo.com/?q=${encodeURIComponent(query)}`
@ -51,4 +53,11 @@ export default class DuckDuckGoProvider extends AutocompleteProvider {
getName() {
return 'Results from DuckDuckGo';
}
static getInstance(): DuckDuckGoProvider {
if(instance == null)
instance = new DuckDuckGoProvider();
return instance;
}
}