diff options
| -rw-r--r-- | background_page.html | 2 | ||||
| -rw-r--r-- | lib/completion.js | 21 | 
2 files changed, 12 insertions, 11 deletions
diff --git a/background_page.html b/background_page.html index d9873d87..0a120997 100644 --- a/background_page.html +++ b/background_page.html @@ -1,8 +1,8 @@  <html>  <head> +<script type="text/javascript" src="lib/utils.js"></script>  <script type="text/javascript" src="commands.js"></script>  <script type="text/javascript" src="lib/clipboard.js"></script> -<script type="text/javascript" src="lib/utils.js"></script>  <script type="text/javascript" src="background/settings.js"></script>  <script type="text/javascript" src="lib/completion.js"></script>  <script type="text/javascript" charset="utf-8"> diff --git a/lib/completion.js b/lib/completion.js index e8365b9c..7e4bcf57 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -2,14 +2,15 @@ var completion = (function() {    /** Helper class to construct fuzzy completers for asynchronous data sources like history or bookmark     * matchers. */ -  var AsyncCompletionSource = function() { -    this.id = utils.createUniqueId(); -    this.reset(); -    this.resultsReady = this.fallbackReadyCallback = function(results) { -      this.completions = results; -    } -  } -  AsyncCompletionSource.prototype = { +  var AsyncCompletionSource = Class.extend({ +    init: function() { +      this.id = utils.createUniqueId(); +      this.reset(); +      this.resultsReady = this.fallbackReadyCallback = function(results) { +        this.completions = results; +      } +    }, +      reset: function() {        fuzzyMatcher.invalidateFilterCache(this.id);        this.completions = null; @@ -64,8 +65,8 @@ var completion = (function() {            self.resultsReady(results);          }        } -    }, -  } +    } +  });    /** A simple completer that suggests to open the input string as an URL or to trigger a web search for the     * given term, depending on whether it thinks the input is a URL or not. */  | 
