Modul:Protection banner: Unterschied zwischen den Versionen
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
K (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) |
||
Zeile 10: | Zeile 10: | ||
-- Lazily initialise modules and objects we don't always need. | -- Lazily initialise modules and objects we don't always need. | ||
local getArgs, makeMessageBox, lang | local getArgs, makeMessageBox, lang | ||
-- Set constants. | |||
local CONFIG_MODULE = 'Module:Protection banner/config' | |||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
Zeile 421: | Zeile 424: | ||
parameterFuncs.TALKPAGE = self._makeTalkPageParameter | parameterFuncs.TALKPAGE = self._makeTalkPageParameter | ||
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter | parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter | ||
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter | |||
parameterFuncs.VANDAL = self._makeVandalTemplateParameter | parameterFuncs.VANDAL = self._makeVandalTemplateParameter | ||
Zeile 642: | Zeile 646: | ||
else | else | ||
return self:_getExpandedMessage('tooltip-blurb-noexpiry') | 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 | ||
end | end | ||
Zeile 881: | Zeile 893: | ||
function p.main(frame, cfg) | function p.main(frame, cfg) | ||
getArgs = getArgs or require('Module:Arguments').getArgs | getArgs = getArgs or require('Module:Arguments').getArgs | ||
cfg = cfg or require( | cfg = cfg or require(CONFIG_MODULE) | ||
local parentTitle = frame:getParent():getTitle() | local parentTitle = frame:getParent():getTitle() | ||
parentTitle = parentTitle:gsub('/sandbox$', '') | parentTitle = parentTitle:gsub('/sandbox$', '') |