Fixed CSS and removed some TODOs
This commit is contained in:
parent
120f792ddf
commit
4ea179ed91
5 changed files with 7 additions and 5 deletions
|
@ -2,6 +2,6 @@ body {
|
|||
background-color: #8888;
|
||||
}
|
||||
|
||||
.loginbox, .userbox, .errormsg, .successmsg {
|
||||
#loginbox, #userbox, #errormsg, #successmsg {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class IOHelper {
|
|||
public static HashMap<String, String> GetCookies(HttpExchange exchange) {
|
||||
if (!exchange.getRequestHeaders().containsKey("Cookie"))
|
||||
return new HashMap<>();
|
||||
HashMap<String, String> map = new HashMap<>(); // TODO
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
for (String cheader : exchange.getRequestHeaders().get("Cookie")) {
|
||||
String[] spl = cheader.split("\\;\\S");
|
||||
for (String s : spl) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import io.github.norbipeti.chat.server.db.domain.User;
|
|||
public class IndexPage extends Page {
|
||||
|
||||
@Override
|
||||
public void handlePage(HttpExchange exchange) throws IOException { //TODO: Make a base HTML and insert all pages into that
|
||||
public void handlePage(HttpExchange exchange) throws IOException {
|
||||
User user = IOHelper.GetLoggedInUser(exchange);
|
||||
if (user == null)
|
||||
IOHelper.SendModifiedPage(200, this,
|
||||
|
|
|
@ -47,7 +47,7 @@ public class RegisterPage extends Page {
|
|||
IOHelper.LoginUser(exchange, user);
|
||||
IOHelper.Redirect("/", exchange);
|
||||
}
|
||||
return; // TODO: Only show tag when needed
|
||||
return;
|
||||
}
|
||||
IOHelper.SendPage(200, this, exchange);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,10 @@ public class StylePage extends Page {
|
|||
File cssfile = new File("pages", exchange.getRequestURI().getPath());
|
||||
if (!cssfile.exists())
|
||||
IOHelper.SendResponse(404, "<h1>CSS file not found</h1>", exchange);
|
||||
else
|
||||
else {
|
||||
exchange.getResponseHeaders().add("Content-Type", "text/css");
|
||||
IOHelper.SendResponse(200, IOHelper.ReadFile(cssfile), exchange);
|
||||
}
|
||||
} else
|
||||
System.out.println(exchange.getRequestURI().getPath());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue