mirror of https://github.com/teverse/teverse
Compare commits
No commits in common. "98ea58ce1307ba11c71cb7ec3c556404175c801e" and "2dfc1f6dd5ad630130d52f03ff25d77057d4861b" have entirely different histories.
98ea58ce13
...
2dfc1f6dd5
|
@ -1,17 +1,2 @@
|
||||||
local loadingText = teverse.construct("guiTextBox", {
|
|
||||||
parent = teverse.interface,
|
|
||||||
size = guiCoord(2, 0, 2, 0),
|
|
||||||
position = guiCoord(-0.5, 0, -0.5, 0),
|
|
||||||
backgroundColour = colour.black(),
|
|
||||||
textColour = colour.white(),
|
|
||||||
text = "teverse",
|
|
||||||
textAlign = "middle",
|
|
||||||
textSize = 38,
|
|
||||||
textFont = "tevurl:fonts/moskUltraBold.ttf",
|
|
||||||
zIndex = 2000
|
|
||||||
})
|
|
||||||
|
|
||||||
local ui = require("tevgit:core/dashboard/ui.lua")
|
local ui = require("tevgit:core/dashboard/ui.lua")
|
||||||
ui.setup()
|
ui.setup()
|
||||||
|
|
||||||
loadingText:destroy()
|
|
|
@ -61,6 +61,7 @@ return {
|
||||||
iconId = "sliders-h",
|
iconId = "sliders-h",
|
||||||
iconType = "faSolid",
|
iconType = "faSolid",
|
||||||
setup = function(page)
|
setup = function(page)
|
||||||
|
page.backgroundAlpha = 1.0
|
||||||
|
|
||||||
local feed = teverse.construct("guiScrollView", {
|
local feed = teverse.construct("guiScrollView", {
|
||||||
parent = page,
|
parent = page,
|
||||||
|
@ -269,7 +270,7 @@ return {
|
||||||
|
|
||||||
local feedItems = teverse.construct("guiFrame", {
|
local feedItems = teverse.construct("guiFrame", {
|
||||||
parent = feed,
|
parent = feed,
|
||||||
backgroundAlpha = 0,
|
backgroundAlpha = 1,
|
||||||
clip = true
|
clip = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -308,34 +309,30 @@ return {
|
||||||
if code == 200 then
|
if code == 200 then
|
||||||
lastRefresh = os.clock()
|
lastRefresh = os.clock()
|
||||||
local json = teverse.json:decode(body)
|
local json = teverse.json:decode(body)
|
||||||
if #json > 0 then
|
if json[1].id == newestFeed then
|
||||||
if json[1].id == newestFeed then
|
-- no change from last refresh
|
||||||
-- no change from last refresh
|
return nil
|
||||||
return nil
|
else
|
||||||
else
|
-- may require refactoring
|
||||||
-- may require refactoring
|
for _,v in pairs(feedItems.children) do
|
||||||
for _,v in pairs(feedItems.children) do
|
if v.name == "feedItem" then
|
||||||
if v.name == "feedItem" then
|
v:destroy()
|
||||||
v:destroy()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
newestFeed = json[1].id
|
|
||||||
local y = 50
|
|
||||||
for _,v in pairs(json) do
|
|
||||||
local date = os.date("%d/%m/%Y %H:%M", os.parseISO8601(v.postedAt))
|
|
||||||
local item = newFeedItem("tevurl:asset/user/" .. v.postedBy.id, v.postedBy.username, date, v.message)
|
|
||||||
item.parent = feedItems
|
|
||||||
local dy = item:child("body").textDimensions.y
|
|
||||||
item.size = guiCoord(1, -20, 0, dy + 28)
|
|
||||||
item.position = guiCoord(0, 10, 0, y)
|
|
||||||
y = y + dy + 28
|
|
||||||
end
|
|
||||||
|
|
||||||
feed.canvasSize = guiCoord(1, 0, 0, feedItems.absolutePosition.y + y + 100)
|
|
||||||
else
|
|
||||||
feed.canvasSize = guiCoord(1, 0, 0, 0)
|
|
||||||
end
|
end
|
||||||
|
newestFeed = json[1].id
|
||||||
|
local y = 50
|
||||||
|
for _,v in pairs(json) do
|
||||||
|
local date = os.date("%d/%m/%Y %H:%M", os.parseISO8601(v.postedAt))
|
||||||
|
local item = newFeedItem("tevurl:asset/user/" .. v.postedBy.id, v.postedBy.username, date, v.message)
|
||||||
|
item.parent = feedItems
|
||||||
|
local dy = item:child("body").textDimensions.y
|
||||||
|
item.size = guiCoord(1, -20, 0, dy + 28)
|
||||||
|
item.position = guiCoord(0, 10, 0, y)
|
||||||
|
y = y + dy + 28
|
||||||
|
end
|
||||||
|
|
||||||
|
feed.canvasSize = guiCoord(1, 0, 0, feedItems.absolutePosition.y + y + 100)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -355,7 +352,6 @@ return {
|
||||||
input.text = ""
|
input.text = ""
|
||||||
input.textEditable = true
|
input.textEditable = true
|
||||||
input.textAlpha = 1.0
|
input.textAlpha = 1.0
|
||||||
submitting = false
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -137,10 +137,7 @@ controller.setup = function()
|
||||||
end
|
end
|
||||||
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
|
setupPage(require("tevgit:core/dashboard/pages/home.lua"))
|
||||||
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
|
setupPage(require("tevgit:core/dashboard/pages/apps.lua"))
|
||||||
|
setupPage(require("tevgit:core/dashboard/pages/develop.lua"))
|
||||||
if _DEVICE:sub(0,6) ~= "iPhone" then
|
|
||||||
setupPage(require("tevgit:core/dashboard/pages/develop.lua"))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return controller
|
return controller
|
|
@ -50,13 +50,6 @@ local gui = teverse.construct("guiTextBox", {
|
||||||
textColour = colour.rgb(61, 66, 71)
|
textColour = colour.rgb(61, 66, 71)
|
||||||
})
|
})
|
||||||
|
|
||||||
local progressBar = teverse.construct("guiFrame", {
|
|
||||||
parent = dialog,
|
|
||||||
size = guiCoord(0, 0, 0, 5),
|
|
||||||
position = guiCoord(0, 0, 1, -5),
|
|
||||||
backgroundColour = colour.rgb(74, 140, 122)
|
|
||||||
})
|
|
||||||
|
|
||||||
if _OS == "OSX" or _OS == "IOS" then
|
if _OS == "OSX" or _OS == "IOS" then
|
||||||
-- We distribute updates via the app store on iOS/OSX
|
-- We distribute updates via the app store on iOS/OSX
|
||||||
gui.text = "A new version is available, please check the App Store."
|
gui.text = "A new version is available, please check the App Store."
|
||||||
|
@ -66,8 +59,3 @@ teverse.networking:on("_update", function(message)
|
||||||
print('got ', message)
|
print('got ', message)
|
||||||
gui.text = message
|
gui.text = message
|
||||||
end)
|
end)
|
||||||
|
|
||||||
teverse.networking:on("_downloadProgress", function(str)
|
|
||||||
local pcnt = tonumber(str)
|
|
||||||
progressBar.size = guiCoord(pcnt/100, 0, 0, 5)
|
|
||||||
end)
|
|
Loading…
Reference in New Issue