|
|
@@ -17,7 +17,8 @@
|
|
|
[frontend.util.property :as property]
|
|
|
[goog.dom :as gdom]
|
|
|
[goog.object :as gobj]
|
|
|
- [promesa.core :as p]))
|
|
|
+ [promesa.core :as p]
|
|
|
+ [frontend.mobile.util :as mobile-util]))
|
|
|
|
|
|
;; TODO: move to frontend.handler.editor.commands
|
|
|
|
|
|
@@ -283,14 +284,15 @@
|
|
|
["Query table function" [[:editor/input "{{function }}" {:backward-pos 2}]] "Create a query table function"]
|
|
|
["Calculator" [[:editor/input "```calc\n\n```" {:backward-pos 4}]
|
|
|
[:codemirror/focus]] "Insert a calculator"]
|
|
|
- ["Draw" (fn []
|
|
|
- (let [file (draw/file-name)
|
|
|
- path (str config/default-draw-directory "/" file)
|
|
|
- text (util/format "[[%s]]" path)]
|
|
|
- (p/let [_ (draw/create-draw-with-default-content path)]
|
|
|
- (println "draw file created, " path))
|
|
|
- text)) "Draw a graph with Excalidraw"]
|
|
|
-
|
|
|
+ (when-not (mobile-util/is-native-platform?)
|
|
|
+ ["Draw" (fn []
|
|
|
+ (let [file (draw/file-name)
|
|
|
+ path (str config/default-draw-directory "/" file)
|
|
|
+ text (util/format "[[%s]]" path)]
|
|
|
+ (p/let [_ (draw/create-draw-with-default-content path)]
|
|
|
+ (println "draw file created, " path))
|
|
|
+ text)) "Draw a graph with Excalidraw"])
|
|
|
+
|
|
|
(when (util/zh-CN-supported?)
|
|
|
["Embed Bilibili video" [[:editor/input "{{bilibili }}" {:last-pattern (state/get-editor-command-trigger)
|
|
|
:backward-pos 2}]]])
|