Skip to content

Commit 1bc380f

Browse files
Natnael GetahunThibaut
authored andcommitted
Add DuckDuckGo shortcut
Added an alias ```alt + d``` to be DuckDuckGo shortcut
1 parent 17964b6 commit 1bc380f

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

assets/javascripts/app/shortcuts.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ class app.Shortcuts
149149
when 40
150150
@trigger 'altDown'
151151
false
152+
when 68
153+
@trigger 'altD'
154+
false
152155
when 70
153156
@trigger 'altF', event
154157
when 71

assets/javascripts/templates/pages/help_tmpl.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ app.templates.helpPage = ->
131131
<dt class="_shortcuts-dt">
132132
<code class="_shortcut-code">alt + s</code>
133133
<dd class="_shortcuts-dd">Search on Stack Overflow
134+
<dt class="_shortcuts-dt">
135+
<code class="_shortcut-code">alt + d</code>
136+
<dd class="_shortcuts-dd">Search on DuckDuckGo
134137
</dl>
135138
<p class="_note _note-green">
136139
<strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or

assets/javascripts/views/search/search.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class app.views.Search extends app.View
1717
typing: 'focus'
1818
altG: 'google'
1919
altS: 'stackoverflow'
20+
altD: 'duckduckgo'
2021

2122
@routes:
2223
after: 'afterRoute'
@@ -113,6 +114,10 @@ class app.views.Search extends app.View
113114
@externalSearch "https://stackoverflow.com/search?q="
114115
return
115116

117+
duckduckgo: =>
118+
@externalSearch "https://duckduckgo.com/?t=devdocs&q="
119+
return
120+
116121
onResults: (results) =>
117122
@hasResults = true if results.length
118123
@trigger 'results', results, @flags

0 commit comments

Comments
 (0)