Module:Infobox MOS: Difference between revisions
Split "main" function into a wrapper function (called by template) and "main function" (called by wrapper) |
Fixed wrong args being passed |
||
| Line 47: | Line 47: | ||
-- Main function | -- Main function | ||
-- To be called by wrapper | -- To be called by wrapper | ||
function p._infobox_MOS( | function p._infobox_MOS(tuning, debug_mode, other_names) | ||
local | local tuning = tuning or "5L 2s" | ||
local debug_mode = debug_mode == true | local debug_mode = debug_mode == true | ||
local other_names = other_names or nil | local other_names = other_names or nil | ||
local mos = MOS.parse(tuning) | |||
local | |||
-- category of the main article | -- category of the main article | ||
| Line 276: | Line 275: | ||
function p.infobox_MOS(frame) | function p.infobox_MOS(frame) | ||
local | local tuning = frame.args['Tuning'] | ||
local other_names = frame.args['Other names'] or nil | local other_names = frame.args['Other names'] or nil | ||
local debug_mode = frame.args['debug'] ~= nil | local debug_mode = frame.args['debug'] ~= nil | ||
return p._infobox_MOS( | return p._infobox_MOS(tuning, debug_mode, other_names) | ||
end | end | ||