Модуль:Universal infocard: юрамалар арасында аерма
Контент бетерелгән Контент өстәлгән
к Ilnur efende үзгәртүләре (бәхәс) Takhirgeran Umar юрамасына кадәр кире кайтарылды Тамга: кире кайтару |
Copying 2 changes by Putnik: CSS classes instead of styles,support custom CSS class for .infobox from mw:Module:Universal infocard. (docs) Тамга: кулдан кире кайтару DiBabel [1.2] |
||
Юл номеры - 17:
local entityId = nil;
--
local
title = 'infobox-above',▼
▲if config and config.styles then
▲ for key, value in pairs( config.styles ) do
▲ styles[ key ] = value;
end
end
function getClassString( type )
local class;
if classes[type] then
class = classes[type];
elseif type ~= '' then
class = 'infobox-' .. type;
else
end▼
if class == '' then
return '';
end▼
return ' class="'.. class .. '"';
end
function getTemplate( propertyId )
Строка 94 ⟶ 97 :
colspan = 'colspan="2"';
end
result = result .. '<td ' .. colspan ..
result = result .. value1;
result = result .. '</td>';
Строка 103 ⟶ 106 :
colspan = 'colspan="2"';
end
result = result .. '<td ' .. colspan ..
result = result .. value2;
result = result .. '</td>';
Строка 113 ⟶ 116 :
end
function getLine( value
local result = '';
if ( value and string.len( value ) ~= 0 ) then
result = result .. '<tr><td colspan="2"
result = result .. value;
result = result .. '</td></tr>\n';
Строка 128 ⟶ 131 :
if ( value ~= nil and string.len( value ) ~= 0 ) then
if label then
result = result .. '<tr><th
result = result .. '<td
else
result = result .. '<tr><td colspan="2
end
result = result .. value;
Строка 155 ⟶ 158 :
local coord = statements[ 1 ].mainsnak.datavalue.value;
local title = expandTemplate( args.frame, getTemplate( 'title' ), { from = entityId } );
local mapContent = [[ {
Строка 280 ⟶ 279 :
function getErrorMessage( message )
local result = '<table
▲ end
▲ result = result .. '<tr><td colspan="2" style="text-align:center">' .. message .. '</td></tr>\n';
result = result .. '</table>';
return result;
Строка 302 ⟶ 297 :
end
local result = '<table
if config and config.i18n and config.i18n.dataName then
result = result .. ' data-name="' .. config.i18n.dataName .. '"';
▲ end
end
result = result .. '>\n';
Строка 362 ⟶ 354 :
label = expandTemplate( frame, titleTemplate, { from = entityId } );
end
result = result .. getLine( label,
---- Original name.
if claims.P1559 ~= nil then
result = result .. getLine( expandTemplate( frame, getTemplate( 'P1559' ), { from = entityId } ),
elseif claims.P1705 ~= nil then
result = result .. getLine( expandTemplate( frame, getTemplate( 'P1705' ), { from = entityId } ),
end
Строка 421 ⟶ 413 :
local label = propertyLabel( propertyId );
if propertyClaims[ 1 ].mainsnak.datatype == 'commonsMedia' then
result = result .. getLine( renderValue( frame, propertyId, { alt = label } ),
else
result = result .. getValue( label, renderValue( frame, propertyId ) );
Строка 434 ⟶ 426 :
---- Map.
if claims.P625 ~= nil then
result = result .. getLine( renderValue( frame, 'map' ),
end
---- Commons.
if claims.P373 ~= nil then
result = result .. getLine( expandTemplate( frame, getTemplate( 'P373' ), { from = entityId } ),
end
|