forked from RunningJon/outsourcer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIView.java
48 lines (45 loc) · 1.52 KB
/
UIView.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public class UIView
{
public static String viewLogin(String loginMessage)
{
String myScript = getJavaScriptFunctions();
String onLoad = "login()";
String msg = OutsourcerView.getHead(myScript, onLoad);
msg += "<table class=\"ostable\">\n";
msg += "<tr><td><h1><a href=\"/\">Outsourcer 5</a></h1></td>\n";
msg += "</tr>\n";
msg += "</table>\n";
msg += "<form action=\"/\" name=\"login\" id=\"login\" method=\"post\">\n";
msg += "<input type=\"hidden\" id=\"submit_form\" name=\"submit_form\" value=\"1\">\n";
msg += "<table class=\"logintable\" width=\"100%\">\n";
msg += "<tr><td align=\"center\">\n";
msg += "<table class=\"logintable\">\n";
msg += "<tr>\n";
msg += "<td>Username</td>\n";
msg += "<td><input type=\"text\" id=\"username\" name=\"username\"></td>\n";
msg += "</tr>\n";
msg += "<tr>\n";
msg += "<td>Password</td>\n";
msg += "<td><input type=\"password\" id=\"password\" name=\"password\"></td>\n";
msg += "</tr>\n";
msg += "<tr>\n";
msg += "<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Login\"></td>\n";
msg += "</tr>\n";
msg += "</table>\n";
msg += "</td></tr>\n";
if (!(loginMessage == ""))
msg += "<tr><th>" + loginMessage + "</th></tr>\n";
msg += "</table>\n";
msg += "</form>\n";
msg += "</body></html>\n";
return msg;
}
private static String getJavaScriptFunctions()
{
String myScript = "function login()\n";
myScript += "{\n";
myScript += " document.getElementById(\"username\").focus()\n";
myScript += "}\n";
return myScript;
}
}