diff options
Diffstat (limited to 'background_scripts/completion_search.coffee')
| -rw-r--r-- | background_scripts/completion_search.coffee | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/background_scripts/completion_search.coffee b/background_scripts/completion_search.coffee index cb819025..b3ae88d4 100644 --- a/background_scripts/completion_search.coffee +++ b/background_scripts/completion_search.coffee @@ -1,4 +1,13 @@ +class EngineWrapper + constructor: (@searchUrl, @engine) -> + + getUrl: (queryTerms) -> + @engine.getUrl queryTerms + + parse: (xhr) -> + @engine.parse xhr + CompletionSearch = debug: false inTransit: {} @@ -93,7 +102,7 @@ CompletionSearch = # Elide duplicate requests. First fetch the suggestions... @inTransit[completionCacheKey] ?= new AsyncDataFetcher (callback) => - engine = @lookupEngine searchUrl + engine = new EngineWrapper searchUrl, @lookupEngine searchUrl url = engine.getUrl queryTerms @get searchUrl, url, (xhr = null) => |
