Modul:TemplateData: Unterschied zwischen den Versionen
2017-05-22
wp>PerfektesChaos (Test) |
wp>PerfektesChaos (2017-05-22) |
||
Zeile 1: | Zeile 1: | ||
local TemplateData = { serial = "2017-05- | local TemplateData = { serial = "2017-05-22", | ||
suite = "TemplateData" } | suite = "TemplateData" } | ||
--[=[ | --[=[ | ||
Zeile 10: | Zeile 10: | ||
-- multiple #invoke option names mapped into unique internal fields | -- multiple #invoke option names mapped into unique internal fields | ||
cat = "strange", | cat = "strange", | ||
cssParams = "stylesTable", | |||
debug = false, | debug = false, | ||
docpageCreate = "suffix", | docpageCreate = "suffix", | ||
Zeile 17: | Zeile 18: | ||
solo = false, -- complaint on missing description | solo = false, -- complaint on missing description | ||
strange = false, -- title of maintenance category | strange = false, -- title of maintenance category | ||
stylesTable = false, -- styles for params table | |||
subpage = false, -- pattern to identify subpage | subpage = false, -- pattern to identify subpage | ||
suffix = false -- subpage creation scheme | suffix = false -- subpage creation scheme | ||
Zeile 515: | Zeile 517: | ||
-- name and aliases | -- name and aliases | ||
code:wikitext( access ) | code:css( "font-size", "92%" ) | ||
:css( "white-space", "nowrap" ) | |||
:wikitext( access ) | |||
if not fine( access ) then | if not fine( access ) then | ||
code:addClass( "error" ) | code:addClass( "error" ) | ||
Zeile 679: | Zeile 683: | ||
if Data.order and #Data.order > 1 then | if Data.order and #Data.order > 1 then | ||
r:addClass( "sortable" ) | r:addClass( "sortable" ) | ||
end | |||
if Config.stylesTable then | |||
r:cssText( Config.stylesTable ) | |||
end | end | ||
r:newline() | r:newline() | ||
Zeile 1.058: | Zeile 1.065: | ||
end | end | ||
end | end | ||
if source and | |||
( source:find( "|", 1, true ) or source:find( "}}", 1, true ) ) then | |||
-- <ref | |||
spy=string.format( "[[category:%s]]", Config.strange ) | spy=string.format( "[[category:%s]]", Config.strange ) | ||
end | end | ||
end | end | ||
TemplateData.getPlainJSON( source ) | TemplateData.getPlainJSON( source ) | ||
if not Data.lazy and Config.subpage then | |||
if not Data.title then | |||
Data.title = mw.title.getCurrentTitle() | |||
end | |||
Data.lazy = Data.title.text:match( Config.subpage ) | |||
end | |||
return spy .. finalize() | return spy .. finalize() | ||
end -- furnish() | end -- furnish() |