Move useless scripts to samples folder

This commit is contained in:
Evgeny
2024-04-18 14:47:18 +04:00
parent 3242d9c24f
commit 5eea6d8b91
8 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
-- name = "Calendar"
-- description = "Calendar search script"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- type = "search"
local events = calendar:events()
local results = {}
function on_search(str)
results = {}
buttons = {}
for _,event in pairs(events) do
if event.title:lower():find(str:lower()) ~= nil then
table.insert(results, event)
table.insert(buttons, event.title)
end
end
search:show(buttons)
end
function on_click(idx)
calendar:open_event(results[idx].id)
end