Модуль:Universal infocard: юрамалар арасында аерма
Контент бетерелгән Контент өстәлгән
Төзәтмә аңлатмасы юк |
Takhirgeran Umar (бәхәс) кулланучысының 2503612 төзәтмәсе кире кагылды Тамга: кире кайтару |
||
Юл номеры - 17:
local entityId = nil;
--
local
infobox = '',
if config and config.classes then▼
error = '',
for key, value in pairs( config.classes ) do▼
title = 'background:#eaecf0; font-weight:bold;',
classes[ key ] = value;▼
original = 'font-style:oblique;',
label = 'width:9em;',
text = '',
media = '',
split = 'vertical-align:middle; text-align:center;',
footer = 'background:#eaecf0;',
};
local classes = {
media = 'infobox-image',
footer = 'infobox-below'
};
end
end
▲ class = 'infobox';
end▼
end▼
function getTemplate( propertyId )
Строка 97 ⟶ 94 :
colspan = 'colspan="2"';
end
result = result .. '<td ' .. colspan ..
result = result .. value1;
result = result .. '</td>';
Строка 106 ⟶ 103 :
colspan = 'colspan="2"';
end
result = result .. '<td ' .. colspan ..
result = result .. value2;
result = result .. '</td>';
Строка 116 ⟶ 113 :
end
function getLine( value, style, class )
local result = '';
if ( value and string.len( value ) ~= 0 ) then
result = result .. '<tr><td colspan="2" style="text-align:center;' ..
result = result .. value;
result = result .. '</td></tr>\n';
Строка 131 ⟶ 128 :
if ( value ~= nil and string.len( value ) ~= 0 ) then
if label then
result = result .. '<tr><th style="' ..
result = result .. '<td style="' ..
else
result = result .. '<tr><td colspan="2" style="' ..
end
result = result .. value;
Строка 158 ⟶ 155 :
local coord = statements[ 1 ].mainsnak.datavalue.value;
local title = expandTemplate( args.frame, getTemplate( 'title' ), { from = entityId } );
mw.logObject( coord, 'coord' );
mw.logObject( title, 'title' );
local mapContent = [[ {
Строка 279 ⟶ 280 :
function getErrorMessage( message )
local result = '<table class="infobox" cellspacing="2"
if config and config.styles and config.styles.inferrorobox then
result = result .. '<tr><td colspan="2">' .. message .. '</td></tr>\n';▼
result = result .. ' style="' .. config.styles.error .. '"';
▲ end
result = result .. '>\n';
▲ result = result .. '<tr><td colspan="2" style="text-align:center">' .. message .. '</td></tr>\n';
result = result .. '</table>';
return result;
Строка 297 ⟶ 302 :
end
local result = '<table class="infobox" cellspacing="2"'
if config and config.i18n and config.i18n.dataName then
result = result .. ' data-name="' .. config.i18n.dataName .. '"';
▲ end
if config and config.styles and config.styles.infobox then
result = result .. ' style="' .. config.styles.infobox .. '"';
end
result = result .. '>\n';
Строка 354 ⟶ 362 :
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
Строка 413 ⟶ 421 :
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 ) );
Строка 426 ⟶ 434 :
---- 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
|