Jump to content

Module:Multiple image and Module:Multiple image/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
adds classN parameter, so it is possible to skin-invert-image and bg-transparent in darkmode.
 
Adding classN - so it is possible to skin-invert-image and bg-transparent in darkmode
 
Line 26: Line 26:
end
end


local function renderImageCell(image, width, height, link, alt, thumbtime, caption, class, textalign, istyle, border)
local function renderImageCell(image, width, height, link, alt, thumbtime, caption, class, textalign, istyle, border, raw)
local root = mw.html.create('')
local root = mw.html.create('')


Line 49: Line 49:
imagediv:css('overflow', 'hidden')
imagediv:css('overflow', 'hidden')
end
end
if (require('Module:Yesno')(raw, false) ~= true) then
imagediv:wikitext('[[file:' .. image .. classstr .. widthstr .. linkstr .. altstr .. thumbtimestr .. ']]')
image = '[[file:' .. image .. classstr .. widthstr .. linkstr .. altstr .. thumbtimestr .. ']]'
end
imagediv:wikitext(image)
if isnotempty(caption) then
if isnotempty(caption) then
local captiondiv = root:tag('div')
local captiondiv = root:tag('div')
Line 279: Line 282:
imagediv:wikitext(renderImageCell(img, w, heights[k],
imagediv:wikitext(renderImageCell(img, w, heights[k],
pargs['link' .. i], pargs['alt' .. i],
pargs['link' .. i], pargs['alt' .. i],
pargs['thumbtime' .. i], pargs['caption' .. i], pargs['class' .. i], capalign, imgstyle, border))
pargs['thumbtime' .. i], pargs['caption' .. i], pargs['class' .. i],
capalign, imgstyle, border, pargs['raw' .. i]))
end
end
end
end
Line 306: Line 310:
nonautoscaledimages = false
nonautoscaledimages = false


return frame:extensionTag {name = 'templatestyles', args = {src = 'Multiple image/styles.css', wrapper = ".tmulti"}}
return frame:extensionTag {name = 'templatestyles', args = {src = 'Multiple image/sandbox/styles.css', wrapper = ".tmulti"}}
.. renderMultipleImages( frame )
.. renderMultipleImages( frame )
.. (autoscaledimages and '[[Category:Pages using multiple image with auto scaled images]]' or '')
.. (autoscaledimages and '[[Category:Pages using multiple image with auto scaled images]]' or '')