Added echoing of input lines

This commit is contained in:
rxi 2014-06-28 12:06:03 +01:00
parent fc96823be8
commit 441d2f5327

View File

@ -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">&#8729;&#8729;' .. str .. '</span>'
end
if line.count > 1 then
str = '<span class="repeatcount">' .. line.count .. '</span> ' .. str
end