From 98d332793ccb8b73a8b5f6ec8893d0459412b242 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 14:40:46 -0500 Subject: [PATCH 01/13] alpha sort --- src/modules/instance.js | 47 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index ffece311..eeee115c 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -5,37 +5,36 @@ import { instanceDefaultProperties } from './config.js' const defaultState = { // Stuff from static/config.json and apiConfig + alwaysShowSubjectInput: true, + background: '/static/aurora_borealis.jpg', + collapseMessageWithSubject: false, + disableChat: false, + greentext: false, + hideFilteredStatuses: false, + hideMutedPosts: false, + hidePostStats: false, + hideSitename: false, + hideUserStats: false, + logo: '/static/logo.png', + logoMargin: '.2em', + logoMask: true, + minimalScopesMode: false, name: 'Pleroma FE', + nsfwCensorImage: undefined, + postContentType: 'text/plain', + redirectRootLogin: '/main/friends', + redirectRootNoLogin: '/main/all', registrationOpen: true, safeDM: true, - textlimit: 5000, + scopeCopy: true, server: 'http://localhost:4040/', + showFeaturesPanel: true, + showInstanceSpecificPanel: false, + subjectLineBehavior: 'email', + textlimit: 5000, theme: 'pleroma-dark', themeData: undefined, - background: '/static/aurora_borealis.jpg', - logo: '/static/logo.png', - logoMask: true, - logoMargin: '.2em', - redirectRootNoLogin: '/main/all', - redirectRootLogin: '/main/friends', - showInstanceSpecificPanel: false, - alwaysShowSubjectInput: true, - hideMutedPosts: false, - collapseMessageWithSubject: false, - hidePostStats: false, - hideUserStats: false, - hideFilteredStatuses: false, - disableChat: false, - scopeCopy: true, - subjectLineBehavior: 'email', - postContentType: 'text/plain', - hideSitename: false, - nsfwCensorImage: undefined, vapidPublicKey: undefined, - noAttachmentLinks: false, - showFeaturesPanel: true, - minimalScopesMode: false, - greentext: false, // Nasty stuff pleromaBackend: true, From a4a25105babae42b04d173b44dcb8a2d797b87fc Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 14:43:36 -0500 Subject: [PATCH 02/13] Separate the user configurable section --- src/modules/instance.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index eeee115c..1b04032b 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -4,6 +4,9 @@ import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' import { instanceDefaultProperties } from './config.js' const defaultState = { + // not user configurable + name: 'Pleroma FE', + // Stuff from static/config.json and apiConfig alwaysShowSubjectInput: true, background: '/static/aurora_borealis.jpg', @@ -19,7 +22,6 @@ const defaultState = { logoMargin: '.2em', logoMask: true, minimalScopesMode: false, - name: 'Pleroma FE', nsfwCensorImage: undefined, postContentType: 'text/plain', redirectRootLogin: '/main/friends', From 62e0fda5978c8cf592fb0cdf28e485e87378f467 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 14:46:31 -0500 Subject: [PATCH 03/13] loginMethod was missing --- src/modules/instance.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/instance.js b/src/modules/instance.js index 1b04032b..8be8ba63 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -18,6 +18,7 @@ const defaultState = { hidePostStats: false, hideSitename: false, hideUserStats: false, + loginMethod: 'password', logo: '/static/logo.png', logoMargin: '.2em', logoMask: true, From 1db2fc3f41207c2af363c2017efb633a60e9a042 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 14:52:21 -0500 Subject: [PATCH 04/13] alpha sort --- static/config.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/static/config.json b/static/config.json index c8267869..9aeed8f1 100644 --- a/static/config.json +++ b/static/config.json @@ -1,23 +1,23 @@ { - "theme": "pleroma-dark", - "background": "/static/aurora_borealis.jpg", - "logo": "/static/logo.png", - "logoMask": true, - "logoMargin": ".1em", - "redirectRootNoLogin": "/main/all", - "redirectRootLogin": "/main/friends", - "showInstanceSpecificPanel": false, - "collapseMessageWithSubject": false, - "scopeCopy": true, - "subjectLineBehavior": "email", - "postContentType": "text/plain", "alwaysShowSubjectInput": true, + "background": "/static/aurora_borealis.jpg", + "collapseMessageWithSubject": false, "hidePostStats": false, "hideUserStats": false, "loginMethod": "password", - "webPushNotifications": false, + "logo": "/static/logo.png", + "logoMargin": ".1em", + "logoMask": true, + "minimalScopesMode": false, "noAttachmentLinks": false, "nsfwCensorImage": "", + "postContentType": "text/plain", + "redirectRootLogin": "/main/friends", + "redirectRootNoLogin": "/main/all", + "scopeCopy": true, "showFeaturesPanel": true, - "minimalScopesMode": false + "showInstanceSpecificPanel": false, + "subjectLineBehavior": "email", + "theme": "pleroma-dark", + "webPushNotifications": false } From 0ef5965b3bfb6e9f8a305714f60a54b43066473a Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 14:52:48 -0500 Subject: [PATCH 05/13] Add missing settings: disableChat, greentext, hideFilteredStatuses, hideMutedPosts, hidePostStats, hideSitename --- static/config.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/config.json b/static/config.json index 9aeed8f1..727dde73 100644 --- a/static/config.json +++ b/static/config.json @@ -2,7 +2,12 @@ "alwaysShowSubjectInput": true, "background": "/static/aurora_borealis.jpg", "collapseMessageWithSubject": false, + "disableChat": false, + "greentext": false, + "hideFilteredStatuses": false, + "hideMutedPosts": false, "hidePostStats": false, + "hideSitename": false, "hideUserStats": false, "loginMethod": "password", "logo": "/static/logo.png", From cad40133d2919d012c30ba728bfd02b3491d478f Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:29:38 -0500 Subject: [PATCH 06/13] Alpha sort docs, add missing options --- docs/CONFIGURATION.md | 78 +++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 0a9bbd7a..d6a66d0b 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -19,32 +19,66 @@ There's currently no mechanism for user-settings synchronization across several ## Options -### `theme` -Default theme used for new users. De-facto instance-default, user can change theme. +### `alwaysShowSubjectInput` +`true` - will always show subject line input, `false` - only show when it's not empty (i.e. replying). To hide subject line input completely, set it to `false` and `subjectLineBehavior` to `"noop"` ### `background` Default image background. Be aware of using too big images as they may take longer to load. Currently image is fitted with `background-size: cover` which means "scaled and cropped", currently left-aligned. De-facto instance default, user can choose their own background, if they remove their own background, instance default will be used instead. +### `collapseMessageWithSubject` +Collapse post content when post has a subject line (content warning). Instance-default. + +### `disableChat` +hides the chat (TODO: even if it's enabled on backend) + +### `greentext` +Changes lines prefixed with the `>` character to have a green text color + +### `hideFilteredStatuses` +Removes filtered statuses from timelines. + +### `hideMutedPosts` +Removes muted statuses from timelines. + +### `hidePostStats` +Hide repeats/favorites counters for posts. + +### `hideSitename` +Hide instance name in header. + +### `hideUserStats` +Hide followers/friends counters for users. + +### `loginMethod` +`"password"` - show simple password field +`"token"` - show button to log in with external method (will redirect to login form, more details in BE documentation) + ### `logo`, `logoMask`, `logoMargin` Instance `logo`, could be any image, including svg. By default it assumes logo used will be monochrome-with-alpha one, this is done to be compatible with both light and dark themes, so that white logo designed with dark theme in mind won't be invisible over light theme, this is done via [CSS3 Masking](https://www.html5rocks.com/en/tutorials/masking/adobe/). Basically - it will take alpha channel of the image and fill non-transparent areas of it with solid color. If you really want colorful logo - it can be done by setting `logoMask` to `false`. `logoMargin` allows you to adjust vertical margins between logo boundary and navbar borders. The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout. +### `minimalScopesMode` +Limit scope selection to *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from PleromaFE. + +### `nsfwCensorImage` +Use custom image for NSFW'd images + +### `postContentType` +Default post formatting option (markdown/bbcode/plaintext/etc...) + ### `redirectRootNoLogin`, `redirectRootLogin` These two settings should point to where FE should redirect visitor when they login/open up website root -### `chatDisabled` -hides the chat (TODO: even if it's enabled on backend) +### `scopeCopy` +Copy post scope (visibility) when replying to a post. Instance-default. + +### `showFeaturesPanel` +Show panel showcasing instance features/settings to logged-out visitors ### `showInstanceSpecificPanel` This allows you to include arbitrary HTML content in a panel below navigation menu. PleromaFE looks for an html page `instance/panel.html`, by default it's not provided in FE, but BE bundles some [default one](https://git.pleroma.social/pleroma/pleroma/blob/develop/priv/static/instance/panel.html). De-facto instance-defaults, since user can hide instance-specific panel. -### `collapseMessageWithSubject` -Collapse post content when post has a subject line (content warning). Instance-default. - -### `scopeCopy` -Copy post scope (visibility) when replying to a post. Instance-default. - ### `subjectLineBehavior` How to handle subject line (CW) when replying to a post. * `"email"` - like EMail - prepend `re: ` to subject line if it doesn't already start with it. @@ -52,33 +86,13 @@ How to handle subject line (CW) when replying to a post. * `"noop"` - do not copy Instance-default. -### `postContentType` -Default post formatting option (markdown/bbcode/plaintext/etc...) - -### `alwaysShowSubjectInput` -`true` - will always show subject line input, `false` - only show when it's not empty (i.e. replying). To hide subject line input completely, set it to `false` and `subjectLineBehavior` to `"noop"` - -### `hidePostStats` and `hideUserStats` -Hide counters for posts and users respectively, i.e. hiding repeats/favorites counts for posts, hiding followers/friends counts for users. This is just cosmetic and aimed to ease pressure and bias imposed by stat numbers of people and/or posts. (as an example: so that people care less about how many followers someone has since they can't see that info) - -### `loginMethod` -`"password"` - show simple password field -`"token"` - show button to log in with external method (will redirect to login form, more details in BE documentation) +### `theme` +Default theme used for new users. De-facto instance-default, user can change theme. ### `webPushNotifications` Enables [PushAPI](https://developer.mozilla.org/en-US/docs/Web/API/Push_API) - based notifications for users. Instance-default. -### `noAttachmentLinks` -**TODO Currently doesn't seem to be doing anything code-wise**, but implication is to disable adding links for attachments, which looks nicer but breaks compatibility with old GNU/Social servers. -### `nsfwCensorImage` -Use custom image for NSFW'd images - -### `showFeaturesPanel` -Show panel showcasing instance features/settings to logged-out visitors - -### `hideSitename` -Hide instance name in header ## Indirect configuration Some features are configured depending on how backend is configured. In general the approach is "if backend allows it there's no need to hide it, if backend doesn't allow it there's no need to show it. From 55fe6e4703fd8587744ee0ef5a8e3b4213f08432 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:30:54 -0500 Subject: [PATCH 07/13] Alpha sort indirect section --- docs/CONFIGURATION.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index d6a66d0b..003efc7a 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -100,12 +100,12 @@ Some features are configured depending on how backend is configured. In general ### Chat **TODO somewhat broken, see: chatDisabled** chat can be disabled by disabling it in backend +### Private Mode +If the `private` instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users. + ### Rich text formatting in post formatting Rich text formatting options are displayed depending on how many formatting options are enabled on backend, if you don't want your users to use rich text at all you can only allow "text/plain" one, frontend then will only display post text format as a label instead of dropdown (just so that users know for example if you only allow Markdown, only BBCode or only Plain text) -### Who to follow -This is a panel intended for users to find people to follow based on randomness or on post contents. Being potentially privacy unfriendly feature it needs to be enabled and configured in backend to be enabled. - ### Safe DM message display Setting this will change the warning text that is displayed for direct messages. @@ -114,5 +114,6 @@ ATTENTION: If you actually want the behavior to change. You will need to set the DO NOT activate this without checking the backend configuration first! -### Private Mode -If the `private` instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users. +### Who to follow +This is a panel intended for users to find people to follow based on randomness or on post contents. Being potentially privacy unfriendly feature it needs to be enabled and configured in backend to be enabled. + From 0ebf1bebb4aac0800a57f9d4be64dda0a2a07e61 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:32:02 -0500 Subject: [PATCH 08/13] SafeDM is enabled by default and won't take effect if BE not enabled anyway. --- docs/CONFIGURATION.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 003efc7a..7100d260 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -106,14 +106,6 @@ If the `private` instance setting is enabled in the backend, features that are n ### Rich text formatting in post formatting Rich text formatting options are displayed depending on how many formatting options are enabled on backend, if you don't want your users to use rich text at all you can only allow "text/plain" one, frontend then will only display post text format as a label instead of dropdown (just so that users know for example if you only allow Markdown, only BBCode or only Plain text) -### Safe DM message display - -Setting this will change the warning text that is displayed for direct messages. - -ATTENTION: If you actually want the behavior to change. You will need to set the appropriate option at the backend. See the backend documentation for information about that. - -DO NOT activate this without checking the backend configuration first! - ### Who to follow This is a panel intended for users to find people to follow based on randomness or on post contents. Being potentially privacy unfriendly feature it needs to be enabled and configured in backend to be enabled. From d91f5189ef6bf540e9ba34a5650be52afb746235 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:33:01 -0500 Subject: [PATCH 09/13] Config setting is actually called disableChat --- docs/CONFIGURATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 7100d260..39a2840d 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -98,7 +98,7 @@ Enables [PushAPI](https://developer.mozilla.org/en-US/docs/Web/API/Push_API) - b Some features are configured depending on how backend is configured. In general the approach is "if backend allows it there's no need to hide it, if backend doesn't allow it there's no need to show it. ### Chat -**TODO somewhat broken, see: chatDisabled** chat can be disabled by disabling it in backend +**TODO somewhat broken, see: disableChat** chat can be disabled by disabling it in backend ### Private Mode If the `private` instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users. From e80fa3ff6d620dfe09ca373e7761b6c2f1775a12 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:40:13 -0500 Subject: [PATCH 10/13] Split apiConfig options from static/config.json options; Move safeDM to nasty section, alpha sort things --- src/modules/instance.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index 8be8ba63..a8029dc1 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -4,10 +4,16 @@ import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' import { instanceDefaultProperties } from './config.js' const defaultState = { - // not user configurable + // not configurable name: 'Pleroma FE', - // Stuff from static/config.json and apiConfig + // Stuff from apiConfig + server: 'http://localhost:4040/', + textlimit: 5000, + themeData: undefined, + vapidPublicKey: undefined, + + // Stuff from static/config.json alwaysShowSubjectInput: true, background: '/static/aurora_borealis.jpg', collapseMessageWithSubject: false, @@ -28,29 +34,25 @@ const defaultState = { redirectRootLogin: '/main/friends', redirectRootNoLogin: '/main/all', registrationOpen: true, - safeDM: true, scopeCopy: true, - server: 'http://localhost:4040/', showFeaturesPanel: true, showInstanceSpecificPanel: false, subjectLineBehavior: 'email', - textlimit: 5000, theme: 'pleroma-dark', - themeData: undefined, - vapidPublicKey: undefined, // Nasty stuff - pleromaBackend: true, - emoji: [], - emojiFetched: false, customEmoji: [], customEmojiFetched: false, - restrictedNicknames: [], + emoji: [], + emojiFetched: false, + pleromaBackend: true, postFormats: [], + restrictedNicknames: [], + safeDM: true, // Feature-set, apparently, not everything here is reported... - mediaProxyAvailable: false, chatAvailable: false, + mediaProxyAvailable: false, gopherAvailable: false, suggestionsEnabled: false, suggestionsWeb: '', From 03318b64aacbbb48d15c94ada5ade4b38752a734 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 15:48:21 -0500 Subject: [PATCH 11/13] Really alpha sort this --- src/modules/instance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index a8029dc1..278a93ab 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -52,8 +52,8 @@ const defaultState = { // Feature-set, apparently, not everything here is reported... chatAvailable: false, - mediaProxyAvailable: false, gopherAvailable: false, + mediaProxyAvailable: false, suggestionsEnabled: false, suggestionsWeb: '', From 79c53b849ed8d5abac978ed675488bf53ea8fb06 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 16:46:58 -0500 Subject: [PATCH 12/13] registrationOpen is not an FE setting --- src/modules/instance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index 278a93ab..beea424b 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -8,6 +8,7 @@ const defaultState = { name: 'Pleroma FE', // Stuff from apiConfig + registrationOpen: true, server: 'http://localhost:4040/', textlimit: 5000, themeData: undefined, @@ -33,7 +34,6 @@ const defaultState = { postContentType: 'text/plain', redirectRootLogin: '/main/friends', redirectRootNoLogin: '/main/all', - registrationOpen: true, scopeCopy: true, showFeaturesPanel: true, showInstanceSpecificPanel: false, From 229bf79d9016d19e1482f5e02f2f03e5d8b078e2 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 13 May 2020 17:20:35 -0500 Subject: [PATCH 13/13] name setting should be with apiConfig section --- src/modules/instance.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/instance.js b/src/modules/instance.js index beea424b..94d4176b 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -4,10 +4,8 @@ import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' import { instanceDefaultProperties } from './config.js' const defaultState = { - // not configurable - name: 'Pleroma FE', - // Stuff from apiConfig + name: 'Pleroma FE', registrationOpen: true, server: 'http://localhost:4040/', textlimit: 5000,