Commit ec7b10c0 authored by sp2419's avatar sp2419
Browse files

Neaten HTML printing of IndexPage

parent 159273eb
Pipeline #173703 passed with stages
in 4 minutes and 22 seconds
...@@ -19,78 +19,42 @@ public class IndexPage implements Page { ...@@ -19,78 +19,42 @@ public class IndexPage implements Page {
public void writeContent(Writer _writer) throws IOException { public void writeContent(Writer _writer) throws IOException {
PrintWriter writer = (PrintWriter) _writer; PrintWriter writer = (PrintWriter) _writer;
// File indexPage = new File("src/main/java/ic/doc/web/indexPage.html"); // header
// Scanner indexPageScanner = new Scanner(indexPage); writer.println(
// "<html>\n"
// StringBuilder indexPageContentsBuilder = new StringBuilder(); + "<head><title>Welcome</title></head>\n"
// + "\n"
// while (indexPageScanner.hasNextLine()) { + "<body style=\"\n"
// indexPageContentsBuilder.append(indexPageScanner.nextLine()); + "text-align:center;\n"
// } + "color:black;\n"
// + "background: linear-gradient(to bottom, tan 0%, darkturquoise 200%);\n"
// indexPageScanner.close(); + "background: #ecc19c;\n"
// + "font-family:arial;\n"
// String indexPageContents = indexPageContentsBuilder.toString(); + "\">\n"
// + "<br>");
// writer.println(indexPageContents);
writer.println("<html>\n" + // body
"<head><title>Welcome</title></head>\n" + writer.println(
"\n" + "<h1 style=\"color:#1e847f\"><u>Welcome To The Mystery Query!!</u></h1><br><br>\n"
"<body style=\"\n" + + "<p style=\"color:black\">Enter your query in the box below:\n"
"text-align:center;\n" + + " <form>\n"
"color:black;\n" + + " <input type=\"text\" name=\"q\"/\n"
"background: linear-gradient(to bottom, tan 0%, darkturquoise 200%);\n" + + " style=\"color:white;\n"
"background: #ecc19c;\n" + + " font-size:30;text-align:center;\n"
"font-family:arial;\n" + + " background-color: #1e847f;border:0px\">\n"
"\">\n" + + " <br><br><input type=\"submit\">\n"
"<br>\n" + + " <br><br>\n"
"<h1 style=\"color:#1e847f\"><u>Welcome To The Mystery Query!!</u></h1><br><br>\n" + + " <p>Result format:</p>\n"
"<p style=\"color:black\">Enter your query in the box below:\n" + + " <input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>\n"
" <form>\n" + + " <label for=\"http\" style=\"color:black\">HTTP</label>\n"
" <input type=\"text\" name=\"q\"/\n" + + " <input type=\"radio\" name=\"format\" id=\"markdown\" value=\"markdown\">\n"
" style=\"color:white;\n" + + " <label for=\"markdown\" style=\"color:black\">Markdown</label>\n"
" font-size:30;text-align:center;\n" + + " <input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">\n"
" background-color: #1e847f;border:0px\">\n" + + " <label for=\"pdf\" style=\"color:black\">PDF</label>\n"
" <br><br><input type=\"submit\">\n" + + " </form>\n"
" <br><br>\n" + + "</p>");
" <p>Result format:</p>\n" +
" <input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>\n" +
" <label for=\"http\" style=\"color:black\">HTTP</label>\n" +
" <input type=\"radio\" name=\"format\" id=\"markdown\" value=\"markdown\">\n" +
" <label for=\"markdown\" style=\"color:black\">Markdown</label>\n" +
" <input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">\n" +
" <label for=\"pdf\" style=\"color:black\">PDF</label>\n" +
" </form>\n" +
"</p>\n" +
"</body>\n" +
"</html>");
// // Header // footer
// writer.println("<html>"); writer.println("</body>\n" + "</html>");
// writer.println("<head><title>Welcome</title></head>");
// writer.println("<body>");
//
// // Content
// writer.println(
// "<h1>Welcome To The Mystery Query!!</h1>" +
// "<p>Enter your query in the box below: " +
// "<form>" +
// "<input type=\"text\" name=\"q\" />" +
// "<br><br><input type=\"submit\">" +
// "<br><br><p>Result format:</p>" +
// "<input type=\"radio\" name=\"format\" id=\"http\" value=\"http\" checked>" +
// "<label for=\"http\">HTTP</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"markdown\"
// value=\"markdown\">" +
// "<label for=\"markdown\">Markdown</label>" +
// "<br><input type=\"radio\" name=\"format\" id=\"pdf\" value=\"pdf\">" +
// "<label for=\"pdf\">PDF</label>" +
// "</form>" +
// "</p>");
//
// // Footer
// writer.println("</body>");
// writer.println("</html>");
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment