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

独自の機能を追加
(1版 をインポートしました)
template>本日晴天
(独自の機能を追加)
13行目: 13行目:


-- Set constants.
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
local CONFIG_MODULE = 'モジュール:Protection banner/config'


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
311行目: 311行目:
return not self:isProtected()
return not self:isProtected()
or type(expiry) == 'number' and expiry < os.time()
or type(expiry) == 'number' and expiry < os.time()
end
-- 日本語版独自
function Protection:isMismatched()
return self.reason == 'dispute' and self.level ~= 'sysop'
end
end


328行目: 333行目:
ret[#ret + 1] = makeCategoryLink(
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isMismatched() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-mismatch'],
self.title.text
self.title.text
)
)
685行目: 696行目:
local imageFilename = protectionObj.bannerConfig.image
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
if imageFilename then
obj._imageFilename = imageFilename
-- 日本語版独自の条件分岐
if type(imageFilename) == 'string' then
obj._imageFilename = imageFilename
elseif type(imageFilename) == 'function' then
obj._imageFilename = imageFilename(protectionObj)
end
else
else
-- If an image filename isn't specified explicitly in the banner config,
-- If an image filename isn't specified explicitly in the banner config,
匿名利用者