Jump to content

Module:Sandbox/Dat Hack3r: Difference between revisions

Dat Hack3r (talk | contribs)
m Implemented variable types correctly.
Dat Hack3r (talk | contribs)
m Forgot to add the colon (":") after the namespace.
 
(4 intermediate revisions by the same user not shown)
Line 24: Line 24:
else
else
if mw.title.new(string.format(title_format, i), title.namespace).exists then
if mw.title.new(string.format(title_format, i), title.namespace).exists then
table.insert(navlist, '[['..title.namespace..string.format(title_format, i)..'|'..string.format(text_format, i)..']]')
table.insert(navlist, '[['..title.nsText..':'..string.format(title_format, i)..'|'..string.format(text_format, i)..']]')
else
else
table.insert(navlist, '<span class="seriesNavigation-item-inactive">'..string.format(text_format, i)..'</span>')
table.insert(navlist, '<span class="seriesNavigation-item-inactive">'..string.format(text_format, i)..'</span>')
Line 30: Line 30:
end
end
end
end
navlist[1] = prepad..navlist[1]
navlist[#navlist] = navlist[#navlist]..postpad


local templatestyles = mw.getCurrentFrame():extensionTag{
local templatestyles = mw.getCurrentFrame():extensionTag{
Line 35: Line 37:
args = {src = 'Module:Series navigation/styles.css'}
args = {src = 'Module:Series navigation/styles.css'}
}
}
return templatestyles..'<div class="toccolours seriesNavigation" role="navigation" aria-label="Range">'..prepad..horizontal(navlist)..postpad..'</div>'
return templatestyles..'<div class="toccolours seriesNavigation" role="navigation" aria-label="Range">'..horizontal(navlist)..'</div>'
end
end