Module:AVDevice: Difference between revisions
Connectivity: keep Inputs/Outputs as main rows, add location stripe groups inside each value cell (via update-page on MediaWiki MCP Server) |
Fix I/O location group spacing: top-align labels, remove value padding, wrap content in padding div (via update-page on MediaWiki MCP Server) |
||
| Line 166: | Line 166: | ||
local function buildLocationGroupedIO(frame, fullPageName, ioType, locations, locationLabels) | local function buildLocationGroupedIO(frame, fullPageName, ioType, locations, locationLabels) | ||
local html = '' | local html = '' | ||
for _, loc in ipairs(locations) do | for _, loc in ipairs(locations) do | ||
| Line 173: | Line 172: | ||
local locContent = queryIOByLocation(frame, fullPageName, ioType, loc) | local locContent = queryIOByLocation(frame, fullPageName, ioType, loc) | ||
if locContent and locContent ~= '' then | if locContent and locContent ~= '' then | ||
html = html .. | html = html .. | ||
'<div class="infobox-io-location-group">' .. | '<div class="infobox-io-location-group">' .. | ||
'<div class="infobox-io-location-header">' .. locationLabels[loc] .. '</div>' .. | '<div class="infobox-io-location-header">' .. locationLabels[loc] .. '</div>' .. | ||
locContent .. | '<div class="infobox-io-location-content">' .. locContent .. '</div>' .. | ||
'</div>' | '</div>' | ||
end | end | ||
| Line 331: | Line 329: | ||
addSectionRow(container, 'Connectivity') | addSectionRow(container, 'Connectivity') | ||
-- Custom rows for Inputs/Outputs: label top-aligned, value has no padding | |||
-- so the first location group header aligns flush with the label | |||
if inputsHtml then | if inputsHtml then | ||
local labelDiv = container:tag('div') | |||
labelDiv:addClass('infobox-label') | |||
css(labelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left; align-self:start;') | |||
labelDiv:wikitext('Inputs') | |||
local valueDiv = container:tag('div') | |||
valueDiv:addClass('infobox-value') | |||
css(valueDiv, 'padding:0;') | |||
valueDiv:node(mw.html.create('span'):wikitext(inputsHtml)) | |||
end | end | ||
if outputsHtml then | if outputsHtml then | ||
local labelDiv = container:tag('div') | |||
labelDiv:addClass('infobox-label') | |||
css(labelDiv, 'padding:0.2em 0.4em; font-weight:bold; text-align:left; align-self:start;') | |||
labelDiv:wikitext('Outputs') | |||
local valueDiv = container:tag('div') | |||
valueDiv:addClass('infobox-value') | |||
css(valueDiv, 'padding:0;') | |||
valueDiv:node(mw.html.create('span'):wikitext(outputsHtml)) | |||
end | end | ||
end | end | ||