http://wiki.maoism.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Wikidata/media&feed=atom&action=history
Модуль:Wikidata/media - История изменений
2024-03-29T12:51:22Z
История изменений этой страницы в вики
MediaWiki 1.37.1
http://wiki.maoism.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Wikidata/media&diff=1287&oldid=prev
Maoism archivist: 1 версия импортирована
2020-10-15T08:07:13Z
<p>1 версия импортирована</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="ru">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Предыдущая</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Версия 11:07, 15 октября 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="ru"><div class="mw-diff-empty">(нет различий)</div>
</td></tr></table>
Maoism archivist
http://wiki.maoism.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Wikidata/media&diff=1286&oldid=prev
wiki>Putnik: fix
2017-07-17T16:12:14Z
<p>fix</p>
<p><b>Новая страница</b></p><div>local p = {}<br />
<br />
function p.formatCommonsCategory( context, options, value )<br />
local link = 'commons:Category:' .. value<br />
local title = value .. ' на Викискладе'<br />
if ( options['text'] and options['text'] ~= '' ) then<br />
title = options['text']<br />
end<br />
<br />
commons = '[[' .. link .. '|' .. title .. ']]'<br />
<br />
--Commons icon<br />
if ( not options['icon'] or options['icon'] ~= '-' ) then<br />
local icon_size = '15px'<br />
if ( options['icon_size'] and options['icon_size'] ~= '' ) then<br />
icon_size = options['icon_size']<br />
end<br />
commons = '[[File:Commons-logo.svg|' .. icon_size .. '|link=' .. link .. ']] ' .. commons<br />
end<br />
<br />
--Text before and after link<br />
if ( options['text_before'] and options['text_before'] ~= '' ) then<br />
if ( options['text_before'] ~= '-' ) then<br />
commons = options['text_before'] .. ' ' .. commons<br />
end<br />
end<br />
<br />
if ( options['text_after'] and options['text_after'] ~= '' ) then<br />
if ( options['text_after'] ~= '-' ) then<br />
commons = commons .. ' ' .. options['text_after']<br />
end<br />
end<br />
<br />
return commons<br />
end<br />
<br />
function p.formatImage( context, options, value )<br />
local image = '[[File:' .. value<br />
if options['border'] and options['border'] ~= '' then<br />
image = image .. '|border'<br />
end<br />
if options['size'] and options['size'] ~= '' then<br />
image = image .. '|' .. options['size']<br />
end<br />
if options['alt'] and options['alt'] ~= '' then<br />
image = image .. '|' .. options['alt']<br />
end<br />
image = image .. ']]'<br />
<br />
return image<br />
end<br />
<br />
--[[ <br />
Функция для оформления одного утверждения (statement) для изображения<br />
<br />
Принимает: объект-таблицу утверждение, таблицу параметров,<br />
объект-функцию оформления внутренних структур утверждения (snak) и<br />
объект-функцию оформления ссылки на источники (reference)<br />
Возвращает: строку оформленного текста с заявлением (claim)<br />
]]<br />
function p.formatImageClaim( context, options, statement )<br />
local snak = statement.mainsnak<br />
local hash = ''<br />
local mainSnakClass = ''<br />
if ( snak.hash ) then<br />
hash = ' data-wikidata-hash="' .. snak.hash .. '"'<br />
else<br />
mainSnakClass = ' wikidata-main-snak';<br />
end<br />
<br />
local before = '<span class="wikidata-snak ' .. mainSnakClass .. '"' .. hash .. '>'<br />
local after = '</span>'<br />
<br />
if snak.snaktype ~= 'value' then<br />
return ''<br />
end<br />
<br />
--Image legend<br />
local legend = ''<br />
if ( statement.qualifiers and statement.qualifiers.P2096 ) then<br />
local langCode = mw.language.getContentLanguage():getCode()<br />
mw.logObject( statement.qualifiers.P2096 )<br />
mw.logObject( langCode )<br />
for k, qualifier in pairs ( statement.qualifiers.P2096 ) do<br />
if qualifier.snaktype == 'value'<br />
and qualifier.datavalue.value.language == langCode<br />
then<br />
legend = '<br>' .. qualifier.datavalue.value.text<br />
break<br />
end<br />
end<br />
end<br />
<br />
return p.formatImage( context, options, snak.datavalue.value ) .. legend<br />
end<br />
<br />
return p</div>
wiki>Putnik