scripts fixes
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
||||||
-- version = "1.0"
|
-- version = "1.0"
|
||||||
|
|
||||||
equals = "<font color=\""..ui:get_color().secondary_text.."\"> = </font>"
|
equals = "<font color=\""..ui:get_colors().secondary_text.."\"> = </font>"
|
||||||
|
|
||||||
function on_alarm()
|
function on_alarm()
|
||||||
http:get("https://api.blockchain.info/ticker")
|
http:get("https://api.blockchain.info/ticker")
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function on_resume()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_click()
|
function on_click()
|
||||||
aio:show_args_dialog()
|
settings:show_dialog()
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_time(y,m,d)
|
function get_time(y,m,d)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
-- version = "1.0"
|
-- version = "1.0"
|
||||||
|
|
||||||
function on_alarm()
|
function on_alarm()
|
||||||
http:get("https://official-joke-api.appspot.com/random_joke")
|
http:get("https://official-joke-api.appspot.com/random_joke")
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_network_result(result)
|
function on_network_result(result)
|
||||||
@@ -15,7 +15,7 @@ function on_network_result(result)
|
|||||||
|
|
||||||
ui:show_lines({setup, punchline})
|
ui:show_lines({setup, punchline})
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_click()
|
function on_click()
|
||||||
if setup ~= nil then
|
if setup ~= nil then
|
||||||
system:copy_to_clipboard(setup.."\n"..punchline)
|
system:copy_to_clipboard(setup.."\n"..punchline)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ end
|
|||||||
|
|
||||||
function on_click()
|
function on_click()
|
||||||
if (next(settings:get()) == nil) then
|
if (next(settings:get()) == nil) then
|
||||||
aio:show_args_dialog()
|
settings:show_dialog()
|
||||||
else
|
else
|
||||||
system:open_browser(click_url)
|
system:open_browser(click_url)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ local article_url = "https://"..lang..".wikipedia.org/wiki/"
|
|||||||
local title = ""
|
local title = ""
|
||||||
|
|
||||||
function on_alarm()
|
function on_alarm()
|
||||||
http:get(random_url)
|
http:get(random_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_network_result(result)
|
function on_network_result(result)
|
||||||
@@ -43,7 +43,7 @@ end
|
|||||||
|
|
||||||
function string:smart_sub(max)
|
function string:smart_sub(max)
|
||||||
local pos1, pos2 = self:find("%.", max-50)
|
local pos1, pos2 = self:find("%.", max-50)
|
||||||
|
|
||||||
if pos1 ~= nil and pos1 < max+50 then
|
if pos1 ~= nil and pos1 < max+50 then
|
||||||
return self:sub(1, pos1+1)
|
return self:sub(1, pos1+1)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
-- version = "1.0"
|
-- version = "1.0"
|
||||||
|
|
||||||
function on_resume()
|
function on_resume()
|
||||||
ui:show_text(system:get_from_clipboard())
|
local clipboard = system:get_from_clipboard()
|
||||||
|
ui:show_text(clipboard)
|
||||||
end
|
end
|
||||||
|
|||||||
3
samples/on_resume_test.lua
Normal file
3
samples/on_resume_test.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
function on_resume()
|
||||||
|
ui:show_toast("on_resume called")
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user