17,230
edits
mNo edit summary |
(switch to zdw selectors) |
||
(One intermediate revision by the same user not shown) | |||
Line 24: | Line 24: | ||
function Box:render() | function Box:render() | ||
local root = mw.html.create( 'div' ) | local root = mw.html.create( 'div' ) | ||
:addClass( self.boxType == 'dark' and ' | :addClass( self.boxType == 'dark' and 'zdw-box--dark' or 'zdw-box' ) | ||
:addClass( self.args.class ) | :addClass( self.args.class ) | ||
Line 53: | Line 53: | ||
function Box:renderHeader() | function Box:renderHeader() | ||
local header = mw.html.create( 'div' ) | local header = mw.html.create( 'div' ) | ||
:addClass( ' | :addClass( 'zdw-box__title' ) | ||
:css( 'text-align', 'center' ) | :css( 'text-align', 'center' ) | ||
:wikitext( self.args.title ) | :wikitext( self.args.title ) | ||
Line 61: | Line 61: | ||
:addClass( 'edit plainlinks' ) | :addClass( 'edit plainlinks' ) | ||
:wikitext( '[' .. tostring( mw.uri.fullUrl( self.args.edit, { action = 'edit' } ) ) .. ' [edit]]' ) | :wikitext( '[' .. tostring( mw.uri.fullUrl( self.args.edit, { action = 'edit' } ) ) .. ' [edit]]' ) | ||
end | end | ||
Line 87: | Line 84: | ||
function Box:renderFooter() | function Box:renderFooter() | ||
local footer = mw.html.create( 'div' ) | local footer = mw.html.create( 'div' ) | ||
:addClass( ' | :addClass( 'zdw-box__title zdw-hlist' ) | ||
:css( 'text-align', 'center' ) | :css( 'text-align', 'center' ) | ||
Line 99: | Line 96: | ||
end | end | ||
local p, mt = | local p, mt = {}, {} | ||
p.Box = Box | |||
function p._main( boxType, args ) | function p._main( boxType, args ) | ||
local box = Box.new( boxType, args ) | local box = Box.new( boxType, args ) | ||
return box:render() | return box:render() | ||
end | end | ||