Module:Infobox: Difference between revisions
Undid revision 782833995 by Jc86035 (talk) looks like this caused some serious problems, will require more testing (see, e.g, my talk page)
m>Jc86035 m (fixes for child infoboxes so HTML Tidy is not required) |
m>Frietjes |
||
Line 10: | Line 10: | ||
local origArgs | local origArgs | ||
local root | local root | ||
local function union(t1, t2) | local function union(t1, t2) | ||
Line 47: | Line 43: | ||
-- Adds a row to the infobox, with either a header cell | -- Adds a row to the infobox, with either a header cell | ||
-- or a label/data cell combination. | -- or a label/data cell combination. | ||
if rowArgs.header then | if rowArgs.header then | ||
root | |||
:tag('tr') | :tag('tr') | ||
:addClass(rowArgs.rowclass) | :addClass(rowArgs.rowclass) | ||
Line 98: | Line 73: | ||
:done() | :done() | ||
end | end | ||
local dataCell = row:tag('td') | local dataCell = row:tag('td') | ||
if not rowArgs.label then | if not rowArgs.label then | ||
Line 114: | Line 88: | ||
:wikitext(rowArgs.data) | :wikitext(rowArgs.data) | ||
end | end | ||
end | end | ||
Line 142: | Line 102: | ||
local function renderAboveRow() | local function renderAboveRow() | ||
if not args.above then return end | if not args.above then return end | ||
root | root | ||
:tag('tr') | :tag('tr') | ||
Line 270: | Line 231: | ||
-- Specify the overall layout of the infobox, with special settings | -- Specify the overall layout of the infobox, with special settings | ||
-- if the infobox is used as a 'child' inside another infobox. | -- if the infobox is used as a 'child' inside another infobox. | ||
if args.child ~= 'yes' then | if args.child ~= 'yes' then | ||
root = mw.html.create('table') | root = mw.html.create('table') | ||
Line 300: | Line 260: | ||
else | else | ||
root = mw.html.create() | root = mw.html.create() | ||
root | root | ||
:wikitext(args.title) | :wikitext(args.title) | ||
Line 313: | Line 273: | ||
renderTrackingCategories() | renderTrackingCategories() | ||
return | return tostring(root) | ||
end | end | ||