1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-14 14:20:11 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
7caa5c5d57
lang: fix the usual on slovenian
someone directly translated "English (US)" again. Why?
2023-06-23 13:49:19 +01:00
65c2722a20
font: switch to hanken grotesk
thought it looked quite nice License included in about section.
2023-06-23 13:45:04 +01:00
6b3fc3d492
lang: correct language names
Low German/Saxon (NDS) is empty entirely, which caused discord lang
registration to error, so i've just filled in the name. Somebody
directly translated "English (US)" into italian instead of putting
Italian in italian, corrected that. Use some common sense!
2023-06-23 13:09:26 +01:00
fec9776def
build: fix up goreleaser
removed deprecated options, fixed to work with new user page.
2023-06-23 13:00:46 +01:00
bfeab3648c
form: change contact-via radios to checks 2023-06-23 12:30:52 +01:00
c0f2409fcc
readme/site: make project status message less pessimistic
I think my current activity on the project justifies the change.
2023-06-23 12:20:18 +01:00
29 changed files with 271 additions and 125 deletions

View File

@ -85,7 +85,7 @@ steps:
commands: commands:
- curl -sL https://git.io/goreleaser > goreleaser - curl -sL https://git.io/goreleaser > goreleaser
- chmod +x goreleaser - chmod +x goreleaser
- ./scripts/version.sh ./goreleaser --snapshot --skip-publish --rm-dist - ./scripts/version.sh ./goreleaser --snapshot --skip-publish --clean
- wget https://builds.hrfee.pw/upload.py - wget https://builds.hrfee.pw/upload.py
- pip3 install requests - pip3 install requests
- bash -c 'sftp -i /id_rsa2 -o StrictHostKeyChecking=no root@161.97.102.153:/mnt/redoc <<< $"put docs/swagger.json jfa-go.json"' - bash -c 'sftp -i /id_rsa2 -o StrictHostKeyChecking=no root@161.97.102.153:/mnt/redoc <<< $"put docs/swagger.json jfa-go.json"'
@ -163,7 +163,7 @@ steps:
commands: commands:
- curl -sL https://git.io/goreleaser > goreleaser - curl -sL https://git.io/goreleaser > goreleaser
- chmod +x goreleaser - chmod +x goreleaser
- ./scripts/version.sh ./goreleaser --snapshot --skip-publish --rm-dist - ./scripts/version.sh ./goreleaser --snapshot --skip-publish --clean
trigger: trigger:
event: event:

View File

