Jump to content

Module:Category handler/shared

Permanently protected module
From Wikipedia, the free encyclopedia

-- This module contains shared functions used by [[Module:Category handler]]-- and its submodules.localp={}functionp.matchesBlacklist(page,blacklist)fori,patterninipairs(blacklist)dolocalmatch=mw.ustring.match(page,pattern)ifmatchthenreturntrueendendreturnfalseendfunctionp.getParamMappings(useLoadData)localdataPage='Module:Namespace detect/data'ifuseLoadDatathenreturnmw.loadData(dataPage).mappingselsereturnrequire(dataPage).mappingsendendfunctionp.getNamespaceParameters(titleObj,mappings)-- We don't use title.nsText for the namespace name because it adds-- underscores.localmappingsKeyiftitleObj.isTalkPagethenmappingsKey='talk'elsemappingsKey=mw.site.namespaces[titleObj.namespace].nameendmappingsKey=mw.ustring.lower(mappingsKey)returnmappings[mappingsKey]or{}endreturnp
close