Module:Box: Difference between revisions

Want an adless experience? Log in or Create an account.
switch to zdw selectors
(looks like trying to overload a type with 'static' functions is going to be a pain, so separating out the type and the module)
(switch to zdw selectors)
 
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 'darkbox' or 'box' )
     :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( 'title' )
     :addClass( 'zdw-box__title' )
     :css( 'text-align', 'center' )
     :css( 'text-align', 'center' )
     :wikitext( self.args.title )
     :wikitext( self.args.title )
Line 84: Line 84:
function Box:renderFooter()
function Box:renderFooter()
   local footer = mw.html.create( 'div' )
   local footer = mw.html.create( 'div' )
     :addClass( 'title hlist' )
     :addClass( 'zdw-box__title zdw-hlist' )
     :css( 'text-align', 'center' )
     :css( 'text-align', 'center' )