Module:Sensitive IP addresses/summary: Difference between revisions

Content deleted Content added
strip suffixes for CIDR ranges that can be represented as a single IP address
more accessible and simple markup
 
(6 intermediate revisions by 3 users not shown)
Line 37:
-- Return a wikitext table summarizing all the sensitive IP ranges
-- and the entities they belong to.
 
-- Load dependencies
local lang = mw.language.getContentLanguage()
 
-- Set up options
Line 42 ⟶ 45:
local rangeSeparator = options.rangeseparator or ', '
local showNotes = yesno(options.notes)
local nColumns = showNotes and 3 or 4
 
-- Get the entity data
Line 52 ⟶ 54:
-- Make the table root
local root = mw.html.create('table')
root:addClass('sensitive-ip-addresses')
if options.class then
root:addClass(options.class)
Line 61 ⟶ 64:
-- Add main header
if options.mainheader then
root:tag('trcaption'):tagwikitext('td'options.mainheader)
:attr('colspan', nColumns)
:cssText(options.cellstyle)
:wikitext(options.mainheader)
end
 
Line 111:
:tag('td')
:cssText(options.cellstyle)
:wikitext(lang:ucfirst(entityData.description or entityData.name))
if showNotes then
dataRow:tag('td')