25 lines
812 B
Plaintext
25 lines
812 B
Plaintext
load_subtree = function(filename, out, depth)
|
|
-- load a file and recursively all replies to it
|
|
-- print('load_subtree', filename)
|
|
local item = initialize_item(filename, depth)
|
|
-- every item is a row consisting of two columns:
|
|
-- one column of padding and another of text
|
|
local row = cols(Inter_comment_spacing)
|
|
table.insert(out, row)
|
|
table.insert(row.data,
|
|
{type='rectangle', w=depth*Indent, h=0})
|
|
local item_stuff = rows()
|
|
table.insert(row.data, item_stuff)
|
|
table.insert(item_stuff.data, item)
|
|
table.insert(item_stuff.data, {
|
|
type='text', data={{data='reply'}},
|
|
button=true, name=filename,
|
|
margin=20,
|
|
bg=Reply_button_color,
|
|
border=Reply_button_border_color,
|
|
})
|
|
for i,reply_id in ipairs(item.metadata.replies) do
|
|
local reply = load_subtree(reply_id, out, depth+1)
|
|
end
|
|
return item
|
|
end |