mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-15 22:54:21 +00:00
Added echoing of input lines
This commit is contained in:
parent
fc96823be8
commit
441d2f5327
11
lovebird.lua
11
lovebird.lua
@ -32,6 +32,7 @@ lovebird.pages["index"] = [[
|
||||
-- Handle console input
|
||||
if req.parsedbody.input then
|
||||
local str = req.parsedbody.input
|
||||
lovebird.pushline({ type = 'input', str = str })
|
||||
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
|
||||
lovebird.onerror)
|
||||
end
|
||||
@ -75,6 +76,11 @@ end
|
||||
border: 1px solid #E0E0E0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.inputline {
|
||||
font-family: mono, courier;
|
||||
font-size: 13px;
|
||||
color: #808080;
|
||||
}
|
||||
#header {
|
||||
background: #101010;
|
||||
height: 25px;
|
||||
@ -125,6 +131,8 @@ end
|
||||
}
|
||||
#inputbox {
|
||||
width: 100%;
|
||||
font-family: mono, courier;
|
||||
font-size: 13px;
|
||||
}
|
||||
#output {
|
||||
overflow-y: scroll;
|
||||
@ -492,6 +500,9 @@ function lovebird.recalcbuffer()
|
||||
if not lovebird.allowhtml then
|
||||
str = lovebird.htmlescape(line.str):gsub("\n", "<br>")
|
||||
end
|
||||
if line.type == "input" then
|
||||
str = '<span class="inputline">∙∙' .. str .. '</span>'
|
||||
end
|
||||
if line.count > 1 then
|
||||
str = '<span class="repeatcount">' .. line.count .. '</span> ' .. str
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user