Module:Infobox: Difference between revisions
c |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
-- Taken from Wikipedia, June | -- Taken from Wikipedia, 25 June 2020 edit | ||
-- | -- | ||
Line 120: | Line 120: | ||
local row = root:tag('tr') | local row = root:tag('tr') | ||
row:addClass(rowArgs.rowclass) | row:addClass(rowArgs.rowclass) | ||
row:addClass((args.collapsible == 'yes' or args.collapsible == 'collapsed') and "customcollapse-content" or nil) | |||
row:cssText(rowArgs.rowstyle) | row:cssText(rowArgs.rowstyle) | ||
row:attr('id', rowArgs.rowid) | row:attr('id', rowArgs.rowid) | ||
Line 302: | Line 303: | ||
if args.decat ~= 'yes' then | if args.decat ~= 'yes' then | ||
if args.child == 'yes' then | if args.child == 'yes' then | ||
if args.title then | -- if args.title then | ||
root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]') | -- root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]') | ||
end | -- end | ||
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then | elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then | ||
root:wikitext('[[Category:Articles which use infobox templates with no data rows]]') | root:wikitext('[[Category:Articles which use infobox templates with no data rows]]') | ||
Line 335: | Line 336: | ||
root | root | ||
:css('width', '22em') | :css('width', '22em') | ||
end | |||
if args.collapsible == 'yes' then | |||
root | |||
:addClass('customcollapse') | |||
elseif args.collapsible == 'collapsed' then | |||
root | |||
:addClass('customcollapse') | |||
:addClass('collapsed') | |||
end | end | ||
root | root | ||
Line 341: | Line 351: | ||
renderTitle() | renderTitle() | ||
renderAboveRow() | renderAboveRow() | ||
elseif args.collapsible == 'yes' or args.collapsible == 'collapsed' then | |||
root = mw.html.create('div') | |||
root | |||
:addClass('customcollapse') | |||
:addClass((args.collapsible == 'collapsed') and 'collapsed' or nil) | |||
:wikitext(args.title) | |||
else | else | ||
root = mw.html.create() | root = mw.html.create() | ||
Line 435: | Line 452: | ||
preprocessSingleArg('autoheaders') | preprocessSingleArg('autoheaders') | ||
preprocessSingleArg('child') | preprocessSingleArg('child') | ||
preprocessSingleArg('collapsible') | |||
preprocessSingleArg('bodyclass') | preprocessSingleArg('bodyclass') | ||
preprocessSingleArg('subbox') | preprocessSingleArg('subbox') |