diff options
author | raylu <raylu@gridium.com> | 2013-10-20 19:25:35 -0700 |
---|---|---|
committer | raylu <raylu@gridium.com> | 2013-10-20 19:54:54 -0700 |
commit | f106905f06603fd6be645034daaec682991beff1 (patch) | |
tree | 2f0eea23881aaafb273f09de135898d5883818ee /web | |
parent | b68a36e89ed31342a7eb5b98bd05706bbf942ec5 (diff) | |
download | ykill-f106905f06603fd6be645034daaec682991beff1.tar.xz |
items on kill page
Diffstat (limited to 'web')
-rw-r--r-- | web/static/css/kill.ccss | 12 | ||||
-rw-r--r-- | web/static/js/kill.js | 35 |
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}) + )); + }); + }); }); }); |