Module:Navbar: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 3: Line 3:
local p = {}
local p = {}


function p._navbar(name, mode, text, namespace)
function p._navbar(name, mode, text, namespace, debugg)
mode = mode or ""
mode = mode or ""
text = (text == nil and "" or text .. " ")
text = (text == nil and "" or text .. " ")
Line 13: Line 13:
local s = " • "
local s = " • "
return "<span style=\"font-size: 0.75em; font-weight: normal; font-style: normal;\">"
local result = "<span style=\"font-size: 0.75em; font-weight: normal; font-style: normal;\">"
.. string.format(mode == "mini" and "%s[[%s|V]]%s[[%s|T]]%s[[%s|E]]" or "%s[[%s|View]]%s[[%s|Talk]]%s[[%s|Edit]]",
.. string.format(mode == "mini" and "%s[[%s|V]]%s[[%s|T]]%s[[%s|E]]" or "%s[[%s|View]]%s[[%s|Talk]]%s[[%s|Edit]]",
text, p_name, s, p_talk_name, s, p_edit_name)
text, p_name, s, p_talk_name, s, p_edit_name)
.. "</span>"
.. "</span>"
return (debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end


Line 24: Line 26:
local mode = frame.args["mode"]
local mode = frame.args["mode"]
local text = frame.args["text"]
local text = frame.args["text"]
local debugg = frame.args["debug"]
return p._navbar(name, mode, text, namespace)
return p._navbar(name, mode, text, namespace, debugg)
end
end


Line 68: Line 71:
.. "}}"
.. "}}"


return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end


Line 120: Line 123:
.. "}}"
.. "}}"


return frame:preprocess(debugg == true and "<pre>" .. result .. "</pre>" or result)
return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result)
end
end


return p
return p