summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-08-06 02:31:59 +0200
committerThomas F. K. Jorna <[email protected]>2021-08-06 02:31:59 +0200
commitb92b006e2c22302e708672de97b9a05081ecca1c (patch)
tree7117eee455b6b8e4b60e4265e36f258a3a360f73 /org-roam-ui.el
parentd1a7d3c00a603cb774697e49696e9a0d2c4661b9 (diff)
features!: context menu, better ui, and smoother updates
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index fe0eb1b..655b643 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -144,7 +144,6 @@ This serves the web-build and API over HTTP."
(let* ((msg (json-parse-string (websocket-frame-text frame) :object-type 'alist))
(command (alist-get 'command msg))
(data (alist-get 'data msg)))
- (message "%s" (websocket-frame-text frame))
(cond ((string= command "open")
(org-roam-node-visit
(org-roam-populate (org-roam-node-create
@@ -155,6 +154,14 @@ This serves the web-build and API over HTTP."
(delete-file (alist-get 'file data))
(org-roam-db-sync)
(org-roam-ui--send-graphdata)))
+ ((string= command "create")
+
+ (progn
+ (if (and (fboundp #'orb-edit-note) (alist-get 'ROAM_REFS data))
+ (orb-edit-note (alist-get 'id data)))
+ (org-roam-capture-
+ :node (org-roam-node-create :title (alist-get 'title data))
+ :props '(:finalize find-file))))
(t (message "Something went wrong when receiving a message from Org-Roam-UI")))))
:on-close (lambda (_websocket)
(remove-hook 'after-save-hook #'org-roam-ui--on-save)