Module:Infobox MOS: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
Undo. The debug mode is used in several places on the wiki where categories should be disabled
Tag: Undo
Line 22: Line 22:
-- Helper function
-- Helper function
-- Create a keyboard visualization, based on the Halberstadt keyboard layout
-- Create a keyboard visualization, based on the Halberstadt keyboard layout
function p.kb_vis(input_mos, debug_mode)
function p.kb_vis(input_mos)
local input_mos = input_mos or mos.new(5, 2)
local input_mos = input_mos or mos.new(5, 2)
Line 29: Line 29:
local vis = ""
local vis = ""
if input_mos.nL + input_mos.ns < 40 then
if input_mos.nL + input_mos.ns < 40 then
vis = kbvis.vis_small(brightest_mode, debug_mode)
vis = kbvis.vis_small(brightest_mode)
end
end
Line 389: Line 389:


-- New "main" function
-- New "main" function
function p._infobox_mos(tuning, other_names_unparsed, debug_mode)
function p._infobox_mos(tuning, other_names_unparsed)
local tuning = tuning or "5L 2s"
local tuning = tuning or "5L 2s"
local other_names_unparsed = other_names_unparsed or ""
local other_names_unparsed = other_names_unparsed or ""
debug_mode = (debug_mode == nil and false or debug_mode)
local tuning_parsed = mos.parse(tuning)
local tuning_parsed = mos.parse(tuning)
Line 400: Line 399:
-- Keyboard visualization
-- Keyboard visualization
local kb_vis = p.kb_vis(tuning_parsed, debug_mode)
local kb_vis = p.kb_vis(tuning_parsed)
p.concatenate_tables(sections, kb_vis)
p.concatenate_tables(sections, kb_vis)
Line 455: Line 454:
local tuning = args["Tuning"] or args["Scale Signature"]
local tuning = args["Tuning"] or args["Scale Signature"]
local other_names = args["othernames"] or nil
local other_names = args["othernames"] or nil
local debug_mode = yesno(args["debug"])
local debug_mode = yesno(tonumber(args["nocat"]), false)
local result = p._infobox_mos(tuning, other_names, debug_mode) .. p.categorize(tuning)
local result = p._infobox_mos(tuning, other_names)
return frame:preprocess(debug_mode == true and "<pre>" .. result .. "</pre>" or result)
if not debug_mode then
result = result .. p.categorize(tuning)
end
return frame:preprocess(result)
end
end


return p
return p