mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
✨ 增加公共代码 js/css 片段 https://github.com/siyuan-note/siyuan/issues/6143
This commit is contained in:
parent
d63c63bbd7
commit
1a8c519fb3
1 changed files with 4 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ func getSnippet(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
typ := arg["type"].(string)
|
typ := arg["type"].(string) // js/css/all
|
||||||
enabledArg := int(arg["enabled"].(float64)) // 0:禁用,1:启用,2:全部
|
enabledArg := int(arg["enabled"].(float64)) // 0:禁用,1:启用,2:全部
|
||||||
enabled := true
|
enabled := true
|
||||||
if 0 == enabledArg {
|
if 0 == enabledArg {
|
||||||
|
|
@ -55,6 +55,9 @@ func getSnippet(c *gin.Context) {
|
||||||
snippets = append(snippets, s)
|
snippets = append(snippets, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if 1 > len(snippets) {
|
||||||
|
snippets = []*conf.Snippet{}
|
||||||
|
}
|
||||||
|
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"snippets": snippets,
|
"snippets": snippets,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue