scripts fixes

This commit is contained in:
Evgeny
2021-09-10 13:54:19 +03:00
parent 825b116ae8
commit 6b1800a627
7 changed files with 12 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
-- version = "1.0"
function on_alarm()
http:get("https://official-joke-api.appspot.com/random_joke")
http:get("https://official-joke-api.appspot.com/random_joke")
end
function on_network_result(result)
@@ -15,7 +15,7 @@ function on_network_result(result)
ui:show_lines({setup, punchline})
end
function on_click()
if setup ~= nil then
system:copy_to_clipboard(setup.."\n"..punchline)

View File

@@ -28,7 +28,7 @@ end
function on_click()
if (next(settings:get()) == nil) then
aio:show_args_dialog()
settings:show_dialog()
else
system:open_browser(click_url)
end

View File

@@ -18,7 +18,7 @@ local article_url = "https://"..lang..".wikipedia.org/wiki/"
local title = ""
function on_alarm()
http:get(random_url)
http:get(random_url)
end
function on_network_result(result)
@@ -43,7 +43,7 @@ end
function string:smart_sub(max)
local pos1, pos2 = self:find("%.", max-50)
if pos1 ~= nil and pos1 < max+50 then
return self:sub(1, pos1+1)
else