Module:Episode list: Difference between revisions

Content deleted Content added
sync with sandbox - added EpisodeNumber3 arg
Use templatestyles to replace some inline CSS and reduce WP:PEIS, as some articles otherwise won't render citations.
Tag: Reverted
Line 255:
row:tag('td')
:attr('id', 'pc' .. idTrim(idTrim(args.ProdCode, ' ----'), '<'))
:css('text-align', 'center')
:wikitext(args.ProdCode)
elseif (args.ProdCode == '' or string.find(args.ProdCode or '', 'TBA') ~= nil) then
createEmptyCell(args, v, false)
createTableData(args.ProdCode, 1, "center"nil)
else
-- ProductionCode parameter not used; Do nothing.
Line 325 ⟶ 324:
 
-- If serial titles need to be centered and not left, then this should be removed.
local textAlign = "nil -- default from stylesheet is center"
if (v == 'Aux1' and isSerial) then
textAlign = "left"
Line 521 ⟶ 520:
return nil
end
 
local textAlign = "left"
 
-- If Title is blank, then set Raw Title to TBA
if (hasValue(titleText) == false) then
titleText = tableEmptyCellModule._main({})
textAlign = "left"
end
 
Line 537 ⟶ 533:
:attr('scope', 'row')
:attr('rowspan', numberOfParameterGroups)
:css('text-align', textAlign)
:wikitext(titleText)
else
Line 543 ⟶ 538:
:addClass('summary')
:attr('scope', 'row')
:css('text-align', textAlign)
:wikitext(titleText)
end
Line 551 ⟶ 545:
:addClass('summary')
:attr('rowspan', numberOfParameterGroups)
:css('text-align', textAlign)
:wikitext(titleText)
else
row:tag('td')
:addClass('summary')
:css('text-align', textAlign)
:wikitext(titleText)
end
Line 572 ⟶ 564:
:attr('rowspan', numberOfParameterGroups)
:attr('id', epID and 'ep' .. epID or '')
:css('text-align', 'center')
:wikitext(episodeText)
end
Line 636 ⟶ 627:
createTableRowEpisodeNumberHeader(episodeValue, numberOfParameterGroups, episodeText)
else
createTableData(episodeText, numberOfParameterGroups, "center"nil)
end
 
Line 798 ⟶ 789:
row = root:tag('tr') -- Create the table row and store it globally
:addClass('vevent')
:css('text-align', 'center')
:css('background', topColor)
 
Line 831 ⟶ 821:
-- Local function which handles both module entry points.
local function main(frame, sublist)
local getArgs = require('Module:Arguments').getArgs
local args
 
-- Most parameters should still display when blank, so don't remove blanks
local getArgsargs = require('Module:Arguments').getArgs(frame, {
if (sublist) then
args = getArgs(frame, {removeBlanks = false, wrappers = 'Template:Episode list/sublist'})
wrappers = sublist and 'Template:Episode list/sublist' or 'Template:Episode list'})
else
args = getArgs(frame, {removeBlanks = false, wrappers = 'Template:Episode list'})
end
 
-- args['1'] = mw.getCurrentFrame():getParent():getTitle()
return frame:preprocess('<templatestyles src="Module:Episode list/styles.css"/>') .. _main(args, sublist, frame)
end