Announcements - do not show again
This commit is contained in:
1 parent
fbac4ab959
commit
ec941d64dc
10 files changed
+99
-3
No files matched your search
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Ability to hide annoucement messages
|
||||||
|
|
||||||
## [0.35.4] - 2025-01-07
|
## [0.35.4] - 2025-01-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+2
-1
@@ -65,6 +65,7 @@
|
|||||||
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject @sveltejs/vite-plugin-svelte,svelte,vite,@vitejs/plugin-legacy",
|
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject @sveltejs/vite-plugin-svelte,svelte,vite,@vitejs/plugin-legacy",
|
||||||
"registry:write": "node tools/registry.js --input registry.json",
|
"registry:write": "node tools/registry.js --input registry.json",
|
||||||
"registry:read": "node tools/registry.js --output registry.json",
|
"registry:read": "node tools/registry.js --output registry.json",
|
||||||
"registry:clear": "node tools/registry.js --clear"
|
"registry:clear": "node tools/registry.js --clear",
|
||||||
|
"restart-app": "node tools/restart-app.js --app-id dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
import "pkg:/source/utils/Locale.bs"
|
import "pkg:/source/utils/Locale.bs"
|
||||||
|
import "pkg:/source/utils/RegistryUtils.bs"
|
||||||
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
namespace DialogUtils
|
namespace DialogUtils
|
||||||
@@ -91,4 +93,58 @@ namespace DialogUtils
|
|||||||
return dialog
|
return dialog
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ShowDialogOnce(options as object) as object
|
||||||
|
messageId = ValidString(options.messageId)
|
||||||
|
hasMessageId = messageId <> ""
|
||||||
|
|
||||||
|
if hasMessageId
|
||||||
|
messages = RegistryUtils.Read(RegistryUtils.MESSAGES)
|
||||||
|
if not StringUtils.IsNullOrEmpty(messages)
|
||||||
|
messages = ParseJson(messages)
|
||||||
|
if IsAssociativeArray(messages)
|
||||||
|
savedMessageId = ValidString(messages["messageId"])
|
||||||
|
if savedMessageId = messageId
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
options.buttons = [
|
||||||
|
Tr(Locale.Buttons.OK)
|
||||||
|
`${Tr(Locale.Buttons.OK)} - ${Tr(Locale.Buttons.DotNotShowAgain)}`
|
||||||
|
]
|
||||||
|
|
||||||
|
dialog = ShowDialogEx(options)
|
||||||
|
if dialog = invalid
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
dialog.AddFields({
|
||||||
|
"messageId": messageId
|
||||||
|
})
|
||||||
|
|
||||||
|
dialog.ObserveField("buttonSelected", FuncName(OnShowDialogOnceButtonSelected))
|
||||||
|
return dialog
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnShowDialogOnceButtonSelected(event as object) as void
|
||||||
|
buttonSelected = event.getData()
|
||||||
|
if buttonSelected <> 1
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
dialog = event.GetRoSGNode()
|
||||||
|
messageId = dialog.messageId
|
||||||
|
if messageId = ""
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
messages = {
|
||||||
|
"messageId": messageId
|
||||||
|
}
|
||||||
|
|
||||||
|
RegistryUtils.Write(RegistryUtils.MESSAGES, FormatJson(messages))
|
||||||
|
end function
|
||||||
|
|
||||||
end namespace
|
end namespace
|
||||||
@@ -35,7 +35,8 @@ function StartWebServer()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function ShowAnnouncement()
|
function ShowAnnouncement()
|
||||||
DialogUtils.ShowDialogEx({
|
DialogUtils.ShowDialogOnce({
|
||||||
|
messageId: "1736288537"
|
||||||
title: "Announcement - Playlet backend"
|
title: "Announcement - Playlet backend"
|
||||||
message: [
|
message: [
|
||||||
"An experimental built-in backend has been added to Playlet."
|
"An experimental built-in backend has been added to Playlet."
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ function StartWebServer()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function ShowAnnouncement()
|
function ShowAnnouncement()
|
||||||
DialogUtils_ShowDialogEx({
|
DialogUtils_ShowDialogOnce({
|
||||||
|
messageId: "1736288537"
|
||||||
title: "Announcement - Playlet backend"
|
title: "Announcement - Playlet backend"
|
||||||
message: [
|
message: [
|
||||||
"An experimental built-in backend has been added to Playlet."
|
"An experimental built-in backend has been added to Playlet."
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/utils/RegistryUtils.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||||
<children>
|
<children>
|
||||||
<Logger id="Logger" />
|
<Logger id="Logger" />
|
||||||
|
|||||||
@@ -36,6 +36,10 @@
|
|||||||
<source>OK</source>
|
<source>OK</source>
|
||||||
<translation>OK</translation>
|
<translation>OK</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Do not show again</source>
|
||||||
|
<translation>Do not show again</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Activate</source>
|
<source>Activate</source>
|
||||||
<translation>Activate</translation>
|
<translation>Activate</translation>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Locale
|
|||||||
@locale
|
@locale
|
||||||
enum Buttons
|
enum Buttons
|
||||||
OK = "OK"
|
OK = "OK"
|
||||||
|
DotNotShowAgain = "Do not show again"
|
||||||
Activate = "Activate"
|
Activate = "Activate"
|
||||||
InUse = "In Use"
|
InUse = "In Use"
|
||||||
Login = "Login"
|
Login = "Login"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace RegistryUtils
|
|||||||
const SEARCH_HISTORY = "search_history"
|
const SEARCH_HISTORY = "search_history"
|
||||||
const PLAYLET_LIB_URLS = "playlet_lib_urls"
|
const PLAYLET_LIB_URLS = "playlet_lib_urls"
|
||||||
const BOOKMARKS = "bookmarks"
|
const BOOKMARKS = "bookmarks"
|
||||||
|
const MESSAGES = "messages"
|
||||||
|
|
||||||
const LAST_LOUNGE_DATA = "last_lounge_data"
|
const LAST_LOUNGE_DATA = "last_lounge_data"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Restarts the Roku app
|
||||||
|
|
||||||
|
const { ArgumentParser } = require('argparse');
|
||||||
|
const getEnvVars = require('./get-env-vars');
|
||||||
|
|
||||||
|
const config = getEnvVars(['ROKU_DEV_TARGET']);
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const parser = new ArgumentParser({
|
||||||
|
description: 'Restart Roku app using ECP'
|
||||||
|
});
|
||||||
|
|
||||||
|
parser.add_argument('--app-id', { help: 'App Id' });
|
||||||
|
|
||||||
|
const args = parser.parse_args();
|
||||||
|
const appId = args.app_id
|
||||||
|
|
||||||
|
const url = `http://${config.ROKU_DEV_TARGET}:8060/launch/${appId}?restart=true`;
|
||||||
|
console.log("Restarting app", appId);
|
||||||
|
await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
body: '',
|
||||||
|
});
|
||||||
|
})();
|
||||||
Reference in new issue
Block a user