Modul:Infobox: Unterschied zwischen den Versionen

257 Bytes hinzugefügt ,  5. Mai 2019
renderConnectivity
Keine Bearbeitungszusammenfassung
(renderConnectivity)
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 138: Zeile 138:


function renderSensors()
function renderSensors()
return renderList('P57')
end
function renderConnectivity()
return renderList('P74')
end
function renderList(claimIdentifier)
local entity = mw.wikibase.getEntityObject()
local entity = mw.wikibase.getEntityObject()
result = ''
result = ''
if not entity or not entity.claims then return end --the entity doesnt exist or have no claims
if not entity or not entity.claims then return end --the entity doesnt exist or have no claims
local property = entity.claims['P57']
local property = entity.claims[claimIdentifier]
if property then
if property then
for key, prop in pairs(property) do
for key, prop in pairs(property) do
Zeile 191: Zeile 199:
local propValue = prop.mainsnak.datavalue
local propValue = prop.mainsnak.datavalue
result = result .. ", " .. getValue(prop) .. "-Kern";
result = result .. ", " .. getValue(prop) .. "-Kern";
if prop.qualifiers["P32"] and prop.qualifiers["P32"][1] and prop.qualifiers["P32"][1].datavalue then
if prop.qualifiers and prop.qualifiers["P32"] and prop.qualifiers["P32"][1] and prop.qualifiers["P32"][1].datavalue then
result = result .. " " .. getValueLabel(prop.qualifiers["P32"][1].datavalue) .. " CPU"
result = result .. " " .. getValueLabel(prop.qualifiers["P32"][1].datavalue) .. " CPU"
else
result = result .. " unbekannte CPU"
end
end
end
end
Zeile 205: Zeile 215:
     renderCPU = renderCPU,
     renderCPU = renderCPU,
     renderSensors = renderSensors,
     renderSensors = renderSensors,
    renderConnectivity = renderConnectivity,
     renderAmazon = renderAmazon,
     renderAmazon = renderAmazon,
}
}
11.008

Bearbeitungen