יחידה:ParamValidator: הבדלים בין גרסאות בדף

formatting
מ שחזור עקב בעית lua
שורה 102: שורה 102:
function calculateViolations( frame, subpages )
function calculateViolations( frame, subpages )


-- used for parameter type validy test. add "isDate", "isWikicode" etc.
-- this can be made more sophisticated later, e.g. for "wiki page" and such
function isNumber( s ) mw.language.getCurrentLanguage():parseNumber( s ) end
function compatible( val, typ )
function compatible( val, typ )
if not typ or empty( val ) then return true
if typ == 'number' and not mw.language.getCurrentLanguage():parseNumber( val ) then return false end
elseif typ == 'number' then return isNumber( val )  
-- elseif typ == 'date'  then return isDate( val ) etc. etc. etc.
end
return true
return true
end
end