Difference between revisions of "Module:Changes"
Jump to navigation
Jump to search
m (Removed unneeded code) |
m (This should add the notlast parameter in) |
||
| Line 21: | Line 21: | ||
args = f:getParent().args | args = f:getParent().args | ||
end | end | ||
back = p.list(args) | |||
if args["notlast"] ~= nil then | |||
back = back .. "<br/><hr style=\"width:auto;\"><br/>" | |||
end | |||
return back | |||
end | end | ||
return p | return p | ||
Revision as of 18:33, 10 February 2015
Replacement Lua scripting to do what Template:Changes does/did, but in a more flexible way.
- It supports the new structure of Version History.
- It can have as many changes as needed, providing that they go up sequencially, and numbers are not missed out (change1, change2, change3 is ok, but change1, change3 isn't).
- It should be faster.
Message me (Chocohead) either on the wiki (here) or on the Forum if you find any problems.
The above documentation is transcluded from Module:Changes/doc. (edit | history)
local p = {}
-- Generate list
function p.list( args )
local s = nil
local n = 1
local back = "Arguments <br/><ul>"
repeat s = args["change" .. n]
if s ~= nil then
back = back .. "<li>" .. s .. "</li>"
n = n + 1
end
until s == nil
return back .. "</ul>"
end
function p.changes( f )
if f == mw.getCurrentFrame() then
args = f:getParent().args
end
back = p.list(args)
if args["notlast"] ~= nil then
back = back .. "<br/><hr style=\"width:auto;\"><br/>"
end
return back
end
return p