Module:PagedGallery: Difference between revisions

Want an adless experience? Log in or Create an account.
m
move 'zdw-paged-gallery' class to content div so the js works
(add page content)
m (move 'zdw-paged-gallery' class to content div so the js works)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
local Box = require( 'Module:Box' ).Box
local Box = require( 'Module:Box' ).Box


local PAGE_NUMBER_FORMAT = "\{(#+)}"
local PAGE_NUMBER_FORMAT = "%((#+)%)"


local PagedGallery = Box.new()
local PagedGallery = Box.new()
Line 9: Line 9:


function PagedGallery.new( args )
function PagedGallery.new( args )
  args.class = 'zdw-paged-gallery'
   local width = args.width or 300
   local width = args.width or 300
   args.width = width * 2 .. 'px'
   args.width = width * 2 .. 'px'
Line 27: Line 26:
-- override Box:renderContent
-- override Box:renderContent
function PagedGallery:renderContent()
function PagedGallery:renderContent()
   local content = mw.html.create( 'div' );
   local content = mw.html.create( 'div' )
    :addClass( 'zdw-paged-gallery' )
   local nav = content:tag( 'div' )
   local nav = content:tag( 'div' )
     :addClass( 'zdw-paged-gallery__navigation' )
     :addClass( 'zdw-paged-gallery__navigation' )
Line 74: Line 74:
   getParent = function() return {
   getParent = function() return {
     args = {
     args = {
       format = 'The-Legend-of-Zelda-North-American-Instruction-Manual-Page-{##}.jpg',
       format = 'The-Legend-of-Zelda-North-American-Instruction-Manual-Page-(##).jpg',
       numPages = 47
       numPages = 47
     }
     }