Module:CRTModel: Difference between revisions

Use frame:extensionTag for style output to avoid HTML escaping (via update-page on MediaWiki MCP Server)
Fix typo: docTitle -> docType in document display text fallback (via update-page on MediaWiki MCP Server)
Line 18: Line 18:
end
end
return node
return node
end
-- Generate the CSS for night mode support
local function getStylesContent()
return [[
/* CRT Model Infobox - Base Styles (Light Mode) */
.infobox-crt-model {
border: 1px solid #a2a9b1;
background: #f8f9fa;
}
.infobox-crt-model .infobox-section-header {
background: #e0e0e0;
color: #202122;
}
.infobox-crt-model .infobox-label {
color: #202122;
}
.infobox-crt-model .infobox-value {
color: #202122;
}
.infobox-crt-model .infobox-title {
color: #202122;
}
.infobox-crt-model .mod-not-feasible {
color: #dc2626;
}
.infobox-button {
display: inline-block;
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-size: 0.875rem;
font-weight: 500;
text-decoration: none;
cursor: pointer;
}
.infobox-button-primary {
background-color: #2563eb;
color: #ffffff;
border: 1px solid #2563eb;
}
.infobox-button-secondary {
background-color: #eff6ff;
color: #1d4ed8;
border: 1px solid #bfdbfe;
}
/* Night Mode - Explicit preference (Minerva: ?minervanightmode=1 or user setting) */
html.skin-theme-clientpref-night .infobox-crt-model {
border-color: #72777d;
background: #27292d;
}
html.skin-theme-clientpref-night .infobox-crt-model .infobox-section-header {
background: #3c3f44;
color: #f8f9fa;
}
html.skin-theme-clientpref-night .infobox-crt-model .infobox-label {
color: #f8f9fa;
}
html.skin-theme-clientpref-night .infobox-crt-model .infobox-value {
color: #eaecf0;
}
html.skin-theme-clientpref-night .infobox-crt-model .infobox-title {
color: #f8f9fa;
}
html.skin-theme-clientpref-night .infobox-crt-model .mod-not-feasible {
color: #f87171;
}
html.skin-theme-clientpref-night .infobox-button-primary {
background-color: #3b82f6;
color: #ffffff;
border-color: #3b82f6;
}
html.skin-theme-clientpref-night .infobox-button-secondary {
background-color: #1e3a5f;
color: #93c5fd;
border-color: #1e40af;
}
/* Night Mode - System preference (prefers-color-scheme: dark) */
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os .infobox-crt-model {
border-color: #72777d;
background: #27292d;
}
html.skin-theme-clientpref-os .infobox-crt-model .infobox-section-header {
background: #3c3f44;
color: #f8f9fa;
}
html.skin-theme-clientpref-os .infobox-crt-model .infobox-label {
color: #f8f9fa;
}
html.skin-theme-clientpref-os .infobox-crt-model .infobox-value {
color: #eaecf0;
}
html.skin-theme-clientpref-os .infobox-crt-model .infobox-title {
color: #f8f9fa;
}
html.skin-theme-clientpref-os .infobox-crt-model .mod-not-feasible {
color: #f87171;
}
html.skin-theme-clientpref-os .infobox-button-primary {
background-color: #3b82f6;
color: #ffffff;
border-color: #3b82f6;
}
html.skin-theme-clientpref-os .infobox-button-secondary {
background-color: #1e3a5f;
color: #93c5fd;
border-color: #1e40af;
}
}
/* Mobile Responsiveness */
@media (max-width: 600px) {
.infobox-crt-model {
float: none !important;
width: 100% !important;
margin: 0 0 1em 0 !important;
max-width: 100% !important;
}
}
]]
end
end


Line 511: Line 389:
end
end


                    -- Always link to the wiki page
-- Always link to the wiki page
local docPageName = trim(cells[1])
local docPageName = trim(cells[1])
if docPageName then
if docPageName then
-- Determine display text priority: custom title > type
-- Determine display text priority: custom title > type > default
local displayText = 'Document'
local displayText = 'Document'
if docTitle then
if docTitle then
displayText = docTitle
displayText = docTitle
elseif docType then
elseif docType then
displayText = docTitle
displayText = docType
end
end
MediaWiki Appliance - Powered by TurnKey Linux