Browser based potokens

This commit is contained in:
Brahim Hadriche committed 2026-06-26 13:06:51 -04:00
1 parent 5e798f19de
commit 63f9ac693a
27 files changed
+722 -499

No files matched your search

@@ -0,0 +1,30 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Services/Innertube/PoTokens.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
function Init()
m.top.focusable = true
m.top.itemSpacings = [8]
m.button = m.top.findNode("Button")
m.button.observeField("buttonSelected", FuncName(OnButtonSelected))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.button, true)
end function
function BindPreference(_preferences as object, _key as string)
' Do nothing
end function
function OnButtonSelected()
Innertube.PoTokens.ClearAllPoTokens()
DialogUtils.ShowDialogEx({
message: Tr(Locale.Settings.PoTokensCleared)
title: Tr(Locale.Generic.Success)
})
end function
@@ -0,0 +1,19 @@
<component name="ClearPoTokensControl" extends="LayoutGroup" includes="Focus">
<interface>
<field id="displayText" type="string" alias="Button.text" />
<field id="description" type="string" alias="DescriptionLabel.text" />
<function name="BindPreference" />
</interface>
<children>
<Button
id="Button"
minWidth="340"
showFocusFootprint="true" />
<Label id="DescriptionLabel"
width="450"
color="0xb4b4b4ff"
wrap="true">
<Font role="font" uri="font:SystemFontFile" size="18" />
</Label>
</children>
</component>