Changes
edit for succinctness
function formNavBar( div, args ) if not args[1] then local class span = HtmlBuilder.create('span') span .addClass('error') .css('float', 'left'noprint plainlinks hlist navbar) .css(';white-space', 'nowrap') .wikitext('Error: No name provided') return span end
local title;
else
title = mw.title.new( args[1] pageName );
if title.namespace == 0 then
title = mw.title.newmakeTitle( 'Template:' .. args[1] , pageName ); end
end
local mainpage, talkpage, editurl; mainpage = title.fullText; local talkpage = title.talkPageTitle; talkpage = talkpageand title.talkPageTitle.fullText or ''; local editurl = title:fullUrl( 'action=edit' );
local viewLink, talkLink, editLink = 'view', 'talk', 'edit' if args.mini ~= nil then class viewLink, talkLink, editLink = class .. ' miniv', 't', 'e';
end
local div = HtmlBuilder.create( 'div' )
div
.addClass( class 'noprint' ) .addClass( 'plainlinks' ) .addClass( 'hlist' ) .addClass( 'navbar') .cssText( args.style or ) if args.mini then div.addClass('mini' )end
if not (args.mini == nil and or args.plain == nil ) then div .tag( 'span' ) .css( 'word-spacing', 0 ) .cssText( args.fontstyle or '' ) .wikitext( args.text or 'This box:' ); .wikitext( ' ' )
end
if args.brackets ~= nil then div.wikitext(' '); div .tag('span') .css('margin-right', '-0.125em') .cssText( args.fontstyle or '' ) .wikitext( '[' ) .newline();
end
local ul = div.tag('ul');
ul .tag( 'li' ) .addClass( 'nv-view' ) .wikitext( '[[' .. mainpage .. '|' ) .tag( 'span ' ) .attr( 'title', 'View this template' ) .cssText( args.fontstyle or '' ) .wikitext( viewLink ) .done() .wikitext( inner ']]' )
.done()
.tag( 'span ' )
.attr( 'title', 'Edit Discuss this template' )
.cssText( args.fontstyle or '' )
.wikitext( inner talkLink )
.done()
.wikitext( ']]' ); if not args.noedit then ul .tag( 'li' ) .addClass( 'nv-edit' ) .wikitext( '[' .. editurl .. ' ' ) .tag( 'span ' ) .attr( 'title', 'Edit this template' ) .cssText( args.fontstyle or '' ) .wikitext( editLink ) .done() .wikitext( ']' );
end
if args.brackets ~= nil then div .tag('span') .css('margin-left', '-0.125em') .cssText( args.fontstyle or '' ) .wikitext( ']' ) .newline();
end
if args.state == 'plain' then spacerSide = 'right' end
end
end
end
end
return p