Browse Source

ux: add shortcut setting entry in setting page

Weihua Lu 4 years ago
parent
commit
cdb289dc50
2 changed files with 18 additions and 0 deletions
  1. 14 0
      src/main/frontend/components/settings.cljs
  2. 4 0
      src/main/frontend/dicts.cljs

+ 14 - 0
src/main/frontend/components/settings.cljs

@@ -368,6 +368,20 @@
                   (let [value (not enable-encryption?)]
                     (config-handler/set-config! :feature/enable-encryption? value))))
 
+        [:div.it.sm:grid.sm:grid-cols-3.sm:gap-4.sm:items-start
+         [:label.block.text-sm.font-medium.leading-5.opacity-70
+          {:for "customize_shortcuts"}
+          (t :settings-page/customize-shortcuts)]
+         [:div.mt-1.sm:mt-0.sm:col-span-2
+          [:div.max-w-lg.rounded-md
+           (ui/button
+            (t :settings-page/shortcut-settings)
+            :class "text-sm p-0.5"
+            :on-click
+            (fn []
+              (state/close-settings!)
+              (route-handler/redirect! {:to :shortcut})))]]]
+
         (when (string/starts-with? current-repo "https://")
           (toggle "enable_git_auto_push"
                   "Enable Git auto push"

+ 4 - 0
src/main/frontend/dicts.cljs

@@ -214,6 +214,8 @@
         :settings-page/enable-tooltip "Enable tooltip"
         :settings-page/enable-journals "Enable journals"
         :settings-page/enable-encryption "Enable encryption feature"
+        :settings-page/customize-shortcuts "Customize shortcuts"
+        :settings-page/shortcut-settings "Shortcut Settings"
         :settings-page/home-default-page "Set the default home page"
         :settings-page/enable-block-time "Enable block timestamps"
         :settings-page/dont-use-other-peoples-proxy-servers "Don't use other people's proxy servers. It's very dangerous, which could make your token and notes stolen. Logseq will not be responsible for this loss if you use other people's proxy servers. You can deploy it yourself, check "
@@ -879,6 +881,8 @@
            :settings-page/enable-timetracking "开启 timetracking"
            :settings-page/enable-journals "开启日记"
            :settings-page/enable-encryption "激活加密功能"
+           :settings-page/customize-shortcuts "自定义快捷键"
+           :settings-page/shortcut-settings "快捷键设置"
            :settings-page/home-default-page "设置首页默认页面"
            :settings-page/enable-block-time "记录 block 创建/修改时间"
            :settings-page/dont-use-other-peoples-proxy-servers "不要使用其他人的代理服务器。这非常危险,可能会使您的令牌和笔记被盗。 如果您使用其他人的代理服务器,Logseq 将不会对此损失负责。您可以自己部署它,请查阅 "