mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Enable or disable all CSS and JS code snippets https://github.com/siyuan-note/siyuan/issues/9860
This commit is contained in:
parent
01205215eb
commit
65f747fbf2
2 changed files with 30 additions and 0 deletions
|
|
@ -29,6 +29,35 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func setConfSnippet(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
param, err := gulu.JSON.MarshalJSON(arg)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
snippet := &conf.Snpt{}
|
||||
if err = gulu.JSON.UnmarshalJSON(param, snippet); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
model.Conf.Snippet = snippet
|
||||
model.Conf.Save()
|
||||
|
||||
ret.Data = snippet
|
||||
}
|
||||
|
||||
func addVirtualBlockRefExclude(c *gin.Context) {
|
||||
// Add internal kernel API `/api/setting/addVirtualBlockRefExclude` https://github.com/siyuan-note/siyuan/issues/9909
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue