expand connections

This commit is contained in:
j 2011-09-30 19:37:41 +02:00
commit 9626995fd4
2 changed files with 22 additions and 1 deletions

View file

@ -304,7 +304,7 @@ pandora.ui.infoView = function(data) {
'Spoofs', 'Spoofed in'
].forEach(function(key) {
data.connections[key] && html.push(
formatKey(key) + formatValue(data.connections[key])
formatKey(key) + formatConnections(data.connections[key])
);
});
$div.html(html.join('; '));
@ -352,6 +352,12 @@ pandora.ui.infoView = function(data) {
return '<span style="color: rgb(128, 128, 128)">' + str + '</span>';
}
function formatConnections(connections) {
return connections.map(function(c) {
return '<a href="/' + c.item + '">' + c.title + '</a>';
}).join(', ');
}
function formatValue(value, key) {
return (Ox.isArray(value) ? value : [value]).map(function(value) {
return key ?