Modul:Infobox: Unterschied zwischen den Versionen

283 Bytes hinzugefügt ,  5. Mai 2019
renderConnectivity
Keine Bearbeitungszusammenfassung
(renderConnectivity)
 
(2 dazwischenliegende Versionen desselben Benutzers werden 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 152: Zeile 160:
end
end


function renderAmazon()
function renderAmazon(frame)
local entity = mw.wikibase.getEntityObject()
local entity = mw.wikibase.getEntityObject()
result = ''
result = ''
Zeile 158: Zeile 166:
local property = entity.claims['P8']
local property = entity.claims['P8']
if property and property[1] and property[1].mainsnak and property[1].mainsnak.datavalue then
if property and property[1] and property[1].mainsnak and property[1].mainsnak.datavalue then
result = result .. "Amazon|" .. getValueLabel(property[1].mainsnak.datavalue) .. "|" .. entity:getLabel() .. " bei Amazon"
result = frame:expandTemplate{ title = 'Amazon', args = { getValueLabel(property[1].mainsnak.datavalue), entity:getLabel() .. " bei Amazon" } }
end
end
return result
return result
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