mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Copy/Cut folded heading changed to copy/cut Headings and Bottom Blocks and support multiple headings copy/cut https://github.com/siyuan-note/siyuan/issues/8019
This commit is contained in:
parent
4767e399e2
commit
c55c413365
3 changed files with 59 additions and 6 deletions
|
|
@ -189,6 +189,20 @@ func getHeadingChildrenIDs(c *gin.Context) {
|
|||
ret.Data = ids
|
||||
}
|
||||
|
||||
func appendHeadingChildren(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
dom := arg["dom"].(string)
|
||||
model.AppendHeadingChildren(id, dom)
|
||||
}
|
||||
|
||||
func getHeadingChildrenDOM(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
@ -199,7 +213,11 @@ func getHeadingChildrenDOM(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
dom := model.GetHeadingChildrenDOM(id)
|
||||
removeFoldAttr := false
|
||||
if nil != arg["removeFoldAttr"] {
|
||||
removeFoldAttr = arg["removeFoldAttr"].(bool)
|
||||
}
|
||||
dom := model.GetHeadingChildrenDOM(id, removeFoldAttr)
|
||||
ret.Data = dom
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,6 +222,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/block/getBlockRelevantIDs", model.CheckAuth, getBlockRelevantIDs)
|
||||
ginServer.Handle("POST", "/api/block/getBlockTreeInfos", model.CheckAuth, getBlockTreeInfos)
|
||||
ginServer.Handle("POST", "/api/block/checkBlockRef", model.CheckAuth, checkBlockRef)
|
||||
ginServer.Handle("POST", "/api/block/appendHeadingChildren", model.CheckAuth, appendHeadingChildren)
|
||||
|
||||
ginServer.Handle("POST", "/api/file/getFile", model.CheckAuth, getFile)
|
||||
ginServer.Handle("POST", "/api/file/putFile", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, putFile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue