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