Cleanup community scripts
This commit is contained in:
@@ -47,7 +47,7 @@ function on_click()
|
||||
http:get("https://www.cbr.ru/scripts/XML_daily.asp?date_req="..dat:replace("%.","/"))
|
||||
return false
|
||||
else
|
||||
system:copy_to_clipboard(val)
|
||||
system:to_clipboard(val)
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -61,10 +61,10 @@ function on_network_result(res)
|
||||
return
|
||||
end
|
||||
end
|
||||
search:show({"Нет данных по валюте "..cur},{red})
|
||||
search:show_buttons({"Нет данных по валюте "..cur},{red})
|
||||
end
|
||||
|
||||
function on_long_click()
|
||||
system:copy_to_clipboard(val)
|
||||
system:to_clipboard(val)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -9,12 +9,12 @@ function on_resume()
|
||||
end
|
||||
|
||||
function on_network_result(result)
|
||||
joke = ajson:get_value(result, "object array:attachments object:0 string:text")
|
||||
joke = ajson:read(result, "object array:attachments object:0 string:text")
|
||||
ui:show_text(joke)
|
||||
end
|
||||
|
||||
function on_click()
|
||||
if joke ~= nil then
|
||||
system:copy_to_clipboard(joke)
|
||||
system:to_clipboard(joke)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ function on_search(input)
|
||||
text_from = input
|
||||
text_to = ""
|
||||
|
||||
search:show_top({"Translate \""..input.."\""}, {blue})
|
||||
search:show_buttons({"Translate \""..input.."\""}, {blue}, true)
|
||||
end
|
||||
|
||||
function on_click()
|
||||
@@ -30,20 +30,20 @@ function on_click()
|
||||
request_trans(text_from)
|
||||
return false
|
||||
else
|
||||
system:copy_to_clipboard(text_to)
|
||||
system:to_clipboard(text_to)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function request_trans(str)
|
||||
http:get(uri.."&tl="..system:get_lang().."&dt=t&q="..str)
|
||||
http:get(uri.."&tl="..system:lang().."&dt=t&q="..str)
|
||||
end
|
||||
|
||||
function on_network_result(result, code)
|
||||
if code >= 200 and code < 300 then
|
||||
decode_and_show(result)
|
||||
else
|
||||
search:show_top({"Server error"}, {red})
|
||||
search:show_buttons({"Server error"}, {red}, true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -57,7 +57,7 @@ function decode_and_show(result)
|
||||
--local lang_from = t[3]
|
||||
|
||||
if text_to ~= "" then
|
||||
search:show_top({text_to}, {blue})
|
||||
search:show_buttons({text_to}, {blue}, true)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ function on_dialog_action(text)
|
||||
end
|
||||
|
||||
function translate(str)
|
||||
http:get(uri.."&tl="..system:get_lang().."&dt=t&q="..str)
|
||||
http:get(uri.."&tl="..system:lang().."&dt=t&q="..str)
|
||||
end
|
||||
|
||||
function on_network_result(result)
|
||||
|
||||
@@ -18,7 +18,7 @@ local blue = md_colors.light_blue_800
|
||||
function on_search(input)
|
||||
text_from = input
|
||||
text_to = ""
|
||||
search:show({input},{blue})
|
||||
search:show_buttons({input},{blue})
|
||||
end
|
||||
|
||||
function on_click(idx)
|
||||
|
||||
@@ -8,7 +8,7 @@ local pass = ""
|
||||
function on_search(str)
|
||||
if str:lower():find(string.lower("password")) then
|
||||
pass = gen_pass()
|
||||
search:show{pass}
|
||||
search:show_buttons{pass}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,5 +26,5 @@ function gen_pass()
|
||||
end
|
||||
|
||||
function on_click()
|
||||
system:copy_to_clipboard(pass)
|
||||
system:to_clipboard(pass)
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ function on_search(input)
|
||||
end
|
||||
|
||||
function on_click()
|
||||
system:copy_to_clipboard(ip)
|
||||
system:to_clipboard(ip)
|
||||
end
|
||||
|
||||
function get_ip()
|
||||
@@ -27,9 +27,9 @@ end
|
||||
function on_network_result(result,code)
|
||||
if code >= 200 and code < 300 then
|
||||
ip = result
|
||||
search:show({result},{blue})
|
||||
search:show_buttons({result},{blue})
|
||||
else
|
||||
search:show({"Server Error"},{red})
|
||||
search:show_buttons({"Server Error"},{red})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ local names = {"Quick menu", "Quick apps menu", "Applications menu", "Toggle hea
|
||||
|
||||
local colors = { md_colors.purple_800, md_colors.purple_600, md_colors.amber_900, md_colors.orange_900, md_colors.blue_900, md_colors.deep_purple_800, md_colors.grey_600, md_colors.green_900, md_colors.green_900, md_colors.blue_800, md_colors.pink_300, md_colors.pink_A200, md_colors.green_600, md_colors.grey_800, md_colors.teal_700, md_colors.teal_800, md_colors.orange_700, md_colors.red_800, md_colors.red_900, md_colors.deep_purple_700, md_colors.blue_700, md_colors.amber_800, md_colors.blue_grey_700}
|
||||
|
||||
local actions = { "quick_menu", "quick_apps_menu", "apps_menu", "headers", "settings", "refresh", "restart", "notify", "clear_notifications", "quick_settings", "fold", "unfold", "private_mode", "screen_off", "scroll_down", "scroll_up", "add_note", "start_record", "send_mail", "show_recents", "voice", "one_handed", "search"}
|
||||
local actions = { "quick_menu", "quick_apps_menu", "apps_menu", "headers", "settings", "refresh", "restart", "notify", "clear_notifications", "quick_settings", "fold", "unfold", "private_mode", "screen_off", "scroll_down", "scroll_up", "add_note", "start_record", "send_mail", "show_recents", "voice", "one_handed", "search"}
|
||||
|
||||
local pos = 0
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@ function on_alarm()
|
||||
end
|
||||
|
||||
function on_network_result(result)
|
||||
setup = ajson:get_value(result, "object string:setup")
|
||||
punchline = ajson:get_value(result, "object string:punchline")
|
||||
setup = ajson:read(result, "object string:setup")
|
||||
punchline = ajson:read(result, "object string:punchline")
|
||||
|
||||
ui:show_lines({setup, punchline})
|
||||
end
|
||||
|
||||
function on_click()
|
||||
if setup ~= nil then
|
||||
system:copy_to_clipboard(setup.."\n"..punchline)
|
||||
system:to_clipboard(setup.."\n"..punchline)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ function on_search(str)
|
||||
local region = codes[code]
|
||||
|
||||
if region ~= nil then
|
||||
search:show{code.." - "..region}
|
||||
search:show_buttons{code.." - "..region}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ text_to=""
|
||||
function on_search(input)
|
||||
text_from = input
|
||||
text_to = ""
|
||||
search:show({"Share \""..input.."\""}, {blue})
|
||||
search:show_buttons({"Share \""..input.."\""}, {blue}, true)
|
||||
end
|
||||
|
||||
function on_click()
|
||||
|
||||
Reference in New Issue
Block a user