Module:Keyboard vis: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 13: | Line 13: | ||
-- Produces a small keyboard visualization | -- Produces a small keyboard visualization | ||
-- Likely to display correctly on most devices | -- Likely to display correctly on most devices | ||
function p.vis_small(step_pattern) | function p.vis_small(step_pattern, debug_mode) | ||
local step_pattern = step_pattern or "LLLsLLs" | local step_pattern = step_pattern or "LLLsLLs" | ||
| Line 40: | Line 40: | ||
line_4 = line_4 .. CORNER_BR | line_4 = line_4 .. CORNER_BR | ||
local out_str = '<pre style="background-color: white; ' | local out_str = (debug_mode == true and '<pre' or '<pre') | ||
.. 'style="background-color: white; ' | |||
.. 'line-height: 1; ' | .. 'line-height: 1; ' | ||
.. 'font-family: Courier New, monospace; ' | .. 'font-family: Courier New, monospace; ' | ||
.. 'font-size: 1em; ' | .. 'font-size: 1em; ' | ||
.. 'padding: 0.1em; ' | .. 'padding: 0.1em; ' | ||
.. 'margin: 0.1em;">' | .. 'margin: 0.1em;' | ||
.. (debug_mode == true and '">' or '">') | |||
.. string.format('%s\n%s\n%s\n%s', line_1, line_2, line_3, line_4) | .. string.format('%s\n%s\n%s\n%s', line_1, line_2, line_3, line_4) | ||
.. '</pre>' | .. (debug_mode == true and '</pre>' or '</pre>') | ||
return out_str | return out_str | ||
end | end | ||
return p | return p | ||