-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor some content node stuff, and add an auth popup dialog
- Loading branch information
Showing
25 changed files
with
203 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<component name="ActionContentNode" extends="ContentNode"> | ||
<interface> | ||
<field id="type" type="string" value="action" /> | ||
<field id="action" type="string" /> | ||
</interface> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<component name="LoadingContentNode" extends="ContentNode"> | ||
<interface> | ||
<field id="isPlaceHolder" type="boolean" value="true" /> | ||
<field id="type" type="string" value="loading" /> | ||
</interface> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import "pkg:/source/utils/Types.bs" | ||
import "pkg:/source/asyncTask/asyncTask.bs" | ||
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs" | ||
import "pkg:/source/utils/StringUtils.bs" | ||
|
||
function Init() | ||
m.urlLabel = m.top.findNode("urlLabel") | ||
m.qrCode = m.top.findNode("QrCodePoster") | ||
|
||
m.top.width = "920" | ||
m.top.observeFieldScoped("buttonSelected", FuncName(Close)) | ||
end function | ||
|
||
function OnNodeReady() | ||
address = m.webserver@.GetServerAddress(invalid) | ||
isValidIp = not StringUtils.IsNullOrEmpty(address) | ||
if isValidIp | ||
m.top.url = `${address}/invidious/login` | ||
else | ||
m.urlLabel.text = "No IP address found" | ||
end if | ||
|
||
m.invidious.observeFieldScoped("authToken", FuncName(OnAuthTokenChange)) | ||
end function | ||
|
||
function Close() | ||
m.top.close = true | ||
end function | ||
|
||
function OnUrlSet() | ||
url = m.top.url | ||
|
||
m.urlLabel.text = url | ||
StartAsyncTask(GenerateQrCodeTask, { qrPoster: m.qrCode, text: url }) | ||
end function | ||
|
||
function OnAuthTokenChange() | ||
Close() | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<component name="LoginDialog" extends="StandardDialog" initialFocus="buttonArea" includes="AutoBind"> | ||
<interface> | ||
<field id="webServer" type="node" bind="/WebServer" /> | ||
<field id="invidious" type="node" bind="/Invidious" /> | ||
<field id="url" type="string" onChange="OnUrlSet" /> | ||
</interface> | ||
<children> | ||
<StdDlgTitleArea primaryTitle="Login to Invidious" /> | ||
<StdDlgContentArea> | ||
<StdDlgTextItem | ||
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." /> | ||
</StdDlgContentArea> | ||
<StdDlgButtonArea id="buttonArea"> | ||
<StdDlgButton text="OK" /> | ||
</StdDlgButtonArea> | ||
<StdDlgSideCardArea | ||
id="sideCarArea" | ||
horizAlign="right" | ||
width="400" | ||
extendToDialogEdge="false" | ||
showDivider="true"> | ||
<Label | ||
text="Scan the QR Code" | ||
horizAlign="center" | ||
wrap="true" width="400"> | ||
<Font role="font" uri="font:SystemFontFile" size="24" /> | ||
</Label> | ||
<QRPoster | ||
id='QrCodePoster' | ||
loadWidth='300' | ||
loadHeight='300' | ||
loadPadding='10' | ||
translation="[50, 50]" /> | ||
<Label | ||
id="urlLabel" | ||
horizAlign="center" | ||
width="400" | ||
translation="[0, 380]"> | ||
<Font role="font" uri="font:BoldSystemFontFile" size="18" /> | ||
</Label> | ||
</StdDlgSideCardArea> | ||
</children> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
playlet-lib/src/components/VideoFeed/VideoRowCell/ActionRowCell.bs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Init() | ||
m.label = m.top.findNode("label") | ||
end function | ||
|
||
function OnContentSet() as void | ||
content = m.top.itemContent | ||
|
||
if content = invalid | ||
return | ||
end if | ||
|
||
m.label.text = content.title | ||
end function |
19 changes: 19 additions & 0 deletions
19
playlet-lib/src/components/VideoFeed/VideoRowCell/ActionRowCell.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<component name="ActionRowCell" extends="Group"> | ||
<interface> | ||
<field id="itemContent" type="node" onChange="OnContentSet" /> | ||
<field id="type" type="string" value="action" /> | ||
</interface> | ||
<children> | ||
<Label | ||
id="label" | ||
width="310" | ||
height="196" | ||
horizAlign="center" | ||
vertAlign="center" | ||
translation="[20,0]" | ||
wrap="true" | ||
font="font:LargeBoldSystemFont" /> | ||
</children> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.