diff options
-rw-r--r-- | web/static/css/base.ccss | 3 | ||||
-rw-r--r-- | web/static/css/kill.ccss | 14 | ||||
-rw-r--r-- | web/static/js/kill.js | 31 | ||||
-rw-r--r-- | web/static/js/search.js | 11 | ||||
-rw-r--r-- | web/templates/base.html | 3 | ||||
-rw-r--r-- | web/templates/kill.html | 8 |
6 files changed, 52 insertions, 18 deletions
diff --git a/web/static/css/base.ccss b/web/static/css/base.ccss index 19aa187..eb10d96 100644 --- a/web/static/css/base.ccss +++ b/web/static/css/base.ccss @@ -9,7 +9,8 @@ body: height: 100% background: #000 color: #ddd - font-family: sans-serif + font-family: Metrophobic, sans-serif + font-size: 12pt a: text-decoration: none diff --git a/web/static/css/kill.ccss b/web/static/css/kill.ccss index 6fada2f..a6aa9cf 100644 --- a/web/static/css/kill.ccss +++ b/web/static/css/kill.ccss @@ -65,13 +65,25 @@ table#attackers: width: 50px table#items: + table-layout: fixed + width: 460px + + th:nth-child(1): + width: 32px + th:nth-child(2): + width: 300px + th:nth-child(3): + width: 50px + .slot: background-color: #222 tr:nth-child(odd): background-color: #181818 td:nth-child(3): text-align: right + font-weight: bold + padding-right: 8px .dropped: background-color: #050 .destroyed: - color: #a00 + color: #a22 diff --git a/web/static/js/kill.js b/web/static/js/kill.js index 18ad6ab..8b3dc7b 100644 --- a/web/static/js/kill.js +++ b/web/static/js/kill.js @@ -55,6 +55,8 @@ window.addEvent('domready', function() { for (var i = 0; i < num; i++) divs[i].addClass('avail'); + if (!items[slot]) + return; items[slot].each(function(item) { var div = $('slot_' + item['flag']); var bg_img = div.getStyle('background-image'); @@ -86,18 +88,27 @@ window.addEvent('domready', function() { table.grab(new Element('tr').grab( new Element('td', {'html': slot, 'colspan': 3, 'class': 'slot'}) )); + if (slot == 'high') { + var highs = {'dropped': {}, 'destroyed': {}}; + items[slot].each(function(item) { + var d = item['dropped'] ? 'dropped' : 'destroyed'; + var count = item[d]; + if (highs[d][item['type_id']]) + highs[d][item['type_id']][d] += item[d]; + else + highs[d][item['type_id']] = item; + }); + items[slot] = []; + Object.each(highs, function(item_class) { + Object.each(item_class, function(item) { + items[slot].push(item); + }); + }); + } items[slot].each(function(item) { var type_id = item['type_id']; - if (type_id instanceof String) - type_id = type_id.split(',', 2)[0]; - var count, item_class; - if (item['dropped']) { - count = item['dropped']; - item_class = 'dropped'; - } else { - count = item['destroyed']; - item_class = 'destroyed'; - } + var item_class = item['dropped'] ? 'dropped' : 'destroyed'; + var count = item[item_class]; table.grab(new Element('tr').adopt( new Element('td').grab( new Element('img', { diff --git a/web/static/js/search.js b/web/static/js/search.js index faeb8fe..127291e 100644 --- a/web/static/js/search.js +++ b/web/static/js/search.js @@ -2,10 +2,13 @@ window.addEvent('domready', function() { ykill.api('/search' + document.location.search, function(results) { var corps = $('corps'); results.corporations.each(function(corp) { - corps.grab(new Element('a', { - 'html': corp.corporation_name, - 'href': '/corporation/' + corp.corporation_id, - })); + corps.adopt( + new Element('a', { + 'html': corp.corporation_name, + 'href': '/corporation/' + corp.corporation_id, + }), + new Element('br') + ); }); }); }); diff --git a/web/templates/base.html b/web/templates/base.html index b05a4fa..47b7a99 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -1,7 +1,8 @@ <!DOCTYPE html> <html> <head> - <link rel="stylesheet" type="text/css" href="/css/base.css" /> + <link rel="stylesheet" type="text/css" href="/css/base.css"> + <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Metrophobic"> {% block css %}{% end %} <script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools.js"></script> <script> diff --git a/web/templates/kill.html b/web/templates/kill.html index 48abdaa..818529e 100644 --- a/web/templates/kill.html +++ b/web/templates/kill.html @@ -57,7 +57,13 @@ <table id="attackers"></table> -<table id="items"></table> +<table id="items"> + <thead><tr> + <th></th> + <th></th> + <th></th> + </tr></thead> +</table> <div class="clear"></div> |