@ -8,11 +8,10 @@ before:
hooks: hooks:
- go mod download - go mod download
- rm -rf data/web - rm -rf data/web
- mkdir -p data - mkdir -p data/web/css
- cp -r static data/web - bash -c 'cp -r static/* data/web/'
- npm install - npm install
- npm install esbuild - npm install esbuild
- mkdir -p data/web/css
- cp node_modules/remixicon/fonts/remixicon.css node_modules/remixicon/fonts/remixicon.woff2 data/web/css/ - cp node_modules/remixicon/fonts/remixicon.css node_modules/remixicon/fonts/remixicon.woff2 data/web/css/
- cp -r html data/ - cp -r html data/
- node scripts/missing-colors.js html data/html - node scripts/missing-colors.js html data/html
@ -26,11 +25,13 @@ before:
- cp -r ts tempts - cp -r ts tempts
- scripts/dark-variant.sh tempts - scripts/dark-variant.sh tempts
- scripts/dark-variant.sh tempts/modules - scripts/dark-variant.sh tempts/modules
- npx esbuild --target=es6 --format=esm --bundle tempts/admin.ts --outfile=./data/web/js/admin.js --minify - mkdir -p data/web/js
- npx esbuild --target=es6 --format=esm --bundle tempts/pwr.ts --outfile=./data/web/js/pwr.js --minify - npx esbuild --target=es6 --bundle tempts/admin.ts --outfile=./data/web/js/admin.js --minify
- npx esbuild --target=es6 --format=esm --bundle tempts/form.ts --outfile=./data/web/js/form.js --minify - npx esbuild --target=es6 --bundle tempts/user.ts --outfile=./data/web/js/user.js --minify
- npx esbuild --target=es6 --format=esm --bundle tempts/setup.ts --outfile=./data/web/js/setup.js --minify - npx esbuild --target=es6 --bundle tempts/pwr.ts --outfile=./data/web/js/pwr.js --minify
- npx esbuild --target=es6 --format=esm --bundle tempts/crash.ts --outfile=./data/crash.js --minify - npx esbuild --target=es6 --bundle tempts/form.ts --outfile=./data/web/js/form.js --minify
- npx esbuild --target=es6 --bundle tempts/setup.ts --outfile=./data/web/js/setup.js --minify
- npx esbuild --target=es6 --bundle tempts/crash.ts --outfile=./data/crash.js --minify
- rm -r tempts - rm -r tempts
- npx esbuild --bundle css/base.css --outfile=./data/web/css/bundle.css --external:remixicon.css --minify - npx esbuild --bundle css/base.css --outfile=./data/web/css/bundle.css --external:remixicon.css --minify
- cp html/crash.html data/ - cp html/crash.html data/
@ -87,32 +88,32 @@ archives:
builds: builds:
- windows-tray - windows-tray
format: zip format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_TrayIcon_{{ .Os }}_{{ .Arch }}" name_template: >-
replacements: {{ .ProjectName }}_{{ .Version }}_TrayIcon_
darwin: macOS {{- if eq .Os "darwin" }}macOS
linux: Linux {{- else }}{{- title .Os }}{{ end }}_
windows: Windows {{- if eq .Arch "amd64" }}x86_64
amd64: x86_64 {{- else }}{{ .Arch }}{{ end }}
- id: linux-tray - id: linux-tray
builds: builds:
- linux-tray - linux-tray
format: zip format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_TrayIcon_{{ .Os }}_{{ .Arch }}" name_template: >-
replacements: {{ .ProjectName }}_{{ .Version }}_TrayIcon_
darwin: macOS {{- if eq .Os "darwin" }}macOS
linux: Linux {{- else }}{{- title .Os }}{{ end }}_
windows: Windows {{- if eq .Arch "amd64" }}x86_64
amd64: x86_64 {{- else }}{{ .Arch }}{{ end }}
- id: notray - id: notray
builds: builds:
- notray - notray
format: zip format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" name_template: >-
replacements: {{ .ProjectName }}_{{ .Version }}_
darwin: macOS {{- if eq .Os "darwin" }}macOS
linux: Linux {{- else }}{{- title .Os }}{{ end }}_
windows: Windows {{- if eq .Arch "amd64" }}x86_64
amd64: x86_64 {{- else }}{{ .Arch }}{{ end }}
checksum: checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
snapshot: snapshot:
@ -167,10 +168,10 @@ nfpms:
replaces: replaces:
- jfa-go - jfa-go
dependencies: dependencies:
- libappindicator3-1 - libayatana-appindicator
rpm: rpm:
dependencies: dependencies:
- libappindicator-gtk3 - libappindicator-gtk3
apk: apk:
dependencies: dependencies:
- libappindicator - libayatana-appindicator

View File

@ -130,7 +130,7 @@ bundle-css:
$(info copying fonts) $(info copying fonts)
cp -r node_modules/remixicon/fonts/remixicon.css node_modules/remixicon/fonts/remixicon.woff2 $(DATA)/web/css/ cp -r node_modules/remixicon/fonts/remixicon.css node_modules/remixicon/fonts/remixicon.woff2 $(DATA)/web/css/
$(info bundling css) $(info bundling css)
$(ESBUILD) --bundle css/base.css --outfile=$(DATA)/web/css/bundle.css --external:remixicon.css --minify $(ESBUILD) --bundle css/base.css --outfile=$(DATA)/web/css/bundle.css --external:remixicon.css --external:../fonts/hanken* --minify
npx tailwindcss -i $(DATA)/web/css/bundle.css -o $(DATA)/web/css/bundle.css $(TAILWIND) npx tailwindcss -i $(DATA)/web/css/bundle.css -o $(DATA)/web/css/bundle.css $(TAILWIND)
# npx postcss -o $(DATA)/web/css/bundle.css $(DATA)/web/css/bundle.css # npx postcss -o $(DATA)/web/css/bundle.css $(DATA)/web/css/bundle.css

