Module:Shortcut: Difference between revisions
From Test Wiki
Content deleted Content added
redo templatestyles |
Implement merger code by Pppery |
||
| Line 37: | Line 37: | ||
local listItems = {} |
local listItems = {} |
||
for i, shortcut in ipairs(shortcuts) do |
for i, shortcut in ipairs(shortcuts) do |
||
if yesno(options['target']) then |
|||
| ⚫ | |||
listItems[i] = string.format("[[%s]]",shortcut) |
|||
| ⚫ | |||
else |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
end |
|||
end |
end |
||
table.insert(listItems, options.msg) |
table.insert(listItems, options.msg) |
||
| Line 70: | Line 74: | ||
local nShortcuts = #shortcuts |
local nShortcuts = #shortcuts |
||
if nShortcuts > 0 then |
if nShortcuts > 0 then |
||
local headingMsg = options['shortcut-heading'] or cfg['shortcut-heading'] |
|||
shortcutHeading = message(headingMsg, nShortcuts) |
|||
shortcutHeading = frame:preprocess(shortcutHeading) |
shortcutHeading = frame:preprocess(shortcutHeading) |
||
end |
end |
||
| Line 94: | Line 99: | ||
function p.main(frame) |
function p.main(frame) |
||
local args = require('Module:Arguments').getArgs(frame |
local args = require('Module:Arguments').getArgs(frame) |
||
wrappers = 'Template:Shortcut' |
|||
}) |
|||
-- Separate shortcuts from options |
-- Separate shortcuts from options |
||