Module:Prime limit navigation: Difference between revisions
ArrowHead294 (talk | contribs) No edit summary |
ArrowHead294 (talk | contribs) No edit summary |
||
Line 12: | Line 12: | ||
end | end | ||
function p.prime_limit_navigation (frame) | function p.prime_limit_navigation(frame) | ||
local i = table_index (PRIME_LIST, tonumber (frame.args['limit'])) | local i = table_index(PRIME_LIST, tonumber (frame.args['limit'])) | ||
local entry_prev, entry_curr, entry_next = "", "", "" | local entry_prev, entry_curr, entry_next, out_elem = "", "", "", "" | ||
if PRIME_LIST[i] then | if PRIME_LIST[i] then | ||
entry_curr = "[[" .. PRIME_LIST[i] .. "-limit]]" | entry_curr = "[[" .. PRIME_LIST[i] .. "-limit]]" | ||
if PRIME_LIST[i-1] then | if PRIME_LIST[i-1] then | ||
entry_prev = "<small>[[" .. PRIME_LIST[i-1] .. "-limit| | entry_prev = "<small>[[" .. PRIME_LIST[i-1] .. "-limit|← " .. PRIME_LIST[i-1] .. "-limit]]</small> " | ||
else | else | ||
entry_prev = "" | entry_prev = "" | ||
end | end | ||
if PRIME_LIST[i+1] then | if PRIME_LIST[i+1] then | ||
entry_next = " <small>[[" .. PRIME_LIST[i+1] .. "-limit|" .. PRIME_LIST[i+1] .. "-limit | entry_next = " <small>[[" .. PRIME_LIST[i+1] .. "-limit|" .. PRIME_LIST[i+1] .. "-limit →]]</small>" | ||
else | else | ||
entry_next = "" | entry_next = "" | ||
end | end | ||
end | end | ||
out_elem = "<div class=\"toccolours\" style=\"float: right;\">\n" .. | |||
"<center>'''[[Prime limit]]'''</center>\n" .. | "<center>'''[[Prime limit]]'''</center>\n" .. | ||
"----\n" .. | "----\n" .. | ||
entry_prev .. entry_curr .. entry_next .. "\n" .. | entry_prev .. entry_curr .. entry_next .. "\n" .. | ||
"</div>" | "</div>" | ||
return out_elem | |||
end | end | ||
return p; | return p; |