From 1d91a7996a5ade0915cd340c5726baa3c0986e04 Mon Sep 17 00:00:00 2001
From: Alex Xu <alex_y_xu@yahoo.ca>
Date: Sun, 16 Mar 2014 11:50:06 -0400
Subject: Merge branch 'master' of happinessforme.com:html5ks

Conflicts:
	Makefile
	Modernizr
---
 www/warned.html | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'www')

diff --git a/www/warned.html b/www/warned.html
index 99779ed..e3daf67 100644
--- a/www/warned.html
+++ b/www/warned.html
@@ -1,11 +1,16 @@
 <!DOCTYPE html>
-<html><head>
-<script>
+<html><head><script>
 document.cookie = "warned=1; Expires=Tue, 19 Jan 2038 00:00:00 GMT; HttpOnly";
+var l = /language=[^&]*/.exec(location.search).replace(/[ \t]/g, '').split(",");
+loop: for (var i = 0; i < l.length; i++) {
+  switch (l[i].split(';')[0]) {
+    case "en": var lang = "en"; break loop;
+    case "fr": var lang = "fr"; break loop;
+  }
+}
 localStorage.persistent = {
   hdisable: location.search.indexOf("hdisable=on") > -1,
-  language: location.search.search("language=.*[=,]en") > -1 ? "en" : "fr"
+  language: lang || "en"
 };
 location.replace("./");
-</script>
-</head><body>If you're seeing this, something's gone wrong. Go back and report a bug.</body></html>
+</script></head><body>If you're seeing this, something's gone wrong. Go back and try again, and if it still doesn't work, file a bug.</body></html>
-- 
cgit v1.2.3-70-g09d2