diff options
| author | Phil Crosby | 2012-05-05 18:13:48 -0700 | 
|---|---|---|
| committer | Phil Crosby | 2012-05-05 18:32:14 -0700 | 
| commit | 0638daca21aef47b8cc91a366e21676679903c0c (patch) | |
| tree | beeec9a78fb1c9c4070805f736bc67691afc55f9 | |
| parent | c2e8618fabd68fb9a920e5b6310e92fe31313e9d (diff) | |
| download | vimium-0638daca21aef47b8cc91a366e21676679903c0c.tar.bz2 | |
Name everything "completor". There's very little different between completors and completorSources.
| -rw-r--r-- | background_page.html | 20 | ||||
| -rw-r--r-- | lib/completion.js | 15 | 
2 files changed, 17 insertions, 18 deletions
| diff --git a/background_page.html b/background_page.html index 0a120997..e4b3e915 100644 --- a/background_page.html +++ b/background_page.html @@ -53,17 +53,17 @@    var tabLoadedHandlers = {}; // tabId -> function()    var completionSources = { -    smart:     new completion.SmartCompletionSource({ -      'wiki ': [ 'Wikipedia (en)',    'http://en.wikipedia.org/wiki/%s' ], -      'luck ': [ 'Google Lucky (en)', 'http://www.google.com/search?q=%s&btnI=I%27m+Feeling+Lucky' ], -      'cc '  : [ 'dict.cc',           'http://www.dict.cc/?s=%s' ], -      ';'    : [ 'goto',              '%s' ], -      '?'    : [ 'search',            function(query) { return utils.createSearchUrl(query) } ], +    smart:     new completion.SmartKeywordCompleter({ +      "wiki ": [ "Wikipedia (en)",    "http://en.wikipedia.org/wiki/%s" ], +      "luck ": [ "Google Lucky (en)", "http://www.google.com/search?q=%s&btnI=I%27m+Feeling+Lucky" ], +      "cc "  : [ "dict.cc",           "http://www.dict.cc/?s=%s" ], +      ";"    : [ "goto",              "%s" ], +      "?"    : [ "search",            function(query) { return utils.createSearchUrl(query); }],        }), -    domain:    new completion.DomainCompletionSource(), -    bookmarks: new completion.FuzzyBookmarkCompletionSource(), -    history:   new completion.FuzzyHistoryCompletionSource(20000), -    tabs:      new completion.FuzzyTabCompletionSource(), +    domain:    new completion.DomainCompleter(), +    bookmarks: new completion.FuzzyBookmarkCompleter(), +    history:   new completion.FuzzyHistoryCompleter(20000), +    tabs:      new completion.FuzzyTabCompleter(),    }    var completers = {      omni: new completion.MultiCompleter([ diff --git a/lib/completion.js b/lib/completion.js index 543b9117..b31c4918 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -173,8 +173,7 @@ var completion = (function() {      }    }); -  /** A fuzzy bookmark completer */ -  var FuzzyBookmarkCompletionSource = Class.extend({ +  var FuzzyBookmarkCompleter = Class.extend({      init: function() { this.asyncCompleter = new AsyncCompleter(); },      filter: function(query, callback) { return this.asyncCompleter.filter(query, callback); }, @@ -242,7 +241,7 @@ var completion = (function() {    /*     * A completer which matches only domains from sites in your history with the current query.     */ -  var DomainCompletionSource = Class.extend({ +  var DomainCompleter = Class.extend({      // A mapping of doamin => useHttps, where useHttps is a boolean.      domains: null, @@ -617,11 +616,11 @@ var completion = (function() {    // public interface    return { -    FuzzyBookmarkCompletionSource: FuzzyBookmarkCompletionSource, -    FuzzyHistoryCompletionSource: FuzzyHistoryCompletionSource, -    FuzzyTabCompletionSource: FuzzyTabCompletionSource, -    SmartCompletionSource: SmartCompletionSource, -    DomainCompletionSource: DomainCompletionSource, +    FuzzyBookmarkCompleter: FuzzyBookmarkCompleter, +    FuzzyHistoryCompleter: FuzzyHistoryCompleter, +    FuzzyTabCompleter: FuzzyTabCompleter, +    SmartKeywordCompleter: SmartKeywordCompleter, +    DomainCompleter: DomainCompleter,      MultiCompleter: MultiCompleter    };  })() | 
