Модуль:MoscowMetro: различия между версиями
[отпатрулированная версия] | [отпатрулированная версия] |
Содержимое удалено Содержимое добавлено
YLSS (обсуждение | вклад) Калининско-Солнцевская линия |
YLSS (обсуждение | вклад) Обсуждение:Московский метрополитен#13 линия: ТПК=Каховская, КожЛ - розовая |
||
Строка 18:
},
html = {
icon_fmt = '<span title="%s">[[File:Moskwa Metro Line %s.svg|%
text_fmt = '[[%s|<span style="display:inline-block;line-height:%spx;height:%spx;font-size:%spx;font-weight:bold;background:#%s;color:white;text-align:center" title="%s"> %s </span>]]', --[[
parameters: link, icon size, icon size, icon size - 3, color, alt, linenum ]]
small = '<span style="font-size:85%%">%s</span>',
style = '<span style="%s">%s</span>',
sortkey = '<span style="display:none" class="sortkey">%s</span>',
},
Строка 30 ⟶ 31 :
},
default = {
icon_size = '
}
}
i18n.NAMES['СолЛ'] = i18n.NAMES['8']; i18n.NAMES['КСЛ'] = i18n.NAMES['8'];
i18n.NAMES['13'] = i18n.NAMES['
i18n.NAMES['L1'], i18n.NAMES['Л1'] = i18n.NAMES['12'], i18n.NAMES['12']; --для совместимости с предыдущими версиями шаблонов
Строка 70 ⟶ 71 :
['11'] = '79CDCD', -- Каховская
['12'] = 'ACBFE1', -- Бутовская
['13'] = 'F09E36', --
['КожЛ'] = 'CC0066', -- Кожуховская
['М1'] = '2C87C5', -- Московский монорельс
}
COLORS['ТПК'] = COLORS['
COLORS['Кожуховская'] = COLORS['КожЛ']
COLORS['СолЛ'] = COLORS['8'] ; COLORS['Солнцевская'] = COLORS['8'] ; COLORS['КСЛ'] = COLORS['8']
COLORS['L1'], COLORS['Л1'] = COLORS['12'], COLORS['12'];
function IconByNum(num)
if num == 'ТПК' or num == 'КожЛ' then return
elseif num == 'М1' then return 'M1'
elseif num == 'КСЛ' or num == 'СолЛ' then return '8'
Строка 98 ⟶ 101 :
local num, station, station_dabbed, CPIC = frame.args['line'] or '', frame.args['station'] or '', frame.args['station_dabbed'] or '', frame.args['CPIC'] or '' ~= ''
local icon_size, alt, text, small, style = frame.args['size'] or '', frame.args['alt'] or '', frame.args['text'] or '', frame.args['small'] or '', frame.args['style'] or ''
local icon, station_stripped
if not i18n.NAMES[num] then return '[[Категория:Википедия:Статьи с неверно заданными параметрами модуля MoscowMetro]]' end
local iconN = IconByNum(num)
if icon_size == '' then
icon_size = i18n.default.icon_size elseif
icon_size = mw.ustring.sub(icon_size, 1, -3 )
end
if alt == '' then
Строка 117 ⟶ 122 :
end
local link = text == '' and (station_dabbed ~= '' and station_dabbed or (station ~= '' and station .. i18n.text.dab or i18n.link(num))) or i18n.link(num)
if iconN then
else
icon = mw.ustring.format(i18n.html.text_fmt, link, icon_size, icon_size, tonumber(icon_size) - 3, COLORS[num], alt, num)
end
if text == '' then return icon end
local result = ''
Строка 132 ⟶ 141 :
end
if small ~= '' then result = mw.ustring.format(i18n.html.small, result) end
return (not iconN and station == '' and station_dabbed == '' and '' or icon .. '
end
|