Modul:TemplatePar: Unterschied zwischen den Versionen
gem. Spezial:Diff/138700547/138700802 geändert
wp>Hephaion K (per Adminnanfrage) |
wp>Mabschaaf (gem. Spezial:Diff/138700547/138700802 geändert) |
||
Zeile 1: | Zeile 1: | ||
--[=[ TemplatePar 2015- | --[=[ TemplatePar 2015-02-09 | ||
Template parameter utility | Template parameter utility | ||
* assert | * assert | ||
Zeile 310: | Zeile 310: | ||
if type( scan ) == "string" then | if type( scan ) == "string" then | ||
if s == "n" or s == "0,0" or s == "0.0" then | if s == "n" or s == "0,0" or s == "0.0" then | ||
if not analyze:match( "[0-9]" ) then | if not analyze:match( "[0-9]" ) and | ||
not analyze:match( "^%s*$" ) then | |||
scan = false | scan = false | ||
if options.say then | if options.say then | ||
Zeile 827: | Zeile 828: | ||
-- feasible() | -- feasible() | ||
-- failure() | -- failure() | ||
local r | local r = feasible( analyze, options, false ) | ||
local show | local show | ||
if options.min and not r then | if options.min and not r then | ||
Zeile 879: | Zeile 880: | ||
-- false if valid or no answer permitted | -- false if valid or no answer permitted | ||
-- Uses: | -- Uses: | ||
-- mw.text.trim() | |||
-- format() | -- format() | ||
-- failure() | -- failure() | ||
local r = false | local r = false | ||
if type( assignment ) == "table" then | if type( assignment ) == "table" then | ||
local story = assignment.args[ access ] | local story = assignment.args[ access ] or "" | ||
if type( | if type( access ) == "number" then | ||
if type( options ) ~= "table" then | story = mw.text.trim( story ) | ||
end | |||
if type( options ) ~= "table" then | |||
options = { } | |||
end | end | ||
options.say = access | |||
r = format( story, options ) | |||
end | end | ||
return r | return r | ||
Zeile 908: | Zeile 909: | ||
-- Uses: | -- Uses: | ||
-- form() | -- form() | ||
-- failure() | -- failure() | ||
-- finalize() | -- finalize() | ||
Zeile 1.088: | Zeile 1.088: | ||
-- mw.text.trim() | -- mw.text.trim() | ||
-- TemplatePar.downcase() | -- TemplatePar.downcase() | ||
-- frame:getParent() | -- frame:getParent() | ||
-- formatted() | -- formatted() |