Модуль:Предмет: различия между версиями

Нет описания правки
Нет описания правки
 
Строка 30: Строка 30:
local isWrap = argsRaw.wrapper ~= nil
local isWrap = argsRaw.wrapper ~= nil
local isVert = argsRaw.vertical ~= nil
local isVert = argsRaw.vertical ~= nil
 
-- Если id найден в JsonPaths, префиксы проекта нужны
local hasId = (JsonPaths.has(id) == true)
local hasId = (JsonPaths.has(id) == true)
local projPrefix = hasId and JsonPaths.prefix() or ''
local projPrefix = hasId and JsonPaths.prefix() or ''
local projPrefixFile = hasId and JsonPaths.prefixFile() or ''


-- Получение имени
-- Получение имени
Строка 54: Строка 52:


-- Изображение
-- Изображение
local imgFile = argsRaw.image or argsRaw.img or (id .. '.png')
local imgFile = argsRaw.image or argsRaw.img or (JsonPaths.prefixFile(id) .. '.png')
if imgFile ~= '' and projPrefixFile ~= '' then
imgFile = projPrefixFile .. imgFile
end
 
local img = imgFile ~= '' and formatImage(imgFile, size, linkTgt) or ''
local img = imgFile ~= '' and formatImage(imgFile, size, linkTgt) or ''
if argsRaw.imageTooltip then
if argsRaw.imageTooltip then