From fdbf483207c5654885290da88d16a156e86bc375 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Thu, 21 Aug 2014 22:17:31 -0300 Subject: Suggestion for impl of #1141 --- content_scripts/vomnibar.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 6997d387..b7703583 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -90,15 +90,15 @@ class VomnibarUI if (KeyboardUtils.isEscape(event)) return "dismiss" else if (key == "up" || - (event.shiftKey && event.keyCode == keyCodes.tab) || (event.ctrlKey && (key == "k" || key == "p"))) return "up" else if (key == "down" || - (event.keyCode == keyCodes.tab && !event.shiftKey) || (event.ctrlKey && (key == "j" || key == "n"))) return "down" else if (event.keyCode == keyCodes.enter) return "enter" + else if (event.keyCode == keyCodes.tab) + return "complete" onKeydown: (event) -> action = @actionFromKeyEvent(event) @@ -133,6 +133,11 @@ class VomnibarUI # Shift+Enter will open the result in a new tab instead of the current tab. @completions[@selection].performAction(openInNewTab) @hide() + else if (action == "complete") + if (@selection == -1) + @input.value = window.location + else + @input.value = @completions[@selection].url # It seems like we have to manually suppress the event here and still return true. event.stopPropagation() -- cgit v1.2.3 From 34e3e91de12128f1d23c120f97c80b41dae9b42c Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Fri, 22 Aug 2014 08:55:42 -0300 Subject: Changed key biding to use right arrow instead of tab, returning previous tab functionalities --- content_scripts/vomnibar.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index b7703583..95e080e8 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -90,15 +90,19 @@ class VomnibarUI if (KeyboardUtils.isEscape(event)) return "dismiss" else if (key == "up" || + (event.shiftKey && event.keyCode == keyCodes.tab) || (event.ctrlKey && (key == "k" || key == "p"))) return "up" else if (key == "down" || + (event.keyCode == keyCodes.tab && !event.shiftKey) || (event.ctrlKey && (key == "j" || key == "n"))) return "down" else if (event.keyCode == keyCodes.enter) return "enter" - else if (event.keyCode == keyCodes.tab) + else if (key == "right") return "complete" + else if (key == "left") + return "current" onKeydown: (event) -> action = @actionFromKeyEvent(event) @@ -138,6 +142,8 @@ class VomnibarUI @input.value = window.location else @input.value = @completions[@selection].url + else if (action == "current") + @input.value = window.location # It seems like we have to manually suppress the event here and still return true. event.stopPropagation() -- cgit v1.2.3 From f2475fdbe927f5d6d66840f7941779f5a8c5d194 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Fri, 22 Aug 2014 16:25:18 -0300 Subject: Switching again to Ctrl+Enter --- content_scripts/vomnibar.coffee | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 95e080e8..bbcb3f43 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -97,12 +97,10 @@ class VomnibarUI (event.keyCode == keyCodes.tab && !event.shiftKey) || (event.ctrlKey && (key == "j" || key == "n"))) return "down" + else if (event.ctrlKey && event.keyCode == keyCodes.enter) + return "complete" else if (event.keyCode == keyCodes.enter) return "enter" - else if (key == "right") - return "complete" - else if (key == "left") - return "current" onKeydown: (event) -> action = @actionFromKeyEvent(event) @@ -142,8 +140,6 @@ class VomnibarUI @input.value = window.location else @input.value = @completions[@selection].url - else if (action == "current") - @input.value = window.location # It seems like we have to manually suppress the event here and still return true. event.stopPropagation() -- cgit v1.2.3 From 877b4caa12ba9816483bc708d884f9cb48e1759b Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Wed, 3 Sep 2014 14:33:18 -0300 Subject: Changed to show url when item selected --- content_scripts/vomnibar.coffee | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index bbcb3f43..9c13cd6d 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -97,8 +97,6 @@ class VomnibarUI (event.keyCode == keyCodes.tab && !event.shiftKey) || (event.ctrlKey && (key == "j" || key == "n"))) return "down" - else if (event.ctrlKey && event.keyCode == keyCodes.enter) - return "complete" else if (event.keyCode == keyCodes.enter) return "enter" @@ -113,10 +111,12 @@ class VomnibarUI else if (action == "up") @selection -= 1 @selection = @completions.length - 1 if @selection < @initialSelectionValue + @input.value = @completions[@selection].url @updateSelection() else if (action == "down") @selection += 1 @selection = @initialSelectionValue if @selection == @completions.length + @input.value = @completions[@selection].url @updateSelection() else if (action == "enter") # If they type something and hit enter without selecting a completion from our list of suggestions, @@ -135,11 +135,6 @@ class VomnibarUI # Shift+Enter will open the result in a new tab instead of the current tab. @completions[@selection].performAction(openInNewTab) @hide() - else if (action == "complete") - if (@selection == -1) - @input.value = window.location - else - @input.value = @completions[@selection].url # It seems like we have to manually suppress the event here and still return true. event.stopPropagation() -- cgit v1.2.3