To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Module:ChangeLog: Difference between revisions

From ZNC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
     end
     end
   end
   end
   return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])
   return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])[1]
end
end


Line 22: Line 22:
     end
     end
   end
   end
   return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])
   return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])[1]
end
end



Revision as of 09:11, 2 April 2017

Documentation for this module may be created at Module:ChangeLog/doc

local p = {}

function p.prev(frame)
  local versions = mw.text.split(frame:expandTemplate{title='ZNC-Versions'}, '%s')
  local found = nil
  for i = 1, #versions, 1 do
    if versions[i] == frame.args.this then
      found = i - 1
      break
    end
  end
  return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])[1]
end

function p.next(frame)
  local versions = mw.text.split(frame:expandTemplate{title='ZNC-Versions'}, '%s')
  local found = nil
  for i = 1, #versions, 1 do
    if versions[i] == frame.args.this then
      found = i + 1
      break
    end
  end
  return mw.ustring.gsub(frame.args.template, 'XXX', versions[found])[1]
end

function p.stability(frame)
  return 'stable'
end

return p