summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/static/css/kill.ccss12
-rw-r--r--web/static/js/kill.js35
2 files changed, 37 insertions, 10 deletions
diff --git a/web/static/css/kill.ccss b/web/static/css/kill.ccss
index e53ea0e..2ea2e38 100644
--- a/web/static/css/kill.ccss
+++ b/web/static/css/kill.ccss
@@ -25,3 +25,15 @@ table#attackers:
white-space: normal
&:nth-child(3):
width: 50px
+
+table#items:
+ .slot:
+ background-color: #222
+ tr:nth-child(odd):
+ background-color: #181818
+ td:nth-child(3):
+ text-align: right
+ .dropped:
+ background-color: #050
+ .destroyed:
+ color: #a00
diff --git a/web/static/js/kill.js b/web/static/js/kill.js
index 1ef53a4..8fe142a 100644
--- a/web/static/js/kill.js
+++ b/web/static/js/kill.js
@@ -57,17 +57,32 @@ window.addEvent('domready', function() {
});
table = $('items');
- data['items'].each(function(item) {
- table.grab(new Element('tr').adopt(
- new Element('td').grab(
- new Element('img', {
- 'src': '//image.eveonline.com/Type/' + item['type_id'] + '_32.png',
- 'alt': item['item_name'],
- })
- ),
- new Element('td', {'html': item['item_name']}),
- new Element('td', {'html': item['dropped'] || item['destroyed']})
+ var items = data['items'];
+ var slots = ['subsystem', 'high', 'medium', 'low', 'rig', 'drone bay', 'cargo', 'special hold', 'implant', '???'];
+ slots.each(function(slot) {
+ if (!items[slot])
+ return;
+ table.grab(new Element('tr').grab(
+ new Element('td', {'html': slot, 'colspan': 3, 'class': 'slot'})
));
+ var slot_items = items[slot];
+ ['dropped', 'destroyed'].each(function(item_class) {
+ Object.each(slot_items[item_class], function(item, item_ids) {
+ var type_id = item_ids.split(',', 2)[0]
+ var item_name = item[1];
+ var count = item[0];
+ table.grab(new Element('tr').adopt(
+ new Element('td').grab(
+ new Element('img', {
+ 'src': '//image.eveonline.com/Type/' + type_id + '_32.png',
+ 'alt': item_name,
+ })
+ ),
+ new Element('td', {'html': item_name}),
+ new Element('td', {'html': count, 'class': item_class})
+ ));
+ });
+ });
});
});