comparison web/src/luan/modules/web/web_run.luan @ 286:91be4027b2a8

Improve HTML of some tools. git-svn-id: https://luan-java.googlecode.com/svn/trunk@287 21e917c8-12df-6dd8-5cb6-c86387c605b9
author hugo.tech@gmail.com <hugo.tech@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 03 Dec 2014 02:26:19 +0000
parents 582e8db4cdb6
children 5652cdea25f5
comparison
equal deleted inserted replaced
285:582e8db4cdb6 286:91be4027b2a8
16 print(i,line) 16 print(i,line)
17 i = i + 1 17 i = i + 1
18 end 18 end
19 end 19 end
20 20
21 local function basic_style() %>
22 body {font-family:'Arial',sans-serif;font-size:16px;text-align:center}
23 input,textarea {padding:.5em;border-radius:10px;border:1px solid #ccc;font-size:16px;display:block}
24 textarea {width:50%;margin:0 auto}
25 input.btn {background:#3B619D;color:#FFF;padding:.5em 2em;font-size:20px;margin:.5em auto}
26 h1 {font-weight:bold;font-size: 20px}
27 p {margin:1em 0 .2em}
28 <% end
29
21 local function form() %> 30 local function form() %>
22 <html> 31 <!DOCTYPE html>
23 <body> 32 <html lang="en">
24 <form method="post"> 33 <head>
25 <input type="hidden" name="content_type" value="text/plain" /> 34 <title>Run Luan Code</title>
26 <input type="submit" value="Execute Luan code below"> 35 <style><% basic_style() %></style>
27 <br /> 36 </head>
28 <textarea name="code" rows="30" cols="90" wrap="off"> 37 <body>
29 </textarea> 38 <h1>Run Luan Code</h1>
30 </form> 39 <form name="form0" method="post">
31 </body> 40 <input type="hidden" name="content_type" value="text/plain" />
41 <textarea name="code" rows="20" cols="90" wrap="off"></textarea>
42 <input type="submit" class="btn" value="Execute Luan Code"/>
43 </form>
44 <script>document.form0.code.focus();</script>
45 </body>
32 </html> 46 </html>
33 <% end 47 <% end
34 48
35 function service() 49 function service()
36 Io.stdout = Http.response.text_writer() 50 Io.stdout = Http.response.text_writer()