אונטערשייד צווישן ווערסיעס פון "יחידה:תמונות מרובות"

207 בייטן אראפגענומען ,  פֿאַר 1 יאָר
ניסוי
(צופאסונג)
צייכן: צוריקגעשטעלט
(ניסוי)
צייכן: מאנועל צוריקשטעל
שורה 94: שורה 94:


local function changeIntoEng(param)
local function changeIntoEng(param)
if ( param == 'מרכז' or param == 'center' or param == 'צענטער' ) then
if ( param == 'מרכז' or param == 'center' or param == 'centre' ) then
return 'center'
return 'center'
elseif ( align == 'ימין' or param == 'right' or param == 'רעכטס' ) then
elseif ( align == 'ימין' or param == 'right' ) then
return 'right'
return 'right'
elseif ( align == 'שמאל' or param == 'left' or param == 'לינקס' ) then
elseif ( align == 'שמאל' or param == 'left' ) then
return 'left'
return 'left'
else
else
שורה 108: שורה 108:
local pargs = frame:getParent().args
local pargs = frame:getParent().args
local args = frame.args
local args = frame.args
local width = removepx(pargs['ברייט'] or '')
local width = removepx(pargs['רוחב'] or '')
local dir = pargs['ריכטונג'] or ''
local dir = pargs['כיוון'] or ''
local border = pargs['גבול'] or args['גבול'] or ''
local border = pargs['גבול'] or args['גבול'] or ''
local align = changeIntoEng(pargs['אויסגלייך']) or changeIntoEng(args['אויסגלייך']) or 'left'
local align = changeIntoEng(pargs['יישור']) or changeIntoEng(args['יישור']) or 'left'
local capalign = changeIntoEng(pargs['קעפל אויסגלייך']) or changeIntoEng(args['קעפל אויסגלייך']) or ''
local capalign = changeIntoEng(pargs['יישור כותרת']) or changeIntoEng(args['יישור כותרת']) or ''
local totalwidth = removepx(pargs['ברייט כולל'] or args['ברייט כולל'] or '')
local totalwidth = removepx(pargs['רוחב כולל'] or args['רוחב כולל'] or '')
local imgstyle = pargs['עיצוב בילד'] or args['עיצוב בילד']
local imgstyle = pargs['עיצוב תמונה'] or args['עיצוב תמונה']
local header = pargs['קעפל'] or pargs['קעפל'] or nil
local header = pargs['כותרת'] or pargs['כותרת'] or nil
local footer = pargs['פיסל'] or nil
local footer = pargs['סיומת'] or nil
local imagegap = tonumber(pargs['מרווח'] or '1') or 1
local imagegap = tonumber(pargs['מרווח'] or '1') or 1
local perrow = nil
local perrow = nil
שורה 123: שורה 123:
["none"] = 'tnone',
["none"] = 'tnone',
["center"] = 'tnone',
["center"] = 'tnone',
["לינקס"] = 'tleft',
["centre"] = 'tnone',
["צענטער"] = 'tnone',
["רעכטס"] = 'tright',
["right"] = 'tright'
["right"] = 'tright'
}
}
שורה 133: שורה 131:
local imagecount = 0
local imagecount = 0
for k, v in pairs( pargs ) do
for k, v in pairs( pargs ) do
local i = tonumber(tostring(k):match( '^%s*בילד([%d]+)%s*$' ) or '0')
local i = tonumber(tostring(k):match( '^%s*תמונה([%d]+)%s*$' ) or '0')
if( i > 0 and isnotempty(v) ) then
if( i > 0 and isnotempty(v) ) then
table.insert( imagenumbers, i)
table.insert( imagenumbers, i)
שורה 162: שורה 160:
local i = imagenumbers[k]
local i = imagenumbers[k]
if( isnotempty(totalwidth) ) then
if( isnotempty(totalwidth) ) then
widths[k], heights[k] = getdimensions(pargs['בילד' .. i], pargs['ברייט' .. i], pargs['אורך' .. i])
widths[k], heights[k] = getdimensions(pargs['תמונה' .. i], pargs['רוחב' .. i], pargs['אורך' .. i])
else
else
widths[k] = getWidth(width, pargs['ברייט' .. i])
widths[k] = getWidth(width, pargs['רוחב' .. i])
end
end
widthsum[r] = widthsum[r] + widths[k]
widthsum[r] = widthsum[r] + widths[k]
שורה 230: שורה 228:
bodywidth = math.max( 100, bodywidth - 8);
bodywidth = math.max( 100, bodywidth - 8);


local bg = pargs['הינטערגרונט'] or ''
local bg = pargs['רקע'] or ''
-- create the array of images
-- create the array of images
local root = mw.html.create('div')
local root = mw.html.create('div')
שורה 260: שורה 258:
:tag('div')
:tag('div')
:addClass('theader')
:addClass('theader')
:css('text-align', pargs['קעפל אויסגלייך'])
:css('text-align', pargs['יישור כותרת'])
:css('background-color', pargs['קעפל הינטערגרונט'])
:css('background-color', pargs['רקע כותרת'])
:wikitext(header)
:wikitext(header)
end
end
שורה 280: שורה 278:
end
end
local i = imagenumbers[k]
local i = imagenumbers[k]
local img = pargs['בילד' .. i]
local img = pargs['תמונה' .. i]
local w = widths[k]
local w = widths[k]
imagediv:css('width', tostring(2 + w) .. 'px')
imagediv:css('width', tostring(2 + w) .. 'px')
שורה 292: שורה 290:
-- add the footer
-- add the footer
if( isnotempty(footer) ) then
if( isnotempty(footer) ) then
local falign = string.lower(changeIntoEng(pargs['פיסל אויסגלייך']) or changeIntoEng(args['פיסל אויסגלייך']) or 'left')
local falign = string.lower(changeIntoEng(pargs['יישור סיומת']) or changeIntoEng(args['יישור סיומת']) or 'left')
falign = (falign == 'centre') and 'center' or falign
falign = (falign == 'centre') and 'center' or falign
div:tag('div')
div:tag('div')
שורה 300: שורה 298:
:addClass('thumbcaption')
:addClass('thumbcaption')
:css('text-align', (falign ~= 'left') and falign or nil)
:css('text-align', (falign ~= 'left') and falign or nil)
:css('background-color', pargs['פיסל הינטערגרונט'])
:css('background-color', pargs['רקע סיומת'])
:wikitext(footer)
:wikitext(footer)
end
end
שורה 312: שורה 310:
nonautoscaledimages = false
nonautoscaledimages = false


return frame:extensionTag {name = 'templatestyles', args = {src = 'מערערע בילדער/styles.css', wrapper = ".tmulti"}}
return frame:extensionTag {name = 'templatestyles', args = {src = 'תמונות מרובות/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 '')