mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Add two shortcuts for block navigation https://github.com/siyuan-note/siyuan/issues/11193
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getParentNextChildID(c *gin.Context) {
|
||||
func getBlockSiblingID(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
@@ -39,8 +39,11 @@ func getParentNextChildID(c *gin.Context) {
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
parent, previous, next := model.GetBlockSiblingID(id)
|
||||
ret.Data = map[string]string{
|
||||
"id": model.GetParentNextChildID(id),
|
||||
"parent": parent,
|
||||
"next": next,
|
||||
"previous": previous,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
||||
ginServer.Handle("POST", "/api/block/getHeadingChildrenDOM", model.CheckAuth, getHeadingChildrenDOM)
|
||||
ginServer.Handle("POST", "/api/block/swapBlockRef", model.CheckAuth, model.CheckReadonly, swapBlockRef)
|
||||
ginServer.Handle("POST", "/api/block/transferBlockRef", model.CheckAuth, model.CheckReadonly, transferBlockRef)
|
||||
ginServer.Handle("POST", "/api/block/getParentNextChildID", model.CheckAuth, getParentNextChildID)
|
||||
ginServer.Handle("POST", "/api/block/getBlockSiblingID", model.CheckAuth, getBlockSiblingID)
|
||||
|
||||
ginServer.Handle("POST", "/api/file/getFile", model.CheckAuth, getFile)
|
||||
ginServer.Handle("POST", "/api/file/putFile", model.CheckAuth, model.CheckReadonly, putFile)
|
||||
|
||||
Reference in New Issue
Block a user