細
コメントを修正
細 (1版 をインポートしました) |
bsd>本日晴天 細 (コメントを修正) |
||
| 3行目: | 3行目: | ||
-- Get required modules. | -- Get required modules. | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
local messageBox = require('Module:Message box') | |||
-- Get the config table. | -- Get the config table. | ||
| 32行目: | 33行目: | ||
expectType = expectType or 'string' | expectType = expectType or 'string' | ||
if type(msg) ~= expectType then | if type(msg) ~= expectType then | ||
error(' | error('メッセージ: cfg.' .. cfgKey .. 'の入力エラー。(想定:' .. expectType .. '、実際:' .. type(msg) .. ')', 2) | ||
end | end | ||
if not valArray then | if not valArray then | ||
| 40行目: | 41行目: | ||
local function getMessageVal(match) | local function getMessageVal(match) | ||
match = tonumber(match) | match = tonumber(match) | ||
return valArray[match] or error(' | return valArray[match] or error('メッセージ: メッセージ設定で$' .. match .. 'キーの値が見つかりませんでした。' .. cfgKey, 4) | ||
end | end | ||
| 434行目: | 435行目: | ||
local editProt = protectionLevels.edit and protectionLevels.edit[1] | local editProt = protectionLevels.edit and protectionLevels.edit[1] | ||
local moveProt = protectionLevels.move and protectionLevels.move[1] | local moveProt = protectionLevels.move and protectionLevels.move[1] | ||
-- 日本語版独自仕様: 編集保護と移動保護で保護レベルが異なる場合に、両方のアイコンを表示する | |||
local ret = '' | |||
if editProt then | if editProt then | ||
-- The page is edit-protected. | -- The page is edit-protected. | ||
ret = ret .. require('Module:Protection banner')._main{ | |||
message('protection-reason-edit'), small = true | message('protection-reason-edit'), small = true | ||
} | } | ||
end | |||
-- The page is move | if moveProt and moveProt ~= editProt and moveProt ~= 'autoconfirmed' then | ||
-- The page is move-protected. | |||
ret = ret .. require('Module:Protection banner')._main{ | |||
action = 'move', small = true | action = 'move', small = true | ||
} | } | ||
end | end | ||
return ret | |||
end | end | ||
| 509行目: | 511行目: | ||
return nil | return nil | ||
end | end | ||
if docTitle.isRedirect then | if docTitle.isRedirect then | ||
docTitle = docTitle.redirectTarget | docTitle = docTitle.redirectTarget | ||
end | end | ||
| 748行目: | 750行目: | ||
local box = mw.html.create('div') | local box = mw.html.create('div') | ||
-- 'documentation-metadata' | box:attr('role', 'note') | ||
-- 'documentation-metadata' | |||
:addClass(message('end-box-class')) | |||
-- 'plainlinks' | -- 'plainlinks' | ||
:addClass(message('end-box-plainlinks')) | :addClass(message('end-box-plainlinks')) | ||
| 884行目: | 887行目: | ||
local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) | local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) | ||
-- for Modules, add testcases run link if exists | -- for Modules, add testcases run link if exists | ||
if testcasesTitle.contentModel == "Scribunto" | if testcasesTitle.contentModel == "Scribunto" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then | ||
local testcasesRunLinkDisplay = message('testcases-run-link-display') | local testcasesRunLinkDisplay = message('testcases-run-link-display') | ||
local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) | local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) | ||