Module:shortcut box: Difference between revisions

Created page with "local export = {} function export.show(frame) local output = {} -- Hacky way to allow function to be called from other modules. local args = (frame.getParent and frame:get..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 14: Line 14:
demo = true
demo = true
end
end
output[#output + 1] = '<div class="noprint plainlinks shortcut-box">'
output[#output + 1] = [[<div class="plainlinks" style="border: 1px solid #aaa; color: black; background: #f9f9f9;
margin: 0 0 .5em 1em; text-align: center; padding: 5px; float: right; clear: both; font-weight: bold; font-size: smaller;">]]


if args.temp then
if args.temp then
output[#output + 1] = "Temporary [[Wiktionary:Shortcut|shortcut" .. (args[2] and 's' or '') .. "]]:<br/>"
output[#output + 1] = "Temporary [[wikt:Wiktionary:Shortcut|shortcut" .. (args[2] and 's' or '') .. "]]:<br/>"
else
else
output[#output + 1] = "[[Wiktionary:Shortcut|Shortcut" .. (args[2] and 's' or '') .. "]]:<br/>"
output[#output + 1] = "[[wikt:Wiktionary:Shortcut|Shortcut" .. (args[2] and 's' or '') .. "]]:<br/>"
end
end
Line 56: Line 57:
local targetText = redirectTarget.fullText
local targetText = redirectTarget.fullText
if title.nsText == "Template" then
if title.nsText == "Template" then
if SUBPAGENAME == 'documentation' then
if SUBPAGENAME == 'doc' then
iattn = (targetText ~= BASEPAGENAME)
iattn = (targetText ~= BASEPAGENAME)
else
else
Line 62: Line 63:
end
end
else
else
if SUBPAGENAME == 'documentation' then
if SUBPAGENAME == 'doc' then
iattn = not (targetText == BASEPAGENAME
iattn = not (targetText == BASEPAGENAME
or targetText == FULLPAGENAME)
or targetText == FULLPAGENAME)
else
else
iattn = not (targetText == FULLPAGENAME
iattn = not (targetText == FULLPAGENAME
or targetText == FULLPAGENAME .. '/documentation')
or targetText == FULLPAGENAME .. '/doc')
end
end
end
end
Line 92: Line 93:
output[#output + 1] = '[[Category:Shortcut boxes needing attention]]'
output[#output + 1] = '[[Category:Shortcut boxes needing attention]]'
end
end
if SUBPAGENAME ~= 'documentation' then
if SUBPAGENAME ~= 'doc' and FULLPAGENAME ~= 'Template:Shortcut' then
output[#output + 1] = '[[Category:Wiktionary pages with shortcuts]]'
output[#output + 1] = '[[Category:Templates with shortcuts]]'
end
end
end
end