View File

@ -9,15 +9,14 @@
##### [docker](#docker) | [debian/ubuntu](#debian) | [arch (aur)](#aur) | [other platforms](#other-platforms) ##### [docker](#docker) | [debian/ubuntu](#debian) | [arch (aur)](#aur) | [other platforms](#other-platforms)
--- ---
## Project Status: Active-ish
Studies mean I can't work on this project a lot outside of breaks, however I hope i'll be able to fit in general support and things like bug fixes into my time. New features and such will likely come in short bursts throughout the year (if they do at all).
## Project Status #### Does/Will it still work?
Due to studies and general lack of enthusiasm for work on this project, new features are unlikely, and while occasionally I might fix a bug or two, I won't be supporting the project a lot. jfa-go currently works on Jellyfin 10.8.9, the latest version. I should be able to maintain compatability in the future, unless any big changes occur.
#### Does it still work?
jfa-go still appears to work on the latest version of Jellyfin (10.8.9), and unless any large architectural changes occur to it, functionality should still remain.
#### Alternatives #### Alternatives
None of these have been tested by myself, but I have seen them mentioned quite frequently. If you want a bit more of a guarantee of support, I've seen these projects mentioned although haven't tried them myself.
* [Wizarr](https://github.com/Wizarrrr/wizarr) focuses on invites, and also includes some Discord & Ombi integration. * [Wizarr](https://github.com/Wizarrrr/wizarr) focuses on invites, and also includes some Discord & Ombi integration.
* [Jellyseerr](https://github.com/Fallenbagel/jellyseerr) is a fork of Overseerr, which can manage users and mainly acts as an Ombi alternative. * [Jellyseerr](https://github.com/Fallenbagel/jellyseerr) is a fork of Overseerr, which can manage users and mainly acts as an Ombi alternative.

View File

@ -3,6 +3,7 @@
@import "./dark.css"; @import "./dark.css";
@import "./tooltip.css"; @import "./tooltip.css";
@import "./loader.css"; @import "./loader.css";
@import "./fonts.css";
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@ -13,8 +14,7 @@
--border-width-2: 3px; --border-width-2: 3px;
--border-width-4: 5px; --border-width-4: 5px;
--border-width-8: 8px; --border-width-8: 8px;
font-family: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
} }
.light { .light {

44
css/fonts.css Normal file
View File

@ -0,0 +1,44 @@
/* hanken-grotesk-regular - cyrillic-ext_latin_vietnamese */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Hanken Grotesk';
font-style: normal;
font-weight: 400;
src: url('../fonts/hanken-grotesk-v8-cyrillic-ext_latin_vietnamese-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* hanken-grotesk-500 - cyrillic-ext_latin_vietnamese */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Hanken Grotesk';
font-style: normal;
font-weight: 500;
src: url('../fonts/hanken-grotesk-v8-cyrillic-ext_latin_vietnamese-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* hanken-grotesk-500italic - cyrillic-ext_latin_vietnamese */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Hanken Grotesk';
font-style: italic;
font-weight: 500;
src: url('../fonts/hanken-grotesk-v8-cyrillic-ext_latin_vietnamese-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ *
}
/* hanken-grotesk-700 - cyrillic-ext_latin_vietnamese */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Hanken Grotesk';
font-style: normal;
font-weight: 700;
src: url('../fonts/hanken-grotesk-v8-cyrillic-ext_latin_vietnamese-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* hanken-grotesk-700italic - cyrillic-ext_latin_vietnamese */
@font-face {
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
font-family: 'Hanken Grotesk';
font-style: italic;
font-weight: 700;
src: url('../fonts/hanken-grotesk-v8-cyrillic-ext_latin_vietnamese-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

View File

@ -342,6 +342,7 @@ func (d *DiscordDaemon) registerCommands() {
commands[1].Options[0].Choices = make([]*dg.ApplicationCommandOptionChoice, len(d.app.storage.lang.Telegram)) commands[1].Options[0].Choices = make([]*dg.ApplicationCommandOptionChoice, len(d.app.storage.lang.Telegram))
i := 0 i := 0
for code := range d.app.storage.lang.Telegram { for code := range d.app.storage.lang.Telegram {
d.app.debug.Printf("Registering choice \"%s\":\"%s\"\n", d.app.storage.lang.Telegram[code].Meta.Name, code)
commands[1].Options[0].Choices[i] = &dg.ApplicationCommandOptionChoice{ commands[1].Options[0].Choices[i] = &dg.ApplicationCommandOptionChoice{
Name: d.app.storage.lang.Telegram[code].Meta.Name, Name: d.app.storage.lang.Telegram[code].Meta.Name,
Value: code, Value: code,

View File

@ -60,7 +60,7 @@
</div> </div>
<a class="button ~urge mt-4 mb-4 @low discord lang-link" href="https://discord.com/invite/MrtvuQmyhP" target="_blank"><i class="ri-discord-line mr-2"></i>discord</a> <a class="button ~urge mt-4 mb-4 @low discord lang-link" href="https://discord.com/invite/MrtvuQmyhP" target="_blank"><i class="ri-discord-line mr-2"></i>discord</a>
</div> </div>
<p><a href="https://github.com/hrfee/jfa-go/blob/main/LICENSE">Available under the MIT License.</a></p> <p><a href="https://github.com/hrfee/jfa-go/blob/main/LICENSE">Available under the MIT License. Font "Hanken Grotesk" available under SIL OFL 1.1 License.</a></p>
<pre class="font-mono bg-inherit">{{ .license }}</pre> <pre class="font-mono bg-inherit">{{ .license }}</pre>
</div> </div>
</div> </div>

View File

@ -85,21 +85,21 @@
{{ if or (.telegramEnabled) (or .discordEnabled .matrixEnabled) }} {{ if or (.telegramEnabled) (or .discordEnabled .matrixEnabled) }}
<div id="contact-via" class="unfocused"> <div id="contact-via" class="unfocused">
<label class="row switch pb-4 unfocused"> <label class="row switch pb-4 unfocused">
<input type="radio" name="contact-via" value="email" id="contact-via-email" class="mr-2"><span>Contact through Email</span> <input type="checkbox" name="contact-via" value="email" id="contact-via-email" class="mr-2"><span>Contact through Email</span>
</label> </label>
{{ if .telegramEnabled }} {{ if .telegramEnabled }}
<label class="row switch pb-4 unfocused"> <label class="row switch pb-4 unfocused">
<input type="radio" name="contact-via" value="telegram" id="contact-via-telegram" class="mr-2"><span>Contact through Telegram</span> <input type="checkbox" name="contact-via" value="telegram" id="contact-via-telegram" class="mr-2"><span>Contact through Telegram</span>
</label> </label>
{{ end }} {{ end }}
{{ if .discordEnabled }} {{ if .discordEnabled }}
<label class="row switch pb-4 unfocused"> <label class="row switch pb-4 unfocused">
<input type="radio" name="contact-via" value="discord" id="contact-via-discord" class="mr-2"><span>Contact through Discord</span> <input type="checkbox" name="contact-via" value="discord" id="contact-via-discord" class="mr-2"><span>Contact through Discord</span>
</label> </label>
{{ end }} {{ end }}
{{ if .matrixEnabled }} {{ if .matrixEnabled }}
<label class="row switch pb-4 unfocused"> <label class="row switch pb-4 unfocused">
<input type="radio" name="contact-via" value="matrix" id="contact-via-matrix" class="mr-2"><span>Contact through Matrix</span> <input type="checkbox" name="contact-via" value="matrix" id="contact-via-matrix" class="mr-2"><span>Contact through Matrix</span>
</label> </label>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Inglese (US)" "name": "Italiano (IT)"
}, },
"strings": { "strings": {
"username": "Username", "username": "Username",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Angleščina (ZDA)" "name": "Slovenščina (SI)"
}, },
"strings": { "strings": {
"username": "Uporabniško ime", "username": "Uporabniško ime",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Inglese (US)" "name": "Italiano (IT)"
}, },
"strings": { "strings": {
"ifItWasNotYou": "Se non sei stato tu, puoi ignorare questa email.", "ifItWasNotYou": "Se non sei stato tu, puoi ignorare questa email.",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Inglese (US)" "name": "Italiano (IT)"
}, },
"strings": { "strings": {
"pageTitle": "Crea Un Account Jellyfin", "pageTitle": "Crea Un Account Jellyfin",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Angleščina (ZDA)" "name": "Slovenščina (SI)"
}, },
"strings": { "strings": {
"pageTitle": "Ustvari Jellyfin Račun", "pageTitle": "Ustvari Jellyfin Račun",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Angleščina (ZDA)" "name": "Slovenščina (SI)"
}, },
"strings": { "strings": {
"passwordReset": "Ponastavitev gesla", "passwordReset": "Ponastavitev gesla",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "" "name": "Nedderdütsch (NDS)"
}, },
"strings": { "strings": {
"pageTitle": "", "pageTitle": "",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Angleščina (ZDA)" "name": "Slovenščina (SI)"
}, },
"strings": { "strings": {
"pageTitle": "", "pageTitle": "",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Inglese (US)" "name": "Italiano (IT)"
}, },
"strings": { "strings": {
"startMessage": "", "startMessage": "",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "" "name": "Nedderdütsch (NDS)"
}, },
"strings": { "strings": {
"startMessage": "", "startMessage": "",

View File

@ -1,6 +1,6 @@
{ {
"meta": { "meta": {
"name": "Angleščina (ZDA)" "name": "Slovenščina (SI)"
}, },
"strings": { "strings": {
"startMessage": "Pozdravljeni!\nVnesite svoj Jellyfin PIN da potrdite svoj račun.", "startMessage": "Pozdravljeni!\nVnesite svoj Jellyfin PIN da potrdite svoj račun.",

View File

@ -81,7 +81,7 @@ sudo apt-get install jfa-go-tray
<span class="row col flex center supra">notices</span> <span class="row col flex center supra">notices</span>
<div class="row col flex center"> <div class="row col flex center">
<aside class="aside ~critical w-9/12 text-xs"> <aside class="aside ~critical w-9/12 text-xs">
<strong>(Permanent) Hiatus:</strong> Due to studies and a general lack of enthusiasm, new features are unlikely, bug fixes are a strong maybe, and compatibility with future versions isn't guaranteed. <strong>Project Status:</strong> Due to studies, support from me (<a href="https://github.com/hrfee">@hrfee</a>) will be sporadic.
</aside> </aside>
</div> </div>
<span class="row col flex center supra">links</span> <span class="row col flex center supra">links</span>

93
static/fonts/OFL.txt Normal file
View File

@ -0,0 +1,93 @@
Copyright 2021 The Hanken Grotesk Project Authors (https://github.com/marcologous/hanken-grotesk)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -67,9 +67,9 @@ if (window.telegramEnabled) {
telegramButton.classList.add("unfocused"); telegramButton.classList.add("unfocused");
document.getElementById("contact-via").classList.remove("unfocused"); document.getElementById("contact-via").classList.remove("unfocused");
document.getElementById("contact-via-email").parentElement.classList.remove("unfocused"); document.getElementById("contact-via-email").parentElement.classList.remove("unfocused");
const radio = document.getElementById("contact-via-telegram") as HTMLInputElement; const checkbox = document.getElementById("contact-via-telegram") as HTMLInputElement;
radio.parentElement.classList.remove("unfocused"); checkbox.parentElement.classList.remove("unfocused");
radio.checked = true; checkbox.checked = true;
validator.validate(); validator.validate();
} }
}; };
@ -99,9 +99,9 @@ if (window.discordEnabled) {
discordButton.classList.add("unfocused"); discordButton.classList.add("unfocused");
document.getElementById("contact-via").classList.remove("unfocused"); document.getElementById("contact-via").classList.remove("unfocused");
document.getElementById("contact-via-email").parentElement.classList.remove("unfocused"); document.getElementById("contact-via-email").parentElement.classList.remove("unfocused");
const radio = document.getElementById("contact-via-discord") as HTMLInputElement; const checkbox = document.getElementById("contact-via-discord") as HTMLInputElement;
radio.parentElement.classList.remove("unfocused") checkbox.parentElement.classList.remove("unfocused")
radio.checked = true; checkbox.checked = true;
validator.validate(); validator.validate();
} }
}; };
@ -131,9 +131,9 @@ if (window.matrixEnabled) {
matrixButton.classList.add("unfocused"); matrixButton.classList.add("unfocused");
document.getElementById("contact-via").classList.remove("unfocused"); document.getElementById("contact-via").classList.remove("unfocused");
document.getElementById("contact-via-email").parentElement.classList.remove("unfocused"); document.getElementById("contact-via-email").parentElement.classList.remove("unfocused");
const radio = document.getElementById("contact-via-matrix") as HTMLInputElement; const checkbox = document.getElementById("contact-via-matrix") as HTMLInputElement;
radio.parentElement.classList.remove("unfocused"); checkbox.parentElement.classList.remove("unfocused");
radio.checked = true; checkbox.checked = true;
validator.validate(); validator.validate();
} }
}; };
@ -298,7 +298,7 @@ const create = (event: SubmitEvent) => {
if (window.captcha && !window.reCAPTCHA && !captchaVerified) { if (window.captcha && !window.reCAPTCHA && !captchaVerified) {
} }
toggleLoader(submitSpan); addLoader(submitSpan);
let send: sendDTO = { let send: sendDTO = {
code: window.code, code: window.code,
username: usernameField.value, username: usernameField.value,
@ -307,22 +307,22 @@ const create = (event: SubmitEvent) => {
}; };
if (telegramVerified) { if (telegramVerified) {
send.telegram_pin = window.telegramPIN; send.telegram_pin = window.telegramPIN;
const radio = document.getElementById("contact-via-telegram") as HTMLInputElement; const checkbox = document.getElementById("contact-via-telegram") as HTMLInputElement;
if (radio.checked) { if (checkbox.checked) {
send.telegram_contact = true; send.telegram_contact = true;
} }
} }
if (discordVerified) { if (discordVerified) {
send.discord_pin = window.discordPIN; send.discord_pin = window.discordPIN;
const radio = document.getElementById("contact-via-discord") as HTMLInputElement; const checkbox = document.getElementById("contact-via-discord") as HTMLInputElement;
if (radio.checked) { if (checkbox.checked) {
send.discord_contact = true; send.discord_contact = true;
} }
} }
if (matrixVerified) { if (matrixVerified) {
send.matrix_pin = matrixPIN; send.matrix_pin = matrixPIN;
const radio = document.getElementById("contact-via-matrix") as HTMLInputElement; const checkbox = document.getElementById("contact-via-matrix") as HTMLInputElement;
if (radio.checked) { if (checkbox.checked) {
send.matrix_contact = true; send.matrix_contact = true;
} }
} }
@ -335,56 +335,55 @@ const create = (event: SubmitEvent) => {
} }
} }
_post("/newUser", send, (req: XMLHttpRequest) => { _post("/newUser", send, (req: XMLHttpRequest) => {
if (req.readyState == 4) { if (req.readyState != 4) return;
let vals = req.response as ValidatorRespDTO; removeLoader(submitSpan);
let valid = true; let vals = req.response as ValidatorRespDTO;
for (let type in vals) { let valid = true;
if (requirements[type]) requirements[type].valid = vals[type]; for (let type in vals) {
if (!vals[type]) valid = false; if (requirements[type]) requirements[type].valid = vals[type];
} if (!vals[type]) valid = false;
if (req.status == 200 && valid) { }
if (window.redirectToJellyfin == true) { if (req.status == 200 && valid) {
const url = ((document.getElementById("modal-success") as HTMLDivElement).querySelector("a.submit") as HTMLAnchorElement).href; if (window.redirectToJellyfin == true) {
window.location.href = url; const url = ((document.getElementById("modal-success") as HTMLDivElement).querySelector("a.submit") as HTMLAnchorElement).href;
} else { window.location.href = url;
if (window.userPageEnabled) {
const userPageNoticeArea = document.getElementById("modal-success-user-page-area");
const link = `<a href="${window.userPageAddress}" target="_blank">${userPageNoticeArea.getAttribute("my-account-term")}</a>`;
userPageNoticeArea.innerHTML = userPageNoticeArea.textContent.replace("{myAccount}", link);
}
window.successModal.show();
}
} else { } else {
submitSpan.classList.add("~critical"); if (window.userPageEnabled) {
submitSpan.classList.remove("~urge"); const userPageNoticeArea = document.getElementById("modal-success-user-page-area");
if (req.response["error"] as string) { const link = `<a href="${window.userPageAddress}" target="_blank">${userPageNoticeArea.getAttribute("my-account-term")}</a>`;
submitSpan.textContent = window.messages[req.response["error"]]; userPageNoticeArea.innerHTML = userPageNoticeArea.textContent.replace("{myAccount}", link);
} else {
submitSpan.textContent = window.messages["errorPassword"];
} }
setTimeout(() => { window.successModal.show();
submitSpan.classList.add("~urge");
submitSpan.classList.remove("~critical");
submitSpan.textContent = submitText;
}, 1000);
} }
} else if (req.status != 401 && req.status != 400){
submitSpan.classList.add("~critical");
submitSpan.classList.remove("~urge");
if (req.response["error"] as string) {
submitSpan.textContent = window.messages[req.response["error"]];
} else {
submitSpan.textContent = window.messages["errorPassword"];
}
setTimeout(() => {
submitSpan.classList.add("~urge");
submitSpan.classList.remove("~critical");
submitSpan.textContent = submitText;
}, 1000);
} }
}, true, (req: XMLHttpRequest) => { }, true, (req: XMLHttpRequest) => {
if (req.readyState == 4) { if (req.readyState != 4) return;
toggleLoader(submitSpan); removeLoader(submitSpan);
if (req.status == 401 || req.status == 400) { if (req.status == 401 || req.status == 400) {
if (req.response["error"] as string) { if (req.response["error"] as string) {
if (req.response["error"] == "confirmEmail") { if (req.response["error"] == "confirmEmail") {
window.confirmationModal.show(); window.confirmationModal.show();
return; return;
}
if (req.response["error"] in window.messages) {
submitSpan.textContent = window.messages[req.response["error"]];
} else {
submitSpan.textContent = req.response["error"];
}
setTimeout(() => { submitSpan.textContent = submitText; }, 1000);
} }
if (req.response["error"] in window.messages) {
submitSpan.textContent = window.messages[req.response["error"]];
} else {
submitSpan.textContent = req.response["error"];
}
setTimeout(() => { submitSpan.textContent = submitText; }, 1000);
} }
} }
}); });

View File

@ -7,6 +7,7 @@ import (
"io/fs" "io/fs"
"net/http" "net/http"
"net/url" "net/url"
"path/filepath"
"strings" "strings"
"time" "time"
@ -134,6 +135,14 @@ func (app *appContext) AdminPage(gc *gin.Context) {
license = "" license = ""
} }
license = string(l) license = string(l)
fontLicense, err := fs.ReadFile(localFS, filepath.Join("web", "fonts", "OFL.txt"))
if err != nil {
app.debug.Printf("Failed to load OFL.txt: %s", err)
}
license += "---Hanken Grotesk---\n\n"
license += string(fontLicense)
gcHTML(gc, http.StatusOK, "admin.html", gin.H{ gcHTML(gc, http.StatusOK, "admin.html", gin.H{
"urlBase": app.getURLBase(gc), "urlBase": app.getURLBase(gc),
"cssClass": app.cssClass, "cssClass": app.cssClass,