Jump to content
Main menu
Main menu
move to sidebar
hide
Nabegasion
Fanhaluman
Fanhaluman komunida
Tinilaika siha gi halacha
Maseha håfa na påhina
Ayuda
Manespesiat na påhina
Aligao
Aligao
Appearance
Nina'i siha
Fa'tinas kuenta-hu
Log in
Ramientan petsonat
Nina'i siha
Fa'tinas kuenta-hu
Log in
Pages for logged out editors
learn more
Contributions
Kuentusiyi i IP este
Tumulaika
Module:Image array
Add languages
Module
Diskuti
English
Read
Edit source
View history
Kåhon ramienta
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
Håfa ha na'chetton guini
Umachetton na tinilaika siha
Na'kåtga hulu' i atkibu
Page information
Get shortened URL
Download QR code
Appearance
move to sidebar
hide
Adahi:
Ti ma log-in hao. Mausa iyo-mu IP address sempre para tumulaika i historian påhina este.
Anti-spam check. Do
not
fill this in!
-- implements [[template:image array]] local p = {} local function isnotempty(s) return s and s:match( '^%s*(.-)%s*$' ) ~= '' end local function renderArrayCell( img, c, a, l, tc, t, w, h) local alt, link, text, border = '', '', mw.text.unstrip(t), '' if( isnotempty(a) ) then alt = 'alt=' .. a end if( isnotempty(l) ) then link = 'link=' .. l end if( isnotempty(tc) and not isnotempty(t)) then text = mw.text.unstrip(c) end local cell = mw.html.create('') if( img ) then cell:tag('div') :css('display', 'table-cell') :css('vertical-align', 'middle') :css('width', w .. 'px') :css('height', h .. 'px') :css('margin-left', 'auto') :css('margin-right', 'auto') :wikitext(mw.ustring.format('[[File:%s|%dx%dpx|%s|%s|%s]]', img, w, h, alt, link, text)) cell:tag('div') :css('padding', '1px') :wikitext(c) end return tostring(cell) end local function imagearray( frame ) local args = frame:getParent().args local width = tonumber(args['width'] or '60') local height = tonumber(args['height'] or '70') local perrow = tonumber(args['perrow'] or '4') local bw = tonumber(args['border-width'] or '0') local fs = args['font-size'] or '88%' local text = args['text'] or '' local margin = args['margin'] or 'auto' local border = ( bw > 0 ) and tostring(bw) .. 'px #aaa solid' or nil -- find all the nonempty image numbers local imagenums = {} local imagecount = 0 for k, v in pairs( args ) do local i = tonumber(tostring(k):match( '^%s*image([%d]+)%s*$' ) or '0') if( i > 0 and isnotempty(v) ) then table.insert( imagenums, i ) imagecount = imagecount + 1 end end -- sort the image numbers table.sort(imagenums) -- compute the number of rows local rowcount = math.ceil(imagecount / perrow) -- start table root = mw.html.create('table') root :css('border-collapse','collapse') :css('text-align','center') :css('font-size', fs) :css('line-height','1.25em') :css('margin',margin) :css('width', tostring(width*perrow) .. 'px') -- loop over the images for j = 1, rowcount do local row = root:tag('tr') row:css('vertical-align', 'top') for k = 1, perrow do i = imagenums[(j-1)*perrow + k] or 0 row:tag('td') :css('width', width .. 'px') :css('text-align', 'center') :css(border and 'border' or '', border or '') :wikitext(renderArrayCell( args['image' .. i], args['caption' .. i] or '', args['alt' .. i] or '', args['link' .. i] or '', args['text'] or '', args['text' .. i] or '', width, height)) end end -- end table return tostring(root) end function p.array( frame ) return imagearray( frame ) end return p
Sumaria:
By saving changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Kansela
Ayudo tumulaika
(para u baba gi nuebu na bentåna)
Preview page with this template
Wikidata entities used in this page
Module:Image array
: Sitelink, Description: en
I plantiyas siha ni ma'usa gi påhina:
Module:Image array/doc
(
tulaika
)
Aligao
Aligao
Tumulaika
Module:Image array
Add languages
Add topic