Module:Infobox: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
m 1 revision imported from wikipedia:Module:Infobox
ocd triggered
Line 18: Line 18:
slast = s
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(<templatestyles[^<>]*>%s*</templatestyles>)', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
end
-- end moving templatestyles and categories inside of table rows
-- end moving templatestyles and categories inside of table rows
Line 394: Line 394:
Loads the templatestyles for the infobox.
Loads the templatestyles for the infobox.


TODO: load base templatestyles here rather than in MediaWiki:Common.css
TODO: FINISH loading base templatestyles here rather than in
We aren't doing it here yet because there are 4-5000 pages with 'raw' infobox
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
tables. See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
Will have to do some bizarre conversion category like with sidebar.

]=]
]=]
local function loadTemplateStyles()
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
-- See function description
-- See function description
-- local base_templatestyles = frame:extensionTag{
local base_templatestyles = frame:extensionTag{
-- name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
-- }
}

local templatestyles = ''
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
if args['templatestyles'] then templatestyles = frame:extensionTag{
Line 428: Line 428:


return table.concat({
return table.concat({
-- base_templatestyles, -- see function description
base_templatestyles, -- see function description
templatestyles,
templatestyles,
child_templatestyles,
child_templatestyles,
grandchild_templatestyles
grandchild_templatestyles
})
})
end
end