Change variables to camelCase

This commit is contained in:
thomabx 2020-03-22 15:40:47 -07:00
parent 98afd12b4a
commit 509465122b
9 changed files with 63 additions and 63 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="PublicUserData" extends="ContentNode">
<interface>
<field id="Name" type="string" />
<field id="ImageURL" type="string" />
<field id="name" type="string" />
<field id="imageURL" type="string" />
</interface>
<script type="text/brightscript" uri="PublicUserData.brs" />
</component>

View File

@ -1,17 +1,17 @@
sub init()
end sub
sub ItemContentChanged()
ItemData = m.top.ItemContent
if ItemData = invalid then return
sub itemContentChanged()
itemData = m.top.itemContent
if itemData = invalid then return
ProfileImage = m.top.findNode("ProfileImage")
ProfileName = m.top.findNode("ProfileName")
profileImage = m.top.findNode("profileImage")
profileName = m.top.findNode("profileName")
if ItemData.ImageURL = "" then
ProfileImage.uri = "pkg://images/baseline_person_white_48dp.png"
if itemData.imageURL = "" then
profileImage.uri = "pkg://images/baseline_person_white_48dp.png"
else
ProfileImage.uri = ItemData.ImageURL
profileImage.uri = itemData.imageURL
end if
ProfileName.text = ItemData.Name
profileName.text = itemData.name
end sub

View File

@ -2,12 +2,12 @@
<component name="UserItem" extends="Group">
<children>
<LayoutGroup layoutDirection="vert">
<Poster id="ProfileImage" width="300" height="300" />
<Label id="ProfileName" horizAlign="center" vertAlign="center" font="font:SmallBoldSystemFont" color="#EBEBEB" height="64" width="300" />
<Poster id="profileImage" width="300" height="300" />
<Label id="profileName" horizAlign="center" vertAlign="center" font="font:SmallBoldSystemFont" color="#EBEBEB" height="64" width="300" />
</LayoutGroup>
</children>
<interface>
<field id="ItemContent" type="node" onChange="ItemContentChanged" />
<field id="itemContent" type="node" onChange="itemContentChanged" />
</interface>
<script type="text/brightscript" uri="UserItem.brs" />
</component>

View File

@ -3,11 +3,11 @@ sub init()
m.top.content = SetData()
m.top.observeField("itemSelected", "SetUser")
m.top.showRowLabel = [false]
UpdateSize()
updateSize()
m.top.setFocus(true)
end sub
sub UpdateSize()
sub updateSize()
dimensions = m.top.getScene().currentDesignResolution
border = 200
@ -31,25 +31,25 @@ sub UpdateSize()
end sub
function SetData()
if m.top.ItemContent = invalid then
function setData()
if m.top.itemContent = invalid then
data = CreateObject("roSGNode", "ContentNode")
return data
end if
UserData = m.top.ItemContent
userData = m.top.itemContent
data = CreateObject("roSGNode", "ContentNode")
row = data.CreateChild("ContentNode")
for each item in UserData
for each item in userData
row.appendChild(item)
end for
m.top.content = data
UpdateSize()
updateSize()
return data
end function
sub SetUser()
m.top.UserSelected = m.top.ItemContent[m.top.rowItemFocused[1]].Name
sub setUser()
m.top.userSelected = m.top.itemContent[m.top.rowItemFocused[1]].Name
end sub
function onKeyEvent(key as string, press as boolean) as boolean

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="UserRow" extends="RowList">
<interface>
<field id="UserSelected" type="string" alwaysNotify="true" />
<field id="ItemContent" type="array" onChange="SetData" />
<field id="userSelected" type="string" alwaysNotify="true" />
<field id="itemContent" type="array" onChange="setData" />
</interface>
<script type="text/brightscript" uri="UserRow.brs"/>
</component>

View File

@ -1,23 +1,23 @@
sub init()
end sub
sub ItemContentChanged()
m.top.findNode("UserRow").ItemContent = m.top.ItemContent
Redraw()
sub iItemContentChanged()
m.top.findNode("UserRow").ItemContent = m.top.itemContent
redraw()
end sub
sub Redraw()
UserCount = m.top.ItemContent.Count()
TopBorder = 360
LeftBorder= 130
ItemWidth = 300
ItemSpacing = 40
sub redraw()
userCount = m.top.itemContent.Count()
topBorder = 360
leftBorder= 130
itemWidth = 300
itemSpacing = 40
if UserCount < 5 then
LeftBorder = (1920 - ((UserCount * ItemWidth) + ((UserCount - 1) * ItemSpacing))) / 2
if userCount < 5 then
leftBorder = (1920 - ((userCount * itemWidth) + ((userCount - 1) * itemSpacing))) / 2
end if
' break()
m.top.findNode("UserRow").translation = [LeftBorder, TopBorder]
m.top.findNode("UserRow").translation = [leftBorder, topBorder]
end sub
function onKeyEvent(key as string, press as boolean) as boolean
@ -32,7 +32,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
else if key = "down" then
if m.top.focusedChild.isSubType("UserRow") then
m.top.findNode("AlternateOptions").setFocus(true)
m.top.findNode("alternateOptions").setFocus(true)
return true
end if
end if

View File

