Просмотр исходного кода

Fixes issue #3276 - Software error when Elasticsearch is not configured and `rake searchindex:rebuild`

Martin Edenhofer 4 лет назад
Родитель
Сommit
0756b7ac23

+ 13 - 0
app/assets/javascripts/app/controllers/widget/keyboard_shortcuts.coffee

@@ -443,6 +443,19 @@ App.Config.set(
               description: 'Format as //strikethrough//'
               globalEvent: 'richtext-strikethrough'
             }
+            {
+              key: 'v'
+              magicKey: true
+              description: 'Paste from clipboard'
+              globalEvent: 'clipboard-paste'
+            }
+            {
+              key: 'v'
+              magicKey: true
+              shiftKey: true
+              description: 'Paste from clipboard (plain text)'
+              globalEvent: 'clipboard-paste-plain-text'
+            }
             {
               key: 'f'
               hotkeys: true

+ 2 - 2
app/assets/javascripts/app/lib/base/jquery.contenteditable.js

@@ -199,7 +199,7 @@
       || e.keyCode == 75
       || e.keyCode == 76
       || e.keyCode == 85
-      || e.keyCode == 86
+      || e.keyCode == 83
       || e.keyCode == 88
       || e.keyCode == 90
       || e.keyCode == 89)) {
@@ -237,7 +237,7 @@
       if (e.keyCode == 85) {
         document.execCommand('underline')
       }
-      if (e.keyCode == 86) {
+      if (e.keyCode == 83) {
         document.execCommand('strikeThrough')
       }
       if (e.keyCode == 88) {

+ 3 - 0
app/assets/javascripts/app/views/keyboard_shortcuts.jst.eco

@@ -37,6 +37,9 @@
         <% else if shortcut.magicKey: %>
           <kbd><%= @magicKey %></kbd>
         <% end %>
+        <% if shortcut.shiftKey: %>
+          <kbd>shift</kbd>
+        <% end %>
         <% if shortcut.keyPrefix: %>
           <%= shortcut.keyPrefix %>
         <% end %>