Home
Random
Log in
Settings
About MISERY wiki
Disclaimers
MISERY wiki
Search
Editing
Module:Mbox
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local getArgs = require('Module:Arguments').getArgs function p.main(frame) local args = getArgs(frame) local styles = {} if args.bordercolor then styles['border-left'] = '4px solid ' .. args.bordercolor elseif args.type == 'notice' then styles['border-left'] = '4px solid #3a86c8' elseif args.type == 'warning' then styles['border-left'] = '4px solid #c8a83a' elseif args.type == 'danger' then styles['border-left'] = '4px solid #c83a3a' else styles['border-left'] = '4px solid #5a8a3a' end if args.bgcolor then styles['background-color'] = args.bgcolor else styles['background-color'] = '#1a2a10' end local container = mw.html.create('div') :addClass('mbox') :addClass(args.class or '') :css(styles) :css({ ['padding'] = '10px 14px', ['margin'] = '8px 0', ['display'] = 'flex', ['align-items'] = 'flex-start', ['gap'] = '12px', ['border-radius'] = '2px', }) :cssText(args.style or '') local content = container:tag('div') :css({ ['flex'] = '1' }) if args.image then container:tag('div') :wikitext('[[File:' .. args.image .. '|' .. (args.imagewidth or '40px') .. ']]') end if args.header then content:tag('div') :css({ ['font-weight'] = 'bold', ['margin-bottom'] = '4px', ['color'] = '#c09040', ['text-transform'] = 'uppercase', ['letter-spacing'] = '0.05em', }) :wikitext(args.header) end if args.text then content:tag('div') :wikitext(args.text) if args.comment then content:tag('div') :css({ ['font-size'] = '0.85em', ['opacity'] = '0.7', ['margin-top'] = '4px' }) :wikitext(args.comment) end end return container end return p
Summary:
Please note that all contributions to MISERY wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
MISERY:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Pages included on this page:
Template:T
(
edit
)
Module:Mbox/doc
(
edit
)