Module:Navbar: Difference between revisions

Per edit request
(Does not work, now hidden in MediaWiki:Print.css)
(Per edit request)
Line 3:
local HtmlBuilder = require('Module:HtmlBuilder')
 
local function trim(s)
return mw.ustring.match( s, "^%s*(.-)%s*$" )
end
 
local function errorhtmlError(s)
local span = HtmlBuilder.create('span')
 
Line 19:
end
 
local function getTitle( pageName )
pageName = trim( pageName );
local page_title, talk_page_title;
Line 38:
end
 
local function _navbar( args )
if not args[1] then
return errorhtmlError('No name provided')
end
Line 46:
good, title, talk_title = pcall( getTitle, args[1] );
if not good then
return errorhtmlError(title);
end
 
if not title then
return errorhtmlError('Page does not exist')
end
Line 150:
-- behavior of {{navbar}}, change any empty arguments to nil, so Lua will consider
-- them false too.
local args = {}
for k, v in pairs(origArgs) do
if v ~= '' then
Anonymous user