summaryrefslogtreecommitdiffstats
path: root/web/static/js/common.js
diff options
context:
space:
mode:
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;
+ },
+});