Fixes #1199.
Unified · Split
| @@ -149,6 +149,9 @@ class app.Shortcuts · 148 unmodified lines | ||
| 149 | 149 | when 40 |
| 150 | 150 | @trigger 'altDown' |
| 151 | 151 | false |
| 152 | + when 67 | |
| 153 | + @trigger 'altC' | |
| 154 | + false | |
| 152 | 155 | when 68 |
| 153 | 156 | @trigger 'altD' |
| 154 | 157 | false |
| @@ -1,4 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | + [ | |
| 3 | + "2021-04-29", | |
| 4 | + "Added <code class=\"_label\">alt + c</code> shortcut to copy URL of original page." | |
| 5 | + ], | |
| 2 | 6 | [ |
| 3 | 7 | "2021-02-26", |
| 4 | 8 | "New documentation: <a href=\"/react_bootstrap/\">React Bootstrap</a>" |
| @@ -130,6 +130,9 @@ app.templates.helpPage = -> · 129 unmodified lines | ||
| 130 | 130 | </dl> |
| 131 | 131 | <h3 class="_shortcuts-title">Miscellaneous</h3> |
| 132 | 132 | <dl class="_shortcuts-dl"> |
| 133 | + <dt class="_shortcuts-dt"> | |
| 134 | + <code class="_shortcut-code">alt + c</code> | |
| 135 | + <dd class="_shortcuts-dd">Copy URL of original page | |
| 133 | 136 | <dt class="_shortcuts-dt"> |
| 134 | 137 | <code class="_shortcut-code">alt + o</code> |
| 135 | 138 | <dd class="_shortcuts-dd">Open original page |
| @@ -6,6 +6,7 @@ class app.views.EntryPage extends app.View · 5 unmodified lines | ||
| 6 | 6 | click: 'onClick' |
| 7 | 7 | |
| 8 | 8 | @shortcuts: |
| 9 | + altC: 'onAltC' | |
| 9 | 10 | altO: 'onAltO' |
| 10 | 11 | |
| 11 | 12 | @routes: |
| @@ -153,6 +154,12 @@ class app.views.EntryPage extends app.View · 141 unmodified lines | ||
| 153 | 154 | setTimeout (-> target.className = '_pre-clip'), 2000 |
| 154 | 155 | return |
| 155 | 156 | |
| 157 | + onAltC: => | |
| 158 | + return unless link = @find('._attribution:last-child ._attribution-link') | |
| 159 | + console.log(link.href + location.hash) | |
| 160 | + navigator.clipboard.writeText(link.href + location.hash) | |
| 161 | + return | |
| 162 | + | |
| 156 | 163 | onAltO: => |
| 157 | 164 | return unless link = @find('._attribution:last-child ._attribution-link') |
| 158 | 165 | @delay -> $.popup(link.href + location.hash) |