"మాడ్యూల్:Protection banner" కూర్పుల మధ్య తేడాలు

don't add protection categories or show padlock icons for user js/css pages; based on code contributed by User:ProcrastinatingReader
చి (en:Module:Protection_banner నుండి కూర్పులను దిగుమతి చేసాం)
(don't add protection categories or show padlock icons for user js/css pages; based on code contributed by User:ProcrastinatingReader)
end
return setmetatable(obj, Protection)
end
 
function Protection:isUserScript()
-- Whether the page is a user JavaScript or CSS page.
local title = self.title
return title.namespace == 2 and (
title.contentModel == 'javascript' or title.contentModel == 'css'
)
end
 
return self.level ~= '*'
end
 
function Protection:shouldShowLock()
-- Whether we should output a banner/padlock
return self:isProtected() and not self:isUserScript()
end
 
-- Whether this page needs a protection category.
Protection.shouldHaveProtectionCategory = Protection.shouldShowLock
 
function Protection:isTemporary()
 
function Protection:makeProtectionCategory()
if not self:isProtectedshouldHaveProtectionCategory() then
return ''
end
 
local cfg = self._cfg
local title = self.title
-- Exit if the page is not protected.
if not self:isProtected() then
return ''
end
-- Get the expiry key fragment.
namespaceFragment = 'talk'
end
 
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
function Protection:isIncorrect()
local expiry = self.expiry
return not self:isProtectedshouldHaveProtectionCategory()
or type(expiry) == 'number' and expiry < os.time()
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = { self:makeProtectionCategory() }
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
-- Render the banner
if protectionObj:isProtectedshouldShowLock() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
"https://te.wikipedia.org/wiki/ప్రత్యేక:MobileDiff/3039826" నుండి వెలికితీశారు