Content deleted Content added
create a new module |
add "clear: right;" to the main CSS |
||
(8 intermediate revisions by the same user not shown) | |||
Line 3:
p = {}
local function
local row = tbl:tag('tr')
row:tag('th')
Line 10:
end
local function
local function add_template_row(frame, tbl, pagename)
local row = tbl:tag('tr')
row:tag('td')
:wikitext(frame:expandTemplate{ title='tl', args={ pagename } })
row:tag('td')
:wikitext(edit(frame, 'Template:' .. pagename))
local row = tbl:tag('tr')
row:tag('td')
:wikitext('[[' .. pagename .. '|' .. (text or pagename) .. ']]')
row:tag('td')
:wikitext(right or edit(frame, pagename))
end
local function
row_function = add_wikilink_row
end
local nums = {}
for k, _ in pairs(args) do
if type(k) == 'string' then
local num = k:match('^' ..
if num then
table.insert(nums, tonumber(num))
end
end
end
if #nums == 0 then
return
end
table.sort(nums)
add_header_row(frame, tbl, add_section_header)
for _, num in ipairs(nums) do
local arg_name =
local
local
local text =
local right = args[arg_name .. 'right']
row_function(frame, tbl, pagename, text or arg, right)
▲ end
▲ if right == nil then
▲ right = frame:expandTemplate{ title='edit', args = { a } }
▲ end
▲ toolbox_row(frame, tbl, a, text, right)
end
end
Line 49 ⟶ 61:
local args = getArgs(frame)
local tbl = mw.html.create('table')
:cssText('clear: right; float:right; border:1px navy solid;')
tbl:tag('caption')
:wikitext('Portal toolbox')
local rootTitle = mw.title.getCurrentTitle().rootPageTitle.subjectPageTitle
add_section(frame, args, tbl, 'Other', 'other', '')
return tbl
end
|