From b68a36e89ed31342a7eb5b98bd05706bbf942ec5 Mon Sep 17 00:00:00 2001 From: raylu Date: Sun, 20 Oct 2013 18:45:06 -0700 Subject: clean up kill page --- web/static/js/common.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'web/static/js/common.js') diff --git a/web/static/js/common.js b/web/static/js/common.js index 4592cbe..547c349 100644 --- a/web/static/js/common.js +++ b/web/static/js/common.js @@ -1,6 +1,16 @@ -window.ykill.api = function (path, cb) { - new Request.JSON({ - 'url': ykill.api_host + path, - 'onSuccess': cb, - }).get(); -} +Object.append(window.ykill, { + 'api': function (path, cb) { + new Request.JSON({ + 'url': ykill.api_host + path, + 'onSuccess': cb, + }).get(); + }, + + 'portrait': function (id, text, img_dir, img_suffix) { + var img = new Element('img', { + 'src': '//image.eveonline.com/' + img_dir + '/' + id + img_suffix, + 'alt': text, + }); + return img; + }, +}); -- cgit v1.2.3