Module:Message box: Difference between revisions
Jump to navigation
Jump to search
Testing |
Testing |
||
Line 7: | Line 7: | ||
local yesno = require('Module:Yesno') | local yesno = require('Module:Yesno') | ||
local templatestyles = 'Module:Message box/styles.css' | local templatestyles = 'Module:Message box/styles.css' | ||
-- Get a language object for formatDate and ucfirst. | -- Get a language object for formatDate and ucfirst. | ||
Line 75: | Line 74: | ||
obj.cfg = cfg[boxType] | obj.cfg = cfg[boxType] | ||
if not obj.cfg then | if not obj.cfg then | ||
styles = 'Module:Message box/styles.css' | |||
local ns = obj.title.namespace | local ns = obj.title.namespace | ||
-- boxType is "mbox" or invalid input | -- boxType is "mbox" or invalid input | ||
Line 92: | Line 92: | ||
elseif ns == 0 then | elseif ns == 0 then | ||
obj.cfg = cfg.ambox -- main namespace | obj.cfg = cfg.ambox -- main namespace | ||
styles = 'Module:Message box/styles.css' | |||
elseif ns == 6 then | elseif ns == 6 then | ||
obj.cfg = cfg.imbox -- file namespace | obj.cfg = cfg.imbox -- file namespace | ||
styles = 'Module:Message box/styles.css' | |||
elseif ns == 14 then | elseif ns == 14 then | ||
obj.cfg = cfg.cmbox -- category namespace | obj.cfg = cfg.cmbox -- category namespace | ||
styles = 'Module:Message box/styles.css' | |||
else | else | ||
local nsTable = mw.site.namespaces[ns] | local nsTable = mw.site.namespaces[ns] | ||
styles = 'Module:Message box/styles.css' | |||
if nsTable and nsTable.isTalk then | if nsTable and nsTable.isTalk then | ||
obj.cfg = cfg.tmbox -- any talk namespace | obj.cfg = cfg.tmbox -- any talk namespace |