Module:Article history/config: Difference between revisions

Content deleted Content added
add result text and aliases
rework the functions so that they take an action object as input
Line 309:
},
WPR = {
name = function (dataactionObj)
local resultnames = data.result{
if result approved == 'approved'WikiProject or result == 'approved versionrevision' then,
returncopyedited = 'Guild of Copy Editors',
return 'WikiProject approved revision'
returncollaboration = 'WikiProject collaboration',
elseif result == 'copyedit' or result == 'copyedited' or result == 'proofread' then
returnmaindate = "Today's featured article"
return 'Guild of Copy Editors'
end}
elseif result == 'cotw' or result == 'collaborated' or result == 'collaboration' then
local result = actionObj:getNormalizedResult()
return 'WikiProject collaboration'
elseifreturn result ==and names[result] or 'maindate'WikiProject thenpeer review'
return "Today's featured article"
else
return 'WikiProject peer review'
end
end,
results = {
approved = {
text = function(dataactionObj)
if dataactionObj.oldid then
local url = mw.uri.fullUrl(
mwactionObj.title.getCurrentTitle().prefixedText,
{diff = 'cur', oldid = dataactionObj.oldid}
)
return string.format(
Line 340 ⟶ 336:
"No oldid detected for the approved version; " ..
"please set the 'action%doldid' parameter " ..
"or setgive the 'action%dresult' parameter to a " ..
"different value.",
dataactionObj.numparamNum,
dataactionObj.numparamNum
))
end