Модуль:tableofchemicals
| Строка 1: | Строка 1: | ||
p = {} | p = {} | ||
p.chem = mw.text.jsonDecode(mw.title.new("User:CapybaraBot/ | p.chem = mw.text.jsonDecode(mw.title.new("User:CapybaraBot/chem_prototypes.json"):getContent()) | ||
p.react = mw.text.jsonDecode(mw.title.new("User:CapybaraBot/react_prototypes.json"):getContent()) | p.react = mw.text.jsonDecode(mw.title.new("User:CapybaraBot/react_prototypes.json"):getContent()) | ||
| Строка 54: | Строка 54: | ||
local color = "" | local color = "" | ||
local textColor = "" | local textColor = "" | ||
local group = "" | |||
local desc = "" | |||
local physicalDesc = "" | |||
if firstProductId and p.chem[firstProductId] then | if firstProductId and p.chem[firstProductId] then | ||
substanceName = p.chem[firstProductId].name or firstProductId | substanceName = p.chem[firstProductId].name or firstProductId | ||
color = p.chem[firstProductId].color or "" | color = p.chem[firstProductId].color or "" | ||
textColor = p.chem[firstProductId].textColor or "" | textColor = p.chem[firstProductId].textColor or "" | ||
group = p.chem[firstProductId].group or "" | |||
desc = p.chem[firstProductId].desc or "" | |||
physicalDesc = p.chem[firstProductId].physicalDesc or "" | |||
end | end | ||
templateArgs.substance = substanceName | templateArgs.substance = substanceName | ||
templateArgs.color = color | templateArgs.color = color | ||
templateArgs.textColor = textColor | templateArgs.textColor = textColor | ||
templateArgs.group = group | |||
templateArgs.desc = desc | |||
templateArgs.physicalDesc = physicalDesc | |||
local template = "Строка_реакции" | local template = "Строка_реакции" | ||