Add option to have Remember Me chedked by default

pull/190/head
Rob Loach 2024-02-06 18:01:41 -05:00
rodzic 2a44c5973d
commit 8fac02c243
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 627C60834A74A21A
5 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -171,6 +171,8 @@ The password argument is optional if `STATICRYPT_PASSWORD` is set in the environ
[string] [default: "Password"]
--template-remember Label to use for the "Remember me" checkbox.
[string] [default: "Remember me"]
--template-remember-checked Makes the "Remember me" checkbox checked by default.
[string] [default: "Remember me"]
--template-title Title for the output HTML page.
[string] [default: "Protected Page"]

Wyświetl plik

@ -472,6 +472,11 @@ function parseCommandLineArguments() {
describe: 'Label to use for the "Remember me" checkbox.',
default: "Remember me",
})
.option("template-remember-checked", {
type: "boolean",
describe: 'Label to use for the "Remember me" checkbox.',
default: false,
})
.option("template-title", {
type: "string",
describe: "Title for the output HTML page.",

Wyświetl plik

@ -137,6 +137,7 @@ async function runStatiCrypt() {
template_instructions: namedArgs.templateInstructions,
template_placeholder: namedArgs.templatePlaceholder,
template_remember: namedArgs.templateRemember,
template_remember_checked: namedArgs.templateRememberChecked ? "checked" : "",
template_title: namedArgs.templateTitle,
template_color_primary: namedArgs.templateColorPrimary,
template_color_secondary: namedArgs.templateColorSecondary,

Wyświetl plik

@ -170,7 +170,7 @@
/>
<label id="staticrypt-remember-label" class="staticrypt-remember hidden">
<input id="staticrypt-remember" type="checkbox" name="remember" />
<input id="staticrypt-remember" type="checkbox" name="remember" /*[|template_remember_checked|]*/0 />
/*[|template_remember|]*/0
</label>

Wyświetl plik

@ -11,5 +11,6 @@ node ../cli/index.js example.html \
--short \
--salt b93bbaf35459951c47721d1f3eaeb5b9 \
--config false \
--template-instructions "Enter \"test\" to unlock the page"
--template-instructions "Enter \"test\" to unlock the page" \
--template-remember-checked