Toggle menu
520
1.5K
103
22.5K
Epithet Erased Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Mbox

From Epithet Erased Wiki
Revision as of 20:54, 20 June 2024 by DirectorNook8 (talk | contribs)

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

local Mbox = {}

local function createMessageBox(args)
    local mw = require('mw')

    -- Default styles
    local styles = {
        ['border-left-color'] = args.bordercolor or 'black',
        ['background-color'] = args.bgcolor or 'white'
    }

    -- Create HTML structure
    local container = mw.html.create('div')
        :addClass('mbox')
        :css(styles)
        :wikitext(args.text or '')

    return container
end

function Mbox.main(frame)
    local args = require('Dev:Arguments').getArgs(frame)

    -- Create the message box
    local mbox = createMessageBox(args)

    return tostring(mbox)
end

return Mbox