aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzyMode.js
diff options
context:
space:
mode:
authorPhil Crosby2012-05-05 19:11:40 -0700
committerPhil Crosby2012-05-05 19:11:40 -0700
commite97088b3d552243e833496ff81992d3895afec0d (patch)
tree717cb5024e1ce655c7506c41a225e6ab8a5691f9 /fuzzyMode.js
parent07179da4731a17eba827fd289992c8499ea46939 (diff)
downloadvimium-e97088b3d552243e833496ff81992d3895afec0d.tar.bz2
Have "O" activate teh vomnibox with the current URL. Completes #521.
Diffstat (limited to 'fuzzyMode.js')
-rw-r--r--fuzzyMode.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/fuzzyMode.js b/fuzzyMode.js
index 0233652a..4b682058 100644
--- a/fuzzyMode.js
+++ b/fuzzyMode.js
@@ -8,14 +8,18 @@ var fuzzyMode = (function() {
return completers[name];
}
- /** Trigger the fuzzy mode dialog */
- function start(name, refreshInterval) {
- var completer = getCompleter(name);
+ /*
+ * Activate the Vomnibox.
+ */
+ function activate(completerName, refreshInterval, initialQueryValue) {
+ var completer = getCompleter(completerName);
if (!fuzzyBox)
fuzzyBox = new FuzzyBox(10);
completer.refresh();
fuzzyBox.setCompleter(completer);
fuzzyBox.setRefreshInterval(refreshInterval);
+ if (initialQueryValue)
+ fuzzyBox.setQuery(initialQueryValue);
fuzzyBox.show();
}
@@ -28,6 +32,8 @@ var fuzzyMode = (function() {
this.initDom();
},
+ setQuery: function(query) { this.input.value = query; },
+
setCompleter: function(completer) {
this.completer = completer;
this.reset();
@@ -211,8 +217,8 @@ var fuzzyMode = (function() {
// public interface
return {
- activateAll: function() { start("omni", 100); },
- activateAllNewTab: function() { start("omni", 100); },
- activateTabs: function() { start("tabs", 0); },
+ activate: function() { activate("omni", 100); },
+ activateWithCurrentUrl: function() { activate("omni", 100, window.location.toString()); },
+ activateTabSelection: function() { activate("tabs", 0); }
}
})();