「モジュール:Documentation」の版間の差分

コメントを修正
(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('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
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('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
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.
return require('Module:Protection banner')._main{
ret = ret .. require('Module:Protection banner')._main{
message('protection-reason-edit'), small = true
message('protection-reason-edit'), small = true
}
}
elseif moveProt and moveProt ~= 'autoconfirmed' then
end
-- The page is move-protected but not edit-protected. Exclude move
if moveProt and moveProt ~= editProt and moveProt ~= 'autoconfirmed' then
-- protection with the level "autoconfirmed", as this is equivalent to
-- The page is move-protected.
-- no move protection at all.
ret = ret .. require('Module:Protection banner')._main{
return require('Module:Protection banner')._main{
action = 'move', small = true
action = 'move', small = true
}
}
else
return nil
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')
box:addClass(message('end-box-class'))
-- '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" and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
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)
匿名利用者