mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 19:38:48 +01:00
🎨 Spaced repetition interface supports review by document selection https://github.com/siyuan-note/siyuan/issues/7954
This commit is contained in:
parent
0ebdd49f8a
commit
66bd5e91a5
7 changed files with 112 additions and 38 deletions
|
|
@ -95,7 +95,7 @@ func heading2Doc(c *gin.Context) {
|
|||
|
||||
name := path.Base(targetPath)
|
||||
box := model.Conf.Box(targetNotebook)
|
||||
files, _, _ := model.ListDocTree(targetNotebook, path.Dir(targetPath), model.Conf.FileTree.Sort)
|
||||
files, _, _ := model.ListDocTree(targetNotebook, path.Dir(targetPath), model.Conf.FileTree.Sort, false)
|
||||
evt := util.NewCmdResult("heading2doc", 0, util.PushModeBroadcast)
|
||||
evt.Data = map[string]interface{}{
|
||||
"box": box,
|
||||
|
|
@ -140,7 +140,7 @@ func li2Doc(c *gin.Context) {
|
|||
|
||||
name := path.Base(targetPath)
|
||||
box := model.Conf.Box(targetNotebook)
|
||||
files, _, _ := model.ListDocTree(targetNotebook, path.Dir(targetPath), model.Conf.FileTree.Sort)
|
||||
files, _, _ := model.ListDocTree(targetNotebook, path.Dir(targetPath), model.Conf.FileTree.Sort, false)
|
||||
evt := util.NewCmdResult("li2doc", 0, util.PushModeBroadcast)
|
||||
evt.Data = map[string]interface{}{
|
||||
"box": box,
|
||||
|
|
@ -448,7 +448,7 @@ func createDailyNote(c *gin.Context) {
|
|||
evt.AppId = app
|
||||
|
||||
name := path.Base(p)
|
||||
files, _, _ := model.ListDocTree(box.ID, path.Dir(p), model.Conf.FileTree.Sort)
|
||||
files, _, _ := model.ListDocTree(box.ID, path.Dir(p), model.Conf.FileTree.Sort, false)
|
||||
evt.Data = map[string]interface{}{
|
||||
"box": box,
|
||||
"path": p,
|
||||
|
|
@ -590,8 +590,13 @@ func searchDocs(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
flashcard := false
|
||||
if arg["flashcard"] != nil {
|
||||
flashcard = arg["flashcard"].(bool)
|
||||
}
|
||||
|
||||
k := arg["k"].(string)
|
||||
ret.Data = model.SearchDocsByKeyword(k)
|
||||
ret.Data = model.SearchDocsByKeyword(k, flashcard)
|
||||
}
|
||||
|
||||
func listDocsByPath(c *gin.Context) {
|
||||
|
|
@ -610,7 +615,12 @@ func listDocsByPath(c *gin.Context) {
|
|||
if nil != sortParam {
|
||||
sortMode = int(sortParam.(float64))
|
||||
}
|
||||
files, totals, err := model.ListDocTree(notebook, p, sortMode)
|
||||
flashcard := false
|
||||
if arg["flashcard"] != nil {
|
||||
flashcard = arg["flashcard"].(bool)
|
||||
}
|
||||
|
||||
files, totals, err := model.ListDocTree(notebook, p, sortMode, flashcard)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
|
|
@ -708,7 +718,7 @@ func getDoc(c *gin.Context) {
|
|||
func pushCreate(box *model.Box, p, treeID string, arg map[string]interface{}) {
|
||||
evt := util.NewCmdResult("create", 0, util.PushModeBroadcast)
|
||||
name := path.Base(p)
|
||||
files, _, _ := model.ListDocTree(box.ID, path.Dir(p), model.Conf.FileTree.Sort)
|
||||
files, _, _ := model.ListDocTree(box.ID, path.Dir(p), model.Conf.FileTree.Sort, false)
|
||||
evt.Data = map[string]interface{}{
|
||||
"box": box,
|
||||
"path": p,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue