Modul:TemplateData: Unterschied zwischen den Versionen
2017-05-27
wp>PerfektesChaos (2017-05-25) |
wp>PerfektesChaos (2017-05-27) |
||
Zeile 1: | Zeile 1: | ||
local TemplateData = { serial = "2017-05- | local TemplateData = { serial = "2017-05-27", | ||
suite = "TemplateData" } | suite = "TemplateData" } | ||
--[=[ | --[=[ | ||
Zeile 571: | Zeile 571: | ||
local details = { "default", "example", "autovalue" } | local details = { "default", "example", "autovalue" } | ||
local dl = mw.html.create( "dl" ) | local dl = mw.html.create( "dl" ) | ||
local section, show | local dd, section, show | ||
for i = 1, #details do | for i = 1, #details do | ||
s = details[ i ] | s = details[ i ] | ||
show = param[ s ] | show = param[ s ] | ||
if show then | if show then | ||
dd = mw.html.create( "dd" ) | |||
:wikitext( show ) | |||
section = factory( "doc-param-" .. s ) | section = factory( "doc-param-" .. s ) | ||
if param.type == "boolean" and | |||
( show == "0" or show == "1" ) then | |||
local ticbox = mw.html.create( "span" ) | |||
:css( "font-size", "125%" ) | |||
:css( "margin-left", "3em" ) | |||
-- LTR | |||
if show == "0" then | |||
ticbox:wikitext( "☐" ) | |||
else | |||
ticbox:wikitext( "☑" ) | |||
end | |||
dd:node( ticbox ) | |||
end | |||
dl:node( mw.html.create( "dt" ) | dl:node( mw.html.create( "dt" ) | ||
:wikitext( section ) ) | :wikitext( section ) ) | ||
:node( | :node( dd ) | ||
end | end | ||
end -- i = 1, #details | end -- i = 1, #details |