Module:Progress box: Difference between revisions

no edit summary
(Created page with "local makePurgeLink = require('Module:Purge')._main local lang = mw.language.getContentLanguage() local CONFIG_MODULE = 'Module:Progress box/config' ------------------------------------------------------------------------------- -- Message mixin -- -- This function is mixed into all of the other classes ------------------------------------------------------------------------------- local function message(self, key, ...) local msg = self._cfg[key] if not msg then e...")
 
No edit summary
Line 49: Line 49:
display = display or cat
display = display or cat
return string.format('[[:Category:%s|%s]]', cat, display)
return string.format('[[:Category:%s|%s]]', cat, display)
end
function Category:getCount()
if not self._count then
local counts = mw.site.stats.pagesInCategory(self:getCategory(), '*')
self._count = counts[self._whatToCount or 'pages']
if not self._count then
error("the count type must be one of 'pages', 'subcats', 'files' or 'all'")
end
end
return self._count
end
end


Line 169: Line 158:
dateFormat = dateFormat,
dateFormat = dateFormat,
}
}
if datedCategoryObj:getCount() > 0 then
table.insert(self._datedCategories, datedCategoryObj)
end
date = ProgressBox.incrementDate(date)
date = ProgressBox.incrementDate(date)
end
end
Line 324: Line 310:
ProgressBox = ProgressBox,
ProgressBox = ProgressBox,
}
}
end
function p._main(args, cfg, title)
return tostring(ProgressBox.new(args, cfg, title))
end
end