Add click listener to Country search script

This commit is contained in:
Evgeny
2023-10-01 16:58:14 +04:00
parent 469b2baf38
commit 8570afbefa

View File

@@ -6,6 +6,8 @@
--- Original code: https://dev.fandom.com/wiki/Global_Lua_Modules/Country --- Original code: https://dev.fandom.com/wiki/Global_Lua_Modules/Country
local url = require("url")
function on_search(str) function on_search(str)
if str == nil then return end if str == nil then return end
@@ -20,6 +22,10 @@ function on_search(str)
end end
end end
function on_click()
system:open_browser("https://google.com/search?q="..url.quote(result))
end
function getCountryData(code, info) function getCountryData(code, info)
if info and code then if info and code then
-- if the code doesn't exist try looking for a country name -- if the code doesn't exist try looking for a country name