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