模組:沙盒/Sunny00217/committed

文档图示 模块文档[创建]
function main (frame)
	local t = mw.text.jsonDecode(mw.title.new('User:Sunny00217/committed.json'):getContent())
	local ret = mw.html.create('div'):attr('id', 'user-committed-identity'):cssText('font-size:85%; display:block; background:#E0E8FF; border:1px solid #E0E8FF; margin: 0.2em 0; padding:0.1em 0.3em; word-wrap: break-word;'):newline()
	local wt = [=[
;身份聲明([[User:Sunny00217/committed.json|source]])
:以下皆是在下的帳戶:
]=]
	for _, v in ipairs(t.self) do
		wt = wt .. ':* ' .. v.site .. ':' .. (v.link or '[' .. v.url .. ' Sunny00217]') .. '\n'
	end
	wt = wt .. [=[
: 若有其他相關帳戶需要證明可以以以下方式詢問:
:* {{fullurl2|User_talk:Sunny00217|action=edit&section=new|討論頁}}
:* [[Special:Email/Sunny00217]]
:* {{email|sunny00217wm|gmail.com}}
;[[SHA-512]]
:曾經用過的:
]=]
	for _, v in ipairs(t.key.history) do
		wt = wt .. ':* 「\'\'\'' .. v.sha .. '\'\'\'」,對應「\'\'\'' .. v.prototype .. '\'\'\'」。\n'
	end
	wt = wt .. ':[[Template:User_committed_identity|目前的]]:\n:* 「\'\'\'' .. t.key.now .. '\'\'\'」,對應「{{block|開出來的人是傻子}}」。\n'
	return ret:wikitext(frame:preprocess(wt)):newline():done()
end

return {
	[''] = main
}