Modul:Protection banner: Unterschied zwischen den Versionen
make makeFullUrl a local helper function
(specify Template:Pp as a wrapper for the module, and make args a local variable as otherwise it's a bit of a bracket overload) |
(make makeFullUrl a local helper function) |
||
| Zeile 43: | Zeile 43: | ||
tostring(dateString) | tostring(dateString) | ||
)) | )) | ||
end | |||
local function makeFullUrl(page, query, display) | |||
return string.format( | |||
'[%s %s]', | |||
tostring(mw.uri.fullUrl(page, query)), | |||
display | |||
) | |||
end | end | ||
| Zeile 319: | Zeile 327: | ||
-- Static methods -- | -- Static methods -- | ||
function Blurb.formatDate(num) | function Blurb.formatDate(num) | ||
| Zeile 396: | Zeile 396: | ||
if self._protectionObj.action == 'move' then | if self._protectionObj.action == 'move' then | ||
-- We need the move log link. | -- We need the move log link. | ||
return | return makeFullUrl( | ||
'Special:Log', | 'Special:Log', | ||
{type = 'move', page = pagename}, | {type = 'move', page = pagename}, | ||
| Zeile 403: | Zeile 403: | ||
else | else | ||
-- We need the history link. | -- We need the history link. | ||
return | return makeFullUrl( | ||
pagename, | pagename, | ||
{action = 'history'}, | {action = 'history'}, | ||
| Zeile 598: | Zeile 598: | ||
if self._protectionObj.action == 'autoreview' then | if self._protectionObj.action == 'autoreview' then | ||
-- We need the pending changes log. | -- We need the pending changes log. | ||
return | return makeFullUrl( | ||
'Special:Log', | 'Special:Log', | ||
{type = 'stable', page = pagename}, | {type = 'stable', page = pagename}, | ||
| Zeile 605: | Zeile 605: | ||
else | else | ||
-- We need the protection log. | -- We need the protection log. | ||
return | return makeFullUrl( | ||
'Special:Log', | 'Special:Log', | ||
{type = 'protect', page = pagename}, | {type = 'protect', page = pagename}, | ||