Бюрократы, Администраторы интерфейса, Администраторы (Semantic MediaWiki), Кураторы (Semantic MediaWiki), Editors (Semantic MediaWiki), Скрывающие, Администраторы, trusted
69 267
правок
мНет описания правки |
мНет описания правки |
||
Строка 5: | Строка 5: | ||
end | end | ||
-- | -- Invoke information from CTD about a term and shows it in footnote, pop-up or right next to term in square brackets. | ||
-- Call example: {{#invoke: CTD | info | | -- Used in Шаблон:Кратко из БТС (оформление) | ||
-- Call example: {{#invoke: CTD | info | term=Term | term_to_show=Term with accent or diacritic marks | shortly=Short description | description=Full description | origin = Origin | userparam=text@view }} | |||
-- 'view' is a language dependent parameter, consider changes in code | |||
function ctd.info( frame ) | function ctd.info( frame ) | ||
local term = '' | local term = '' | ||
Строка 20: | Строка 22: | ||
-- check if 'term' or 'term to show' are specified | -- check if 'term' or 'term to show' are specified | ||
if not isempty(frame.args[' | if not isempty(frame.args['term_to_show']) then | ||
term = frame.args[' | term = frame.args['term_to_show'] | ||
elseif not isempty(frame.args[' | elseif not isempty(frame.args['term']) then | ||
term = frame.args[' | term = frame.args['term'] | ||
else | else | ||
term = text | term = text | ||
Строка 29: | Строка 31: | ||
-- check if short description is specified | -- check if short description is specified | ||
if not isempty(frame.args[' | if not isempty(frame.args['shortly']) then | ||
description = frame.args[' | description = frame.args['shortly'] | ||
else | else | ||
description = frame.args[' | description = frame.args['description'] | ||
end | end | ||
-- check if origin specified | -- check if origin specified | ||
if not isempty(frame.args[' | if not isempty(frame.args['origin']) then | ||
origin = ' ' .. frame.args[' | origin = ' ' .. frame.args['origin'] | ||
end | end | ||