summaryrefslogtreecommitdiffstats
path: root/web/static/js/common.js
diff options
context:
space:
mode:
authorraylu <raylu@gridium.com>2013-10-20 18:45:06 -0700
committerraylu <raylu@gridium.com>2013-10-20 18:45:06 -0700
commitb68a36e89ed31342a7eb5b98bd05706bbf942ec5 (patch)
tree828aa112e8d64c6b0b62ffd4aee7957dacac4e1e /web/static/js/common.js
parent5c1b4b72ea8552e03acf9dec61fc27dfb2cd2adf (diff)
downloadykill-b68a36e89ed31342a7eb5b98bd05706bbf942ec5.tar.xz
clean up kill page
Diffstat (limited to 'web/static/js/common.js')
-rw-r--r--web/static/js/common.js22
1 files changed, 16 insertions, 6 deletions
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;
+ },
+});