aboutsummaryrefslogtreecommitdiff
path: root/internal/ui/form/settings.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <f@miniflux.net> 2024-10-05 20:37:30 -0700
committerGravatar Frédéric Guillot <f@miniflux.net> 2024-10-05 21:21:12 -0700
commite555e442fba0a9ca3c8cf67444e8c42f79db359a (patch)
treee7ee91ff4842ef23569833e0443be91545d4c42e /internal/ui/form/settings.go
parent600dea6ce54989a792e666a0a26de0ee847e4562 (diff)
downloadv2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.tar.gz
v2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.tar.zst
v2-e555e442fba0a9ca3c8cf67444e8c42f79db359a.zip
feat: add new settings option to allow external fonts
Diffstat (limited to 'internal/ui/form/settings.go')
-rw-r--r--internal/ui/form/settings.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/ui/form/settings.go b/internal/ui/form/settings.go
index cf18bd2e..1b9e48dd 100644
--- a/internal/ui/form/settings.go
+++ b/internal/ui/form/settings.go
@@ -10,6 +10,7 @@ import (
"miniflux.app/v2/internal/config"
"miniflux.app/v2/internal/locale"
"miniflux.app/v2/internal/model"
+ "miniflux.app/v2/internal/validator"
)
// MarkReadBehavior list all possible behaviors for automatically marking an entry as read
@@ -37,6 +38,7 @@ type SettingsForm struct {
ShowReadingTime bool
CustomCSS string
CustomJS string
+ ExternalFontHosts string
EntrySwipe bool
GestureNav string
DisplayMode string
@@ -101,6 +103,7 @@ func (s *SettingsForm) Merge(user *model.User) *model.User {
user.ShowReadingTime = s.ShowReadingTime
user.Stylesheet = s.CustomCSS
user.CustomJS = s.CustomJS
+ user.ExternalFontHosts = s.ExternalFontHosts
user.EntrySwipe = s.EntrySwipe
user.GestureNav = s.GestureNav
user.DisplayMode = s.DisplayMode
@@ -148,6 +151,12 @@ func (s *SettingsForm) Validate() *locale.LocalizedError {
return locale.NewLocalizedError("error.settings_media_playback_rate_range")
}
+ if s.ExternalFontHosts != "" {
+ if !validator.IsValidDomainList(s.ExternalFontHosts) {
+ return locale.NewLocalizedError("error.settings_invalid_domain_list")
+ }
+ }
+
return nil
}
@@ -183,6 +192,7 @@ func NewSettingsForm(r *http.Request) *SettingsForm {
ShowReadingTime: r.FormValue("show_reading_time") == "1",
CustomCSS: r.FormValue("custom_css"),
CustomJS: r.FormValue("custom_js"),
+ ExternalFontHosts: r.FormValue("external_font_hosts"),
EntrySwipe: r.FormValue("entry_swipe") == "1",
GestureNav: r.FormValue("gesture_nav"),
DisplayMode: r.FormValue("display_mode"),
mplify'>jarred/simplify Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/examples/openInEditor.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-04-06fix(node:events): fix abort behaviorGravatar Derrick Farris 3-170/+177
2023-04-06test(node:events): remove `console.log`Gravatar Derrick Farris 1-1/+0
2023-04-06feat(node:events): finish `EE.AsyncIterator` and `node:events.on()`, add some...Gravatar Derrick Farris 5-369/+276
2023-04-06wip(node:events): get async iter working, work through test flakinessGravatar Derrick Farris 5-236/+328
2023-04-06wip(node:events): fix `node:events.on` async iter to specGravatar Derrick Farris 16-136/+1116
2023-04-06docs: add a section on uninstalling bun (#2560)Gravatar dave caruso 1-0/+8
2023-04-06docs(cli/bunx): add notice (#2574)Gravatar Jozef Steinhübl 1-0/+4
2023-04-06Fix `toEqual` when the second array has extra array holes (#2580)Gravatar Dylan Conway 3-18/+76
2023-04-06Add last modify field "mtime" for FileBlob (#1431) (#2491)Gravatar Zhongwei Yao 6-33/+128
2023-04-06bun-types: infer strict `Subprocess` from `Bun.spawn()` options, part 2 (#2573)Gravatar dave caruso 9-67/+165
2023-04-06cache needs to update, move to another process (#2578)Gravatar Dylan Conway 2-156/+171
2023-04-06fix(ws): export Server (#2575)Gravatar hiroki osame 1-13/+30
2023-04-06docs(CONTRIBUTING): referece development guide (#2576)Gravatar hiroki osame 1-1/+5
2023-04-05rebase (#1501)Gravatar dave caruso 2-144/+305
2023-04-05Update `typecheck` (#2572)Gravatar Colin McDonnell 3-4/+8
2023-04-05prependGravatar Jarred Sumner 1-7/+3
2023-04-05Add tests for `bun test` with preload scripts (#2566)Gravatar Jake Boone 2-1/+107
2023-04-05Disable buffering when we clear terminalGravatar Jarred Sumner 1-0/+2
2023-04-05PrettierGravatar Jarred Sumner 3-4/+4
2023-04-05fix(fetch.proxy) fix proxy authentication (#2554)Gravatar Ciro Spaciari 3-31/+186
2023-04-05fix: build warnings (#2562)Gravatar hiroki osame 4-4/+1
2023-04-05In Documentation, move --watch before the script name (#2569)Gravatar Lawlzer 1-4/+5
2023-04-05fix `deepEquals` with array holes and accessors (#2557)Gravatar Dylan Conway 2-10/+249
2023-04-05fix: modules to have null prototype (#2561)Gravatar hiroki osame 2-2/+9
2023-04-04:clock1: :clock2: :clock3:Gravatar Jarred Sumner 1-1/+1
2023-04-04Implement `import.meta.main` (#2556)Gravatar Jarred Sumner 10-8/+89
2023-04-04Dylan/fix some failing tests (#2544)Gravatar Jarred Sumner 10-29/+72
2023-04-04Add npm benchmark (#2555)Gravatar Colin McDonnell 13-1/+271
2023-04-03Use absolute paths morebun-v0.5.9Gravatar Jarred Sumner 2-6/+11
2023-04-03Fix test failureGravatar Jarred Sumner 1-15/+18