AEGIS>Pookawboo No edit summary |
m (1 revision imported) |
(No difference)
|
Latest revision as of 11:31, 30 March 2024
This documentation is transcluded from Module:XImg/doc. Changes can be proposed in the talk page.
This module is unused.
This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add
{{Documentation}}
/{{No documentation}}
to the calling template's or parent's module documentation.Function list |
---|
L 3 — XImg.main |
local XImg = {} function XImg.main(frame) local returnValue = '' local parentFrame = frame:getParent() local parentArgs = parentFrame.args if parentArgs.image == nil then return hatnote( mw.ustring.format( 'A required field (%s) is missing!', 'image' ), { icon = 'WikimediaUI-Error.svg', extraclasses = 'error' } ) end local width = '' local frame = '' local rounded = '' local align = '' local title = '' if parentArgs.width ~= nil then width = mw.ustring.format( ' style="width:%s"', parentArgs.width ) end if parentArgs.frame ~= nil then if string.lower(parentArgs.frame) ~= 'no' then frame = ' frame' end end if parentArgs.rounded ~= nil then if string.lower(parentArgs.rounded) ~= 'no' then frame = ' rounded' end end if parentArgs.align ~= nil then if string.lower(parentArgs.align) == 'left' then align = ' alignleft' end if string.lower(parentArgs.align) == 'right' then align = ' alignright' end if string.lower(parentArgs.align) == 'center' then align = ' aligncenter' end if string.lower(parentArgs.align) == 'floatleft' then align = ' floatleft' end if string.lower(parentArgs.align) == 'floatright' then align = ' floatright' end end if parentArgs.title ~= nil then title = mw.ustring.format( '<div class="externalimage-title">%s</div>', parentArgs.title ) end returnValue = mw.ustring.format( '<div class="externalimage-container%s%s%s"%s>%s%s</div>', frame, rounded, align, width, title, parentArgs.image ) return returnValue end return XImg