add many new scripts
This commit is contained in:
26
main/calendar-search.lua
Normal file
26
main/calendar-search.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
-- name = "Calendar"
|
||||
-- description = "Calendar search script"
|
||||
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
||||
-- type = "search"
|
||||
|
||||
local events = calendar:get_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:show_event_dialog(results[idx].id)
|
||||
calendar:open_event(results[idx].id)
|
||||
end
|
||||
Reference in New Issue
Block a user