https://vi.touhouwiki.net/index.php?title=M%C3%B4_%C4%91un:Category_handler/shared&feed=atom&action=historyMô đun:Category handler/shared - Lịch sử thay đổi2024-03-29T13:10:02ZLịch sử thay đổi trang này trên wikiMediaWiki 1.39.3https://vi.touhouwiki.net/index.php?title=M%C3%B4_%C4%91un:Category_handler/shared&diff=13&oldid=prevMami: https://vi.wikipedia.org/wiki/M%C3%B4_%C4%91un:Category_handler/shared2016-07-13T07:24:57Z<p>https://vi.wikipedia.org/wiki/M%C3%B4_%C4%91un:Category_handler/shared</p>
<p><b>Trang mới</b></p><div>-- This module contains shared functions used by [[Mô đun:Category handler]]<br />
-- and its submodules.<br />
<br />
local p = {}<br />
<br />
function p.matchesBlacklist(page, blacklist)<br />
for i, pattern in ipairs(blacklist) do<br />
local match = mw.ustring.match(page, pattern)<br />
if match then<br />
return true<br />
end<br />
end<br />
return false<br />
end<br />
<br />
function p.getParamMappings(useLoadData)<br />
local dataPage = 'Mô đun:Namespace detect/data'<br />
if useLoadData then<br />
return mw.loadData(dataPage).mappings<br />
else<br />
return require(dataPage).mappings<br />
end<br />
end<br />
<br />
function p.getNamespaceParameters(titleObj, mappings)<br />
-- We don't use title.nsText for the namespace name because it adds<br />
-- underscores.<br />
local mappingsKey<br />
if titleObj.isTalkPage then<br />
mappingsKey = 'talk'<br />
else<br />
mappingsKey = mw.site.namespaces[titleObj.namespace].name<br />
end<br />
mappingsKey = mw.ustring.lower(mappingsKey)<br />
return mappings[mappingsKey] or {}<br />
end<br />
<br />
return p</div>Mami