Fix stringsource parsing to that apostrophes don't count as quotes.
[schedulator.git] / webtest.cs
blob5e392bf687076fee7b56168eee486a5ec6c53d79
1 using System;
2 using System.IO;
3 using System.Collections;
4 using Wv;
5 using Wv.Web;
7 public class WebTest
9 public static void Main()
11 HtmlGen g = new HtmlGen(Console.OpenStandardOutput());
13 g.send(g.title("My Title"),
14 g.include_css("webtest.css"),
15 g.use_editinplace()
16 // g.use_tablesort() // incompatible with editinplace...
19 g.send(g.form_start(new Attr("action", "",
20 "name", "sillyform",
21 "method", "post")));
23 g.send(g.h1("My h1"),
24 g.h1("Another h1"),
25 g.h2("My h2"),
26 g.text("This is some text."));
28 g.send(g.h1("Query variables:"));
29 Cgi cgi = new Cgi();
30 g.send(g.table_start());
31 g.send(g.tr(g.th("Key"), g.th("Value")));
32 foreach (string key in cgi.request.Keys)
33 g.send(g.tr(g.td(key), g.td(g.pre(cgi.request[key]))));
34 g.send(g.table_end());
36 g.send(g.p(),
37 g.editinplace("bigtext", "textarea",
38 Attr.none,
39 g.text("some big text\nanother line")));
40 g.send(g.p(),
41 g.editinplace("big2text", "textarea",
42 new Attr("tooltip", g.text("foo <monkeys>")),
43 g.text("big text 2\nanother &lt; <line>!")));
45 g.send(g.p(),
46 g.editinplace("hello", "text",
47 new Attr("size", 50),
48 g.text("this is the content")),
49 g.p());
51 g.send(g.table_start(new Attr("id", "foo1",
52 "tablesort", "1",
53 "border", "0")),
54 g.tr(g.td("hello"),
55 g.td("foo"),
56 g.td("blah")),
57 g.tr(g.td("1"),
58 g.td("2"),
59 g.td("3")),
60 g.tr(g.td("Big"),
61 g.td("Bad"),
62 g.td(g.editinplace("wolf", "text",
63 new Attr("powersearch",
64 "Dog,Cat,Monkey,Blueberry"),
65 g.text("Wolf")))),
66 g.tr(g.td("9"),
67 g.td("8"),
68 g.td(g.editinplace("7", "text",
69 new Attr("autovalidate",
70 "integer"),
71 g.text("7")))),
72 g.table_end());
74 g.send(g.ul_start(new Attr("id", "foo2",
75 "tablesort", "1",
76 "border", "1")),
77 g.li(g.text("title"),
78 g.ul(g.li("hello"),
79 g.li("foo"),
80 g.li("blah"))),
81 g.li(g.ul(g.li("1"),
82 g.li("2"),
83 g.li("3"))),
84 g.li(g.ul(g.li("Big"),
85 g.li("Bad"),
86 g.li("Wolf"))),
87 g.li(g.ul(g.li("9"),
88 g.li("8"),
89 g.li("7 <foo>"))),
90 g.ul_end());
92 g.send(g.h1("Environment variables:"));
93 g.send(g.table_start());
94 g.send(g.tr(g.th("Key"), g.th("Value")));
95 IDictionary env = Environment.GetEnvironmentVariables();
96 foreach (string key in env.Keys)
97 g.send(g.tr(g.td(key), g.td((string)env[key])));
98 g.send(g.table_end());
100 g.send(g.submit("Subm\"it!"),
101 g.form_end());
102 g.send(g.done());