Permalink
Browse files

Don't allow blank names, fix utf-8 issues.

  • Loading branch information...
1 parent 8cbdaef commit 3ae0dc1b41500395263c36a2528e682ee1897859 @Connorhd committed Dec 7, 2010
Binary file not shown.
View
Binary file not shown.
@@ -43,10 +43,10 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp)
pm.close();
}
}
- resp.setContentType("text/plain");
+ resp.setContentType("text/plain; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedin\"}");
} else {
- resp.setContentType("text/json");
+ resp.setContentType("text/json; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedout\"}");
}
}
@@ -15,7 +15,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
if (user != null) {
// This is a bit horrible, should probably just redirect to a JSP?
- resp.setContentType("text/html");
+ resp.setContentType("text/html; charset=utf-8");
resp.getWriter().println("<html><head><link rel=\"icon\" type=\"image/png\" href=\"images/icon16.png\"><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"><title>TabCloud</title></head><body><div style=\"margin: 40px auto; width: 600px;\"><img style=\"float: left; padding-right: 20px;\" src=\"images/tabcloud200.png\" alt=\"TabCloud\" /><div style=\"font-family:sans-serif; font-size: 1.8em; text-align: center; padding-top: 50px;\"><strong>You are now logged in.</strong><br />Click the TabCloud menu icon to access TabCloud.</div></div></body></html>");
} else {
resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
@@ -14,7 +14,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
User user = userService.getCurrentUser();
if (user == null) {
- resp.setContentType("text/html");
+ resp.setContentType("text/html; charset=utf-8");
resp.getWriter().println("<html><head><link rel=\"icon\" type=\"image/png\" href=\"images/icon16.png\"><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"><title>TabCloud</title></head><body><div style=\"margin: 40px auto; width: 600px;\"><img style=\"float: left; padding-right: 20px;\" src=\"images/tabcloud200.png\" alt=\"TabCloud\" /><div style=\"font-family:sans-serif; font-size: 1.8em; text-align: center; padding-top: 50px;\"><strong>You are now logged out.</strong><br />You will have to login again to access your saved windows on TabCloud.</div></div></body></html>");
} else {
resp.sendRedirect(userService.createLogoutURL(req.getRequestURI()));
@@ -37,10 +37,10 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp)
// New user
pm.close();
}
- resp.setContentType("text/plain");
+ resp.setContentType("text/plain; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedin\"}");
} else {
- resp.setContentType("text/json");
+ resp.setContentType("text/json; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedout\"}");
}
}
@@ -45,10 +45,10 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
if (windowString != "")
windowString = windowString.substring(0, windowString.length()-1);
pm.close();
- resp.setContentType("text/plain");
+ resp.setContentType("text/plain; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedin\", \"windows\": ["+windowString+"]}");
} else {
- resp.setContentType("text/json");
+ resp.setContentType("text/json; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedout\"}");
}
}
@@ -36,10 +36,10 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp)
} catch (Exception e) {
pm.close();
}
- resp.setContentType("text/plain");
+ resp.setContentType("text/plain; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedin\"}");
} else {
- resp.setContentType("text/json");
+ resp.setContentType("text/json; charset=utf-8");
resp.getWriter().println("{\"status\": \"loggedout\"}");
}
}
View
@@ -1,5 +1,6 @@
<html>
<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script>
if (localStorage.openin === undefined)
localStorage.openin = 'window';
View
@@ -1,6 +1,6 @@
{
"name": "TabCloud",
- "version": "1.5",
+ "version": "1.6",
"icons": {
"16": "images/icon16.png",
View
@@ -1,5 +1,6 @@
<html>
<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script src="./lib/jquery-1.4.2.min.js"></script>
<script src="./lib/jquery-ui-1.8.5.custom.min.js"></script>
<script src="./lib/jquery.innerfade.js"></script>
@@ -17,6 +18,9 @@
return names[name];
};
var setWindowName = function (name, value) {
+ if (value.length == 0) {
+ value = 'Window';
+ }
var names = JSON.parse(localStorage.tempWindowNames)
names[name] = value;
localStorage.tempWindowNames = JSON.stringify(names);
@@ -355,6 +359,9 @@
background-color: #ccc;
border-radius: 2px;
}
+ #trash .tabplaceholder {
+ opacity: 0.6;
+ }
body {
width: 300px;
font-size: 0.9em;

0 comments on commit 3ae0dc1

Please sign in to comment.