Module:Galbox: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
allow the caller to specify args for the galleries (with "gallery_" prefix)
(remove staging checks (WW Characters and BotW checks were moved to Module:Listing))
(allow the caller to specify args for the galleries (with "gallery_" prefix))
Line 20: Line 20:
end
end


function buildGallery( sections )
function buildGallery( sections, galArgs )
   local gallery = Gallery.new{
   galArgs.widths = galArgs.widths or '62px'
    widths = '62px',
  galArgs.heights = galArgs.heights or '62px'
    heights = '62px'
   local gallery = Gallery.new( galArgs )
   }
   for _, section in ipairs( sections ) do
   for _, section in ipairs( sections ) do
     -- !!!! This may break if Template:Main is modified !!!!
     -- !!!! This may break if Template:Main is modified !!!!
Line 62: Line 61:
function Galbox.new( args )
function Galbox.new( args )
   local obj = Navbox.new( args )
   local obj = Navbox.new( args )
  obj.galArgs = Args.getTable( args.gallery )
   return setmetatable( obj, Galbox )
   return setmetatable( obj, Galbox )
end
end
Line 79: Line 79:
   local defaultGallery
   local defaultGallery
   if #listing.topLevelLeaves > 0 then
   if #listing.topLevelLeaves > 0 then
     defaultGallery = buildGallery( listing.topLevelLeaves )
     defaultGallery = buildGallery( listing.topLevelLeaves, self.galArgs )
   end
   end


Line 97: Line 97:
       tabs:addTabTopWithContent{
       tabs:addTabTopWithContent{
         contentId = group.name,
         contentId = group.name,
         content = buildGallery( group.sections )
         content = buildGallery( group.sections, self.galArgs )
       }
       }
     end
     end

Navigation menu