Mercurial Hosting > luan
comparison http/src/luan/modules/http/Shell_mod.luan @ 560:2f39468680be
remove SimplyHTML from shell
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 23 Jun 2015 07:57:10 -0600 |
parents | 18504c41b0be |
children | 24b05963ba62 |
comparison
equal
deleted
inserted
replaced
559:bfb2c30324c0 | 560:2f39468680be |
---|---|
4 local load = Luan.load or error() | 4 local load = Luan.load or error() |
5 local try = Luan.try or error() | 5 local try = Luan.try or error() |
6 local Io = require "luan:Io" | 6 local Io = require "luan:Io" |
7 local print = Io.print or error() | 7 local print = Io.print or error() |
8 local Http = require "luan:http/Http" | 8 local Http = require "luan:http/Http" |
9 local Html = require "luan:Html" | 9 |
10 | 10 |
11 local M = {} | 11 local M = {} |
12 | 12 |
13 local history = {} | 13 local history = {} |
14 M.env = {} | 14 M.env = {} |
41 | 41 |
42 Io.stdout = Http.response.text_writer() | 42 Io.stdout = Http.response.text_writer() |
43 %> | 43 %> |
44 <html> | 44 <html> |
45 <head> | 45 <head> |
46 <% Html.simply_html_head() %> | |
47 <title>Luan Shell</title> | 46 <title>Luan Shell</title> |
47 <style> | |
48 body { | |
49 font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
50 margin: 2em 5% 0 5%; | |
51 } | |
52 pre { | |
53 font: inherit; | |
54 } | |
55 input[type="text"] { | |
56 font: inherit; | |
57 padding: .5em .8em; | |
58 border-radius: 8px; | |
59 border-style: groove; | |
60 } | |
61 input[type="text"]:focus { | |
62 border-color: #66afe9; | |
63 outline: none; | |
64 } | |
65 input[type="submit"] { | |
66 color: white; | |
67 background: #337ab7; | |
68 border-color: #337ab7; | |
69 font: inherit; | |
70 padding: .5em; | |
71 border-radius: 4px; | |
72 } | |
73 input[type="submit"]:hover { | |
74 background: #236aa7 !important; | |
75 } | |
76 </style> | |
48 </head> | 77 </head> |
49 <body> | 78 <body> |
50 <div container> | 79 <h2>Luan Shell</h2> |
51 <h3>Luan Shell</h3> | 80 <p>This is a command shell. Enter commands below.</p> |
52 <p>This is a command shell. Enter commands below.</p> | 81 <pre><% |
53 <pre><% | 82 for _,v in ipairs(history) do |
54 for _,v in ipairs(history) do | 83 Io.stdout.write(v) |
55 Io.stdout.write(v) | 84 end |
56 end | 85 %></pre> |
57 %></pre> | 86 <form name='form0' method='post'> |
58 <form name='form0' method='post'> | 87 % <input type="text" name='cmd' size="80" autofocus> |
59 % <input name='cmd' size="80" autofocus> | 88 <input type="submit" value="run"> |
60 <input type="submit" value="run" textcolor="white" bgcolor="#337ab7"> | 89 <input type="submit" name="clear" value="clear"> |
61 <input type="submit" name="clear" value="clear" textcolor="white" bgcolor="#337ab7"> | 90 </form> |
62 </form> | |
63 </div> | |
64 <% Html.simply_html_body_bottom() %> | |
65 </body> | 91 </body> |
66 </html> | 92 </html> |
67 <% | 93 <% |
68 end | 94 end |
69 | 95 |