Anonymous user
Module:Message box: Difference between revisions
fix bug for data being shared between multiple message boxes called from the same module; allow boxes to be hidden; use Module:Arguments to fetch the arguments
(fix talk page links, and fix bug producing spurious WhatLinksHere links (however note that a link will appear for Foo if the code "talk=Foo" is used)) |
(fix bug for data being shared between multiple message boxes called from the same module; allow boxes to be hidden; use Module:Arguments to fetch the arguments) |
||
Line 2:
-- Require necessary modules.
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local categoryHandler = require('Module:Category handler').main
Line 18 ⟶ 19:
local trim = mw.text.trim
--------------------------------------------------------------------------------
local box = {}▼
-- Helper functions
--------------------------------------------------------------------------------
local function getTitleObject(page, ...)
Line 58 ⟶ 61:
table.sort(nums)
return nums
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
▲local box = {}
box.__index = box
function box.new()
setmetatable(obj, box)
return obj
end
Line 195 ⟶ 211:
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
if yesno(args.hidden) then
self:addClass('infobox editsection')
end
self:addClass(self.typeClass)
Line 534 ⟶ 553:
local function main(boxType, args)
local outputBox = box.new()
local cfg =
outputBox:setBoxParameters(cfg, args)
return
end
local function makeWrapper(boxType)
return function (frame)
local args = getArgs(frame, {trim = false, removeBlanks = false})
▲ end
▲ local args = {}
▲ end
return main(boxType, args)
end
|