summaryrefslogtreecommitdiffstats
path: root/web/static/js/common.js
blob: e7a4e75603182809555b8f3ea23cacf8a1b9a08d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
	},

	'format_isk': function(isk) {
		return isk.toLocaleString('en-US', {'minimumFractionDigits': 2, 'maximumFractionDigits': 2});
	},
});