🔒 (notes): 新想法默认私有,设置里可改可见范围
公开和仅关注只对新想法生效。已有想法沿用原来记下的范围。
This commit is contained in:
1 parent
352ee1bd99
commit
338e2d2d3c
10 files changed
+207
-61
No files matched your search
@@ -159,6 +159,31 @@ function Setting.rows(plugin)
|
||||
toggle("merge_local_stats", false, "history", _("合并本地阅读时长"),
|
||||
_("关闭时以云端为准;打开后每天取云端与本地中较大的,补上离线阅读。只影响月读里的统计"))
|
||||
toggle("show_paragraph_reviews", false, "forum", _("显示段评"), _("阅读时给有他人段评的句子画线,点按查看;需联网"))
|
||||
local visibility = {
|
||||
{ value = "private", label = _("私有") },
|
||||
{ value = "public", label = _("公开") },
|
||||
{ value = "follow", label = _("仅关注") },
|
||||
}
|
||||
rows[#rows + 1] = function(iw)
|
||||
local cfg = Settings.getSource(SOURCE_ID)
|
||||
local current = cfg.note_visibility
|
||||
if current ~= "public" and current ~= "follow" then current = "private" end
|
||||
local index = 1
|
||||
for i, item in ipairs(visibility) do
|
||||
if item.value == current then index = i end
|
||||
end
|
||||
return Row.widget({ width = iw, chevron = false, kind = "action", icon = "lock",
|
||||
title = _("想法默认可见"),
|
||||
subtitle = _("点按切换。仅关注是互相关注可见,只影响新想法"),
|
||||
status = visibility[index].label,
|
||||
status_on = current ~= "public",
|
||||
callback = function()
|
||||
local next_item = visibility[index % #visibility + 1]
|
||||
cfg.note_visibility = next_item.value
|
||||
Settings.saveSource(SOURCE_ID, cfg)
|
||||
if plugin and plugin.desktop then plugin.desktop:updateView() end
|
||||
end })
|
||||
end
|
||||
rows[#rows + 1] = require("source.category_setting").row(SOURCE_ID, plugin)
|
||||
if not Auth.hasSession() then return rows end
|
||||
rows[#rows + 1] = function(iw)
|
||||
|
||||
Reference in new issue
Block a user