diff --git a/assets/javascripts/app/shortcuts.coffee b/assets/javascripts/app/shortcuts.coffee index 18e05d4d..d3933ea5 100644 --- a/assets/javascripts/app/shortcuts.coffee +++ b/assets/javascripts/app/shortcuts.coffee @@ -101,6 +101,9 @@ class app.Shortcuts when 40 @trigger 'altDown' false + when 71 + @trigger 'altG' + false handleKeypressEvent: (event) -> if event.which is 63 and not event.target.value diff --git a/assets/javascripts/templates/pages/help_tmpl.coffee b/assets/javascripts/templates/pages/help_tmpl.coffee index f4793ad6..9d7ff17b 100644 --- a/assets/javascripts/templates/pages/help_tmpl.coffee +++ b/assets/javascripts/templates/pages/help_tmpl.coffee @@ -77,6 +77,9 @@ app.templates.helpPage = """
Alt + g
+ escape
Alt + g
shortcut for searching on Google. """
+ ], [
+ 1386979200000, # December 14, 2013
""" New PostgreSQL documentation """
], [
1386892800000, # December 13, 2013
diff --git a/assets/javascripts/views/search/search.coffee b/assets/javascripts/views/search/search.coffee
index d9ce6268..7eae260a 100644
--- a/assets/javascripts/views/search/search.coffee
+++ b/assets/javascripts/views/search/search.coffee
@@ -15,6 +15,7 @@ class app.views.Search extends app.View
@shortcuts:
typing: 'autoFocus'
+ altG: 'google'
@routes:
root: 'onRoot'
@@ -82,6 +83,12 @@ class app.views.Search extends app.View
@removeClass @constructor.activeClass
@trigger 'clear'
+ google: =>
+ if @value
+ $.popup "https://www.google.com/search?q=#{encodeURIComponent @value}"
+ @reset()
+ return
+
onResults: (results) =>
@trigger 'results', results, @flags
@flags.initialResults = false