nothing to see here
This commit is contained in:
@@ -737,7 +737,7 @@ end
|
|||||||
--[[-- startup logic --]]--
|
--[[-- startup logic --]]--
|
||||||
local args = {...}
|
local args = {...}
|
||||||
if #args < 1 then
|
if #args < 1 then
|
||||||
error('supply file name')
|
error('supply file name or URL')
|
||||||
end
|
end
|
||||||
|
|
||||||
Builder.itemAdapter = Adapter.wrap({ side = 'bottom', direction = 'up' })
|
Builder.itemAdapter = Adapter.wrap({ side = 'bottom', direction = 'up' })
|
||||||
|
|||||||
@@ -70,7 +70,9 @@ function setup:eventHandler(event)
|
|||||||
if not fs.exists(STARTUP_FILE) then
|
if not fs.exists(STARTUP_FILE) then
|
||||||
Util.writeFile(STARTUP_FILE,
|
Util.writeFile(STARTUP_FILE,
|
||||||
[[os.sleep(1)
|
[[os.sleep(1)
|
||||||
shell.openForegroundTab('packages/milo/MiloRemote')]])
|
if shell.openForegroundTab then
|
||||||
|
shell.openForegroundTab('packages/milo/MiloRemote')
|
||||||
|
end]])
|
||||||
end
|
end
|
||||||
elseif fs.exists(STARTUP_FILE) then
|
elseif fs.exists(STARTUP_FILE) then
|
||||||
fs.delete(STARTUP_FILE)
|
fs.delete(STARTUP_FILE)
|
||||||
|
|||||||
@@ -72,14 +72,14 @@ function init(jua)
|
|||||||
if async then
|
if async then
|
||||||
jua.on("websocket_success", function(event, url, handle)
|
jua.on("websocket_success", function(event, url, handle)
|
||||||
local success, id = pcall(findID,url)
|
local success, id = pcall(findID,url)
|
||||||
if id and callbackRegistry[id] and callbackRegistry[id].success then
|
if success and id and callbackRegistry[id] and callbackRegistry[id].success then
|
||||||
callbackRegistry[id].success(id, handle)
|
callbackRegistry[id].success(id, handle)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
jua.on("websocket_failure", function(event, url)
|
jua.on("websocket_failure", function(event, url)
|
||||||
local success, id = pcall(findID,url)
|
local success, id = pcall(findID,url)
|
||||||
if id and callbackRegistry[id] and callbackRegistry[id].failure then
|
if success and id and callbackRegistry[id] and callbackRegistry[id].failure then
|
||||||
callbackRegistry[id].failure(id)
|
callbackRegistry[id].failure(id)
|
||||||
end
|
end
|
||||||
table.remove(callbackRegistry, id)
|
table.remove(callbackRegistry, id)
|
||||||
@@ -87,14 +87,14 @@ function init(jua)
|
|||||||
|
|
||||||
jua.on("websocket_message", function(event, url, data)
|
jua.on("websocket_message", function(event, url, data)
|
||||||
local success, id = pcall(findID,url)
|
local success, id = pcall(findID,url)
|
||||||
if id and callbackRegistry[id] and callbackRegistry[id].message then
|
if success and id and callbackRegistry[id] and callbackRegistry[id].message then
|
||||||
callbackRegistry[id].message(id, data)
|
callbackRegistry[id].message(id, data)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
jua.on("websocket_closed", function(event, url)
|
jua.on("websocket_closed", function(event, url)
|
||||||
local success, id = pcall(findID,url)
|
local success, id = pcall(findID,url)
|
||||||
if id and callbackRegistry[id] and callbackRegistry[id].closed then
|
if success and id and callbackRegistry[id] and callbackRegistry[id].closed then
|
||||||
callbackRegistry[id].closed(id)
|
callbackRegistry[id].closed(id)
|
||||||
end
|
end
|
||||||
table.remove(callbackRegistry, id)
|
table.remove(callbackRegistry, id)
|
||||||
|
|||||||
Reference in New Issue
Block a user