From 8570afbefa854b75e462d5d47cfffcba88d6e86e Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 1 Oct 2023 16:58:14 +0400 Subject: [PATCH] Add click listener to Country search script --- community/country-search.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/community/country-search.lua b/community/country-search.lua index 0622e02..c57572c 100644 --- a/community/country-search.lua +++ b/community/country-search.lua @@ -6,6 +6,8 @@ --- Original code: https://dev.fandom.com/wiki/Global_Lua_Modules/Country +local url = require("url") + function on_search(str) if str == nil then return end @@ -20,6 +22,10 @@ function on_search(str) end end +function on_click() + system:open_browser("https://google.com/search?q="..url.quote(result)) +end + function getCountryData(code, info) if info and code then -- if the code doesn't exist try looking for a country name