@ -2,8 +2,8 @@
<component name="UserSelect" extends="JFGroup">
<children>
<Label text="Please sign in" horizAlign="center" font="font:LargeSystemFont" height="100" width="1920" translation="[0, 200]" />
<UserRow id="UserRow" translation="[130, 360]" />
<LabelList id="AlternateOptions" vertFocusAnimationStyle="floatingFocus" textHorizAlign="center" translation="[400,850]" itemSize="[1120,60]" itemSpacing="[0,20]" focusedColor="#EBEBEB" focusBitmapBlendColor="#00a4dcFF" focusFootprintBlendColor="#303030">
<UserRow id="userRow" translation="[130, 360]" />
<LabelList id="alternateOptions" vertFocusAnimationStyle="floatingFocus" textHorizAlign="center" translation="[400,850]" itemSize="[1120,60]" itemSpacing="[0,20]" focusedColor="#EBEBEB" focusBitmapBlendColor="#00a4dcFF" focusFootprintBlendColor="#303030">
<ContentNode id="alternate" role="content">
<ContentNode title="Manual Login" />
<!-- <ContentNode title="Forgot Password" /> -->
@ -11,8 +11,8 @@
</LabelList>
</children>
<interface>
<field id="ItemSelected" type="string" alwaysNotify="true" />
<field id="ItemContent" type="array" onChange="ItemContentChanged"/>
<field id="itemSelected" type="string" alwaysNotify="true" />
<field id="itemContent" type="array" onChange="itemContentChanged"/>
</interface>
<script type="text/brightscript" uri="UserSelect.brs" />
</component>

View File

@ -362,16 +362,16 @@ sub Main()
end sub
function LoginFlow(StartOver = false as boolean)
function LoginFlow(startOver = false as boolean)
if m.scene <> invalid then
m.scene.unobserveField("backPressed")
end if
'Collect Jellyfin server and user information
start_login:
if get_setting("server") = invalid or ServerInfo() = invalid or StartOver = true then
if get_setting("server") = invalid or ServerInfo() = invalid or startOver = true then
print "Get server details"
ServerSelection = CreateServerGroup()
if ServerSelection = "backPressed" then
serverSelection = CreateServerGroup()
if serverSelection = "backPressed" then
print "backPressed"
wipe_groups()
return false
@ -379,19 +379,19 @@ function LoginFlow(StartOver = false as boolean)
end if
if get_setting("active_user") = invalid then
PublicUsers = GetPublicUsers()
if PublicUsers.count() then
PublicUsersNodes = []
for each item in PublicUsers
publicUsers = GetPublicUsers()
if publicUsers.count() then
publicUsersNodes = []
for each item in publicUsers
user = CreateObject("roSGNode", "PublicUserData")
user.id = item.Id
user.Name = item.Name
user.name = item.Name
if item.PrimaryImageTag <> invalid then
user.ImageURL = UserImageURL(user.id, { "tag": item.PrimaryImageTag })
end if
PublicUsersNodes.push(user)
publicUsersNodes.push(user)
end for
user = CreateUserSelectGroup(PublicUsersNodes)
user = CreateUserSelectGroup(publicUsersNodes)
m.scene.focusedChild.visible = false
if user = "backPressed" then
return LoginFlow(true)
@ -404,8 +404,8 @@ function LoginFlow(StartOver = false as boolean)
end if
end if
end if
PasswordEntry = CreateSigninGroup(user)
if PasswordEntry = "backPressed" then
passwordEntry = CreateSigninGroup(user)
if passwordEntry = "backPressed" then
m.scene.focusedChild.visible = false
return LoginFlow(true)
end if

View File

@ -33,10 +33,10 @@ function CreateServerGroup()
node = msg.getNode()
if node = "submit"
'Append default ports
MaxSlashes = 0
if left(server_hostname.value,8) = "https://" or left(server_hostname.value,7) = "http://" then MaxSlashes = 2
'Check to make sure entry has no extra slashes before adding default ports.
if Instr(0, server_hostname.value, "/") = MaxSlashes then
maxSlashes = 0
if left(server_hostname.value,8) = "https://" or left(server_hostname.value,7) = "http://" then maxSlashes = 2
'Check to make sure entry has no extra slashes before adding default ports.
if Instr(0, server_hostname.value, "/") = maxSlashes then
if server_hostname.value.len() > 5 and mid(server_hostname.value, server_hostname.value.len()-4,1) <> ":" and mid(server_hostname.value, server_hostname.value.len()-5,1) <> ":" then
if left(server_hostname.value ,5) = "https" then
server_hostname.value = server_hostname.value + ":8920"
@ -74,9 +74,9 @@ function CreateUserSelectGroup(users = [])
m.scene.appendChild(group)
port = CreateObject("roMessagePort")
group.ItemContent = users
group.findNode("UserRow").observeField("UserSelected", port)
group.findNode("AlternateOptions").observeField("itemSelected", port)
group.itemContent = users
group.findNode("userRow").observeField("userSelected", port)
group.findNode("alternateOptions").observeField("itemSelected", port)
group.observeField("backPressed", port)
while(true)
msg = wait(0, port)
@ -85,7 +85,7 @@ function CreateUserSelectGroup(users = [])
return -1
else if isNodeEvent(msg, "backPressed")
return "backPressed"
else if type(msg) = "roSGNodeEvent" and msg.getField() = "UserSelected"
else if type(msg) = "roSGNodeEvent" and msg.getField() = "userSelected"
return msg.GetData()
else if type(msg) = "roSGNodeEvent" and msg.getField() = "itemSelected"
if msg.getData() = 0 then