Ver código fonte

whelp.gg, footer, firefox format_isk fix

raylu 12 anos atrás
pai
commit
719c83e234

+ 5 - 0
web/static/css/base.ccss

@@ -64,3 +64,8 @@ table:
 	width: 900px
 	margin: 0 auto 50px
 	background: #111
+
+footer:
+	width: 900px
+	margin: 50px auto
+	text-align: center

+ 4 - 0
web/static/css/home.ccss

@@ -4,5 +4,9 @@
 #expensive:
 	margin: 0 auto
 
+	td:nth-child(3):
+		text-align: right
+		padding-right: 3px
+
 	caption, tr:nth-child(odd):
 		background-color: #181818

+ 28 - 18
web/static/js/common.js

@@ -1,20 +1,30 @@
-Object.append(window.ykill, {
-	'api': function(path, cb) {
-		new Request.JSON({
-			'url': ykill.api_host + path,
-			'onSuccess': cb,
-		}).get();
-	},
+(function() {
+	var locale_options = false;
+	try {
+		(0).toLocaleString('i');
+	} catch (e) { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Example:_Checking_for_support_for_locales_and_options_arguments
+		locale_options = e.name == 'RangeError';
+	}
+	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;
-	},
+		'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});
-	},
-});
+		'format_isk': function(isk) {
+			if (!locale_options)
+				return parseFloat(isk.toFixed(2)).toLocaleString();
+			return isk.toLocaleString('en-US', {'minimumFractionDigits': 2, 'maximumFractionDigits': 2});
+		},
+	});
+})();

+ 5 - 2
web/templates/base.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-	<title>u r ded</title>
+	<title>whelp.gg</title>
 	<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 %}
@@ -16,7 +16,7 @@
 </head>
 <body>
 	<div id="topbar">
-		<h1><a href="/">u r ded</a></h1>
+		<h1><a href="/">whelp.gg</a></h1>
 		<div id="nav">
 		</div>
 		<form method="get" action="/search">
@@ -27,5 +27,8 @@
 	<div id="wrapper">
 		{% block main %}{% end %}
 	</div>
+	<footer>
+		in the game of moons, you can't win, but you also can't die
+	</footer>
 </body>
 </html>