Anonymous user
Module:Protection banner: Difference between revisions
get rid of a few more unnecessary local variables
Enwikipedia>Mr. Stradivarius (make the protection object responsible for accessing the title object and the config inside the Blurb class) |
Enwikipedia>Mr. Stradivarius (get rid of a few more unnecessary local variables) |
||
Line 393:
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return self.makeFullUrl(
Line 413 ⟶ 412:
function Blurb:_makeDeletionDiscussionLinkParameter()
local display = self:_getExpandedMessage('deletion-discussion-link-display')
return string.format('[[%s|%s]]',
end
end
function Blurb:_makeDisputeBlurbParameter()
return self:_getExpandedMessage('dispute-blurb-expiry')
else
Line 431 ⟶ 428:
function Blurb:_makeDisputeSectionParameter()
-- "disputes", with or without a section link
local disputes = self:_getExpandedMessage('dispute-section-link-display')
if
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
disputes
)
Line 533 ⟶ 529:
function Blurb:_makeIntroBlurbParameter()
return self:_getExpandedMessage('intro-blurb-expiry')
else
Line 542 ⟶ 537:
function Blurb:_makeOfficeBlurbParameter()
return self:_getExpandedMessage('office-blurb-protectiondate')
else
Line 552 ⟶ 546:
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
or error('no default pagetype defined')
end
Line 600 ⟶ 595:
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return self.makeFullUrl(
Line 620 ⟶ 614:
function Blurb:_makeResetBlurbParameter()
return self:_getExpandedMessage('reset-blurb-protectiondate')
else
Line 629 ⟶ 622:
function Blurb:_makeTalkPageParameter()
local display = self:_getExpandedMessage('talk-page-link-display')▼
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
)
end
function Blurb:_makeTooltipBlurbParameter()
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
Line 650 ⟶ 640:
function Blurb:_makeVandalTemplateParameter()
}
▲ username = username or self._protectionObj.title.baseText
end
|