Module:Lockbox: Difference between revisions

Content deleted Content added
local getContent (though it should not matter)
avoid table.insert (2x speed improvement!)
Line 21:
mw.title.getCurrentTitle():getContent() -- self-transclude; see [[mw:Extension:Scribunto/Lua reference manual#Title objects]]
if frame:preprocess "{{CASCADINGSOURCES}}" == "" then
table.insert(output,[#output + 1] = '<strong class="warning">Warning: this page (' .. mw.title.getCurrentTitle().fullText .. ') is not cascade-protected.</strong>\n')
end
Line 32:
if not ns or not mw.site.namespaces[ns] then
generate_transclusion('Template:' .. item)
table.insert(output,[#output + 1] = '* [[Template:' .. item .. ']]\n')
elseif (ns == "File") or (ns == "Image") then
generate_transclusion(item)
table.insert(output,[#output + 1] = '* [[:' .. item .. ']]\n')
elseif ns == "Category" then
generate_transclusion(item)
table.insert(output,[#output + 1] = '* [[:' .. item .. ']]\n')
elseif rest ~= '' then
generate_transclusion(item)
table.insert(output,[#output + 1] = '* [[' .. item .. ']]\n')
end
end