Module:Sandbox/Dat Hack3r: Difference between revisions
Appearance
Dat Hack3r (talk | contribs) m Integrated "prepad" and "postpad" for seamless hidden spacing in navigation. |
Dat Hack3r (talk | contribs) m Implemented variable types correctly. |
||
Line 20: | Line 20: | ||
if i < s_start then | if i < s_start then | ||
prepad = prepad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | prepad = prepad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | ||
elseif i > s_end then | elseif s_end and i > s_end then | ||
postpad = postpad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | postpad = postpad..'<span style="visibility: hidden;"> • '..string.format(text_format, i)..'</span>' | ||
else | else | ||
Line 39: | Line 39: | ||
function p.main(frame) | function p.main(frame) | ||
local s_start = frame:getParent().args['start'] or 1 | local s_start = tonumber(frame:getParent().args['start']) or 1 | ||
local s_end = frame:getParent().args['end'] | local s_end = tonumber(frame:getParent().args['end']) | ||
local increment = frame:getParent().args['increment'] or 1 | local increment = tonumber(frame:getParent().args['increment']) or 1 | ||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
local title_format = frame:getParent().args['title_format'] | local title_format = frame:getParent().args['title_format'] |