更改

添加654字节 、 2026年2月24日 (星期二)
无编辑摘要
第91行: 第91行:  
             out = out .. "[[Category:联动介绍页]]"
 
             out = out .. "[[Category:联动介绍页]]"
 
             out = out .. "[[Category:联动设定]]"
 
             out = out .. "[[Category:联动设定]]"
         else -- 公共设定
+
         elseif type == "公共设定" then
 
             out = out .. (renderLiteInfoBox(frame, "SharedItem.svg", "公共设定页"))
 
             out = out .. (renderLiteInfoBox(frame, "SharedItem.svg", "公共设定页"))
 
             mw.smw.set({['设定类型'] = "公共设定"})
 
             mw.smw.set({['设定类型'] = "公共设定"})
 
             out = out .. "[[Category:公共设定]]"
 
             out = out .. "[[Category:公共设定]]"
 +
        else -- 共享文档页
 +
            out = out .. (renderLiteInfoBox(frame, "SharedItem.svg", "共享资源页"))
 +
            mw.smw.set({['设定类型'] = "共享资源"})
 +
            out = out .. "[[Category:共享资源]]"
 
         end
 
         end
 
     else -- base must exist
 
     else -- base must exist
第128行: 第132行:  
         image = 'Settings.svg',
 
         image = 'Settings.svg',
 
         link = 'https://wiki.ifworlds.org/wiki/特殊:编辑表格/设定页v2/'..title
 
         link = 'https://wiki.ifworlds.org/wiki/特殊:编辑表格/设定页v2/'..title
 +
    }
 +
    return frame:expandTemplate{title = "LinkButtonBox", args = args}
 +
end
 +
 +
function renderShareButton(frame)
 +
    local title = PageName.getPageName()
 +
    local args = {
 +
        image = 'ShareButton.svg',
 +
        link = 'https://share-wiki.ifworlds.org/#/share?title='..title
 
     }
 
     }
 
     return frame:expandTemplate{title = "LinkButtonBox", args = args}
 
     return frame:expandTemplate{title = "LinkButtonBox", args = args}
第133行: 第146行:     
function p.renderCreator(frame)
 
function p.renderCreator(frame)
 +
    local root = mw.html.create("div")
 
     local title = PageName.getPageName()
 
     local title = PageName.getPageName()
 
     local prop_names = {"维护者", "创作者", "输入设定类型", "设定集核心页", "依赖设定集", "仅允许维护者编辑", "创作阶段", "上级概念", "前置条件", "事后效果"}
 
     local prop_names = {"维护者", "创作者", "输入设定类型", "设定集核心页", "依赖设定集", "仅允许维护者编辑", "创作阶段", "上级概念", "前置条件", "事后效果"}
     local props = SMWUtils.query_page_properties("[["..title.."]]", prop_names)[1]["properties"]
+
     local page = SMWUtils.query_page_properties("[["..title.."]]", prop_names)[1]
     local root = mw.html.create("div")
+
    if page == nil then
 +
        return root:done()
 +
    end
 +
     local props = page["properties"]
 
     root:attr("style", "display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, auto)); width: 100%")
 
     root:attr("style", "display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, auto)); width: 100%")
 
     local maintainerTemp = renderMaintainers(frame, props["维护者"], props["创作者"])
 
     local maintainerTemp = renderMaintainers(frame, props["维护者"], props["创作者"])
第151行: 第168行:        +
    root:wikitext(renderShareButton(frame))
 
     root:wikitext(renderEditButton(frame))
 
     root:wikitext(renderEditButton(frame))
 
     return root:done()
 
     return root:done()