Jump to content

Module:Pagination: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Codemini (talk | contribs)
O boy, am worn out
Codemini (talk | contribs)
Really
Line 1: Line 1:
local p = {}
local pk = {}
function p.pagination(frame)
function pk.pagination(frame)
args = frame.args
args = frame.args
prevcolor = args.prevcolor or ''
prevcolor = args.prevcolor or ''
Line 27: Line 27:


end
end
return p
return pk

Revision as of 08:39, 26 May 2025

local pk = {}
function pk.pagination(frame)
 args = frame.args
 prevcolor = args.prevcolor or ''
 nextcolor = args.nextcolor or ''
 previous = args[1] or args.previous
 nextEl = args[2] or args.next
 msg = '<strong class="error">PaginationScriptError: You must provide a link for the</strong>'
 p = '<span class="prev-btn" style="background-color: ' .. prevcolor .. ';>[[' .. previous .. '|Previous]]</span>'
 n = '<span class="next-btn" style="background-color: ' .. nextcolor .. ';>[[' .. nextEl .. '|Next]]</span>'
 hide = args.hide or ''
if previous == '' and nextEl == '' then
 return '<strong class="error">' .. msg .. ' previous and next buttons</strong>'
else
 return p and n
end
 if hide == 'previous' then
 return n
else
 return p and n
end
if hide == 'next' then
 return p
else
 return p and n
end 

end
return pk