Module:Protection banner: Difference between revisions

add a "TOOLTIPFRAGMENT" parameter, as we were having the same issues with commas in tooltips as we did with INTROBLURB and INTROFRAGMENT; also move the config module name to a global variable so that it's more obvious when updating
m (Protected Module:Protection banner: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
(add a "TOOLTIPFRAGMENT" parameter, as we were having the same issues with commas in tooltips as we did with INTROBLURB and INTROFRAGMENT; also move the config module name to a global variable so that it's more obvious when updating)
Line 10:
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
 
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
 
--------------------------------------------------------------------------------
Line 421 ⟶ 424:
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
Line 642 ⟶ 646:
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
 
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
Line 881 ⟶ 893:
function p.main(frame, cfg)
getArgs = getArgs or require('Module:Arguments').getArgs
cfg = cfg or require('Module:Protection banner/config'CONFIG_MODULE)
local parentTitle = frame:getParent():getTitle()
parentTitle = parentTitle:gsub('/sandbox$', '')