Module:Freeze/same page link: Difference between revisions
Appearance
Content deleted Content added
PleaseStand (talk | contribs) split out access to frame |
PleaseStand (talk | contribs) fix silly mistake |
||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
function p._main(offset, text) |
function p._main(page, offset, text) |
||
local query = string.format('action=history&offset=%s&limit=2', offset) |
local query = string.format('action=history&offset=%s&limit=2', offset) |
||
local url = tostring(mw.uri.fullUrl( |
local url = tostring(mw.uri.fullUrl(page, query)) |
||
return string.format('<span class="plainlinks">[%s %s]</span>', url, text) |
return string.format('<span class="plainlinks">[%s %s]</span>', url, text) |
||
end |
end |
||
function p.main(frame) |
function p.main(frame) |
||
return p._main(frame.args[1], frame.args[2]) |
return p._main(frame:getParent():getTitle(), frame.args[1], frame.args[2]) |
||
end |
end |
||
Revision as of 13:34, 6 February 2024
local p = {}
function p._main(page, offset, text)
local query = string.format('action=history&offset=%s&limit=2', offset)
local url = tostring(mw.uri.fullUrl(page, query))
return string.format('<span class="plainlinks">[%s %s]</span>', url, text)
end
function p.main(frame)
return p._main(frame:getParent():getTitle(), frame.args[1], frame.args[2])
end
return p