Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
taehoon | c55e73d061 | |
taehoon | 575598da32 |
4
.babelrc
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"presets": ["@babel/preset-env"],
|
"presets": ["@babel/preset-env"],
|
||||||
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-jsx"],
|
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-transform-vue-jsx"],
|
||||||
"comments": true
|
"comments": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
parser: '@babel/eslint-parser',
|
parser: 'babel-eslint',
|
||||||
sourceType: 'module'
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
|
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
|
||||||
|
@ -21,7 +21,6 @@ module.exports = {
|
||||||
'generator-star-spacing': 0,
|
'generator-star-spacing': 0,
|
||||||
// allow debugger during development
|
// allow debugger during development
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||||
'vue/require-prop-types': 0,
|
'vue/require-prop-types': 0
|
||||||
'vue/multi-word-component-names': 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
/build/webpack.prod.conf.js export-subst
|
|
|
@ -7,4 +7,3 @@ test/e2e/reports
|
||||||
selenium-debug.log
|
selenium-debug.log
|
||||||
.idea/
|
.idea/
|
||||||
config/local.json
|
config/local.json
|
||||||
static/emoji.json
|
|
||||||
|
|
|
@ -1,50 +1,22 @@
|
||||||
# This file is a template, and might need editing before it works on your project.
|
# This file is a template, and might need editing before it works on your project.
|
||||||
# Official framework image. Look for the different tagged releases at:
|
# Official framework image. Look for the different tagged releases at:
|
||||||
# https://hub.docker.com/r/library/node/tags/
|
# https://hub.docker.com/r/library/node/tags/
|
||||||
image: node:16
|
image: node:8
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- check-changelog
|
|
||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
# https://git.pleroma.social/help/ci/yaml/workflow.md#switch-between-branch-pipelines-and-merge-request-pipelines
|
|
||||||
workflow:
|
|
||||||
rules:
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
||||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
|
||||||
when: never
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
|
|
||||||
check-changelog:
|
|
||||||
stage: check-changelog
|
|
||||||
image: alpine
|
|
||||||
rules:
|
|
||||||
- if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate/
|
|
||||||
when: never
|
|
||||||
- if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == 'pleroma/pleroma-fe' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'weblate'
|
|
||||||
when: never
|
|
||||||
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
|
|
||||||
before_script: ''
|
|
||||||
after_script: ''
|
|
||||||
cache: {}
|
|
||||||
script:
|
|
||||||
- apk add git
|
|
||||||
- sh ./tools/check-changelog
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
stage: lint
|
stage: lint
|
||||||
script:
|
script:
|
||||||
- yarn
|
- yarn
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run stylelint
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
|
||||||
- amd64
|
|
||||||
variables:
|
variables:
|
||||||
APT_CACHE_DIR: apt-cache
|
APT_CACHE_DIR: apt-cache
|
||||||
script:
|
script:
|
||||||
|
@ -56,8 +28,6 @@ test:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
tags:
|
|
||||||
- amd64
|
|
||||||
script:
|
script:
|
||||||
- yarn
|
- yarn
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
# Environment info
|
|
||||||
|
|
||||||
<!-- Everything is optional and where applicable but the more information the better. -->
|
|
||||||
* Browser, version, OS, platform:
|
|
||||||
* Instance URL:
|
|
||||||
* Frontend version (see settings -> about):
|
|
||||||
* Backend version (see settings -> about):
|
|
||||||
* Browser extensions (ublock, rikaichamp etc):
|
|
||||||
* Known instance/user customizations (i.e. pleromafe mods/forks, instance styles etc)
|
|
||||||
|
|
||||||
# Bug description & reproduction steps
|
|
||||||
|
|
||||||
<!-- Type out here how to reproduce the bug, what goes wrong and what should go right -->
|
|
||||||
<!-- Screenshots and videos help a lot ;) any observations might also help -->
|
|
||||||
<!-- Also mention if there any errors in browser's console if relevant -->
|
|
||||||
|
|
||||||
# Bug seriousness
|
|
||||||
|
|
||||||
<!-- Everything is optional and free-form -->
|
|
||||||
* How annoying it is:
|
|
||||||
* How often does it happen:
|
|
||||||
* How many people does it affect:
|
|
||||||
* Is there a workaround for it:
|
|
||||||
|
|
||||||
/label ~Bug
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Behavior suggestion/Feature request
|
|
||||||
<!--
|
|
||||||
Type out what you want to see changed or what feature you want to see added to
|
|
||||||
PleormaFE. Please also explain how it would benefit users (or admins/moderators)
|
|
||||||
and what intended usecase is. Any background information (i.e. porting behavior
|
|
||||||
from other frontends/services, specific situations, personal preferences etc.)
|
|
||||||
as well as examples would be greatly appreciated.
|
|
||||||
-->
|
|
||||||
|
|
||||||
/label ~suggestion
|
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<!--
|
|
||||||
please use one of the templates if applicable, otherwise - type out here
|
|
||||||
in free-form
|
|
||||||
-->
|
|
||||||
|
|
||||||
/label ~needs-triage
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
<!--
|
|
||||||
Feel free to submit merge requests that are work-in-progress, but mark them as
|
|
||||||
Draft: or WIP:.
|
|
||||||
Merge requests that have Draft or WIP status will not be merged and have less chances
|
|
||||||
of being reviewed, but you can still ask people to take a look if you need advice.
|
|
||||||
-->
|
|
||||||
# Changes
|
|
||||||
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
|
|
||||||
<!-- List what your merge request changes and how -->
|
|
||||||
<!--
|
|
||||||
Try to not to break existing behavior, if your changes do break existing behavior
|
|
||||||
make it configurable to toggle between old behavior and new. Which one should be
|
|
||||||
default is up to discussion.
|
|
||||||
-->
|
|
||||||
<!-- If your merge request resolves some issue link it like so: "Closes #99999" -->
|
|
||||||
<!--
|
|
||||||
If merge request adds some new feature that depends on backend:
|
|
||||||
|
|
||||||
1. Make sure it gracefully degrades if backend hasn't been updated to support the feature,
|
|
||||||
we try to make PleromaFE compatible with older versions of BE so that people can still
|
|
||||||
update frontend safely without updating backend since it's costly and much riskier.
|
|
||||||
2. Link related BE merge request here
|
|
||||||
-->
|
|
||||||
<!-- Screenshots are welcome -->
|
|
||||||
|
|
||||||
/label ~needs-review
|
|
|
@ -1 +1 @@
|
||||||
16.18.1
|
7.2.1
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"extends": [
|
|
||||||
"stylelint-rscss/config",
|
|
||||||
"stylelint-config-standard",
|
|
||||||
"stylelint-config-recommended-scss",
|
|
||||||
"stylelint-config-html",
|
|
||||||
"stylelint-config-recommended-vue/scss"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"declaration-no-important": true,
|
|
||||||
"rscss/no-descendant-combinator": false,
|
|
||||||
"rscss/class-format": [
|
|
||||||
false,
|
|
||||||
{
|
|
||||||
"component": "pascal-case",
|
|
||||||
"variant": "^-[a-z]\\w+",
|
|
||||||
"element": "^[a-z]\\w+"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"selector-class-pattern": null,
|
|
||||||
"import-notation": null,
|
|
||||||
"custom-property-pattern": null,
|
|
||||||
"keyframes-name-pattern": null,
|
|
||||||
"scss/operator-no-newline-after": null,
|
|
||||||
"declaration-block-no-redundant-longhand-properties": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"ignoreShorthands": [
|
|
||||||
"grid-template",
|
|
||||||
"margin",
|
|
||||||
"padding",
|
|
||||||
"border",
|
|
||||||
"border-width",
|
|
||||||
"border-style",
|
|
||||||
"border-color",
|
|
||||||
"border-radius"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
385
CHANGELOG.md
|
@ -3,387 +3,7 @@ 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.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
## 2.6.1
|
## [Unreleased]
|
||||||
### Fixed
|
|
||||||
- fix admin dashboard not having any feedback on frontend installation
|
|
||||||
- Fix frontend admin tab crashing when no primary frontend is set
|
|
||||||
- Add aria attributes to react and extra buttons
|
|
||||||
|
|
||||||
## 2.6.0
|
|
||||||
### Added
|
|
||||||
- add the initial i18n translation file for Taiwanese (Hokkien), and modify some related files.
|
|
||||||
- Implemented a very basic instance administration screen
|
|
||||||
- Implement quoting
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Keep aspect ratio of custom emoji reaction in notification
|
|
||||||
- Fix openSettingsModalTab so that it correctly opens Settings modal instead of Admin modal
|
|
||||||
- Add alt text to emoji picker buttons
|
|
||||||
- Use export-subst gitattribute to allow tarball builds
|
|
||||||
- fix reports now showing reason/content
|
|
||||||
- Fix HTML attribute parsing, discard attributes not strating with a letter
|
|
||||||
- Make MentionsLine aware of line breaking by non-br elements
|
|
||||||
- Fix a bug where mentioning a user twice will not fill the mention into the textarea
|
|
||||||
- Fix parsing non-ascii tags
|
|
||||||
- Fix OAuth2 token lingering after revocation
|
|
||||||
- fix regex issue in HTML parser/renderer
|
|
||||||
- don't display quoted status twice
|
|
||||||
- fix typo in code that prevented cards from showing at all
|
|
||||||
- Fix react button not working if reaction accounts are not loaded
|
|
||||||
- Fix react button misalignment on safari ios
|
|
||||||
- Fix pinned statuses gone when reloading user timeline
|
|
||||||
- Fix scrolling emoji selector in modal in safari ios
|
|
||||||
|
|
||||||
## 2.5.1
|
|
||||||
### Fixed
|
|
||||||
- Checkboxes in settings can now work with screenreaders
|
|
||||||
- Autocomplete in edit boxes can now work with screenreaders
|
|
||||||
- Status interact buttons now have focus indicator for anonymous users
|
|
||||||
- Top bar buttons now correctly have text labels
|
|
||||||
- It is now possible to register if the site admin requires birthday to register
|
|
||||||
- User cards from search results will correctly popup
|
|
||||||
- Fix notification attachment icon overflow
|
|
||||||
- Editing mute words is less laggy
|
|
||||||
- Repeater's name will no longer mess up with the directionality of the text sitting on the same line
|
|
||||||
- Unauthenticated access will give better error messages
|
|
||||||
- It is now easier to close the media viewer with a mouse when there is only one image
|
|
||||||
- Deleting profile fields can work properly
|
|
||||||
- Clicking the react button will correctly focus the search box
|
|
||||||
- Clicking buttons on the top-bar will no longer bring you to the top of the page
|
|
||||||
- Emoji picker is much faster to load
|
|
||||||
- `blockquote`s have a better display style
|
|
||||||
- Announcements posting and editing are now available to everyone with such a privilege, not just admins
|
|
||||||
- Adding or removing list members will actually work
|
|
||||||
- Emojis without a pack are now correctly displayed in emoji picker
|
|
||||||
- Changing notification settings will actually work
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- You can now set and see birthdays
|
|
||||||
- Optional confirmation dialogs when performing various actions
|
|
||||||
- You can now set fallback languages
|
|
||||||
|
|
||||||
## 2.5.0 - 23.12.2022
|
|
||||||
### Fixed
|
|
||||||
- UI no longer lags when switching between mobile and desktop mode
|
|
||||||
- Popovers no longer constrained by DOM hierarchy, shouldn't be cut off by anything
|
|
||||||
- Emoji autocomplete popover and picker popover stick to the text cursor.
|
|
||||||
- Attachments are ALWAYS in same order as user uploaded, no more "videos first"
|
|
||||||
- Pinned statuses no longer appear at bottom of user timeline (still appear as part of the timeline when fetched deep enough)
|
|
||||||
- Fixed many many bugs related to new mentions, including spacing and alignment issues
|
|
||||||
- Links in profile bios now properly open in new tabs
|
|
||||||
- "Always show mobile button" is working now
|
|
||||||
- Inline images now respect their intended width/height attributes
|
|
||||||
- Links with `&` in them work properly now
|
|
||||||
- Attachment description is prefilled with backend-provided default when uploading
|
|
||||||
- Proper visual feedback that next image is loading when browsing
|
|
||||||
- Additional HTML sanitization on frontend side in case backend sanitization fails
|
|
||||||
- Interaction list popovers now properly emojify names
|
|
||||||
- AdminFE button no longer scrolls page to top when clicked
|
|
||||||
- User handles with non-ascii domains now have less intrusive indicator for the domain name
|
|
||||||
- Completely hidden posts still no longer have 1px border
|
|
||||||
- A lot of accessibility improvements
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Using Vue 3 now
|
|
||||||
- A lot of internal dependencies updated
|
|
||||||
- "(You)s" are optional (opt-in) now, bolding your nickname is also optional (opt-out)
|
|
||||||
- User highlight background now also covers the `@`
|
|
||||||
- Reverted back to textual `@`, svg version is opt-in.
|
|
||||||
- Settings window has been thoroughly rearranged to make more sense and make navigation settings easier.
|
|
||||||
- Uploaded attachments are uniform with displayed attachments
|
|
||||||
- Flash is watchable in media-modal (takes up nearly full screen though due to sizing issues)
|
|
||||||
- Notifications about likes/repeats/emoji reacts are now minimized so they always take up same amount of space irrelevant to size of post. (You can expand them to full if need be)
|
|
||||||
- Slight width/spacing adjustments
|
|
||||||
- More sizing stuff is font-size dependent now
|
|
||||||
- Scrollbars are styled/colorized now
|
|
||||||
- Scrollbars are toggleable (for stuff that didn't have visible scrollbars before) (opt-in)
|
|
||||||
- Updated localization files
|
|
||||||
- Top bar is more useful in mobile mode now.
|
|
||||||
- "Show new" button is way more compact in mobile mode
|
|
||||||
- Slightly adjusted placement and spacing of the topbar buttons so it's less easy to accidentally log yourself out
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- 3 column mode: only enables when there's space for it (opt-out, customizable)
|
|
||||||
- Apologetic pleroma-tan
|
|
||||||
- New button on timeline header to change some of the new and often-used settings
|
|
||||||
- Support for lists
|
|
||||||
- Added ability to edit posts and view post edit history etc.
|
|
||||||
- Added ability to add personal note to users
|
|
||||||
- Added initial support for admin announcements
|
|
||||||
- Added ui for account migration
|
|
||||||
- Added ui for backups
|
|
||||||
- Added ability to force-unfollow a user from you
|
|
||||||
- Emoji are now grouped by pack
|
|
||||||
- Ability to pin navigation items and collapse the navigation menu
|
|
||||||
- Ability to rearrange order of attachments when uploading
|
|
||||||
- Ability to scroll column (or page) to top via panel header button
|
|
||||||
- Options to show domains in mentions
|
|
||||||
- Option to show user avatars in mention links (opt-in)
|
|
||||||
- Option to disable the tooltip for mentions
|
|
||||||
- Option to completely hide muted threads
|
|
||||||
- Option to customize what clicking user avatar does in user popover
|
|
||||||
- Notifications for poll results
|
|
||||||
- "Favorites" link in navigation
|
|
||||||
- Very early and somewhat experimental system for automatic settings sync (used only for pinned navigation and apologetic pleroma-tan)
|
|
||||||
- Implemented remote interaction with statuses for anon visitors
|
|
||||||
- Ability to open videos in modal even if you disabled that feature, via an icon button
|
|
||||||
- New button on attachment that indicates that attachment has a description and shows a bar filled with description
|
|
||||||
- Attachments are truncated just like post contents
|
|
||||||
- Media modal now also displays description and counter position in gallery (i.e. 1/5)
|
|
||||||
- Enabled users to zoom and pan images in media viewer with mouse and touch
|
|
||||||
- Timelines/panels and conversations have sticky headers now (a bit glitchy on some browsers like safari) (opt-out)
|
|
||||||
|
|
||||||
|
|
||||||
## [2.4.2] - 2022-01-09
|
|
||||||
### Added
|
|
||||||
- Added Apply and Reset buttons to the bottom of theme tab to minimize UI travel
|
|
||||||
- Implemented user option to always show floating New Post button (normally mobile-only)
|
|
||||||
- Display reasons for instance specific policies
|
|
||||||
- Added functionality to cancel follow request
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fixed link to external profile not working on user profiles
|
|
||||||
- Fixed mobile shoutbox display
|
|
||||||
- Fixed favicon badge not working in Chrome
|
|
||||||
- Escape html more properly in subject/display name
|
|
||||||
|
|
||||||
|
|
||||||
## [2.4.0] - 2021-08-08
|
|
||||||
### Added
|
|
||||||
- Added a quick settings to timeline header for easier access
|
|
||||||
- Added option to mark posts as sensitive by default
|
|
||||||
- Added quick filters for notifications
|
|
||||||
- Implemented user option to change sidebar position to the right side
|
|
||||||
- Implemented user option to hide floating shout panel
|
|
||||||
- Implemented "edit profile" button if viewing own profile which opens profile settings
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fixed follow request count showing in the wrong location in mobile view
|
|
||||||
|
|
||||||
|
|
||||||
## [2.3.0] - 2021-03-01
|
|
||||||
### Fixed
|
|
||||||
- Button to remove uploaded media in post status form is now properly placed and sized.
|
|
||||||
- Fixed shoutbox not working in mobile layout
|
|
||||||
- Fixed missing highlighted border in expanded conversations again
|
|
||||||
- Fixed some UI jumpiness when opening images particularly in chat view
|
|
||||||
- Fixed chat unread badge looking weird
|
|
||||||
- Fixed punycode names not working properly
|
|
||||||
- Fixed notifications crashing on an invalid notification
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Display 'people voted' instead of 'votes' for multi-choice polls
|
|
||||||
- Changed the "Timelines" link in side panel to toggle show all timeline options inside the panel
|
|
||||||
- Renamed "Timeline" to "Home Timeline" to be more clear
|
|
||||||
- Optimized chat to not get horrible performance after keeping the same chat open for a long time
|
|
||||||
- When opening emoji picker or react picker, it automatically focuses the search field
|
|
||||||
- Language picker now uses native language names
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Added reason field for registration when approval is required
|
|
||||||
- Group staff members by role in the About page
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.3] - 2021-01-18
|
|
||||||
### Added
|
|
||||||
- Added Report button to status ellipsis menu for easier reporting
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Follows/Followers tabs on user profiles now display the content properly.
|
|
||||||
- Handle punycode in screen names
|
|
||||||
- Fixed local dev mode having non-functional websockets in some cases
|
|
||||||
- Show notices for websocket events (errors, abnormal closures, reconnections)
|
|
||||||
- Fix not being able to re-enable websocket until page refresh
|
|
||||||
- Fix annoying issue where timeline might have few posts when streaming is enabled
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Don't filter own posts when they hit your wordfilter
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.2] - 2020-12-22
|
|
||||||
### Added
|
|
||||||
- Mouseover titles for emojis in reaction picker
|
|
||||||
- Support to input emoji into the search box in reaction picker
|
|
||||||
- Added some missing unicode emoji
|
|
||||||
- Added the upload limit to the Features panel in the About page
|
|
||||||
- Support for solid color wallpaper, instance doesn't have to define a wallpaper anymore
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fixed the occasional bug where screen would scroll 1px when typing into a reply form
|
|
||||||
- Fixed timeline errors locking timelines
|
|
||||||
- Fixed missing highlighted border in expanded conversations
|
|
||||||
- Fixed custom emoji not working in profile field names
|
|
||||||
- Fixed pinned statuses not appearing in user profiles
|
|
||||||
- Fixed some elements not being keyboard navigation friendly
|
|
||||||
- Fixed error handling when updating various profile images
|
|
||||||
- Fixed your latest chat messages disappearing when closing chat view and opening it again during the same session
|
|
||||||
- Fixed custom emoji not showing in poll options before voting
|
|
||||||
- Fixed link color not applied to instance name in topbar
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Errors when fetching are now shown with popup errors instead of "Error fetching updates" in panel headers
|
|
||||||
- Made reply/fav/repeat etc buttons easier to hit
|
|
||||||
- Adjusted timeline menu clickable area to match the visible button
|
|
||||||
- Moved external source link from status heading to the ellipsis menu
|
|
||||||
- Disabled horizontal textarea resize
|
|
||||||
- Wallpaper is now top-aligned, horizontally centered.
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.1] - 2020-11-11
|
|
||||||
### Fixed
|
|
||||||
- Fixed regression in react popup alignment and overflowing
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.0] - 2020-11-06
|
|
||||||
### Added
|
|
||||||
- New option to optimize timeline rendering to make the site more responsive (enabled by default)
|
|
||||||
- New instance option `logoLeft` to move logo to the left side in desktop nav bar
|
|
||||||
- Import/export a muted users
|
|
||||||
- Proper handling of deletes when using websocket streaming
|
|
||||||
- Added optimistic chat message sending, so you can start writing next message before the previous one has been sent
|
|
||||||
- Added a small red badge to the favicon when there's unread notifications
|
|
||||||
- Added the NSFW alert to link previews
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Fixed clicking NSFW hider through status popover
|
|
||||||
- Fixed chat-view back button being hard to click
|
|
||||||
- Fixed fresh chat notifications being cleared immediately while leaving the chat view and not having time to actually see the messages
|
|
||||||
- Fixed multiple regressions in CSS styles
|
|
||||||
- Fixed multiple issues with input fields when using CJK font as default
|
|
||||||
- Fixed search field in navbar infringing into logo in some cases
|
|
||||||
- Fixed not being able to load the chat history in vertical screens when the message list doesn't take the full height of the scrollable container on the first fetch.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Clicking immediately when timeline shifts is now blocked to prevent misclicks
|
|
||||||
- Icons changed from fontello (FontAwesome 4 + others) to FontAwesome 5 due to problems with fontello.
|
|
||||||
- Some icons changed for better accessibility (lock, globe)
|
|
||||||
- Logo is now clickable
|
|
||||||
- Changed default logo to SVG version
|
|
||||||
|
|
||||||
|
|
||||||
## [2.1.2] - 2020-09-17
|
|
||||||
### Fixed
|
|
||||||
- Fixed chats list not updating its order when new messages come in
|
|
||||||
- Fixed chat messages sometimes getting lost when you receive a message at the same time
|
|
||||||
|
|
||||||
|
|
||||||
## [2.1.1] - 2020-09-08
|
|
||||||
### Changed
|
|
||||||
- Polls will be hidden with status content if "Collapse posts with subjects" is enabled and the post is collapsed.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Network fetches don't pile up anymore but wait for previous ones to finish to reduce throttling.
|
|
||||||
- Autocomplete won't stop at the second @, so it'll still work with "@lain@l" and not start over.
|
|
||||||
- Fixed weird autocomplete behavior when you write ":custom_emoji: ?"
|
|
||||||
|
|
||||||
|
|
||||||
## [2.1.0] - 2020-08-28
|
|
||||||
### Added
|
|
||||||
- Autocomplete domains from list of known instances
|
|
||||||
- 'Bot' settings option and badge
|
|
||||||
- Added profile meta data fields that can be set in profile settings
|
|
||||||
- Added option to reset avatar/banner in profile settings
|
|
||||||
- Descriptions can be set on uploaded files before posting
|
|
||||||
- Added status preview option to preview your statuses before posting
|
|
||||||
- When a post is a reply to an unavailable post, the 'Reply to'-text has a strike-through style
|
|
||||||
- Added ability to see all favoriting or repeating users when hovering the number on highlighted statuses
|
|
||||||
- Bookmarks
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Change heart to thumbs up in reaction picker
|
|
||||||
- Close the media modal on navigation events
|
|
||||||
- Add colons to the emoji alt text, to make them copyable
|
|
||||||
- Add better visual indication for drag-and-drop for files
|
|
||||||
- When disabling attachments, the placeholder links now show an icon and the description instead of just IMAGE or VIDEO etc
|
|
||||||
- Remove unnecessary options for 'automatic loading when loading older' and 'reply previews'
|
|
||||||
- Greentext now has separate color slot for it
|
|
||||||
- Removed the use of with_move parameters when fetching notifications
|
|
||||||
- Push notifications now are the same as normal notfication, and are localized.
|
|
||||||
- Updated Notification Settings to match new BE API
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Custom Emoji will display in poll options now.
|
|
||||||
- Status ellipsis menu closes properly when selecting certain options
|
|
||||||
- Cropped images look correct in Chrome
|
|
||||||
- Newlines in the muted words settings work again
|
|
||||||
- Clicking on non-latin hashtags won't open a new window
|
|
||||||
- Uploading and drag-dropping multiple files works correctly now.
|
|
||||||
- Subject field now appears disabled when posting
|
|
||||||
- Fix status ellipsis menu being cut off in notifications column
|
|
||||||
- Fixed autocomplete sometimes not returning the right user when there's already some results
|
|
||||||
- Videos and audio and misc files show description as alt/title properly now
|
|
||||||
- Clicking on non-image/video files no longer opens an empty modal
|
|
||||||
- Audio files can now be played back in the frontend with hidden attachments
|
|
||||||
- Videos are not cropped awkwardly in the uploads section anymore
|
|
||||||
- Reply filtering options in Settings -> Filtering now work again using filtering on server
|
|
||||||
- Don't show just blank-screen when cookies are disabled
|
|
||||||
- Add status idempotency to prevent accidental double posting when posting returns an error
|
|
||||||
- Weird bug related to post being sent seemingly after pasting with keyboard (hopefully)
|
|
||||||
- Multiple issues with muted statuses/notifications
|
|
||||||
|
|
||||||
## [2.0.5] - 2020-05-12
|
|
||||||
### Added
|
|
||||||
- Added private notifications option for push notifications
|
|
||||||
- 'Copy link' button for statuses (in the ellipsis menu)
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Registration page no longer requires email if the server is configured not to require it
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Status ellipsis menu closes properly when selecting certain options
|
|
||||||
|
|
||||||
## [2.0.3] - 2020-05-02
|
|
||||||
### Fixed
|
|
||||||
- Show more/less works correctly with auto-collapsed subjects and long posts
|
|
||||||
- RTL characters won't look messed up in notifications
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Emoji autocomplete will match any part of the word and not just start, for example :drool will now helpfully suggest :blobcatdrool: and :blobcatdroolreach:
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- Follow request notification support
|
|
||||||
|
|
||||||
## [2.0.2] - 2020-04-08
|
|
||||||
### Fixed
|
|
||||||
- Favorite/Repeat avatars not showing up on private instances/non-public posts
|
|
||||||
- Autocorrect getting triggered in the captcha field
|
|
||||||
- Overflow on long domains in follow/move notifications
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- Polish translation updated
|
|
||||||
|
|
||||||
## [2.0.0] - 2020-02-28
|
|
||||||
### Added
|
|
||||||
- Tons of color slots including ones for hover/pressed/toggled buttons
|
|
||||||
- Experimental `--variable[,mod]` syntax support for color slots in themes. the `mod` makes color brighter/darker depending on background color (makes darker color brighter/darker depending on background color)
|
|
||||||
- Paper theme by Shpuld
|
|
||||||
- Icons in nav panel
|
|
||||||
- Private mode support
|
|
||||||
- Support for 'Move' type notifications
|
|
||||||
- Pleroma AMOLED dark theme
|
|
||||||
- User level domain mutes, under User Settings -> Mutes
|
|
||||||
- Emoji reactions for statuses
|
|
||||||
- MRF keyword policy disclosure
|
|
||||||
### Changed
|
|
||||||
- Updated Pleroma default themes
|
|
||||||
- theme engine update to 3 (themes v2.1 introduction)
|
|
||||||
- massive internal changes in theme engine - slowly away from "generate things separately with spaghetti code" towards "feed all data into single 'generateTheme' function and declare slot inheritance and all in a separate file"
|
|
||||||
- Breezy theme updates to make it closer to actual Breeze in some aspects
|
|
||||||
- when using `--variable` in shadows it no longer uses the actual CSS3 variable, instead it generates color from other slots
|
|
||||||
- theme doesn't get saved to local storage when opening FE anonymously
|
|
||||||
- Captcha now resets on failed registrations
|
|
||||||
- Notifications column now cleans itself up to optimize performance when tab is left open for a long time
|
|
||||||
- 403 messaging
|
|
||||||
### Fixed
|
|
||||||
- Fixed loader-spinner not disappearing when a status preview fails to load
|
|
||||||
- anon viewers won't get theme data saved to local storage, so admin changing default theme will have an effect for users coming back to instance.
|
|
||||||
- Single notifications left unread when hitting read on another device/tab
|
|
||||||
- Registration fixed
|
|
||||||
- Deactivation of remote accounts from frontend
|
|
||||||
- Fixed NSFW unhiding not working with videos when using one-click unhiding/displaying
|
|
||||||
- Improved performance of anything that uses popovers (most notably statuses)
|
|
||||||
|
|
||||||
## [1.1.7 and earlier] - 2019-12-14
|
|
||||||
### Added
|
### Added
|
||||||
- Ability to hide/show repeats from user
|
- Ability to hide/show repeats from user
|
||||||
- User profile button clutter organized into a menu
|
- User profile button clutter organized into a menu
|
||||||
|
@ -391,10 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Started changelog anew
|
- Started changelog anew
|
||||||
- Ability to change user's email
|
- Ability to change user's email
|
||||||
- About page
|
- About page
|
||||||
- Added remote user redirect
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- changed the way fading effects for user profile/long statuses works, now uses css-mask instead of gradient background hacks which weren't exactly compatible with semi-transparent themes
|
- changed the way fading effects for user profile/long statuses works, now uses css-mask instead of gradient background hacks which weren't exactly compatible with semi-transparent themes
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- improved hotkey behavior on autocomplete popup
|
- improved hotkey behavior on autocomplete popup
|
||||||
|
|
|
@ -3,12 +3,9 @@ Contributors of this project.
|
||||||
- Constance Variable (lambadalambda@social.heldscal.la): Code
|
- Constance Variable (lambadalambda@social.heldscal.la): Code
|
||||||
- Coco Snuss (cocosnuss@social.heldscal.la): Code
|
- Coco Snuss (cocosnuss@social.heldscal.la): Code
|
||||||
- wakarimasen (wakarimasen@shitposter.club): NSFW hiding image
|
- wakarimasen (wakarimasen@shitposter.club): NSFW hiding image
|
||||||
- eris (eris@disqordia.space): Code
|
|
||||||
- dtluna (dtluna@social.heldscal.la): Code
|
- dtluna (dtluna@social.heldscal.la): Code
|
||||||
- sonyam (sonyam@social.heldscal.la): Background images
|
- sonyam (sonyam@social.heldscal.la): Background images
|
||||||
- hakui (hakui@freezepeach.xyz): CSS and styling
|
- hakui (hakui@freezepeach.xyz): CSS and styling
|
||||||
- shpuld (shpuld@shitposter.club): CSS and styling
|
- shpuld (shpuld@shitposter.club): CSS and styling
|
||||||
- Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images.
|
- Vincent Guth (https://unsplash.com/photos/XrwVIFy6rTw): Background images.
|
||||||
- hj (hj@shigusegubu.club): Code
|
- hj (hj@shigusegubu.club): Code
|
||||||
- Sean King (seanking@kazv.moe): Code
|
|
||||||
- tusooa (tusooa@kazv.moe): Code
|
|
||||||
|
|
30
README.md
|
@ -1,19 +1,19 @@
|
||||||
# Pleroma-FE
|
# pleroma_fe
|
||||||
|
|
||||||
> Highly-customizable frontend designed for Pleroma.
|
> A single column frontend for both Pleroma and GS servers.
|
||||||
|
|
||||||
![screenshot](./image-1.png)
|
![screenshot](https://i.imgur.com/DJVqSJ0.png)
|
||||||
|
|
||||||
# For Translators
|
# For Translators
|
||||||
|
|
||||||
To translate Pleroma-FE, use our weblate server: https://translate.pleroma.social/. If you need to add your language it should be added as a json file in [src/i18n/](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/) folder and added in a list within [src/i18n/languages.js](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/languages.js).
|
To translate Pleroma-FE, add your language to [src/i18n/messages.js](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/i18n/messages.js). Pleroma-FE will set your language by your browser locale, but you can temporarily force it in the code by changing the locale in main.js.
|
||||||
|
|
||||||
Pleroma-FE will set your language by your browser locale, but you can change language in settings.
|
# FOR ADMINS
|
||||||
|
|
||||||
# For instance admins
|
You don't need to build Pleroma-FE yourself. Those using the Pleroma backend will be able to use it out of the box.
|
||||||
You don't need to build Pleroma-FE yourself. Those using the Pleroma backend will be able to use it out of the box. Information of customizing PleromaFE settings/defaults is in our [guide](https://docs-develop.pleroma.social/frontend/CONFIGURATION/) and in case you want to build your own custom version there's [another](https://docs-develop.pleroma.social/frontend/HACKING/)
|
For the GNU social backend, check out https://git.pleroma.social/pleroma/pleroma-fe/wikis/dual-boot-with-qvitter to see how to run Pleroma-FE and Qvitter at the same time.
|
||||||
|
|
||||||
# Build Setup
|
## Build Setup
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
# install dependencies
|
# install dependencies
|
||||||
|
@ -21,13 +21,13 @@ npm install -g yarn
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
# serve with hot reload at localhost:8080
|
# serve with hot reload at localhost:8080
|
||||||
yarn dev
|
npm run dev
|
||||||
|
|
||||||
# build for production with minification
|
# build for production with minification
|
||||||
yarn build
|
npm run build
|
||||||
|
|
||||||
# run unit tests
|
# run unit tests
|
||||||
yarn unit
|
npm run unit
|
||||||
```
|
```
|
||||||
|
|
||||||
# For Contributors:
|
# For Contributors:
|
||||||
|
@ -41,4 +41,10 @@ FE Build process also leaves current commit hash in global variable `___pleromaf
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
Set configuration settings in AdminFE, additionally you can edit config.json. For more details see [documentation](https://docs-develop.pleroma.social/frontend/CONFIGURATION/).
|
Edit config.json for configuration.
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
### Login methods
|
||||||
|
|
||||||
|
```loginMethod``` can be set to either ```password``` (the default) or ```token```, which will use the full oauth redirection flow, which is useful for SSO situations.
|
||||||
|
|
|
@ -18,9 +18,6 @@ console.log(
|
||||||
var spinner = ora('building for production...')
|
var spinner = ora('building for production...')
|
||||||
spinner.start()
|
spinner.start()
|
||||||
|
|
||||||
var updateEmoji = require('./update-emoji').updateEmoji
|
|
||||||
updateEmoji()
|
|
||||||
|
|
||||||
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
|
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
|
||||||
rm('-rf', assetsPath)
|
rm('-rf', assetsPath)
|
||||||
mkdir('-p', assetsPath)
|
mkdir('-p', assetsPath)
|
||||||
|
@ -36,8 +33,4 @@ webpack(webpackConfig, function (err, stats) {
|
||||||
chunks: false,
|
chunks: false,
|
||||||
chunkModules: false
|
chunkModules: false
|
||||||
}) + '\n')
|
}) + '\n')
|
||||||
if (stats.hasErrors()) {
|
|
||||||
console.error('See above for errors.')
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,9 +10,6 @@ var webpackConfig = process.env.NODE_ENV === 'testing'
|
||||||
? require('./webpack.prod.conf')
|
? require('./webpack.prod.conf')
|
||||||
: require('./webpack.dev.conf')
|
: require('./webpack.dev.conf')
|
||||||
|
|
||||||
var updateEmoji = require('./update-emoji').updateEmoji
|
|
||||||
updateEmoji()
|
|
||||||
|
|
||||||
// default port where dev server listens for incoming traffic
|
// default port where dev server listens for incoming traffic
|
||||||
var port = process.env.PORT || config.dev.port
|
var port = process.env.PORT || config.dev.port
|
||||||
// Define HTTP proxies to your custom API backend
|
// Define HTTP proxies to your custom API backend
|
||||||
|
@ -24,7 +21,6 @@ var compiler = webpack(webpackConfig)
|
||||||
|
|
||||||
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
||||||
publicPath: webpackConfig.output.publicPath,
|
publicPath: webpackConfig.output.publicPath,
|
||||||
writeToDisk: true,
|
|
||||||
stats: {
|
stats: {
|
||||||
colors: true,
|
colors: true,
|
||||||
chunks: false
|
chunks: false
|
||||||
|
@ -32,20 +28,18 @@ var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
||||||
})
|
})
|
||||||
|
|
||||||
var hotMiddleware = require('webpack-hot-middleware')(compiler)
|
var hotMiddleware = require('webpack-hot-middleware')(compiler)
|
||||||
|
|
||||||
// FIXME: The statement below gives error about hooks being required in webpack 5.
|
|
||||||
// force page reload when html-webpack-plugin template changes
|
// force page reload when html-webpack-plugin template changes
|
||||||
// compiler.plugin('compilation', function (compilation) {
|
compiler.plugin('compilation', function (compilation) {
|
||||||
// compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
|
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
|
||||||
// // FIXME: This supposed to reload whole page when index.html is changed,
|
// FIXME: This supposed to reload whole page when index.html is changed,
|
||||||
// // however now it reloads entire page on every breath, i suppose the order
|
// however now it reloads entire page on every breath, i suppose the order
|
||||||
// // of plugins changed or something. It's a minor thing and douesn't hurt
|
// of plugins changed or something. It's a minor thing and douesn't hurt
|
||||||
// // disabling it, constant reloads hurt much more
|
// disabling it, constant reloads hurt much more
|
||||||
|
|
||||||
// // hotMiddleware.publish({ action: 'reload' })
|
// hotMiddleware.publish({ action: 'reload' })
|
||||||
// // cb()
|
// cb()
|
||||||
// })
|
})
|
||||||
// })
|
})
|
||||||
|
|
||||||
// proxy api requests
|
// proxy api requests
|
||||||
Object.keys(proxyTable).forEach(function (context) {
|
Object.keys(proxyTable).forEach(function (context) {
|
||||||
|
@ -53,7 +47,7 @@ Object.keys(proxyTable).forEach(function (context) {
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
options = { target: options }
|
options = { target: options }
|
||||||
}
|
}
|
||||||
app.use(proxyMiddleware.createProxyMiddleware(context, options))
|
app.use(proxyMiddleware(context, options))
|
||||||
})
|
})
|
||||||
|
|
||||||
// handle fallback for HTML5 history API
|
// handle fallback for HTML5 history API
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
updateEmoji () {
|
|
||||||
const emojis = require('@kazvmoe-infra/unicode-emoji-json/data-by-group')
|
|
||||||
const fs = require('fs')
|
|
||||||
|
|
||||||
Object.keys(emojis)
|
|
||||||
.map(k => {
|
|
||||||
emojis[k].map(e => {
|
|
||||||
delete e.unicode_version
|
|
||||||
delete e.emoji_version
|
|
||||||
delete e.skin_tone_support_unicode_version
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const res = {}
|
|
||||||
Object.keys(emojis)
|
|
||||||
.map(k => {
|
|
||||||
const groupId = k.replace('&', 'and').replace(/ /g, '-').toLowerCase()
|
|
||||||
res[groupId] = emojis[k]
|
|
||||||
})
|
|
||||||
|
|
||||||
console.info('Updating emojis...')
|
|
||||||
fs.writeFileSync('static/emoji.json', JSON.stringify(res))
|
|
||||||
console.info('Done.')
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,11 +2,8 @@ var path = require('path')
|
||||||
var config = require('../config')
|
var config = require('../config')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var projectRoot = path.resolve(__dirname, '../')
|
var projectRoot = path.resolve(__dirname, '../')
|
||||||
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack5-plugin')
|
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
|
||||||
var CopyPlugin = require('copy-webpack-plugin');
|
var FontelloPlugin = require("fontello-webpack-plugin")
|
||||||
var { VueLoaderPlugin } = require('vue-loader')
|
|
||||||
var ESLintPlugin = require('eslint-webpack-plugin');
|
|
||||||
var StylelintPlugin = require('stylelint-webpack-plugin');
|
|
||||||
|
|
||||||
var env = process.env.NODE_ENV
|
var env = process.env.NODE_ENV
|
||||||
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
|
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
|
||||||
|
@ -24,8 +21,7 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
path: config.build.assetsRoot,
|
path: config.build.assetsRoot,
|
||||||
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
||||||
filename: '[name].js',
|
filename: '[name].js'
|
||||||
chunkFilename: '[name].js'
|
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
@ -33,47 +29,37 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.mjs', '.js', '.jsx', '.vue'],
|
extensions: ['.js', '.vue'],
|
||||||
modules: [
|
modules: [
|
||||||
path.join(__dirname, '../node_modules')
|
path.join(__dirname, '../node_modules')
|
||||||
],
|
],
|
||||||
alias: {
|
alias: {
|
||||||
'static': path.resolve(__dirname, '../static'),
|
'vue$': 'vue/dist/vue.runtime.common',
|
||||||
'src': path.resolve(__dirname, '../src'),
|
'src': path.resolve(__dirname, '../src'),
|
||||||
'assets': path.resolve(__dirname, '../src/assets'),
|
'assets': path.resolve(__dirname, '../src/assets'),
|
||||||
'components': path.resolve(__dirname, '../src/components'),
|
'components': path.resolve(__dirname, '../src/components')
|
||||||
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
|
|
||||||
},
|
|
||||||
fallback: {
|
|
||||||
'querystring': require.resolve('querystring-es3'),
|
|
||||||
'url': require.resolve('url/')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
noParse: /node_modules\/localforage\/dist\/localforage.js/,
|
noParse: /node_modules\/localforage\/dist\/localforage.js/,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
enforce: 'post',
|
enforce: 'pre',
|
||||||
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
|
test: /\.(js|vue)$/,
|
||||||
type: 'javascript/auto',
|
include: projectRoot,
|
||||||
loader: '@intlify/vue-i18n-loader',
|
exclude: /node_modules/,
|
||||||
include: [ // Use `Rule.include` to specify the files of locale messages to be pre-compiled
|
use: {
|
||||||
path.resolve(__dirname, '../src/i18n')
|
loader: 'eslint-loader',
|
||||||
]
|
options: {
|
||||||
|
formatter: require('eslint-friendly-formatter'),
|
||||||
|
sourceMap: config.build.productionSourceMap,
|
||||||
|
extract: true
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
loader: 'vue-loader',
|
use: 'vue-loader'
|
||||||
options: {
|
|
||||||
compilerOptions: {
|
|
||||||
isCustomElement(tag) {
|
|
||||||
if (tag === 'pinch-zoom') {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
|
@ -83,23 +69,24 @@ module.exports = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||||
type: 'asset',
|
use: {
|
||||||
generator: {
|
loader: 'url-loader',
|
||||||
filename: utils.assetsPath('img/[name].[hash:7][ext]')
|
options: {
|
||||||
|
limit: 10000,
|
||||||
|
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||||
type: 'asset',
|
use: {
|
||||||
generator: {
|
loader: 'url-loader',
|
||||||
filename: utils.assetsPath('fonts/[name].[hash:7][ext]')
|
options: {
|
||||||
|
limit: 10000,
|
||||||
|
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
test: /\.mjs$/,
|
|
||||||
include: /node_modules/,
|
|
||||||
type: 'javascript/auto'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -107,23 +94,13 @@ module.exports = {
|
||||||
entry: path.join(__dirname, '..', 'src/sw.js'),
|
entry: path.join(__dirname, '..', 'src/sw.js'),
|
||||||
filename: 'sw-pleroma.js'
|
filename: 'sw-pleroma.js'
|
||||||
}),
|
}),
|
||||||
new ESLintPlugin({
|
new FontelloPlugin({
|
||||||
extensions: ['js', 'vue'],
|
config: require('../static/fontello.json'),
|
||||||
formatter: require('eslint-formatter-friendly')
|
name: 'fontello',
|
||||||
}),
|
output: {
|
||||||
new StylelintPlugin({}),
|
css: 'static/[name].' + now + '.css', // [hash] is not supported. Use the current timestamp instead for versioning.
|
||||||
new VueLoaderPlugin(),
|
font: 'static/font/[name].' + now + '.[ext]'
|
||||||
// This copies Ruffle's WASM to a directory so that JS side can access it
|
}
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{
|
|
||||||
from: "node_modules/@ruffle-rs/ruffle/**/*",
|
|
||||||
to: "static/ruffle/[name][ext]"
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
concurrency: 100,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,14 +16,12 @@ module.exports = merge(baseWebpackConfig, {
|
||||||
},
|
},
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
// eval-source-map is faster for development
|
// eval-source-map is faster for development
|
||||||
devtool: 'eval-source-map',
|
devtool: '#eval-source-map',
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': config.dev.env,
|
'process.env': config.dev.env,
|
||||||
'COMMIT_HASH': JSON.stringify('DEV'),
|
'COMMIT_HASH': JSON.stringify('DEV'),
|
||||||
'DEV_OVERRIDES': JSON.stringify(config.dev.settings),
|
'DEV_OVERRIDES': JSON.stringify(config.dev.settings)
|
||||||
'__VUE_OPTIONS_API__': true,
|
|
||||||
'__VUE_PROD_DEVTOOLS__': false
|
|
||||||
}),
|
}),
|
||||||
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
|
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
|
|
|
@ -5,38 +5,26 @@ var webpack = require('webpack')
|
||||||
var merge = require('webpack-merge')
|
var merge = require('webpack-merge')
|
||||||
var baseWebpackConfig = require('./webpack.base.conf')
|
var baseWebpackConfig = require('./webpack.base.conf')
|
||||||
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
var MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||||
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
|
|
||||||
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
var env = process.env.NODE_ENV === 'testing'
|
var env = process.env.NODE_ENV === 'testing'
|
||||||
? require('../config/test.env')
|
? require('../config/test.env')
|
||||||
: config.build.env
|
: config.build.env
|
||||||
|
|
||||||
let commitHash = (() => {
|
let commitHash = require('child_process')
|
||||||
const subst = "$Format:%h$";
|
.execSync('git rev-parse --short HEAD')
|
||||||
if(!subst.match(/Format:/)) {
|
.toString();
|
||||||
return subst;
|
|
||||||
} else {
|
|
||||||
return require('child_process')
|
|
||||||
.execSync('git rev-parse --short HEAD')
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
var webpackConfig = merge(baseWebpackConfig, {
|
var webpackConfig = merge(baseWebpackConfig, {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
module: {
|
module: {
|
||||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
|
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, extract: true })
|
||||||
},
|
},
|
||||||
devtool: config.build.productionSourceMap ? 'source-map' : false,
|
devtool: config.build.productionSourceMap ? '#source-map' : false,
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: 'all'
|
chunks: 'all'
|
||||||
},
|
}
|
||||||
minimizer: [
|
|
||||||
`...`,
|
|
||||||
new CssMinimizerPlugin()
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: config.build.assetsRoot,
|
path: config.build.assetsRoot,
|
||||||
|
@ -48,9 +36,7 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': env,
|
'process.env': env,
|
||||||
'COMMIT_HASH': JSON.stringify(commitHash),
|
'COMMIT_HASH': JSON.stringify(commitHash),
|
||||||
'DEV_OVERRIDES': JSON.stringify(undefined),
|
'DEV_OVERRIDES': JSON.stringify(undefined)
|
||||||
'__VUE_OPTIONS_API__': true,
|
|
||||||
'__VUE_PROD_DEVTOOLS__': false
|
|
||||||
}),
|
}),
|
||||||
// extract css into its own file
|
// extract css into its own file
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
|
@ -72,7 +58,9 @@ var webpackConfig = merge(baseWebpackConfig, {
|
||||||
ignoreCustomComments: [/server-generated-meta/]
|
ignoreCustomComments: [/server-generated-meta/]
|
||||||
// more options:
|
// more options:
|
||||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||||
}
|
},
|
||||||
|
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||||
|
chunksSortMode: 'dependency'
|
||||||
}),
|
}),
|
||||||
// split vendor js into its own file
|
// split vendor js into its own file
|
||||||
// extract webpack runtime and module manifest to its own file in order to
|
// extract webpack runtime and module manifest to its own file in order to
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Make Pleroma FE to also view apng (Animated PNG) attachment.
|
|
|
@ -1 +0,0 @@
|
||||||
Added emoji pack management to the admin panel
|
|
|
@ -1 +0,0 @@
|
||||||
stop using that one runner for intensive tasks
|
|
|
@ -1 +0,0 @@
|
||||||
Create a link to the URL of the scrobble when it's present
|
|
|
@ -1 +0,0 @@
|
||||||
Fix native notifications appearing as many times as there are open tabs. Clicking on notification will focus last focused tab.
|
|
|
@ -1 +0,0 @@
|
||||||
Support showing extra notifications in the notifications column
|
|
|
@ -1 +0,0 @@
|
||||||
Focusing into a tab clears all current desktop notifications
|
|
|
@ -1 +0,0 @@
|
||||||
Support group actors
|
|
|
@ -1 +0,0 @@
|
||||||
Allow hiding custom emojis in picker.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed error that appeared on mobile Chrome(ium) (and derivatives) when native notifications are allowed
|
|
|
@ -1 +0,0 @@
|
||||||
Added option to not mark all notifications when closing notifications drawer on mobile, this creates a new button to mark all as seen.
|
|
|
@ -1 +0,0 @@
|
||||||
Fixed being unable to set notification visibility for reports and follow requests
|
|
|
@ -1 +0,0 @@
|
||||||
Added ability to mute sensitive posts (ported from eintei)
|
|
|
@ -1 +0,0 @@
|
||||||
Added option to toggle what notification types appear in native notifications, by default less important ones (likes, repeats, etc) will no longer show up in native notifications.
|
|
|
@ -1 +0,0 @@
|
||||||
Native notifications now also have "badge" property that matches instance's favicon (visible in Android Chromium at least)
|
|
|
@ -1 +0,0 @@
|
||||||
The expiry date indication won't be shown if the poll never expires
|
|
|
@ -1 +0,0 @@
|
||||||
Added option to treat non-interactive notifications (likes, repeats et all) as seen for visual purposes (no read mark, ignored in counters, still can show in native notifications)
|
|
|
@ -1 +0,0 @@
|
||||||
Synchronized requested notification types with backend, hopefully should fix missing notifications for polls and follow requests
|
|
|
@ -1 +0,0 @@
|
||||||
Interacting (opening reply box etc) or simply clicking on non-interactive notifications now marks them as read. Clicking on native notifications for non-interactive ones also marks them as seen.
|
|
|
@ -1 +0,0 @@
|
||||||
Notifications are no longer sorted by "seen" status since interacting with them can change their read status and makes UI jumpy. Old behavior can be restored in settings.
|
|
|
@ -1 +0,0 @@
|
||||||
Add poll end notifications to fetched types.
|
|
|
@ -1 +0,0 @@
|
||||||
Display public favorites on user profiles
|
|
|
@ -1 +0,0 @@
|
||||||
Display quotes count on posts and add quotes list page
|
|
|
@ -1 +0,0 @@
|
||||||
Show a dedicated registration notice page when further action is required after registering
|
|
|
@ -1 +0,0 @@
|
||||||
Option to only show scrobbles that are recent enough
|
|
|
@ -1 +0,0 @@
|
||||||
Notifications are now shown through a serviceworker (since mobile chrome does not allow them otherwise), it's always enabled, even if previously we only enabled it for WebPush notifications only. If you don't like websites "running" while closed, check how to disable them in your browser. Old way to show notifications will be used as a fallback but might not have all the new features.
|
|
|
@ -1 +0,0 @@
|
||||||
Shows the most recent scrobble under each post when available
|
|
|
@ -1 +0,0 @@
|
||||||
Display loading and error indicator for conversation page
|
|
|
@ -1 +0,0 @@
|
||||||
Add caching system for themes3
|
|
|
@ -1 +0,0 @@
|
||||||
fix color inputs and some in-development themes3 issues
|
|
|
@ -1 +0,0 @@
|
||||||
Overhauled the way themes work, migrating to new Pleroma Interface Style Sheets system.
|
|
|
@ -1 +0,0 @@
|
||||||
unread notifications should now properly catch up (eventually) in polling mode
|
|
|
@ -1 +0,0 @@
|
||||||
Video posters on Safari
|
|
|
@ -1 +0,0 @@
|
||||||
nothing
|
|
|
@ -1 +0,0 @@
|
||||||
Added option to always "show" notifications when using web push for better compatibility with some browsers (chrome, edge, safari)
|
|
|
@ -3,11 +3,6 @@ const path = require('path')
|
||||||
let settings = {}
|
let settings = {}
|
||||||
try {
|
try {
|
||||||
settings = require('./local.json')
|
settings = require('./local.json')
|
||||||
if (settings.target && settings.target.endsWith('/')) {
|
|
||||||
// replacing trailing slash since it can conflict with some apis
|
|
||||||
// and that's how actual BE reports its url
|
|
||||||
settings.target = settings.target.replace(/\/$/, '')
|
|
||||||
}
|
|
||||||
console.log('Using local dev server settings (/config/local.json):')
|
console.log('Using local dev server settings (/config/local.json):')
|
||||||
console.log(JSON.stringify(settings, null, 2))
|
console.log(JSON.stringify(settings, null, 2))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -52,10 +47,7 @@ module.exports = {
|
||||||
target,
|
target,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
cookieDomainRewrite: 'localhost',
|
cookieDomainRewrite: 'localhost',
|
||||||
ws: true,
|
ws: true
|
||||||
headers: {
|
|
||||||
'Origin': target
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
'/oauth/revoke': {
|
'/oauth/revoke': {
|
||||||
target,
|
target,
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Pleroma-FE configuration and customization for instance administrators
|
# Pleroma-FE configuration and customization for instance administrators
|
||||||
|
|
||||||
* *For user configuration, see [Pleroma-FE user guide](../user_guide)*
|
* *For user configuration, see [Pleroma-FE user guide](USER_GUIDE.md)*
|
||||||
* *For local development server configuration, see [Hacking, tweaking, contributing](HACKING.md)*
|
* *For local development server configuration, see [Hacking, tweaking, contributing](HACKING.md)*
|
||||||
|
|
||||||
## Where configuration is stored
|
## Where configuration is stored
|
||||||
|
|
||||||
PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it)
|
PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it)
|
||||||
|
|
||||||
1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](../backend/configuration/cheatsheet.md#frontend_configurations)
|
1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](https://docs-develop.pleroma.social/config.html#frontend_configurations)
|
||||||
2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/static/config.json).
|
2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/static/config.json).
|
||||||
3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/modules/instance.js) )
|
3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/modules/instance.js) )
|
||||||
|
|
||||||
|
@ -19,69 +19,32 @@ There's currently no mechanism for user-settings synchronization across several
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
### `alwaysShowSubjectInput`
|
### `theme`
|
||||||
`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"`
|
Default theme used for new users. De-facto instance-default, user can change theme.
|
||||||
|
|
||||||
### `background`
|
### `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.
|
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`
|
### `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`.
|
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.
|
`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`
|
### `redirectRootNoLogin`, `redirectRootLogin`
|
||||||
These two settings should point to where FE should redirect visitor when they login/open up website root
|
These two settings should point to where FE should redirect visitor when they login/open up website root
|
||||||
|
|
||||||
### `scopeCopy`
|
### `chatDisabled`
|
||||||
Copy post scope (visibility) when replying to a post. Instance-default.
|
hides the chat (TODO: even if it's enabled on backend)
|
||||||
|
|
||||||
### `sidebarRight`
|
|
||||||
Change alignment of sidebar and panels to the right. Defaults to `false`.
|
|
||||||
|
|
||||||
### `showFeaturesPanel`
|
|
||||||
Show panel showcasing instance features/settings to logged-out visitors
|
|
||||||
|
|
||||||
### `showInstanceSpecificPanel`
|
### `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.
|
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`
|
### `subjectLineBehavior`
|
||||||
How to handle subject line (CW) when replying to a post.
|
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.
|
* `"email"` - like EMail - prepend `re: ` to subject line if it doesn't already start with it.
|
||||||
|
@ -89,22 +52,39 @@ How to handle subject line (CW) when replying to a post.
|
||||||
* `"noop"` - do not copy
|
* `"noop"` - do not copy
|
||||||
Instance-default.
|
Instance-default.
|
||||||
|
|
||||||
### `theme`
|
### `postContentType`
|
||||||
Default theme used for new users. De-facto instance-default, user can change theme.
|
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)
|
||||||
|
|
||||||
### `webPushNotifications`
|
### `webPushNotifications`
|
||||||
Enables [PushAPI](https://developer.mozilla.org/en-US/docs/Web/API/Push_API) - based notifications for users. Instance-default.
|
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
|
## 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.
|
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
|
### Chat
|
||||||
**TODO somewhat broken, see: disableChat** chat can be disabled by disabling it in backend
|
**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 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)
|
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)
|
||||||
|
@ -112,3 +92,13 @@ Rich text formatting options are displayed depending on how many formatting opti
|
||||||
### Who to follow
|
### 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.
|
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.
|
||||||
|
|
||||||
|
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!
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
|
@ -25,17 +25,7 @@ This could be a bit trickier, you basically need steps 1-4 from *develop build*
|
||||||
|
|
||||||
### Replacing your instance's frontend with custom FE build
|
### Replacing your instance's frontend with custom FE build
|
||||||
|
|
||||||
#### New way (via AdminFE, a bit janky but works)
|
This is the most easiest way to use and test FE build: you just need to copy or symlink contents of `dist` folder into backend's [static directory](https://docs.pleroma.social/static_dir.html), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder.
|
||||||
|
|
||||||
In backend's [static directory](../backend/configuration/static_dir.md) there should be a folder called `frontends` if you installed any frontends from AdminFE before, otherwise you can create it yourself (ensuring correct permissions). Backend will serve given frontend from path `frontends/{frontend}/{reference}`, where `{frontend}` is name of frontend (`pleroma-fe`) and `{reference}` is version. You could make a production build, move `dist` folder into `frontends/pleroma-fe` and rename it into something like `myCustomVersion`. To actually make backend serve this frontend by default, in AdminFE you'll need to set name/reference in Settings -> Frontend -> Frontends -> Primary.
|
|
||||||
|
|
||||||
You could also install from a zip file (i.e. CI build) but AdminFE UI is a bit buggy and lacking, so this approach is not recommended.
|
|
||||||
|
|
||||||
Take note that frontend management is in early development and currently there's no way for user to change frontend or version for themselves, primary frontend becomes default frontend for all users and visitors.
|
|
||||||
|
|
||||||
#### Old way (replaces everything, hard to maintain, not recommended)
|
|
||||||
|
|
||||||
Copy or symlink contents of `dist` folder into backend's [static directory](../backend/configuration/static_dir.md), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder, and this could remove emojis, other frontends etc. and therefore this approach is not recommended.
|
|
||||||
|
|
||||||
### Running production build locally or on a separate server
|
### Running production build locally or on a separate server
|
||||||
|
|
||||||
|
@ -77,9 +67,9 @@ server {
|
||||||
|
|
||||||
### API, Data, Operations
|
### API, Data, Operations
|
||||||
|
|
||||||
In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](../backend/API/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure.
|
In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](https://docs-develop.pleroma.social/differences_in_mastoapi_responses.html) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure.
|
||||||
|
|
||||||
PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://git.pleroma.social/pleroma/pleroma-fe/-/blob/develop/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation.
|
PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation.
|
||||||
|
|
||||||
For most part, PleromaFE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters.
|
For most part, PleromaFE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,209 @@
|
||||||
|
# Pleroma-FE user guide
|
||||||
|
|
||||||
|
> Be prepared for breaking changes, unexpected behavior and this user guide becoming obsolete and wrong.
|
||||||
|
|
||||||
|
> If there was no insanity
|
||||||
|
>
|
||||||
|
> it would be necessary to create it.
|
||||||
|
>
|
||||||
|
> --Catbag
|
||||||
|
|
||||||
|
Pleroma-FE user interface is modeled after Qvitter which is modeled after older Twitter design. It provides a simple 2-column interface for microblogging. While being simple by default it also provides many powerful customization options.
|
||||||
|
|
||||||
|
## Posting, reading, basic functions.
|
||||||
|
|
||||||
|
After registering and logging in you're presented with your timeline in right column and new post form with timeline list and notifications in the left column.
|
||||||
|
|
||||||
|
Posts will contain the text you are posting, but some content will be modified:
|
||||||
|
|
||||||
|
1. Mentions: Mentions have the form of @user or @user<span></span>@instance.tld. These will become links to the user's profile. In addition, the mentioned user will always get a notification about the post they have been mentioned in, so only mention users that you want to receive this message.
|
||||||
|
2. URLs: URLs like `http://example.com` will be automatically be turned into a clickable links.
|
||||||
|
3. Hashtags: Hashtags like #cofe will also be turned into links.
|
||||||
|
|
||||||
|
**Depending on your instance some of the options might not be available or have different defaults**
|
||||||
|
|
||||||
|
Let's clear up some basic stuff. When you post something it's called a **post** or it could be called a **status** or even a **toot** or a **prööt** depending on whom you ask. Post has body/content but it also has some other stuff in it - from attachments, visibility scope, subject line.
|
||||||
|
* **Emoji** are small images embedded in text, there are two major types of emoji: [unicode emoji](https://en.wikipedia.org/wiki/Emoji) and custom emoji. While unicode emoji are universal and standardized, they can appear differently depending on where you are using them or may not appear at all on older systems. Custom emoji are more *fun* kind - instance administrator can define many images as *custom emoji* for their users. This works very simple - custom emoji is defined by its *shortcode* and an image, so that any shortcode enclosed in colons get replaced with image if such shortcode exist.
|
||||||
|
Let's say there's `:pleroma:` emoji defined on instance. That means
|
||||||
|
> First time using :pleroma: pleroma!
|
||||||
|
|
||||||
|
will become
|
||||||
|
> First time using ![pleroma](./example_emoji.png) pleroma!
|
||||||
|
|
||||||
|
Note that you can only use emoji defined on your instance, you cannot "copy" someone else's emoji, and will have to ask your administrator to copy emoji from other instance to yours.
|
||||||
|
Lastly, there's two convenience options for emoji: an emoji picker (smiley face to the right of "submit" button) and autocomplete suggestions - when you start typing :shortcode: it will automatically try to suggest you emoj and complete the shortcode for you if you select one. **Note** that if emoji doesn't show up in suggestions nor in emoji picker it means there's no such emoji on your instance, if shortcode doesn't match any defined emoji it will appear as text.
|
||||||
|
* **Attachments** are fairly simple - you can attach any file to a post as long as the file is within maximum size limits. If you're uploading explicit material you can mark all of your attachments as sensitive (or add `#nsfw` tag) - it will hide the images and videos behind a warning so that it won't be displayed instantly.
|
||||||
|
* **Subject line** also known as **CW** (Content Warning) could be used as a header to the post and/or to warn others about contents of the post having something that might upset somebody or something among those lines. Several applications allow to hide post content leaving only subject line visible. As a side-effect using subject line will also mark your images as sensitive (see above).
|
||||||
|
* **Visiblity scope** controls who will be able to see your posts. There are four scopes available:
|
||||||
|
|
||||||
|
1. `Public`: This is the default, and some fediverse software like GNU Social only supports this. This means that your post is accessible by anyone and will be shown in the public timelines.
|
||||||
|
2. `Unlisted`: This is the same as public, but your post won't appear in the public timelines. The post will still be accessible by anyone who comes across it (for example, by looking at your profile) or by direct linking. They will also appear in public searches.
|
||||||
|
3. `Followers only`: This will show your post only to your followers. Only they will be able to interact with it. Be careful: When somebody follows you, they will be able to see all your previous `followers only` posts as well! If you want to restrict who can follow you, consider [locking your account down to only approved followers](#profle).
|
||||||
|
4. `Direct`: This will only send the message to the people explicitly mentioned in the post.
|
||||||
|
|
||||||
|
A few things to consider about the security and usage of these scopes:
|
||||||
|
|
||||||
|
- None of these options will change the fact that the messages are all saved in the database unencrypted. They will be visible to your server admin and to any other admin of a server who receives this post. Do not share information that you would consider secret or dangerous. Use encrypted messaging systems for these things.
|
||||||
|
- Follower-only posts can lead to fragmented conversations. If you post a follower-only post and somebody else replies to it with a follower-only post, only people following both of you will see the whole conversation thread. Everybody else will only see half of it. Keep this in mind and keep conversations public if possible.
|
||||||
|
- Changing scopes during a thread or adding people to a direct message will not retroactively make them see the whole conversation. If you add someone to a direct message conversation, they will not see the post that happened before they were mentioned.
|
||||||
|
* **Reply-to** if you are replying to someone, your post will also contain a note that your post is referring to the post you're replying to. Person you're replying to will receive a notification *even* if you remove them from mentioned people. You won't receive notifications when replying to your own posts, but it's useful to reply to your own posts to provide people some context if it's a follow-up to a previous post. There's a small "Reply to ..." label under post author's name which you can hover on to see what post it's referring to.
|
||||||
|
|
||||||
|
Sometimes you may encounter posts that seem different than what they are supposed to. For example, you might see a direct message without any mentions in the text. This can happen because internally, the Fediverse has a different addressing mechanism similar to email, with `to` and `cc` fields. While these are not directly accessible in PleromaFE, other software in the Fediverse might generate those posts. Do not worry in these cases, these are normal and not a bug.
|
||||||
|
|
||||||
|
#### Rich text
|
||||||
|
|
||||||
|
By default new posts you make are plaintext, meaning you can't make text **bold** or add custom links or make lists or anything like that. However if your instance allows it you can use Markdown or BBCode or HTML to spice up your text, however there are certain limitations to what HTML tags and what features of Markdown you can use.
|
||||||
|
|
||||||
|
this section will be expanded later
|
||||||
|
|
||||||
|
### Other actions
|
||||||
|
|
||||||
|
In addition to posting you can also *favorite* post also known as *liking* them and *repeat* posts (also known as *retweeting*, *boosting* and even *reprööting*). Favoriting a post increments a counter on it, notifies post author of your affection towards that post and also adds that post to your "favorited" posts list (in your own profile, "Favorites" tab). Reprööting a post does all that and also repeats this post to your followers and your profile page with a note "*user* repeated post".
|
||||||
|
|
||||||
|
Your own posts can be deleted, but this will only reliably delete the post from your own instance. Other instances will receive a deletion notice, but there's no way to force them to actually delete a post. In addition, not all instances that contain the message might even receive the deletion notice, because they might be offline or not known to have the post because they received it through a repeat. Lastly, deletion notice might not reach certain frontends and clients - post will be visible for them until page refresh or cache clear, they probably won't be able to interact with it apart from replying to it (which will have reply-to mark missing).
|
||||||
|
|
||||||
|
If you are a moderator, you can also delete posts by other people. If those people are on your instance, it will delete the post and send out the deletion notice to other servers. If they are not on your instance, it will just remove the post from your local instance.
|
||||||
|
|
||||||
|
There's also an option to report a user via a post (if the feature is available on your instance) which could be used to notify your (and probably other instance's) admin that someone is being naughty.
|
||||||
|
|
||||||
|
## Users
|
||||||
|
|
||||||
|
When you see someone, you can click on their user picture to view their profile, and click on the userpic in that to see *full* profile. You can *follow* them, *mute* and *block* them. Following is self-explanatory, it adds them t your Home Timeline, lists you as a follower and gives you access to follower-only posts if they have any. Muting makes posts and notifications made by them very tiny, giving you an option to see the post if you're curious. However on clients other than PleromaFE their posts will be completely removed. *Blocking* a user removes them from your timeline and notifications and prevents them from following you (automatically unfollows them from you).
|
||||||
|
|
||||||
|
Please note that some users can be "locked", meaning instead of following them you send a follow request they need to approve for you to become their follower.
|
||||||
|
|
||||||
|
## Timelines
|
||||||
|
|
||||||
|
Currently you have several timelines to browse trough:
|
||||||
|
* **Timeline** aka Home Timeline - this timeline contains all posts by people you follow and your own posts, as well as posts mentioning you directly.
|
||||||
|
* **Interactions** all interactions you've had with people on the network, basically same as notifications except grouped in convenient way - mentions separate from favorites with repeats separate from follows
|
||||||
|
* **Direct Messages** all posts with `direct` scope addressed to you or mentioning you.
|
||||||
|
* **Public Timelines** all posts made by users on instance you're on
|
||||||
|
* **The Whole Known Network** also known as **TWKN** or **Federated Timeline** - all posts on the network by everyone, almost. Due to nature of the network your instance may not know *all** the instances on the network, so only posts originating from known instances are shown there.
|
||||||
|
|
||||||
|
## Your profile
|
||||||
|
|
||||||
|
By clicking wrench icon above the post form you can access the profile edit or "user settings" screen.
|
||||||
|
|
||||||
|
### Profle
|
||||||
|
|
||||||
|
Here you can set up how you appear to other users among with some other settings:
|
||||||
|
|
||||||
|
- Name: this is text that displays next to your avatar in posts. Please note that you **cannot** change your *@<span></span>handle*
|
||||||
|
- Bio: this will be displayed under your profile - you can put anything you want there you want for everyone to see.
|
||||||
|
- Restrict your account to approved followers only: this makes your account "locked", when people follow you - you have to approve or deny their follow requests, this gives more control over who sees your followers only posts.
|
||||||
|
- Default visibility scope: this chooses your default post scope for new posts
|
||||||
|
- Strip rich text from all posts: this strips rich text formatting (bold/italics/lists etc) from all incoming posts. Will only affect newly fetched posts.
|
||||||
|
|
||||||
|
If you're admin or moderator on your instance you also get "Show [role] badge in my profile" - this controls whether to show "Admin" or "Moderator** label on your profile page.
|
||||||
|
|
||||||
|
**For all options mentioned above you have to click "Submit" button for changes to take place**
|
||||||
|
|
||||||
|
- Avatar: this changes picture next to your posts. Your avatar shouldn't exceed 2 MiB (2097152 bytes) or it could cause problems with certain instances.
|
||||||
|
- Banner: this changes background on your profile card. Same as avatar it shouldn't exceed 2 MiB limit.
|
||||||
|
- Profile Background: this changes background picture for UI. It isn't shown to anyone else **yet**, but some time later it will be shown when viewing your profile.
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
Here you can change your password, revoke access tokens, configure 2-factor authentication (if available).
|
||||||
|
|
||||||
|
### Notifications
|
||||||
|
|
||||||
|
This screen allows more fine-grained control over what notifications to show to you based on whom it comes from
|
||||||
|
|
||||||
|
### Data Import/Export
|
||||||
|
|
||||||
|
This allows you to export and import a list of people you follow, in case instance's database gets reverted or if you want to move to another server. Note that you **CANNOT export/import list of people who *follow you***, they'll just need to follow you back after you move.
|
||||||
|
|
||||||
|
### Blocks and Mutes
|
||||||
|
|
||||||
|
These screens give access to full list of people you block/mute, useful for *un*blocking/*un*muting people because blocking/muting them most likely removes them out of your sight completely.
|
||||||
|
|
||||||
|
## Other stuff
|
||||||
|
|
||||||
|
By default you can see **ALL** posts made by other users on your Home Timeline, this contrast behavior of Twitter and Mastodon, which shows you only non-reply posts and replies to people you follow. You can set it up to replicate the said behavior, however the option is currently broken.
|
||||||
|
|
||||||
|
You can view other people's profiles and search for users (top-right corner, person with a plus icon). Tag search is possible but not implemented properly yet, right now you can click on tag link in a post to see posts tagged with that post.
|
||||||
|
|
||||||
|
You can also view posts you've favorited on your own profile, but you cannot see favorites by other people.
|
||||||
|
|
||||||
|
Due to nature of how Pleroma (backend) operates you might see old posts appear as if they are new, this is because instance just learned about that post (i.e. your instance is younger that some other ones) and someone interacted with old post. Posts are sorted by date of when they are received, not date they have been posted because it's very easy to spoof the date, so a post claiming it "was" made in year 2077 could hand at top of your TL forever.
|
||||||
|
|
||||||
|
# Customization and configuration
|
||||||
|
|
||||||
|
Clicking on the cog icon in the upper right will go to the settings screen.
|
||||||
|
|
||||||
|
## General
|
||||||
|
|
||||||
|
### Interface
|
||||||
|
|
||||||
|
- Language: Here you can set the interface language. The default language is the one that you set in your browser settings.
|
||||||
|
- Hide instance-specific panel: This hides the panel in the lower left that usually contains general information about the server.
|
||||||
|
|
||||||
|
### Timeline
|
||||||
|
|
||||||
|
- Hide posts of muted users: If this is set, 'muting' a user will completely hide their posts instead of collapsing them.
|
||||||
|
- Collapse posts with subjects: This will collapse posts that contain a subject, hiding their content. Subjects are also sometimes called content warnings.
|
||||||
|
- Enable automatic streaming of new posts when scrolled to the top: With this enabled, new posts will automatically stream in when you are scrolled to the top. Otherwise, you will see a button on the timeline that will let you display the new posts.
|
||||||
|
- Pause streaming when tab is not focused: This pauses the automatic streaming that the previous option enables when the tab is out of focus. This is useful if you don't want to miss any new posts.
|
||||||
|
- Enable automatic loading when scrolled to the bottom: When this is disabled, a button will be shown on the bottom of the timeline that will let you load older posts.
|
||||||
|
- Enable reply-link preview on hover: Status posts in the timeline and notifications contain links to replies and to the post they are a reply to. If this setting is enabled, hovering over that link will display that linked post in a small hovering overlay.
|
||||||
|
|
||||||
|
### Composing
|
||||||
|
|
||||||
|
- Copy scope when replying: When this is activated, the scope of a reply will be the same as the scope of the post it is replying to. This is useful to prevent accidentally moving private discussions to public, or vice versa.
|
||||||
|
- Always show subject field: Whether or not to display the 'subject' input field in the post form. If you do not want to use subjects, you can deactivate this.
|
||||||
|
- Copy subject when replying: This controls if the subject of a post will be copied from the post it is replying to.
|
||||||
|
- Post status content type: Selects the default content type of your post. The options are: Plain text, HTML, BBCode and Markdown.
|
||||||
|
- Minimize scope selection options: Selecting this will reduce the visibility scopes to 'direct', your default post scope and post scope of post you're replying to.
|
||||||
|
- Automatically hide New Post button: Mobile interface only: hide floating "New post" button when scrolling
|
||||||
|
|
||||||
|
### Attachments
|
||||||
|
|
||||||
|
- Hide attachments in timeline: Do not display attachments in timelines. They will still display in expanded conversations. This is useful to save bandwidth and for browsing in public.
|
||||||
|
- Hide attachments in conversations: Also hide attachments in expanded conversations.
|
||||||
|
- Maximum amount of thumbnails per post: Exactly that :)
|
||||||
|
- Enable clickthrough NSFW attachment hiding: Hide attachments that are marked as NSFW/sensitive behind a click-through image.`
|
||||||
|
- Preload images: This will preload the hidden images so that they display faster when clicking through.
|
||||||
|
- Open NSFW attachments with just one click: Directly open NSFW attachments in a maximised state instead of revealing the image thumbnail.
|
||||||
|
- Play-on-hover GIFs: With this activated, GIFs images and avatars will only be animated on mouse hover. Otherwise, they will be always animated. This is very useful if your timeline looks too flashy from people's animated avatars and eases the CPU load.
|
||||||
|
- Loop videos: Whether to loop videos indefinitely.
|
||||||
|
- Loop only videos without sound: Some instances will use videos without sounds instead of GIFs. This will make only those videos autoplay.
|
||||||
|
- Play videos directly in the media viewer: Play videos right in the timeline instead of opening it in a modal
|
||||||
|
- Don't crop the attachment in thumbnails: if enabled, images in attachments will be fit entirely inside the container instead of being zoomed in and cropped.
|
||||||
|
|
||||||
|
### Notifications
|
||||||
|
|
||||||
|
- Enable web push notifications: this enables Web Push notifications, to allow receiving notifications even when the page isn't opened, doesn't affect regular notifications.
|
||||||
|
|
||||||
|
## Theme
|
||||||
|
|
||||||
|
You can change the look and feel of Pleroma Frontend here. You can choose from several instance-provided presets and you can load one from file and save current theme to file. Before you apply new theme you can see what it will look like approximately in preview section.
|
||||||
|
|
||||||
|
Themes engine was made to be easy to use while giving an option for powerful in-depth customization - you can just tweak colors on "Common" tab and leave everything else as is.
|
||||||
|
|
||||||
|
If there's a little check box next to a color picker it means that color is optional and unless checked will be automatically picked based on some other color or defaults.
|
||||||
|
|
||||||
|
For some features you can also adjust transparency of it by changing its opacity, you just need to tick checkbox next to it, otherwise it will be using default opacity.
|
||||||
|
|
||||||
|
Contrast information is also provided - you can see how readable text is based on contrast between text color and background, icons under color pickers represent contrast rating based on [WCAG](https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast) - thumbs up means AAA rating (good), half-filled circle means AA rating (acceptable) and warning icon means it doesn't pass the minimal contrast requirement and probably will be less readable, especially for vision-challenged people, you can hover over icon to see more detailed information. *Please note* that if background is not opaque (opacity != 1) contrast will be measured based on "worst case scenario", i.e. behind semi-transparent background lies some solid color that makes text harder to read, this however is still inaccurate because it doesn't account that background can be noisy/busy, making text even harder to read.
|
||||||
|
|
||||||
|
Apart from colors you can also tweak shadow and lighting, which is used mostly to give buttons proper relief based on their state, give panes their shade, make things glow etc. It's quite powerful, and basically provides somewhat convenient interface for [CSS Shadows](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow).
|
||||||
|
|
||||||
|
Another thing you can tweak is theme's roundness - some people like sharp edges, some want things more rounded. This is also used if you want circled or square avatars.
|
||||||
|
|
||||||
|
Lastly, you can redefine fonts used in UI without changing fonts in your browser or system, this however requires you to enter font's full name and having that font installed on your system.
|
||||||
|
|
||||||
|
## Filtering
|
||||||
|
|
||||||
|
- Types of notifications to show: This controls what kind of notifications will appear in notification column and which notifications to get in your system outside the web page
|
||||||
|
- Replies in timeline: You may know that other social networks like Twitter will often not display replies to other people in your timeline, even if you are following the poster. Pleroma usually will show these posts to you to encourage conversation. If you do not like this behavior, you can change it here.
|
||||||
|
- Hide post statistics: This hides the number of favorites, number of replies, etc.
|
||||||
|
- Hide user statistics: This hides the number of followers, friends, etc.
|
||||||
|
- Muted words: A list of words that will be muted (i.e. displayed in a collapsed state) on the timeline and in notifications. An easy way to tune down noise in your timeline. Posts can always be expanded when you actually want to see them.
|
||||||
|
- Hide filtered statuses: Selecting this will hide the filtered / muted posts completely instead of collapsing them.
|
||||||
|
|
||||||
|
|
||||||
|
## Version
|
||||||
|
|
||||||
|
Just displays the backend and frontend version. Useful to mention in bug reports.
|
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 491 B |
|
@ -1,8 +0,0 @@
|
||||||
# Introduction to Pleroma-FE
|
|
||||||
## What is Pleroma-FE?
|
|
||||||
|
|
||||||
Pleroma-FE is the default user-facing frontend for Pleroma. It's user interface is modeled after Qvitter which is modeled after an older Twitter design. It provides a simple 2-column interface for microblogging. While being simple by default it also provides many powerful customization options.
|
|
||||||
|
|
||||||
## How can I use it?
|
|
||||||
|
|
||||||
If your instance uses Pleroma-FE, you can acces it by going to your instance (e.g. <https://pleroma.soykaf.com>). You can read more about it's basic functionality in the [Pleroma-FE User Guide](./user_guide/). We also have [a guide for administrators](./CONFIGURATION.md) and for [hackers/contributors](./HACKING.md).
|
|
|
@ -1,44 +0,0 @@
|
||||||
# General overview
|
|
||||||
|
|
||||||
> Be prepared for breaking changes, unexpected behavior and this user guide becoming obsolete and wrong.
|
|
||||||
|
|
||||||
> If there was no insanity
|
|
||||||
>
|
|
||||||
> it would be necessary to create it.
|
|
||||||
>
|
|
||||||
> --Catbag
|
|
||||||
|
|
||||||
Pleroma-FE is the default user-facing frontend for Pleroma. If your instance uses Pleroma-FE, you can access it by going to your instance (e.g. <https://pleroma.soykaf.com>). After logging in you will have two columns in front of you. Here we're going to keep it to the default behaviour, but some instances swap the left and right columns. If you're on such an instance what we refer to as the left column will be on your right and vice versa.
|
|
||||||
|
|
||||||
### Left column
|
|
||||||
|
|
||||||
- first block: This section is dedicated to [posting](posting_reading_basic_functions.md)
|
|
||||||
- second block: Here you can switch between the different views for the right column.
|
|
||||||
- Optional third block: This is the Instance panel that can be activated, but is deactivated by default. It's fully customisable by instance admins and by default has links to the Pleroma-FE and Mastodon-FE.
|
|
||||||
- fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses
|
|
||||||
|
|
||||||
### Right column
|
|
||||||
This is where the interesting stuff happens! There are different views depending on what you choose in the second block of the left panel.
|
|
||||||
|
|
||||||
- **Timelines** Depending on the [timeline](timelines.md) you will see different statuses, but each status has a standard structure:
|
|
||||||
- Profile pic, name and link to profile. An optional left-arrow if it's a reply to another status (hovering will reveal the reply-to status). Clicking on the profile pic will uncollapse the user's profile where you can find information about the account and can [follow, mute or block the account](users_follow_mute_block.md).
|
|
||||||
- An arrow icon on the right side allows you to open the status on the instance where it's originating from.
|
|
||||||
- A `+` button on the rightmost side allows you to Expand/Collapse an entire discussion thread.
|
|
||||||
- The text of the status, including mentions and attachments. If you click on a mention, it will automatically open the profile page of that person.
|
|
||||||
- Four buttons (left to right): Reply, Repeat, Favorite and Add Reaction. The three dots next to it are a dropdown menu for extra options including simple moderation, bookmarking, deleting posts, pinning your own posts to your profile and more.
|
|
||||||
- **Interactions** shows all interactions you've had with people on the network, basically same as notifications except grouped in convenient way.
|
|
||||||
- **Chats** is the chat feature. You can find your friends and start chatting with them. At the moment chat are only one-on-one, but once groups are introduced groupchats will also be possible.
|
|
||||||
- **About** is the about-page and lists the staff, the TOS, activated MRF's, and enabled features
|
|
||||||
|
|
||||||
### Top right
|
|
||||||
|
|
||||||
- The magnifier icon opens the search screen
|
|
||||||
- You can search for statuses, people and hashtags.
|
|
||||||
- You can import statuses from remote servers by pasting the url to the post in the search field.
|
|
||||||
- If you want to search for users that your instance doesn't know about yet, you can search for them using the full `name@instance.tld` handle. You can also use the full url from their remote profile.
|
|
||||||
- The gear icon gives you [settings](settings.md)
|
|
||||||
- If you have admin rights, you'll see an icon that opens the admin interface
|
|
||||||
- The last icon is to log out
|
|
||||||
|
|
||||||
### Bottom right
|
|
||||||
On the bottom right you have the Shoutbox. Here you can communicate with people on the same instance in realtime. It is local-only, very basic and will most probably be removed once the Chats functionality allows group chats.
|
|
|
@ -1,76 +0,0 @@
|
||||||
# Posting, reading, basic functions.
|
|
||||||
|
|
||||||
!!! warning
|
|
||||||
Depending on your instance some of the options might not be available or have different defaults
|
|
||||||
|
|
||||||
After registering and logging in you're presented with your timeline in right column and new post form with timeline list and notifications in the left column.
|
|
||||||
|
|
||||||
Posts will contain the text you are posting, but some content will be modified:
|
|
||||||
|
|
||||||
1. Mentions: Mentions have the form of @user or @user<span></span>@instance.tld. These will become links to the user's profile. In addition, the mentioned user will always get a notification about the post they have been mentioned in, so only mention users that you want to receive this message.
|
|
||||||
2. URLs: URLs like `http://example.com` will be automatically be turned into a clickable links.
|
|
||||||
3. Hashtags: Hashtags like #cofe will also be turned into links.
|
|
||||||
4. There is a default character limit of 5000 characters.
|
|
||||||
|
|
||||||
Let's clear up some basic stuff. When you post something it's called a **post** or it could be called a **status** or even a **toot** or a **prööt** depending on whom you ask. Post has body/content but it also has some other stuff in it - from attachments, visibility scope, subject line...
|
|
||||||
|
|
||||||
**Emoji** are small images embedded in text, there are two major types of emoji: [unicode emoji](https://en.wikipedia.org/wiki/Emoji) and custom emoji. While unicode emoji are universal and standardized, they can appear differently depending on where you are using them or may not appear at all on older systems. Custom emoji are a more *fun* kind - instance administrator can define many images as *custom emoji* for their users. This works very simple - custom emoji is defined by its *shortcode* and an image, so that any shortcode enclosed in colons get replaced with image if such shortcode exist.
|
|
||||||
Let's say there's a `:pleroma:` emoji defined on an instance. That means
|
|
||||||
> First time using :pleroma: pleroma!
|
|
||||||
|
|
||||||
will become
|
|
||||||
> First time using ![pleroma](../assets/example_emoji.png) pleroma!
|
|
||||||
|
|
||||||
Note that you can only use emoji defined on your instance, you cannot "copy" someone else's emoji, and will have to ask your administrator to copy emoji from other instance to yours.
|
|
||||||
Lastly, there's two convenience options for emoji: an emoji picker (smiley face to the right of "submit" button) and autocomplete suggestions - when you start typing :shortcode: it will automatically try to suggest you emoji and complete the shortcode for you if you select one. If emoji doesn't show up in suggestions nor in emoji picker it means there's no such emoji on your instance, if shortcode doesn't match any defined emoji it will appear as text.
|
|
||||||
|
|
||||||
**Attachments** are fairly simple - you can attach any file to a post as long as the file is within maximum size limits. If you're uploading explicit material you can mark all of your attachments as sensitive (or add the `#nsfw` tag) - it will hide the images and videos behind a warning so that it won't be displayed instantly.
|
|
||||||
|
|
||||||
**Subject line** also known as **CW** (Content Warning) could be used as a header to the post and/or to warn others about contents of the post having something that might upset somebody or something among those lines. Several applications allow to hide post content leaving only subject line visible. Using a subject line will not mark your images as sensitive, you will have to do that explicitly (see above).
|
|
||||||
|
|
||||||
**Visiblity scope** controls who will be able to see your posts. There are four scopes available:
|
|
||||||
|
|
||||||
1. `Public`: This is the default, and some fediverse software, like GNU Social, only supports this. This means that your post is accessible by anyone and will be shown in the public timelines.
|
|
||||||
2. `Unlisted`: This is the same as public, but your post won't appear in the public timelines. The post will still be accessible by anyone who comes across it (for example, by looking at your profile) or by direct linking. They will also appear in public searches.
|
|
||||||
3. `Followers only`: This will show your post only to your followers. Only they will be able to interact with it. Be careful: When somebody follows you, they will be able to see all your previous `followers only` posts as well! If you want to restrict who can follow you, consider [locking your account down to only approved followers](../settings#profile).
|
|
||||||
4. `Direct`: This will only send the message to the people explicitly mentioned in the post.
|
|
||||||
|
|
||||||
A few things to consider about the security and usage of these scopes:
|
|
||||||
|
|
||||||
- None of these options will change the fact that the messages are all saved in the database unencrypted. They will be visible to your server admin and to any other admin of a server who receives this post. Do not share information that you would consider secret or dangerous. Use encrypted messaging systems for these things.
|
|
||||||
- Follower-only posts can lead to fragmented conversations. If you post a follower-only post and somebody else replies to it with a follower-only post, only people following both of you will see the whole conversation thread. Everybody else will only see half of it. Keep this in mind and keep conversations public if possible.
|
|
||||||
- Changing scopes during a thread or adding people to a direct message will not retroactively make them see the whole conversation. If you add someone to a direct message conversation, they will not see the post that happened before they were mentioned.
|
|
||||||
* **Reply-to** if you are replying to someone, your post will also contain a note that your post is referring to the post you're replying to. Person you're replying to will receive a notification *even* if you remove them from mentioned people. You won't receive notifications when replying to your own posts, but it's useful to reply to your own posts to provide people some context if it's a follow-up to a previous post. There's a small "Reply to ..." label under post author's name which you can hover on to see what post it's referring to.
|
|
||||||
|
|
||||||
Sometimes you may encounter posts that seem different than what they are supposed to. For example, you might see a direct message without any mentions in the text. This can happen because internally, the Fediverse has a different addressing mechanism similar to email, with `to` and `cc` fields. While these are not directly accessible in PleromaFE, other software in the Fediverse might generate those posts. Do not worry in these cases, these are normal and not a bug.
|
|
||||||
|
|
||||||
## Rich text
|
|
||||||
|
|
||||||
By default new posts you make are plaintext, meaning you can't make text **bold** or add custom links or make lists or anything like that. However if your instance allows it you can use Markdown or BBCode or HTML to spice up your text, however there are certain limitations to what HTML tags and what features of Markdown you can use.
|
|
||||||
|
|
||||||
Here is a small example of some text in markdown.
|
|
||||||
|
|
||||||
```
|
|
||||||
This is an example of markdown text using **bold** and *cursive* text.
|
|
||||||
To get a newline we add two spaces at the end of the previous line.
|
|
||||||
|
|
||||||
Let's also add a list
|
|
||||||
|
|
||||||
* with
|
|
||||||
* some
|
|
||||||
* items
|
|
||||||
```
|
|
||||||
|
|
||||||
If you set the input-method to Markdown, and post this, it will look something like
|
|
||||||
|
|
||||||
![example_markdown](../assets/example_markdown.png)
|
|
||||||
|
|
||||||
## Other actions
|
|
||||||
|
|
||||||
In addition to posting you can also *favorite* posts also known as *liking* them and *repeat* posts (also known as *retweeting*, *boosting* and even *reprööting*). Favoriting a post increments a counter on it, notifies the post author of your affection towards that post and also adds that post to your "favorited" posts list (in your own profile, "Favorites" tab). Reprööting a post does all that and also repeats this post to your followers and your profile page with a note "*user* repeated post".
|
|
||||||
|
|
||||||
Your own posts can be deleted, but this will only reliably delete the post from your own instance. Other instances will receive a deletion notice, but there's no way to force them to actually delete a post. In addition, not all instances that contain the message might even receive the deletion notice, because they might be offline or not known to have the post because they received it through a repeat. Lastly, deletion notice might not reach certain frontends and clients - post will be visible for them until page refresh or cache clear, they probably won't be able to interact with it apart from replying to it (which will have reply-to mark missing).
|
|
||||||
|
|
||||||
If you are a moderator, you can also delete posts by other people. If those people are on your instance, it will delete the post and send out the deletion notice to other servers. If they are not on your instance, it will just remove the post from your local instance.
|
|
||||||
|
|
||||||
There's also an option to report a user's post which can be used to notify your (and optionally the other instance's) admin that someone is being naughty.
|
|
|
@ -1,116 +0,0 @@
|
||||||
# Settings
|
|
||||||
|
|
||||||
On the top-right you will see a gear icon. Click it to open the settings.
|
|
||||||
|
|
||||||
## General
|
|
||||||
|
|
||||||
### Interface
|
|
||||||
|
|
||||||
- **Interface language** is where you can set the interface language. The default language is the one that you set in your browser settings.
|
|
||||||
- **Hide instance-specific panel** hides the panel in the lower left that usually contains general information about the server. This will only be visible if your admin has activated this panel and is deactivated by default.
|
|
||||||
|
|
||||||
### Timeline
|
|
||||||
|
|
||||||
- **Hide posts of muted users** If this is set, 'muting' a user will completely hide their posts instead of collapsing them.
|
|
||||||
- **Collapse posts with subjects** This will collapse posts that contain a subject, hiding their content. Subjects are also sometimes called content warnings.
|
|
||||||
- **Enable automatic streaming of new posts when scrolled to the top** With this enabled, new posts will automatically stream in when you are scrolled to the top. Otherwise, you will see a button on the timeline that will let you display the new posts.
|
|
||||||
- **Pause streaming when tab is not focused** This pauses the automatic streaming that the previous option enables when the tab is out of focus. This is useful if you don't want to miss any new posts.
|
|
||||||
- **Enable automatic loading when scrolled to the bottom** When this is disabled, a button will be shown on the bottom of the timeline that will let you load older posts.
|
|
||||||
- **Enable reply-link preview on hover** Status posts in the timeline and notifications contain links to replies and to the post they are a reply to. If this setting is enabled, hovering over that link will display that linked post in a small hovering overlay.
|
|
||||||
|
|
||||||
### Composing
|
|
||||||
|
|
||||||
- **Copy scope when replying** makes the scope of a reply be the same as the scope of the post it is replying to. This is useful to prevent accidentally moving private discussions to public, or vice versa.
|
|
||||||
- **Always show subject field** Whether or not to display the 'subject' input field in the post form. If you do not want to use subjects, you can deactivate this.
|
|
||||||
- **Copy subject when replying** controls if the subject of a post will be copied from the post it is replying to.
|
|
||||||
- **Post status content type** selects the default content type of your post. The options are: Plain text, HTML, BBCode and Markdown.
|
|
||||||
- **Minimize scope selection options** will reduce the visibility scopes to 'direct', your default post scope and post scope of post you're replying to.
|
|
||||||
- **Automatically hide New Post button** hides the floating "New post" button when scrolling on mobile view.
|
|
||||||
- **Pad emoji with spaces when adding from picker** Will add spaces around emoji you select it from the picker.
|
|
||||||
|
|
||||||
### Attachments
|
|
||||||
|
|
||||||
- **Hide attachments in timeline** Do not display attachments in timelines. They will still display in expanded conversations. This is useful to save bandwidth and for browsing in public.
|
|
||||||
- **Hide attachments in conversations** Also hide attachments in expanded conversations.
|
|
||||||
- **Maximum amount of thumbnails per post** Exactly that :)
|
|
||||||
- **Enable clickthrough NSFW attachment hiding** Hide attachments that are marked as NSFW/sensitive behind a click-through image.`
|
|
||||||
- **Preload images** This will preload the hidden images so that they display faster when clicking through.
|
|
||||||
- **Open NSFW attachments with just one click** Directly open NSFW attachments in a maximised state instead of revealing the image thumbnail.
|
|
||||||
- **Play-on-hover GIFs** With this activated, GIFs images and avatars will only be animated on mouse hover. Otherwise, they will be always animated. This is very useful if your timeline looks too flashy from people's animated avatars and eases the CPU load.
|
|
||||||
- **Loop videos** Whether to loop videos indefinitely.
|
|
||||||
- **Loop only videos without sound** Some instances will use videos without sounds instead of GIFs. This will make only those videos autoplay.
|
|
||||||
- **Play videos directly in the media viewer** Play videos right in the timeline instead of opening it in a modal
|
|
||||||
- **Don't crop the attachment in thumbnails** if enabled, images in attachments will be fit entirely inside the container instead of being zoomed in and cropped.
|
|
||||||
|
|
||||||
### Notifications
|
|
||||||
|
|
||||||
- **Enable web push notifications** this enables Web Push notifications, to allow receiving notifications even when the page isn't opened, doesn't affect regular notifications.
|
|
||||||
|
|
||||||
### Fun
|
|
||||||
|
|
||||||
- **Meme arrows** will make `> greentext` be shown in green (using the "green" from the theme that is used).
|
|
||||||
|
|
||||||
## Profile
|
|
||||||
|
|
||||||
Here you can set up how you appear to other users among with some other settings:
|
|
||||||
|
|
||||||
- **Name** is text that displays next to your avatar in posts. Please note that you **cannot** change your *@handle*
|
|
||||||
- **Bio** will be displayed under your profile - you can put anything you want there you want for everyone to see.
|
|
||||||
- **Restrict your account to approved followers only** makes your account "locked", when people follow you - you have to approve or deny their follow requests, this gives more control over who sees your followers only posts.
|
|
||||||
- **Default visibility scope** is your default post scope for new posts
|
|
||||||
- **Strip rich text from all posts** strips rich text formatting (bold/italics/lists etc) from all incoming posts. This will only affect newly fetched posts.
|
|
||||||
|
|
||||||
If you're admin or moderator on your instance you also get **Show [role] badge in my profile** - this controls whether to show "Admin" or "Moderator** label on your profile page.
|
|
||||||
|
|
||||||
**For all options mentioned above you have to click "Submit" button for changes to take place**
|
|
||||||
|
|
||||||
- **Avatar** this changes picture next to your posts. Your avatar shouldn't exceed 2 MiB (2097152 bytes) or it could cause problems with certain instances.
|
|
||||||
- **Banner** this changes background on your profile card. Same as avatar it shouldn't exceed 2 MiB limit.
|
|
||||||
- **Profile Background** this changes background picture for UI. It isn't shown to anyone else *yet*, but some time later it will be shown when viewing your profisle.
|
|
||||||
|
|
||||||
## Security
|
|
||||||
|
|
||||||
Here you can change your password, revoke access tokens, configure 2-factor authentication (if available).
|
|
||||||
|
|
||||||
## Filtering
|
|
||||||
|
|
||||||
- **Types of notifications to show** This controls what kind of notifications will appear in notification column and which notifications to get in your system outside the web page
|
|
||||||
- **Replies in timeline** You may know that other social networks like Twitter will often not display replies to other people in your timeline, even if you are following the poster. Pleroma usually will show these posts to you to encourage conversation. If you do not like this behavior, you can change it here.
|
|
||||||
- **Hide post statistics** This hides the number of favorites, number of replies, etc.
|
|
||||||
- **Hide user statistics** This hides the number of followers, friends, etc.
|
|
||||||
- **Muted words** allows a list of words that will be muted (i.e. displayed in a collapsed state) on the timeline and in notifications. An easy way to tune down noise in your timeline. By default posts can be expanded if you want to see them.
|
|
||||||
- **Hide filtered statuses** will hide the filtered / muted posts completely instead of collapsing them.
|
|
||||||
|
|
||||||
## Theme
|
|
||||||
|
|
||||||
Here you can change the look and feel of Pleroma-FE. You can choose from several instance-provided presets and you can load one from file and save current theme to file. Before you apply new theme you can see what it will look like approximately in preview section.
|
|
||||||
|
|
||||||
The themes engine was made to be easy to use while giving an option for powerful in-depth customization - you can just tweak colors on "Common" tab and leave everything else as is.
|
|
||||||
|
|
||||||
If there's a little check box next to a color picker it means that color is optional and unless checked will be automatically picked based on some other color or defaults.
|
|
||||||
|
|
||||||
For some features you can also adjust transparency of it by changing its opacity, you just need to tick checkbox next to it, otherwise it will be using default opacity.
|
|
||||||
|
|
||||||
Contrast information is also provided - you can see how readable text is based on contrast between text color and background, icons under color pickers represent contrast rating based on [WCAG](https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast) - thumbs up means AAA rating (good), half-filled circle means AA rating (acceptable) and warning icon means it doesn't pass the minimal contrast requirement and probably will be less readable, especially for vision-challenged people, you can hover over icon to see more detailed information. *Please note* that if background is not opaque (opacity != 1) contrast will be measured based on "worst case scenario", i.e. behind semi-transparent background lies some solid color that makes text harder to read, this however is still inaccurate because it doesn't account that background can be noisy/busy, making text even harder to read.
|
|
||||||
|
|
||||||
Apart from colors you can also tweak shadow and lighting, which is used mostly to give buttons proper relief based on their state, give panes their shade, make things glow etc. It's quite powerful, and basically provides somewhat convenient interface for [CSS Shadows](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow).
|
|
||||||
|
|
||||||
Another thing you can tweak is theme's roundness - some people like sharp edges, some want things more rounded. This is also used if you want circled or square avatars.
|
|
||||||
|
|
||||||
Lastly, you can redefine fonts used in UI without changing fonts in your browser or system, this however requires you to enter font's full name and having that font installed on your system.
|
|
||||||
|
|
||||||
## Notifications
|
|
||||||
|
|
||||||
This screen allows more fine-grained control over what notifications to show to you based on whom it comes from.
|
|
||||||
|
|
||||||
## Data Import/Export
|
|
||||||
|
|
||||||
This allows you to export and import a list of people you follow and block, in case instance's database gets reverted or if you want to move to another server. Note that you **CANNOT export/import list of people who *follow you***, they'll need to follow you back themselves.
|
|
||||||
|
|
||||||
## Mutes and Blocks
|
|
||||||
|
|
||||||
These screens give access to full list of people you block/mute, useful for *un*blocking/*un*muting people because blocking/muting them most likely removes them out of your sight completely.
|
|
||||||
|
|
||||||
## Version
|
|
||||||
|
|
||||||
Just displays the backend and frontend version. Useful to mention in bug reports.
|
|
|
@ -1,13 +0,0 @@
|
||||||
# Timelines
|
|
||||||
|
|
||||||
You have several timelines to browse trough
|
|
||||||
|
|
||||||
- **Timeline** aka Home Timeline - this timeline contains all posts by people you follow and your own posts, as well as posts mentioning you directly.
|
|
||||||
- **Bookmarks** all the posts you've bookmarked. You can bookmark a post by clicking the three dots on the bottom right of the post and choose Bookmark.
|
|
||||||
- **Direct Messages** all posts with `direct` scope addressed to you or mentioning you.
|
|
||||||
- **Public Timelines** all public posts made by users on the instance you're on
|
|
||||||
- **The Whole Known Network** also known as **TWKN** or **Federated Timeline** - all public posts known by your instance. Due to nature of the network your instance may not know *all* the posts on the network, so only posts known by your instance are shown there.
|
|
||||||
|
|
||||||
Note that by default you will see all posts made by other users on your Home Timeline, this contrast behavior of Twitter and Mastodon, which shows you only non-reply posts and replies to people you follow. You can change said behavior in the [settings](settings.md#filtering).
|
|
||||||
|
|
||||||
By default instances will try to send activities (e.g. posts, favorites, etc.) up to 7 days or until the target server received them. For this reason posts that are up to 7 days old and your server didn't know about yet can pop up on your timeline. This is the default behaviour and can be changed by your admin.
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Users: follow, mute, block
|
|
||||||
|
|
||||||
When you see someone, you can click on their user picture to view their profile, and click on the userpic in that to see *full* profile. You can **follow** them, **mute** and **block** them.
|
|
||||||
|
|
||||||
**Following** is self-explanatory, it adds them to your Home Timeline, lists you as a follower and gives you access to follower-only posts if they have any.
|
|
||||||
|
|
||||||
**Muting** collapses posts and notifications made by them, giving you an option to see the post if you're curious. Clients other than PleromaFE may completely remove their posts.
|
|
||||||
|
|
||||||
**Blocking** a user removes them from your timeline and notifications and prevents them from following you (automatically unfollows them from you).
|
|
||||||
|
|
||||||
Please note that some users can be "locked", meaning instead of following them you send a follow request they need to approve for you to become their follower.
|
|
BIN
image-1.png
Before Width: | Height: | Size: 883 KiB |
|
@ -3,14 +3,13 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
<title>Pleroma</title>
|
||||||
<!--server-generated-meta-->
|
<!--server-generated-meta-->
|
||||||
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||||||
</head>
|
</head>
|
||||||
<body class="hidden">
|
<body class="hidden">
|
||||||
<noscript>To use Pleroma, please enable JavaScript.</noscript>
|
<noscript>To use Pleroma, please enable JavaScript.</noscript>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<div id="modal"></div>
|
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
<div id="popovers" />
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
210
package.json
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "pleroma_fe",
|
"name": "pleroma_fe",
|
||||||
"version": "2.6.1",
|
"version": "1.0.0",
|
||||||
"description": "Pleroma frontend, the default frontend of Pleroma social network server",
|
"description": "A Qvitter-style frontend for certain GS servers.",
|
||||||
"author": "Pleroma contributors <https://git.pleroma.social/pleroma/pleroma-fe/-/blob/develop/CONTRIBUTORS.md>",
|
"author": "Roger Braun <roger@rogerbraun.net>",
|
||||||
"private": false,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node build/dev-server.js",
|
"dev": "node build/dev-server.js",
|
||||||
"build": "node build/build.js",
|
"build": "node build/build.js",
|
||||||
|
@ -11,126 +11,106 @@
|
||||||
"unit:watch": "karma start test/unit/karma.conf.js --single-run=false",
|
"unit:watch": "karma start test/unit/karma.conf.js --single-run=false",
|
||||||
"e2e": "node test/e2e/runner.js",
|
"e2e": "node test/e2e/runner.js",
|
||||||
"test": "npm run unit && npm run e2e",
|
"test": "npm run unit && npm run e2e",
|
||||||
"stylelint": "npx stylelint '**/*.scss' '**/*.vue'",
|
|
||||||
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
|
||||||
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
|
"lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "7.21.5",
|
"@babel/runtime": "^7.7.6",
|
||||||
"@chenfengyuan/vue-qrcode": "2.0.0",
|
"@chenfengyuan/vue-qrcode": "^1.0.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
"body-scroll-lock": "^2.6.4",
|
||||||
"@fortawesome/free-regular-svg-icons": "6.4.0",
|
"chromatism": "^3.0.0",
|
||||||
"@fortawesome/free-solid-svg-icons": "6.4.0",
|
"cropperjs": "^1.4.3",
|
||||||
"@fortawesome/vue-fontawesome": "3.0.3",
|
"diff": "^3.0.1",
|
||||||
"@kazvmoe-infra/pinch-zoom-element": "1.2.0",
|
"karma-mocha-reporter": "^2.2.1",
|
||||||
"@kazvmoe-infra/unicode-emoji-json": "0.4.0",
|
"localforage": "^1.5.0",
|
||||||
"@ruffle-rs/ruffle": "0.1.0-nightly.2024.3.17",
|
"object-path": "^0.11.3",
|
||||||
"@vuelidate/core": "2.0.3",
|
"phoenix": "^1.3.0",
|
||||||
"@vuelidate/validators": "2.0.4",
|
"portal-vue": "^2.1.4",
|
||||||
"body-scroll-lock": "3.1.5",
|
"sanitize-html": "^1.13.0",
|
||||||
"chromatism": "3.0.0",
|
"v-click-outside": "^2.1.1",
|
||||||
"click-outside-vue3": "4.0.1",
|
"v-tooltip": "^2.0.2",
|
||||||
"cropperjs": "1.5.13",
|
"vue": "^2.5.13",
|
||||||
"escape-html": "1.0.3",
|
"vue-chat-scroll": "^1.2.1",
|
||||||
"hash-sum": "^2.0.0",
|
"vue-i18n": "^7.3.2",
|
||||||
"js-cookie": "3.0.5",
|
"vue-router": "^3.0.1",
|
||||||
"localforage": "1.10.0",
|
"vue-template-compiler": "^2.3.4",
|
||||||
"parse-link-header": "2.0.0",
|
"vuelidate": "^0.7.4",
|
||||||
"phoenix": "1.7.7",
|
"vuex": "^3.0.1",
|
||||||
"punycode.js": "2.3.0",
|
"whatwg-fetch": "^2.0.3"
|
||||||
"qrcode": "1.5.3",
|
|
||||||
"querystring-es3": "0.2.1",
|
|
||||||
"url": "0.11.0",
|
|
||||||
"utf8": "3.0.0",
|
|
||||||
"vue": "3.2.45",
|
|
||||||
"vue-i18n": "9.2.2",
|
|
||||||
"vue-router": "4.1.6",
|
|
||||||
"vue-template-compiler": "2.7.14",
|
|
||||||
"vue-virtual-scroller": "^2.0.0-beta.7",
|
|
||||||
"vuex": "4.1.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.21.8",
|
"@babel/core": "^7.7.5",
|
||||||
"@babel/eslint-parser": "7.21.8",
|
"@babel/plugin-transform-runtime": "^7.7.6",
|
||||||
"@babel/plugin-transform-runtime": "7.21.4",
|
"@babel/preset-env": "^7.7.6",
|
||||||
"@babel/preset-env": "7.21.5",
|
"@babel/register": "^7.7.4",
|
||||||
"@babel/register": "7.21.0",
|
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
||||||
"@intlify/vue-i18n-loader": "5.0.1",
|
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
|
||||||
"@ungap/event-target": "0.2.4",
|
"@vue/test-utils": "^1.0.0-beta.26",
|
||||||
"@vue/babel-helper-vue-jsx-merge-props": "1.4.0",
|
"autoprefixer": "^6.4.0",
|
||||||
"@vue/babel-plugin-jsx": "1.2.1",
|
"babel-eslint": "^7.0.0",
|
||||||
"@vue/compiler-sfc": "3.2.45",
|
"babel-loader": "^8.0.6",
|
||||||
"@vue/test-utils": "2.2.8",
|
"babel-plugin-lodash": "^3.3.4",
|
||||||
"autoprefixer": "10.4.19",
|
"chai": "^3.5.0",
|
||||||
"babel-loader": "9.1.3",
|
"chalk": "^1.1.3",
|
||||||
"babel-plugin-lodash": "3.3.4",
|
"chromedriver": "^2.21.2",
|
||||||
"chai": "4.3.7",
|
"connect-history-api-fallback": "^1.1.0",
|
||||||
"chalk": "1.1.3",
|
"cross-spawn": "^4.0.2",
|
||||||
"chromedriver": "108.0.0",
|
"css-loader": "^0.28.0",
|
||||||
"connect-history-api-fallback": "2.0.0",
|
"eslint": "^5.16.0",
|
||||||
"copy-webpack-plugin": "11.0.0",
|
"eslint-config-standard": "^12.0.0",
|
||||||
"cross-spawn": "7.0.3",
|
"eslint-friendly-formatter": "^2.0.5",
|
||||||
"css-loader": "6.10.0",
|
"eslint-loader": "^2.1.0",
|
||||||
"css-minimizer-webpack-plugin": "4.2.2",
|
"eslint-plugin-import": "^2.13.0",
|
||||||
"custom-event-polyfill": "1.0.7",
|
"eslint-plugin-node": "^7.0.0",
|
||||||
"eslint": "8.33.0",
|
"eslint-plugin-promise": "^4.0.0",
|
||||||
"eslint-config-standard": "17.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"eslint-formatter-friendly": "7.0.0",
|
"eslint-plugin-vue": "^5.2.2",
|
||||||
"eslint-plugin-import": "2.27.5",
|
"eventsource-polyfill": "^0.9.6",
|
||||||
"eslint-plugin-n": "15.6.1",
|
"express": "^4.13.3",
|
||||||
"eslint-plugin-promise": "6.1.1",
|
"file-loader": "^3.0.1",
|
||||||
"eslint-plugin-vue": "9.9.0",
|
"fontello-webpack-plugin": "https://github.com/w3geo/fontello-webpack-plugin.git#6149eac8f2672ab6da089e8802fbfcac98487186",
|
||||||
"eslint-webpack-plugin": "3.2.0",
|
"function-bind": "^1.0.2",
|
||||||
"eventsource-polyfill": "0.9.6",
|
"html-webpack-plugin": "^3.0.0",
|
||||||
"express": "4.18.2",
|
"http-proxy-middleware": "^0.17.2",
|
||||||
"function-bind": "1.1.1",
|
"inject-loader": "^2.0.1",
|
||||||
"html-webpack-plugin": "5.5.1",
|
"iso-639-1": "^2.0.3",
|
||||||
"http-proxy-middleware": "2.0.6",
|
"isparta-loader": "^2.0.0",
|
||||||
"iso-639-1": "2.1.15",
|
"json-loader": "^0.5.4",
|
||||||
"json-loader": "0.5.7",
|
"karma": "^3.0.0",
|
||||||
"karma": "6.4.2",
|
"karma-coverage": "^1.1.1",
|
||||||
"karma-coverage": "2.2.0",
|
"karma-firefox-launcher": "^1.1.0",
|
||||||
"karma-firefox-launcher": "2.1.2",
|
"karma-mocha": "^1.2.0",
|
||||||
"karma-mocha": "2.0.1",
|
"karma-sinon-chai": "^2.0.2",
|
||||||
"karma-mocha-reporter": "2.2.5",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-sinon-chai": "2.0.2",
|
"karma-spec-reporter": "0.0.26",
|
||||||
"karma-sourcemap-loader": "0.3.8",
|
"karma-webpack": "^4.0.0-rc.3",
|
||||||
"karma-spec-reporter": "0.0.36",
|
"lodash": "^4.16.4",
|
||||||
"karma-webpack": "5.0.0",
|
"lolex": "^1.4.0",
|
||||||
"lodash": "4.17.21",
|
"mini-css-extract-plugin": "^0.5.0",
|
||||||
"mini-css-extract-plugin": "2.7.6",
|
"mocha": "^3.1.0",
|
||||||
"mocha": "10.2.0",
|
"nightwatch": "^0.9.8",
|
||||||
"nightwatch": "2.6.25",
|
"opn": "^4.0.2",
|
||||||
"opn": "5.5.0",
|
"ora": "^0.3.0",
|
||||||
"ora": "0.4.1",
|
"postcss-loader": "^3.0.0",
|
||||||
"postcss": "8.4.23",
|
"raw-loader": "^0.5.1",
|
||||||
"postcss-html": "^1.5.0",
|
"sass": "^1.17.3",
|
||||||
"postcss-loader": "7.0.2",
|
"sass-loader": "git://github.com/webpack-contrib/sass-loader",
|
||||||
"postcss-scss": "^4.0.6",
|
|
||||||
"sass": "1.60.0",
|
|
||||||
"sass-loader": "13.2.2",
|
|
||||||
"selenium-server": "2.53.1",
|
"selenium-server": "2.53.1",
|
||||||
"semver": "7.3.8",
|
"semver": "^5.3.0",
|
||||||
"serviceworker-webpack5-plugin": "2.0.0",
|
"serviceworker-webpack-plugin": "^1.0.0",
|
||||||
"shelljs": "0.8.5",
|
"shelljs": "^0.7.4",
|
||||||
"sinon": "15.0.4",
|
"sinon": "^2.1.0",
|
||||||
"sinon-chai": "3.7.0",
|
"sinon-chai": "^2.8.0",
|
||||||
"stylelint": "14.16.1",
|
"url-loader": "^1.1.2",
|
||||||
"stylelint-config-html": "^1.1.0",
|
"vue-loader": "^14.0.0",
|
||||||
"stylelint-config-recommended-scss": "^8.0.0",
|
"vue-style-loader": "^4.0.0",
|
||||||
"stylelint-config-recommended-vue": "^1.4.0",
|
"webpack": "^4.0.0",
|
||||||
"stylelint-config-standard": "29.0.0",
|
"webpack-dev-middleware": "^3.6.0",
|
||||||
"stylelint-rscss": "0.4.0",
|
"webpack-hot-middleware": "^2.12.2",
|
||||||
"stylelint-webpack-plugin": "^3.3.0",
|
"webpack-merge": "^0.14.1"
|
||||||
"vue-loader": "17.0.1",
|
|
||||||
"vue-style-loader": "4.1.3",
|
|
||||||
"webpack": "5.75.0",
|
|
||||||
"webpack-dev-middleware": "3.7.3",
|
|
||||||
"webpack-hot-middleware": "2.25.3",
|
|
||||||
"webpack-merge": "0.20.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16.0.0",
|
"node": ">= 4.0.0",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
||||||
"extends": [
|
|
||||||
"config:base"
|
|
||||||
]
|
|
||||||
}
|
|
154
src/App.js
|
@ -1,135 +1,123 @@
|
||||||
import UserPanel from './components/user_panel/user_panel.vue'
|
import UserPanel from './components/user_panel/user_panel.vue'
|
||||||
import NavPanel from './components/nav_panel/nav_panel.vue'
|
import NavPanel from './components/nav_panel/nav_panel.vue'
|
||||||
|
import Notifications from './components/notifications/notifications.vue'
|
||||||
|
import SearchBar from './components/search_bar/search_bar.vue'
|
||||||
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
||||||
import FeaturesPanel from './components/features_panel/features_panel.vue'
|
import FeaturesPanel from './components/features_panel/features_panel.vue'
|
||||||
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
|
||||||
import ShoutPanel from './components/shout_panel/shout_panel.vue'
|
import ChatPanel from './components/chat_panel/chat_panel.vue'
|
||||||
import MediaModal from './components/media_modal/media_modal.vue'
|
import MediaModal from './components/media_modal/media_modal.vue'
|
||||||
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
import SideDrawer from './components/side_drawer/side_drawer.vue'
|
||||||
import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'
|
import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'
|
||||||
import MobileNav from './components/mobile_nav/mobile_nav.vue'
|
import MobileNav from './components/mobile_nav/mobile_nav.vue'
|
||||||
import DesktopNav from './components/desktop_nav/desktop_nav.vue'
|
|
||||||
import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'
|
import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'
|
||||||
import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue'
|
|
||||||
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
|
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
|
||||||
import StatusHistoryModal from './components/status_history_modal/status_history_modal.vue'
|
import { windowWidth } from './services/window_utils/window_utils'
|
||||||
import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
|
|
||||||
import { windowWidth, windowHeight } from './services/window_utils/window_utils'
|
|
||||||
import { mapGetters } from 'vuex'
|
|
||||||
import { defineAsyncComponent } from 'vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
components: {
|
components: {
|
||||||
UserPanel,
|
UserPanel,
|
||||||
NavPanel,
|
NavPanel,
|
||||||
Notifications: defineAsyncComponent(() => import('./components/notifications/notifications.vue')),
|
Notifications,
|
||||||
|
SearchBar,
|
||||||
InstanceSpecificPanel,
|
InstanceSpecificPanel,
|
||||||
FeaturesPanel,
|
FeaturesPanel,
|
||||||
WhoToFollowPanel,
|
WhoToFollowPanel,
|
||||||
ShoutPanel,
|
ChatPanel,
|
||||||
MediaModal,
|
MediaModal,
|
||||||
SideDrawer,
|
SideDrawer,
|
||||||
MobilePostStatusButton,
|
MobilePostStatusButton,
|
||||||
MobileNav,
|
MobileNav,
|
||||||
DesktopNav,
|
|
||||||
SettingsModal: defineAsyncComponent(() => import('./components/settings_modal/settings_modal.vue')),
|
|
||||||
UpdateNotification: defineAsyncComponent(() => import('./components/update_notification/update_notification.vue')),
|
|
||||||
UserReportingModal,
|
UserReportingModal,
|
||||||
PostStatusModal,
|
PostStatusModal
|
||||||
EditStatusModal,
|
|
||||||
StatusHistoryModal,
|
|
||||||
GlobalNoticeList
|
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
mobileActivePanel: 'timeline'
|
mobileActivePanel: 'timeline',
|
||||||
|
searchBarHidden: true,
|
||||||
|
supportsMask: window.CSS && window.CSS.supports && (
|
||||||
|
window.CSS.supports('mask-size', 'contain') ||
|
||||||
|
window.CSS.supports('-webkit-mask-size', 'contain') ||
|
||||||
|
window.CSS.supports('-moz-mask-size', 'contain') ||
|
||||||
|
window.CSS.supports('-ms-mask-size', 'contain') ||
|
||||||
|
window.CSS.supports('-o-mask-size', 'contain')
|
||||||
|
)
|
||||||
}),
|
}),
|
||||||
created () {
|
created () {
|
||||||
// Load the locale from the storage
|
// Load the locale from the storage
|
||||||
const val = this.$store.getters.mergedConfig.interfaceLanguage
|
this.$i18n.locale = this.$store.getters.mergedConfig.interfaceLanguage
|
||||||
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
|
||||||
window.addEventListener('resize', this.updateMobileState)
|
window.addEventListener('resize', this.updateMobileState)
|
||||||
},
|
},
|
||||||
unmounted () {
|
destroyed () {
|
||||||
window.removeEventListener('resize', this.updateMobileState)
|
window.removeEventListener('resize', this.updateMobileState)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
classes () {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
'-reverse': this.reverseLayout,
|
|
||||||
'-no-sticky-headers': this.noSticky,
|
|
||||||
'-has-new-post-button': this.newPostButtonShown
|
|
||||||
},
|
|
||||||
'-' + this.layoutType
|
|
||||||
]
|
|
||||||
},
|
|
||||||
navClasses () {
|
|
||||||
const { navbarColumnStretch } = this.$store.getters.mergedConfig
|
|
||||||
return [
|
|
||||||
'-' + this.layoutType,
|
|
||||||
...(navbarColumnStretch ? ['-column-stretch'] : [])
|
|
||||||
]
|
|
||||||
},
|
|
||||||
currentUser () { return this.$store.state.users.currentUser },
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
userBackground () { return this.currentUser.background_image },
|
background () {
|
||||||
instanceBackground () {
|
return this.currentUser.background_image || this.$store.state.instance.background
|
||||||
return this.mergedConfig.hideInstanceWallpaper
|
|
||||||
? null
|
|
||||||
: this.$store.state.instance.background
|
|
||||||
},
|
},
|
||||||
background () { return this.userBackground || this.instanceBackground },
|
enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },
|
||||||
bgStyle () {
|
logoStyle () {
|
||||||
if (this.background) {
|
return {
|
||||||
return {
|
'visibility': this.enableMask ? 'hidden' : 'visible'
|
||||||
'--body-background-image': `url(${this.background})`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shout () { return this.$store.state.shout.joined },
|
logoMaskStyle () {
|
||||||
|
return this.enableMask ? {
|
||||||
|
'mask-image': `url(${this.$store.state.instance.logo})`
|
||||||
|
} : {
|
||||||
|
'background-color': this.enableMask ? '' : 'transparent'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
logoBgStyle () {
|
||||||
|
return Object.assign({
|
||||||
|
'margin': `${this.$store.state.instance.logoMargin} 0`,
|
||||||
|
opacity: this.searchBarHidden ? 1 : 0
|
||||||
|
}, this.enableMask ? {} : {
|
||||||
|
'background-color': this.enableMask ? '' : 'transparent'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
logo () { return this.$store.state.instance.logo },
|
||||||
|
bgStyle () {
|
||||||
|
return {
|
||||||
|
'background-image': `url(${this.background})`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bgAppStyle () {
|
||||||
|
return {
|
||||||
|
'--body-background-image': `url(${this.background})`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sitename () { return this.$store.state.instance.name },
|
||||||
|
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
||||||
|
hideSitename () { return this.$store.state.instance.hideSitename },
|
||||||
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
||||||
showInstanceSpecificPanel () {
|
showInstanceSpecificPanel () {
|
||||||
return this.$store.state.instance.showInstanceSpecificPanel &&
|
return this.$store.state.instance.showInstanceSpecificPanel &&
|
||||||
!this.$store.getters.mergedConfig.hideISP &&
|
!this.$store.getters.mergedConfig.hideISP &&
|
||||||
this.$store.state.instance.instanceSpecificPanelContent
|
this.$store.state.instance.instanceSpecificPanelContent
|
||||||
},
|
},
|
||||||
isChats () {
|
|
||||||
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
|
||||||
},
|
|
||||||
isListEdit () {
|
|
||||||
return this.$route.name === 'lists-edit'
|
|
||||||
},
|
|
||||||
newPostButtonShown () {
|
|
||||||
if (this.isChats) return false
|
|
||||||
if (this.isListEdit) return false
|
|
||||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || this.layoutType === 'mobile'
|
|
||||||
},
|
|
||||||
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
|
||||||
editingAvailable () { return this.$store.state.instance.editingAvailable },
|
isMobileLayout () { return this.$store.state.interface.mobileLayout },
|
||||||
shoutboxPosition () {
|
privateMode () { return this.$store.state.instance.private }
|
||||||
return this.$store.getters.mergedConfig.alwaysShowNewPostButton || false
|
|
||||||
},
|
|
||||||
hideShoutbox () {
|
|
||||||
return this.$store.getters.mergedConfig.hideShoutbox
|
|
||||||
},
|
|
||||||
layoutType () { return this.$store.state.interface.layoutType },
|
|
||||||
privateMode () { return this.$store.state.instance.private },
|
|
||||||
reverseLayout () {
|
|
||||||
const { thirdColumnMode, sidebarRight: reverseSetting } = this.$store.getters.mergedConfig
|
|
||||||
if (this.layoutType !== 'wide') {
|
|
||||||
return reverseSetting
|
|
||||||
} else {
|
|
||||||
return thirdColumnMode === 'notifications' ? reverseSetting : !reverseSetting
|
|
||||||
}
|
|
||||||
},
|
|
||||||
noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders },
|
|
||||||
showScrollbars () { return this.$store.getters.mergedConfig.showScrollbars },
|
|
||||||
...mapGetters(['mergedConfig'])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
scrollToTop () {
|
||||||
|
window.scrollTo(0, 0)
|
||||||
|
},
|
||||||
|
logout () {
|
||||||
|
this.$router.replace('/main/public')
|
||||||
|
this.$store.dispatch('logout')
|
||||||
|
},
|
||||||
|
onSearchBarToggled (hidden) {
|
||||||
|
this.searchBarHidden = hidden
|
||||||
|
},
|
||||||
updateMobileState () {
|
updateMobileState () {
|
||||||
this.$store.dispatch('setLayoutWidth', windowWidth())
|
const mobileLayout = windowWidth() <= 800
|
||||||
this.$store.dispatch('setLayoutHeight', windowHeight())
|
const changed = mobileLayout !== this.isMobileLayout
|
||||||
|
if (changed) {
|
||||||
|
this.$store.dispatch('setMobileLayout', mobileLayout)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1362
src/App.scss
143
src/App.vue
|
@ -1,44 +1,103 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-show="$store.state.interface.themeApplied"
|
id="app"
|
||||||
id="app-loaded"
|
:style="bgAppStyle"
|
||||||
:style="bgStyle"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id="app_bg_wrapper"
|
id="app_bg_wrapper"
|
||||||
class="app-bg-wrapper"
|
class="app-bg-wrapper"
|
||||||
|
:style="bgStyle"
|
||||||
/>
|
/>
|
||||||
<MobileNav v-if="layoutType === 'mobile'" />
|
<MobileNav v-if="isMobileLayout" />
|
||||||
<DesktopNav
|
<nav
|
||||||
v-else
|
v-else
|
||||||
:class="navClasses"
|
id="nav"
|
||||||
/>
|
class="nav-bar container"
|
||||||
<Notifications v-if="currentUser" />
|
@click="scrollToTop()"
|
||||||
|
>
|
||||||
|
<div class="inner-nav">
|
||||||
|
<router-link
|
||||||
|
:to="{ name: 'root' }"
|
||||||
|
class="logo"
|
||||||
|
:style="logoBgStyle"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mask"
|
||||||
|
:style="logoMaskStyle"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
:src="logo"
|
||||||
|
:style="logoStyle"
|
||||||
|
>
|
||||||
|
</router-link>
|
||||||
|
<div class="item">
|
||||||
|
<router-link
|
||||||
|
v-if="!hideSitename"
|
||||||
|
class="site-name"
|
||||||
|
:to="{ name: 'root' }"
|
||||||
|
active-class="home"
|
||||||
|
>
|
||||||
|
{{ sitename }}
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
<div class="item right">
|
||||||
|
<search-bar
|
||||||
|
v-if="currentUser || !privateMode"
|
||||||
|
class="nav-icon mobile-hidden"
|
||||||
|
@toggled="onSearchBarToggled"
|
||||||
|
@click.stop.native
|
||||||
|
/>
|
||||||
|
<router-link
|
||||||
|
class="mobile-hidden"
|
||||||
|
:to="{ name: 'settings'}"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="button-icon icon-cog nav-icon"
|
||||||
|
:title="$t('nav.preferences')"
|
||||||
|
/>
|
||||||
|
</router-link>
|
||||||
|
<a
|
||||||
|
v-if="currentUser && currentUser.role === 'admin'"
|
||||||
|
href="/pleroma/admin/#/login-pleroma"
|
||||||
|
class="mobile-hidden"
|
||||||
|
target="_blank"
|
||||||
|
><i
|
||||||
|
class="button-icon icon-gauge nav-icon"
|
||||||
|
:title="$t('nav.administration')"
|
||||||
|
/></a>
|
||||||
|
<a
|
||||||
|
v-if="currentUser"
|
||||||
|
href="#"
|
||||||
|
class="mobile-hidden"
|
||||||
|
@click.prevent="logout"
|
||||||
|
><i
|
||||||
|
class="button-icon icon-logout nav-icon"
|
||||||
|
:title="$t('login.logout')"
|
||||||
|
/></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
<div
|
<div
|
||||||
id="content"
|
id="content"
|
||||||
class="app-layout container"
|
class="container"
|
||||||
:class="classes"
|
|
||||||
>
|
>
|
||||||
<div class="underlay" />
|
<div class="sidebar-flexer mobile-hidden">
|
||||||
<div
|
<div class="sidebar-bounds">
|
||||||
id="sidebar"
|
<div class="sidebar-scroller">
|
||||||
class="column -scrollable"
|
<div class="sidebar">
|
||||||
:class="{ '-show-scrollbar': showScrollbars }"
|
<user-panel />
|
||||||
>
|
<div v-if="!isMobileLayout">
|
||||||
<user-panel />
|
<nav-panel />
|
||||||
<template v-if="layoutType !== 'mobile'">
|
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
||||||
<nav-panel />
|
<features-panel v-if="!currentUser && showFeaturesPanel" />
|
||||||
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
<who-to-follow-panel v-if="currentUser && suggestionsEnabled" />
|
||||||
<features-panel v-if="!currentUser && showFeaturesPanel" />
|
<notifications v-if="currentUser" />
|
||||||
<who-to-follow-panel v-if="currentUser && suggestionsEnabled" />
|
</div>
|
||||||
<div id="notifs-sidebar" />
|
</div>
|
||||||
</template>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<main
|
<div class="main">
|
||||||
id="main-scroller"
|
|
||||||
class="column main"
|
|
||||||
:class="{ '-full-height': isChats || isListEdit }"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
v-if="!currentUser"
|
v-if="!currentUser"
|
||||||
class="login-hint panel panel-default"
|
class="login-hint panel panel-default"
|
||||||
|
@ -50,29 +109,21 @@
|
||||||
{{ $t("login.hint") }}
|
{{ $t("login.hint") }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<router-view />
|
<transition name="fade">
|
||||||
</main>
|
<router-view />
|
||||||
<div
|
</transition>
|
||||||
id="notifs-column"
|
</div>
|
||||||
class="column -scrollable"
|
<media-modal />
|
||||||
:class="{ '-show-scrollbar': showScrollbars }"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<MediaModal />
|
<chat-panel
|
||||||
<shout-panel
|
v-if="currentUser && chat"
|
||||||
v-if="currentUser && shout && !hideShoutbox"
|
|
||||||
:floating="true"
|
:floating="true"
|
||||||
class="floating-shout mobile-hidden"
|
class="floating-chat mobile-hidden"
|
||||||
:class="{ '-left': shoutboxPosition }"
|
|
||||||
/>
|
/>
|
||||||
<MobilePostStatusButton />
|
<MobilePostStatusButton />
|
||||||
<UserReportingModal />
|
<UserReportingModal />
|
||||||
<PostStatusModal />
|
<PostStatusModal />
|
||||||
<EditStatusModal v-if="editingAvailable" />
|
<portal-target name="modal" />
|
||||||
<StatusHistoryModal v-if="editingAvailable" />
|
|
||||||
<SettingsModal />
|
|
||||||
<UpdateNotification />
|
|
||||||
<GlobalNoticeList />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
@mixin unfocused-style {
|
|
||||||
@content;
|
|
||||||
|
|
||||||
&:focus:not(:focus-visible, :hover) {
|
|
||||||
@content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin focused-style {
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
@content;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
@content;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
$main-color: #f58d2c;
|
||||||
|
$main-background: white;
|
||||||
|
$darkened-background: whitesmoke;
|
||||||
|
|
||||||
|
$fallback--bg: #121a24;
|
||||||
|
$fallback--fg: #182230;
|
||||||
|
$fallback--faint: rgba(185, 185, 186, .5);
|
||||||
|
$fallback--text: #b9b9ba;
|
||||||
|
$fallback--link: #d8a070;
|
||||||
|
$fallback--icon: #666;
|
||||||
|
$fallback--lightBg: rgb(21, 30, 42);
|
||||||
|
$fallback--lightText: #b9b9ba;
|
||||||
|
$fallback--border: #222;
|
||||||
|
$fallback--cRed: #ff0000;
|
||||||
|
$fallback--cBlue: #0095ff;
|
||||||
|
$fallback--cGreen: #0fa00f;
|
||||||
|
$fallback--cOrange: orange;
|
||||||
|
|
||||||
|
$fallback--alertError: rgba(211,16,20,.5);
|
||||||
|
$fallback--alertWarning: rgba(111,111,20,.5);
|
||||||
|
|
||||||
|
$fallback--panelRadius: 10px;
|
||||||
|
$fallback--checkboxRadius: 2px;
|
||||||
|
$fallback--btnRadius: 4px;
|
||||||
|
$fallback--inputRadius: 4px;
|
||||||
|
$fallback--tooltipRadius: 5px;
|
||||||
|
$fallback--avatarRadius: 4px;
|
||||||
|
$fallback--avatarAltRadius: 10px;
|
||||||
|
$fallback--attachmentRadius: 10px;
|
Before Width: | Height: | Size: 396 KiB |
Before Width: | Height: | Size: 521 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.3 KiB |
|
@ -1,92 +1,43 @@
|
||||||
import { createApp } from 'vue'
|
import Vue from 'vue'
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import VueRouter from 'vue-router'
|
||||||
import vClickOutside from 'click-outside-vue3'
|
|
||||||
import VueVirtualScroller from 'vue-virtual-scroller'
|
|
||||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
|
||||||
|
|
||||||
import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
|
|
||||||
|
|
||||||
import App from '../App.vue'
|
|
||||||
import routes from './routes'
|
import routes from './routes'
|
||||||
import VBodyScrollLock from 'src/directives/body_scroll_lock'
|
import App from '../App.vue'
|
||||||
|
import { windowWidth } from '../services/window_utils/window_utils'
|
||||||
import { windowWidth, windowHeight } from '../services/window_utils/window_utils'
|
|
||||||
import { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js'
|
import { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js'
|
||||||
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'
|
||||||
import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js'
|
|
||||||
import { applyTheme, applyConfig, tryLoadCache } from '../services/style_setter/style_setter.js'
|
|
||||||
import FaviconService from '../services/favicon_service/favicon_service.js'
|
|
||||||
import { initServiceWorker, updateFocus } from '../services/sw/sw.js'
|
|
||||||
|
|
||||||
let staticInitialResults = null
|
const getStatusnetConfig = async ({ store }) => {
|
||||||
|
|
||||||
const parsedInitialResults = () => {
|
|
||||||
if (!document.getElementById('initial-results')) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
if (!staticInitialResults) {
|
|
||||||
staticInitialResults = JSON.parse(document.getElementById('initial-results').textContent)
|
|
||||||
}
|
|
||||||
return staticInitialResults
|
|
||||||
}
|
|
||||||
|
|
||||||
const decodeUTF8Base64 = (data) => {
|
|
||||||
const rawData = atob(data)
|
|
||||||
const array = Uint8Array.from([...rawData].map((char) => char.charCodeAt(0)))
|
|
||||||
const text = new TextDecoder().decode(array)
|
|
||||||
return text
|
|
||||||
}
|
|
||||||
|
|
||||||
const preloadFetch = async (request) => {
|
|
||||||
const data = parsedInitialResults()
|
|
||||||
if (!data || !data[request]) {
|
|
||||||
return window.fetch(request)
|
|
||||||
}
|
|
||||||
const decoded = decodeUTF8Base64(data[request])
|
|
||||||
const requestData = JSON.parse(decoded)
|
|
||||||
return {
|
|
||||||
ok: true,
|
|
||||||
json: () => requestData,
|
|
||||||
text: () => requestData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getInstanceConfig = async ({ store }) => {
|
|
||||||
try {
|
try {
|
||||||
const res = await preloadFetch('/api/v1/instance')
|
const res = await window.fetch('/api/statusnet/config.json')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
const textlimit = data.max_toot_chars
|
const { name, closed: registrationClosed, textlimit, uploadlimit, server, vapidPublicKey, safeDMMentionsEnabled } = data.site
|
||||||
const vapidPublicKey = data.pleroma.vapid_public_key
|
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit })
|
store.dispatch('setInstanceOption', { name: 'name', value: name })
|
||||||
store.dispatch('setInstanceOption', { name: 'accountApprovalRequired', value: data.approval_required })
|
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: (registrationClosed === '0') })
|
||||||
store.dispatch('setInstanceOption', { name: 'birthdayRequired', value: !!data.pleroma.metadata.birthday_required })
|
store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) })
|
||||||
store.dispatch('setInstanceOption', { name: 'birthdayMinAge', value: data.pleroma.metadata.birthday_min_age || 0 })
|
store.dispatch('setInstanceOption', { name: 'server', value: server })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'safeDM', value: safeDMMentionsEnabled !== '0' })
|
||||||
|
|
||||||
|
// TODO: default values for this stuff, added if to not make it break on
|
||||||
|
// my dev config out of the box.
|
||||||
|
if (uploadlimit) {
|
||||||
|
store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadlimit.uploadlimit) })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadlimit.avatarlimit) })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadlimit.backgroundlimit) })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadlimit.bannerlimit) })
|
||||||
|
}
|
||||||
|
|
||||||
if (vapidPublicKey) {
|
if (vapidPublicKey) {
|
||||||
store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey })
|
store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey })
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw (res)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Could not load instance config, potentially fatal')
|
|
||||||
console.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getBackendProvidedConfig = async ({ store }) => {
|
return data.site.pleromafe
|
||||||
try {
|
|
||||||
const res = await window.fetch('/api/pleroma/frontend_configurations')
|
|
||||||
if (res.ok) {
|
|
||||||
const data = await res.json()
|
|
||||||
return data.pleroma_fe
|
|
||||||
} else {
|
} else {
|
||||||
throw (res)
|
throw (res)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Could not load backend-provided frontend config, potentially fatal')
|
console.error('Could not load statusnet config, potentially fatal')
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +77,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('nsfwCensorImage')
|
copyInstanceOption('nsfwCensorImage')
|
||||||
copyInstanceOption('background')
|
copyInstanceOption('background')
|
||||||
copyInstanceOption('hidePostStats')
|
copyInstanceOption('hidePostStats')
|
||||||
copyInstanceOption('hideBotIndication')
|
|
||||||
copyInstanceOption('hideUserStats')
|
copyInstanceOption('hideUserStats')
|
||||||
copyInstanceOption('hideFilteredStatuses')
|
copyInstanceOption('hideFilteredStatuses')
|
||||||
copyInstanceOption('logo')
|
copyInstanceOption('logo')
|
||||||
|
@ -144,7 +94,6 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
? 0
|
? 0
|
||||||
: config.logoMargin
|
: config.logoMargin
|
||||||
})
|
})
|
||||||
copyInstanceOption('logoLeft')
|
|
||||||
store.commit('authFlow/setInitialStrategy', config.loginMethod)
|
store.commit('authFlow/setInitialStrategy', config.loginMethod)
|
||||||
|
|
||||||
copyInstanceOption('redirectRootNoLogin')
|
copyInstanceOption('redirectRootNoLogin')
|
||||||
|
@ -157,11 +106,11 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('subjectLineBehavior')
|
copyInstanceOption('subjectLineBehavior')
|
||||||
copyInstanceOption('postContentType')
|
copyInstanceOption('postContentType')
|
||||||
copyInstanceOption('alwaysShowSubjectInput')
|
copyInstanceOption('alwaysShowSubjectInput')
|
||||||
|
copyInstanceOption('noAttachmentLinks')
|
||||||
copyInstanceOption('showFeaturesPanel')
|
copyInstanceOption('showFeaturesPanel')
|
||||||
copyInstanceOption('hideSitename')
|
copyInstanceOption('hideSitename')
|
||||||
copyInstanceOption('sidebarRight')
|
|
||||||
|
|
||||||
return store.dispatch('setTheme', config.theme)
|
return store.dispatch('setTheme', config['theme'])
|
||||||
}
|
}
|
||||||
|
|
||||||
const getTOS = async ({ store }) => {
|
const getTOS = async ({ store }) => {
|
||||||
|
@ -181,7 +130,7 @@ const getTOS = async ({ store }) => {
|
||||||
|
|
||||||
const getInstancePanel = async ({ store }) => {
|
const getInstancePanel = async ({ store }) => {
|
||||||
try {
|
try {
|
||||||
const res = await preloadFetch('/instance/panel.html')
|
const res = await window.fetch('/instance/panel.html')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const html = await res.text()
|
const html = await res.text()
|
||||||
store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html })
|
store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html })
|
||||||
|
@ -202,7 +151,7 @@ const getStickers = async ({ store }) => {
|
||||||
const stickers = (await Promise.all(
|
const stickers = (await Promise.all(
|
||||||
Object.entries(values).map(async ([name, path]) => {
|
Object.entries(values).map(async ([name, path]) => {
|
||||||
const resPack = await window.fetch(path + 'pack.json')
|
const resPack = await window.fetch(path + 'pack.json')
|
||||||
let meta = {}
|
var meta = {}
|
||||||
if (resPack.ok) {
|
if (resPack.ok) {
|
||||||
meta = await resPack.json()
|
meta = await resPack.json()
|
||||||
}
|
}
|
||||||
|
@ -236,39 +185,28 @@ const getAppSecret = async ({ store }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolveStaffAccounts = ({ store, accounts }) => {
|
const resolveStaffAccounts = async ({ store, accounts }) => {
|
||||||
const nicknames = accounts.map(uri => uri.split('/').pop())
|
const backendInteractor = store.state.api.backendInteractor
|
||||||
|
let nicknames = accounts.map(uri => uri.split('/').pop())
|
||||||
|
.map(id => backendInteractor.fetchUser({ id }))
|
||||||
|
nicknames = await Promise.all(nicknames)
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames })
|
store.dispatch('setInstanceOption', { name: 'staffAccounts', value: nicknames })
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNodeInfo = async ({ store }) => {
|
const getNodeInfo = async ({ store }) => {
|
||||||
try {
|
try {
|
||||||
const res = await preloadFetch('/nodeinfo/2.0.json')
|
const res = await window.fetch('/nodeinfo/2.0.json')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
const metadata = data.metadata
|
const metadata = data.metadata
|
||||||
const features = metadata.features
|
const features = metadata.features
|
||||||
store.dispatch('setInstanceOption', { name: 'name', value: metadata.nodeName })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
|
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
|
||||||
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
|
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
|
||||||
store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'pleromaCustomEmojiReactionsAvailable', value: features.includes('pleroma_custom_emoji_reactions') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
|
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
|
||||||
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
|
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
|
||||||
store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })
|
store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })
|
||||||
store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })
|
store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })
|
||||||
store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'groupActorAvailable', value: features.includes('pleroma:group_actors') })
|
|
||||||
|
|
||||||
const uploadLimits = metadata.uploadLimits
|
|
||||||
store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadLimits.avatar) })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadLimits.background) })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadLimits.banner) })
|
|
||||||
store.dispatch('setInstanceOption', { name: 'fieldsLimits', value: metadata.fieldsLimits })
|
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'restrictedNicknames', value: metadata.restrictedNicknames })
|
store.dispatch('setInstanceOption', { name: 'restrictedNicknames', value: metadata.restrictedNicknames })
|
||||||
store.dispatch('setInstanceOption', { name: 'postFormats', value: metadata.postFormats })
|
store.dispatch('setInstanceOption', { name: 'postFormats', value: metadata.postFormats })
|
||||||
|
@ -286,16 +224,9 @@ const getNodeInfo = async ({ store }) => {
|
||||||
|
|
||||||
const frontendVersion = window.___pleromafe_commit_hash
|
const frontendVersion = window.___pleromafe_commit_hash
|
||||||
store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })
|
store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })
|
||||||
|
store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', value: metadata.federation.mrf_policies.includes('TagPolicy') })
|
||||||
|
|
||||||
const federation = metadata.federation
|
const federation = metadata.federation
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', {
|
|
||||||
name: 'tagPolicyAvailable',
|
|
||||||
value: typeof federation.mrf_policies === 'undefined'
|
|
||||||
? false
|
|
||||||
: metadata.federation.mrf_policies.includes('TagPolicy')
|
|
||||||
})
|
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation })
|
store.dispatch('setInstanceOption', { name: 'federationPolicy', value: federation })
|
||||||
store.dispatch('setInstanceOption', {
|
store.dispatch('setInstanceOption', {
|
||||||
name: 'federating',
|
name: 'federating',
|
||||||
|
@ -304,11 +235,8 @@ const getNodeInfo = async ({ store }) => {
|
||||||
: federation.enabled
|
: federation.enabled
|
||||||
})
|
})
|
||||||
|
|
||||||
const accountActivationRequired = metadata.accountActivationRequired
|
|
||||||
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
|
|
||||||
|
|
||||||
const accounts = metadata.staffAccounts
|
const accounts = metadata.staffAccounts
|
||||||
resolveStaffAccounts({ store, accounts })
|
await resolveStaffAccounts({ store, accounts })
|
||||||
} else {
|
} else {
|
||||||
throw (res)
|
throw (res)
|
||||||
}
|
}
|
||||||
|
@ -320,7 +248,7 @@ const getNodeInfo = async ({ store }) => {
|
||||||
|
|
||||||
const setConfig = async ({ store }) => {
|
const setConfig = async ({ store }) => {
|
||||||
// apiConfig, staticConfig
|
// apiConfig, staticConfig
|
||||||
const configInfos = await Promise.all([getBackendProvidedConfig({ store }), getStaticConfig()])
|
const configInfos = await Promise.all([getStatusnetConfig({ store }), getStaticConfig()])
|
||||||
const apiConfig = configInfos[0]
|
const apiConfig = configInfos[0]
|
||||||
const staticConfig = configInfos[1]
|
const staticConfig = configInfos[1]
|
||||||
|
|
||||||
|
@ -328,99 +256,61 @@ const setConfig = async ({ store }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkOAuthToken = async ({ store }) => {
|
const checkOAuthToken = async ({ store }) => {
|
||||||
if (store.getters.getUserToken()) {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
if (store.getters.getUserToken()) {
|
||||||
await store.dispatch('loginUser', store.getters.getUserToken())
|
try {
|
||||||
} catch (e) {
|
await store.dispatch('loginUser', store.getters.getUserToken())
|
||||||
console.error(e)
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
resolve()
|
||||||
return Promise.resolve()
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const afterStoreSetup = async ({ store, i18n }) => {
|
const afterStoreSetup = async ({ store, i18n }) => {
|
||||||
store.dispatch('setLayoutWidth', windowWidth())
|
if (store.state.config.customTheme) {
|
||||||
store.dispatch('setLayoutHeight', windowHeight())
|
// This is a hack to deal with async loading of config.json and themes
|
||||||
|
// See: style_setter.js, setPreset()
|
||||||
FaviconService.initFaviconService()
|
window.themeLoaded = true
|
||||||
initServiceWorker(store)
|
store.dispatch('setOption', {
|
||||||
|
name: 'customTheme',
|
||||||
window.addEventListener('focus', () => updateFocus())
|
value: store.state.config.customTheme
|
||||||
|
})
|
||||||
const overrides = window.___pleromafe_dev_overrides || {}
|
|
||||||
const server = (typeof overrides.target !== 'undefined') ? overrides.target : window.location.origin
|
|
||||||
store.dispatch('setInstanceOption', { name: 'server', value: server })
|
|
||||||
|
|
||||||
await setConfig({ store })
|
|
||||||
|
|
||||||
const { customTheme, customThemeSource, forceThemeRecompilation } = store.state.config
|
|
||||||
const { theme } = store.state.instance
|
|
||||||
const customThemePresent = customThemeSource || customTheme
|
|
||||||
|
|
||||||
if (!forceThemeRecompilation && tryLoadCache()) {
|
|
||||||
store.commit('setThemeApplied')
|
|
||||||
} else {
|
|
||||||
if (customThemePresent) {
|
|
||||||
if (customThemeSource && customThemeSource.themeEngineVersion === CURRENT_VERSION) {
|
|
||||||
applyTheme(customThemeSource)
|
|
||||||
} else {
|
|
||||||
applyTheme(customTheme)
|
|
||||||
}
|
|
||||||
store.commit('setThemeApplied')
|
|
||||||
} else if (theme) {
|
|
||||||
// do nothing, it will load asynchronously
|
|
||||||
} else {
|
|
||||||
console.error('Failed to load any theme!')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
applyConfig(store.state.config)
|
const width = windowWidth()
|
||||||
|
store.dispatch('setMobileLayout', width <= 800)
|
||||||
|
|
||||||
// Now we can try getting the server settings and logging in
|
// Now we can try getting the server settings and logging in
|
||||||
// Most of these are preloaded into the index.html so blocking is minimized
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
checkOAuthToken({ store }),
|
checkOAuthToken({ store }),
|
||||||
|
setConfig({ store }),
|
||||||
|
getTOS({ store }),
|
||||||
getInstancePanel({ store }),
|
getInstancePanel({ store }),
|
||||||
getNodeInfo({ store }),
|
getStickers({ store }),
|
||||||
getInstanceConfig({ store })
|
getNodeInfo({ store })
|
||||||
])
|
])
|
||||||
|
|
||||||
// Start fetching things that don't need to block the UI
|
const router = new VueRouter({
|
||||||
store.dispatch('fetchMutes')
|
mode: 'history',
|
||||||
store.dispatch('startFetchingAnnouncements')
|
|
||||||
getTOS({ store })
|
|
||||||
getStickers({ store })
|
|
||||||
|
|
||||||
const router = createRouter({
|
|
||||||
history: createWebHistory(),
|
|
||||||
routes: routes(store),
|
routes: routes(store),
|
||||||
scrollBehavior: (to, _from, savedPosition) => {
|
scrollBehavior: (to, _from, savedPosition) => {
|
||||||
if (to.matched.some(m => m.meta.dontScroll)) {
|
if (to.matched.some(m => m.meta.dontScroll)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return savedPosition || { left: 0, top: 0 }
|
return savedPosition || { x: 0, y: 0 }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const app = createApp(App)
|
/* eslint-disable no-new */
|
||||||
|
return new Vue({
|
||||||
app.use(router)
|
router,
|
||||||
app.use(store)
|
store,
|
||||||
app.use(i18n)
|
i18n,
|
||||||
|
el: '#app',
|
||||||
app.use(vClickOutside)
|
render: h => h(App)
|
||||||
app.use(VBodyScrollLock)
|
})
|
||||||
app.use(VueVirtualScroller)
|
|
||||||
|
|
||||||
app.component('FAIcon', FontAwesomeIcon)
|
|
||||||
app.component('FALayers', FontAwesomeLayers)
|
|
||||||
|
|
||||||
// remove after vue 3.3
|
|
||||||
app.config.unwrapInjectedRef = true
|
|
||||||
|
|
||||||
app.mount('#app')
|
|
||||||
|
|
||||||
return app
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default afterStoreSetup
|
export default afterStoreSetup
|
||||||
|
|
|
@ -2,30 +2,23 @@ import PublicTimeline from 'components/public_timeline/public_timeline.vue'
|
||||||
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
|
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
|
||||||
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
|
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
|
||||||
import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
|
import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
|
||||||
import BookmarkTimeline from 'components/bookmark_timeline/bookmark_timeline.vue'
|
|
||||||
import ConversationPage from 'components/conversation-page/conversation-page.vue'
|
import ConversationPage from 'components/conversation-page/conversation-page.vue'
|
||||||
import Interactions from 'components/interactions/interactions.vue'
|
import Interactions from 'components/interactions/interactions.vue'
|
||||||
import DMs from 'components/dm_timeline/dm_timeline.vue'
|
import DMs from 'components/dm_timeline/dm_timeline.vue'
|
||||||
import ChatList from 'components/chat_list/chat_list.vue'
|
|
||||||
import Chat from 'components/chat/chat.vue'
|
|
||||||
import UserProfile from 'components/user_profile/user_profile.vue'
|
import UserProfile from 'components/user_profile/user_profile.vue'
|
||||||
import Search from 'components/search/search.vue'
|
import Search from 'components/search/search.vue'
|
||||||
|
import Settings from 'components/settings/settings.vue'
|
||||||
import Registration from 'components/registration/registration.vue'
|
import Registration from 'components/registration/registration.vue'
|
||||||
import PasswordReset from 'components/password_reset/password_reset.vue'
|
import PasswordReset from 'components/password_reset/password_reset.vue'
|
||||||
|
import UserSettings from 'components/user_settings/user_settings.vue'
|
||||||
import FollowRequests from 'components/follow_requests/follow_requests.vue'
|
import FollowRequests from 'components/follow_requests/follow_requests.vue'
|
||||||
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
|
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
|
||||||
import Notifications from 'components/notifications/notifications.vue'
|
import Notifications from 'components/notifications/notifications.vue'
|
||||||
import AuthForm from 'components/auth_form/auth_form.js'
|
import AuthForm from 'components/auth_form/auth_form.js'
|
||||||
import ShoutPanel from 'components/shout_panel/shout_panel.vue'
|
import ChatPanel from 'components/chat_panel/chat_panel.vue'
|
||||||
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
|
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
|
||||||
import About from 'components/about/about.vue'
|
import About from 'components/about/about.vue'
|
||||||
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
|
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
|
||||||
import Lists from 'components/lists/lists.vue'
|
|
||||||
import ListsTimeline from 'components/lists_timeline/lists_timeline.vue'
|
|
||||||
import ListsEdit from 'components/lists_edit/lists_edit.vue'
|
|
||||||
import NavPanel from 'src/components/nav_panel/nav_panel.vue'
|
|
||||||
import AnnouncementsPage from 'components/announcements_page/announcements_page.vue'
|
|
||||||
import QuotesTimeline from '../components/quotes_timeline/quotes_timeline.vue'
|
|
||||||
|
|
||||||
export default (store) => {
|
export default (store) => {
|
||||||
const validateAuthenticatedRoute = (to, from, next) => {
|
const validateAuthenticatedRoute = (to, from, next) => {
|
||||||
|
@ -36,9 +29,8 @@ export default (store) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let routes = [
|
return [
|
||||||
{
|
{ name: 'root',
|
||||||
name: 'root',
|
|
||||||
path: '/',
|
path: '/',
|
||||||
redirect: _to => {
|
redirect: _to => {
|
||||||
return (store.state.users.currentUser
|
return (store.state.users.currentUser
|
||||||
|
@ -50,51 +42,33 @@ export default (store) => {
|
||||||
{ name: 'public-timeline', path: '/main/public', component: PublicTimeline },
|
{ name: 'public-timeline', path: '/main/public', component: PublicTimeline },
|
||||||
{ name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },
|
{ name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },
|
||||||
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
|
|
||||||
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
|
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
|
||||||
{ name: 'quotes', path: '/notice/:id/quotes', component: QuotesTimeline },
|
{ name: 'remote-user-profile-acct',
|
||||||
{
|
path: '/remote-users/(@?):username([^/@]+)@:hostname([^/@]+)',
|
||||||
name: 'remote-user-profile-acct',
|
|
||||||
path: '/remote-users/:_(@)?:username([^/@]+)@:hostname([^/@]+)',
|
|
||||||
component: RemoteUserResolver,
|
component: RemoteUserResolver,
|
||||||
beforeEnter: validateAuthenticatedRoute
|
beforeEnter: validateAuthenticatedRoute
|
||||||
},
|
},
|
||||||
{
|
{ name: 'remote-user-profile',
|
||||||
name: 'remote-user-profile',
|
|
||||||
path: '/remote-users/:hostname/:username',
|
path: '/remote-users/:hostname/:username',
|
||||||
component: RemoteUserResolver,
|
component: RemoteUserResolver,
|
||||||
beforeEnter: validateAuthenticatedRoute
|
beforeEnter: validateAuthenticatedRoute
|
||||||
},
|
},
|
||||||
{ name: 'external-user-profile', path: '/users/$:id', component: UserProfile },
|
{ name: 'external-user-profile', path: '/users/:id', component: UserProfile },
|
||||||
{ name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },
|
||||||
|
{ name: 'settings', path: '/settings', component: Settings },
|
||||||
{ name: 'registration', path: '/registration', component: Registration },
|
{ name: 'registration', path: '/registration', component: Registration },
|
||||||
{ name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },
|
{ name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },
|
||||||
{ name: 'registration-token', path: '/registration/:token', component: Registration },
|
{ name: 'registration-token', path: '/registration/:token', component: Registration },
|
||||||
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'notifications', path: '/:username/notifications', component: Notifications, props: () => ({ disableTeleport: true }), beforeEnter: validateAuthenticatedRoute },
|
{ name: 'user-settings', path: '/user-settings', component: UserSettings, beforeEnter: validateAuthenticatedRoute },
|
||||||
|
{ name: 'notifications', path: '/:username/notifications', component: Notifications, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'login', path: '/login', component: AuthForm },
|
{ name: 'login', path: '/login', component: AuthForm },
|
||||||
{ name: 'shout-panel', path: '/shout-panel', component: ShoutPanel, props: () => ({ floating: false }) },
|
{ name: 'chat', path: '/chat', component: ChatPanel, props: () => ({ floating: false }) },
|
||||||
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
|
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
|
||||||
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
|
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
|
||||||
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
|
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
|
||||||
{ name: 'about', path: '/about', component: About },
|
{ name: 'about', path: '/about', component: About },
|
||||||
{ name: 'announcements', path: '/announcements', component: AnnouncementsPage },
|
{ name: 'user-profile', path: '/(users/)?:name', component: UserProfile }
|
||||||
{ name: 'user-profile', path: '/users/:name', component: UserProfile },
|
|
||||||
{ name: 'legacy-user-profile', path: '/:name', component: UserProfile },
|
|
||||||
{ name: 'lists', path: '/lists', component: Lists },
|
|
||||||
{ name: 'lists-timeline', path: '/lists/:id', component: ListsTimeline },
|
|
||||||
{ name: 'lists-edit', path: '/lists/:id/edit', component: ListsEdit },
|
|
||||||
{ name: 'lists-new', path: '/lists/new', component: ListsEdit },
|
|
||||||
{ name: 'edit-navigation', path: '/nav-edit', component: NavPanel, props: () => ({ forceExpand: true, forceEditMode: true }), beforeEnter: validateAuthenticatedRoute }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if (store.state.instance.pleromaChatMessagesAvailable) {
|
|
||||||
routes = routes.concat([
|
|
||||||
{ name: 'chat', path: '/users/:username/chats/:recipient_id', component: Chat, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute },
|
|
||||||
{ name: 'chats', path: '/users/:username/chats', component: ChatList, meta: { dontScroll: false }, beforeEnter: validateAuthenticatedRoute }
|
|
||||||
])
|
|
||||||
}
|
|
||||||
|
|
||||||
return routes
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="column-inner">
|
<div class="sidebar">
|
||||||
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
<instance-specific-panel v-if="showInstanceSpecificPanel" />
|
||||||
<staff-panel />
|
<staff-panel />
|
||||||
<terms-of-service-panel />
|
<terms-of-service-panel />
|
||||||
|
@ -8,4 +8,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./about.js"></script>
|
<script src="./about.js" ></script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
</style>
|
||||||
|
|
|
@ -1,46 +1,16 @@
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import ProgressButton from '../progress_button/progress_button.vue'
|
import ProgressButton from '../progress_button/progress_button.vue'
|
||||||
import Popover from '../popover/popover.vue'
|
|
||||||
import UserListMenu from 'src/components/user_list_menu/user_list_menu.vue'
|
|
||||||
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import {
|
|
||||||
faEllipsisV
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faEllipsisV
|
|
||||||
)
|
|
||||||
|
|
||||||
const AccountActions = {
|
const AccountActions = {
|
||||||
props: [
|
props: [
|
||||||
'user', 'relationship'
|
'user'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return { }
|
||||||
showingConfirmBlock: false,
|
|
||||||
showingConfirmRemoveFollower: false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
ProgressButton,
|
ProgressButton
|
||||||
Popover,
|
|
||||||
UserListMenu,
|
|
||||||
ConfirmModal
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showConfirmBlock () {
|
|
||||||
this.showingConfirmBlock = true
|
|
||||||
},
|
|
||||||
hideConfirmBlock () {
|
|
||||||
this.showingConfirmBlock = false
|
|
||||||
},
|
|
||||||
showConfirmRemoveUserFromFollowers () {
|
|
||||||
this.showingConfirmRemoveFollower = true
|
|
||||||
},
|
|
||||||
hideConfirmRemoveUserFromFollowers () {
|
|
||||||
this.showingConfirmRemoveFollower = false
|
|
||||||
},
|
|
||||||
showRepeats () {
|
showRepeats () {
|
||||||
this.$store.dispatch('showReblogs', this.user.id)
|
this.$store.dispatch('showReblogs', this.user.id)
|
||||||
},
|
},
|
||||||
|
@ -48,50 +18,14 @@ const AccountActions = {
|
||||||
this.$store.dispatch('hideReblogs', this.user.id)
|
this.$store.dispatch('hideReblogs', this.user.id)
|
||||||
},
|
},
|
||||||
blockUser () {
|
blockUser () {
|
||||||
if (!this.shouldConfirmBlock) {
|
|
||||||
this.doBlockUser()
|
|
||||||
} else {
|
|
||||||
this.showConfirmBlock()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doBlockUser () {
|
|
||||||
this.$store.dispatch('blockUser', this.user.id)
|
this.$store.dispatch('blockUser', this.user.id)
|
||||||
this.hideConfirmBlock()
|
|
||||||
},
|
},
|
||||||
unblockUser () {
|
unblockUser () {
|
||||||
this.$store.dispatch('unblockUser', this.user.id)
|
this.$store.dispatch('unblockUser', this.user.id)
|
||||||
},
|
},
|
||||||
removeUserFromFollowers () {
|
|
||||||
if (!this.shouldConfirmRemoveUserFromFollowers) {
|
|
||||||
this.doRemoveUserFromFollowers()
|
|
||||||
} else {
|
|
||||||
this.showConfirmRemoveUserFromFollowers()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doRemoveUserFromFollowers () {
|
|
||||||
this.$store.dispatch('removeUserFromFollowers', this.user.id)
|
|
||||||
this.hideConfirmRemoveUserFromFollowers()
|
|
||||||
},
|
|
||||||
reportUser () {
|
reportUser () {
|
||||||
this.$store.dispatch('openUserReportingModal', { userId: this.user.id })
|
this.$store.dispatch('openUserReportingModal', this.user.id)
|
||||||
},
|
|
||||||
openChat () {
|
|
||||||
this.$router.push({
|
|
||||||
name: 'chat',
|
|
||||||
params: { username: this.$store.state.users.currentUser.screen_name, recipient_id: this.user.id }
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
shouldConfirmBlock () {
|
|
||||||
return this.$store.getters.mergedConfig.modalOnBlock
|
|
||||||
},
|
|
||||||
shouldConfirmRemoveUserFromFollowers () {
|
|
||||||
return this.$store.getters.mergedConfig.modalOnRemoveUserFromFollowers
|
|
||||||
},
|
|
||||||
...mapState({
|
|
||||||
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="AccountActions">
|
<div class="account-actions">
|
||||||
<Popover
|
<v-popover
|
||||||
trigger="click"
|
trigger="click"
|
||||||
placement="bottom"
|
class="account-tools-popover"
|
||||||
:bound-to="{ x: 'container' }"
|
:container="false"
|
||||||
remove-padding
|
placement="bottom-end"
|
||||||
|
:offset="5"
|
||||||
>
|
>
|
||||||
<template #content>
|
<div slot="popover">
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<template v-if="relationship.following">
|
<template v-if="user.following">
|
||||||
<button
|
<button
|
||||||
v-if="relationship.showing_reblogs"
|
v-if="user.showing_reblogs"
|
||||||
class="dropdown-item menu-item"
|
class="btn btn-default dropdown-item"
|
||||||
@click="hideRepeats"
|
@click="hideRepeats"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.hide_repeats') }}
|
{{ $t('user_card.hide_repeats') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="!relationship.showing_reblogs"
|
v-if="!user.showing_reblogs"
|
||||||
class="dropdown-item menu-item"
|
class="btn btn-default dropdown-item"
|
||||||
@click="showRepeats"
|
@click="showRepeats"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.show_repeats') }}
|
{{ $t('user_card.show_repeats') }}
|
||||||
|
@ -28,106 +29,55 @@
|
||||||
class="dropdown-divider"
|
class="dropdown-divider"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<UserListMenu :user="user" />
|
|
||||||
<button
|
<button
|
||||||
v-if="relationship.followed_by"
|
v-if="user.statusnet_blocking"
|
||||||
class="dropdown-item menu-item"
|
class="btn btn-default btn-block dropdown-item"
|
||||||
@click="removeUserFromFollowers"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.remove_follower') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="relationship.blocking"
|
|
||||||
class="dropdown-item menu-item"
|
|
||||||
@click="unblockUser"
|
@click="unblockUser"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.unblock') }}
|
{{ $t('user_card.unblock') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else
|
||||||
class="dropdown-item menu-item"
|
class="btn btn-default btn-block dropdown-item"
|
||||||
@click="blockUser"
|
@click="blockUser"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.block') }}
|
{{ $t('user_card.block') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="dropdown-item menu-item"
|
class="btn btn-default btn-block dropdown-item"
|
||||||
@click="reportUser"
|
@click="reportUser"
|
||||||
>
|
>
|
||||||
{{ $t('user_card.report') }}
|
{{ $t('user_card.report') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
v-if="pleromaChatMessagesAvailable"
|
|
||||||
class="dropdown-item menu-item"
|
|
||||||
@click="openChat"
|
|
||||||
>
|
|
||||||
{{ $t('user_card.message') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
<template #trigger>
|
<div class="btn btn-default ellipsis-button">
|
||||||
<button class="button-unstyled ellipsis-button">
|
<i class="icon-ellipsis trigger-button" />
|
||||||
<FAIcon
|
</div>
|
||||||
class="icon"
|
</v-popover>
|
||||||
icon="ellipsis-v"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
</Popover>
|
|
||||||
<teleport to="#modal">
|
|
||||||
<confirm-modal
|
|
||||||
v-if="showingConfirmBlock"
|
|
||||||
:title="$t('user_card.block_confirm_title')"
|
|
||||||
:confirm-text="$t('user_card.block_confirm_accept_button')"
|
|
||||||
:cancel-text="$t('user_card.block_confirm_cancel_button')"
|
|
||||||
@accepted="doBlockUser"
|
|
||||||
@cancelled="hideConfirmBlock"
|
|
||||||
>
|
|
||||||
<i18n-t
|
|
||||||
keypath="user_card.block_confirm"
|
|
||||||
tag="span"
|
|
||||||
>
|
|
||||||
<template #user>
|
|
||||||
<span
|
|
||||||
v-text="user.screen_name_ui"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</confirm-modal>
|
|
||||||
</teleport>
|
|
||||||
<teleport to="#modal">
|
|
||||||
<confirm-modal
|
|
||||||
v-if="showingConfirmRemoveFollower"
|
|
||||||
:title="$t('user_card.remove_follower_confirm_title')"
|
|
||||||
:confirm-text="$t('user_card.remove_follower_confirm_accept_button')"
|
|
||||||
:cancel-text="$t('user_card.remove_follower_confirm_cancel_button')"
|
|
||||||
@accepted="doRemoveUserFromFollowers"
|
|
||||||
@cancelled="hideConfirmRemoveUserFromFollowers"
|
|
||||||
>
|
|
||||||
<i18n-t
|
|
||||||
keypath="user_card.remove_follower_confirm"
|
|
||||||
tag="span"
|
|
||||||
>
|
|
||||||
<template #user>
|
|
||||||
<span
|
|
||||||
v-text="user.screen_name_ui"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</i18n-t>
|
|
||||||
</confirm-modal>
|
|
||||||
</teleport>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./account_actions.js"></script>
|
<script src="./account_actions.js"></script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.AccountActions {
|
@import '../../_variables.scss';
|
||||||
.ellipsis-button {
|
@import '../popper/popper.scss';
|
||||||
width: 2.5em;
|
.account-actions {
|
||||||
margin: -0.5em 0;
|
margin: 0 .8em;
|
||||||
padding: 0.5em 0;
|
}
|
||||||
text-align: center;
|
|
||||||
|
.account-actions button.dropdown-item {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
.account-actions .trigger-button {
|
||||||
|
color: $fallback--lightText;
|
||||||
|
color: var(--lightText, $fallback--lightText);
|
||||||
|
opacity: .8;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
color: $fallback--text;
|
||||||
|
color: var(--text, $fallback--text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
export default {
|
|
||||||
name: 'Alert',
|
|
||||||
selector: '.alert',
|
|
||||||
validInnerComponents: [
|
|
||||||
'Text',
|
|
||||||
'Icon',
|
|
||||||
'Link',
|
|
||||||
'Border',
|
|
||||||
'ButtonUnstyled'
|
|
||||||
],
|
|
||||||
variants: {
|
|
||||||
normal: '.neutral',
|
|
||||||
error: '.error',
|
|
||||||
warning: '.warning',
|
|
||||||
success: '.success'
|
|
||||||
},
|
|
||||||
defaultRules: [
|
|
||||||
{
|
|
||||||
directives: {
|
|
||||||
background: '--text',
|
|
||||||
opacity: 0.5,
|
|
||||||
blur: '9px'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
parent: {
|
|
||||||
component: 'Alert'
|
|
||||||
},
|
|
||||||
component: 'Border',
|
|
||||||
textColor: '--parent'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
variant: 'error',
|
|
||||||
directives: {
|
|
||||||
background: '--cRed'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
variant: 'warning',
|
|
||||||
directives: {
|
|
||||||
background: '--cOrange'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
variant: 'success',
|
|
||||||
directives: {
|
|
||||||
background: '--cGreen'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,108 +0,0 @@
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import AnnouncementEditor from '../announcement_editor/announcement_editor.vue'
|
|
||||||
import RichContent from '../rich_content/rich_content.jsx'
|
|
||||||
import localeService from '../../services/locale/locale.service.js'
|
|
||||||
|
|
||||||
const Announcement = {
|
|
||||||
components: {
|
|
||||||
AnnouncementEditor,
|
|
||||||
RichContent
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
editing: false,
|
|
||||||
editedAnnouncement: {
|
|
||||||
content: '',
|
|
||||||
startsAt: undefined,
|
|
||||||
endsAt: undefined,
|
|
||||||
allDay: undefined
|
|
||||||
},
|
|
||||||
editError: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
announcement: Object
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
currentUser: state => state.users.currentUser
|
|
||||||
}),
|
|
||||||
canEditAnnouncement () {
|
|
||||||
return this.currentUser && this.currentUser.privileges.includes('announcements_manage_announcements')
|
|
||||||
},
|
|
||||||
content () {
|
|
||||||
return this.announcement.content
|
|
||||||
},
|
|
||||||
isRead () {
|
|
||||||
return this.announcement.read
|
|
||||||
},
|
|
||||||
publishedAt () {
|
|
||||||
const time = this.announcement.published_at
|
|
||||||
if (!time) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
|
||||||
},
|
|
||||||
startsAt () {
|
|
||||||
const time = this.announcement.starts_at
|
|
||||||
if (!time) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
|
||||||
},
|
|
||||||
endsAt () {
|
|
||||||
const time = this.announcement.ends_at
|
|
||||||
if (!time) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.formatTimeOrDate(time, localeService.internalToBrowserLocale(this.$i18n.locale))
|
|
||||||
},
|
|
||||||
inactive () {
|
|
||||||
return this.announcement.inactive
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
markAsRead () {
|
|
||||||
if (!this.isRead) {
|
|
||||||
return this.$store.dispatch('markAnnouncementAsRead', this.announcement.id)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deleteAnnouncement () {
|
|
||||||
return this.$store.dispatch('deleteAnnouncement', this.announcement.id)
|
|
||||||
},
|
|
||||||
formatTimeOrDate (time, locale) {
|
|
||||||
const d = new Date(time)
|
|
||||||
return this.announcement.all_day ? d.toLocaleDateString(locale) : d.toLocaleString(locale)
|
|
||||||
},
|
|
||||||
enterEditMode () {
|
|
||||||
this.editedAnnouncement.content = this.announcement.pleroma.raw_content
|
|
||||||
this.editedAnnouncement.startsAt = this.announcement.starts_at
|
|
||||||
this.editedAnnouncement.endsAt = this.announcement.ends_at
|
|
||||||
this.editedAnnouncement.allDay = this.announcement.all_day
|
|
||||||
this.editing = true
|
|
||||||
},
|
|
||||||
submitEdit () {
|
|
||||||
this.$store.dispatch('editAnnouncement', {
|
|
||||||
id: this.announcement.id,
|
|
||||||
...this.editedAnnouncement
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.editing = false
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
this.editError = error.error
|
|
||||||
})
|
|
||||||
},
|
|
||||||
cancelEdit () {
|
|
||||||
this.editing = false
|
|
||||||
},
|
|
||||||
clearError () {
|
|
||||||
this.editError = undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Announcement
|
|
|
@ -1,134 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="announcement">
|
|
||||||
<div class="heading">
|
|
||||||
<h4>{{ $t('announcements.title') }}</h4>
|
|
||||||
</div>
|
|
||||||
<div class="body">
|
|
||||||
<rich-content
|
|
||||||
v-if="!editing"
|
|
||||||
:html="content"
|
|
||||||
:emoji="announcement.emojis"
|
|
||||||
:handle-links="true"
|
|
||||||
/>
|
|
||||||
<announcement-editor
|
|
||||||
v-else
|
|
||||||
:announcement="editedAnnouncement"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="footer">
|
|
||||||
<div
|
|
||||||
v-if="!editing"
|
|
||||||
class="times"
|
|
||||||
>
|
|
||||||
<span v-if="publishedAt">
|
|
||||||
{{ $t('announcements.published_time_display', { time: publishedAt }) }}
|
|
||||||
</span>
|
|
||||||
<span v-if="startsAt">
|
|
||||||
{{ $t('announcements.start_time_display', { time: startsAt }) }}
|
|
||||||
</span>
|
|
||||||
<span v-if="endsAt">
|
|
||||||
{{ $t('announcements.end_time_display', { time: endsAt }) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="!editing"
|
|
||||||
class="actions"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
v-if="currentUser"
|
|
||||||
class="btn button-default"
|
|
||||||
:class="{ toggled: isRead }"
|
|
||||||
:disabled="inactive"
|
|
||||||
:title="inactive ? $t('announcements.inactive_message') : ''"
|
|
||||||
@click="markAsRead"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.mark_as_read_action') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="canEditAnnouncement"
|
|
||||||
class="btn button-default"
|
|
||||||
@click="enterEditMode"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.edit_action') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="canEditAnnouncement"
|
|
||||||
class="btn button-default"
|
|
||||||
@click="deleteAnnouncement"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.delete_action') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="actions"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="btn button-default"
|
|
||||||
@click="submitEdit"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.submit_edit_action') }}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="btn button-default"
|
|
||||||
@click="cancelEdit"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.cancel_edit_action') }}
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
v-if="editing && editError"
|
|
||||||
class="alert error"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.edit_error', { error }) }}
|
|
||||||
<button
|
|
||||||
class="button-unstyled"
|
|
||||||
@click="clearError"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="times"
|
|
||||||
:title="$t('announcements.close_error')"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./announcement.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.announcement {
|
|
||||||
border-bottom: 1px solid var(--border);
|
|
||||||
border-radius: 0;
|
|
||||||
padding: var(--status-margin);
|
|
||||||
|
|
||||||
.heading,
|
|
||||||
.body {
|
|
||||||
margin-bottom: var(--status-margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.times {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer .actions {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
flex: 1;
|
|
||||||
margin: 1em;
|
|
||||||
max-width: 10em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,13 +0,0 @@
|
||||||
import Checkbox from '../checkbox/checkbox.vue'
|
|
||||||
|
|
||||||
const AnnouncementEditor = {
|
|
||||||
components: {
|
|
||||||
Checkbox
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
announcement: Object,
|
|
||||||
disabled: Boolean
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default AnnouncementEditor
|
|
|
@ -1,62 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="announcement-editor">
|
|
||||||
<textarea
|
|
||||||
ref="textarea"
|
|
||||||
v-model="announcement.content"
|
|
||||||
class="input post-textarea"
|
|
||||||
rows="1"
|
|
||||||
cols="1"
|
|
||||||
:placeholder="$t('announcements.post_placeholder')"
|
|
||||||
:disabled="disabled"
|
|
||||||
/>
|
|
||||||
<span class="announcement-metadata">
|
|
||||||
<label for="announcement-start-time">{{ $t('announcements.start_time_prompt') }}</label>
|
|
||||||
<input
|
|
||||||
id="announcement-start-time"
|
|
||||||
v-model="announcement.startsAt"
|
|
||||||
class="input"
|
|
||||||
:type="announcement.allDay ? 'date' : 'datetime-local'"
|
|
||||||
:disabled="disabled"
|
|
||||||
>
|
|
||||||
</span>
|
|
||||||
<span class="announcement-metadata">
|
|
||||||
<label for="announcement-end-time">{{ $t('announcements.end_time_prompt') }}</label>
|
|
||||||
<input
|
|
||||||
id="announcement-end-time"
|
|
||||||
v-model="announcement.endsAt"
|
|
||||||
class="input"
|
|
||||||
:type="announcement.allDay ? 'date' : 'datetime-local'"
|
|
||||||
:disabled="disabled"
|
|
||||||
>
|
|
||||||
</span>
|
|
||||||
<span class="announcement-metadata">
|
|
||||||
<Checkbox
|
|
||||||
id="announcement-all-day"
|
|
||||||
v-model="announcement.allDay"
|
|
||||||
:disabled="disabled"
|
|
||||||
/>
|
|
||||||
<label for="announcement-all-day">{{ $t('announcements.all_day_prompt') }}</label>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./announcement_editor.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.announcement-editor {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.announcement-metadata {
|
|
||||||
margin-top: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-textarea {
|
|
||||||
resize: vertical;
|
|
||||||
height: 10em;
|
|
||||||
overflow: none;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,58 +0,0 @@
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import Announcement from '../announcement/announcement.vue'
|
|
||||||
import AnnouncementEditor from '../announcement_editor/announcement_editor.vue'
|
|
||||||
|
|
||||||
const AnnouncementsPage = {
|
|
||||||
components: {
|
|
||||||
Announcement,
|
|
||||||
AnnouncementEditor
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
newAnnouncement: {
|
|
||||||
content: '',
|
|
||||||
startsAt: undefined,
|
|
||||||
endsAt: undefined,
|
|
||||||
allDay: false
|
|
||||||
},
|
|
||||||
posting: false,
|
|
||||||
error: undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.$store.dispatch('fetchAnnouncements')
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
currentUser: state => state.users.currentUser
|
|
||||||
}),
|
|
||||||
announcements () {
|
|
||||||
return this.$store.state.announcements.announcements
|
|
||||||
},
|
|
||||||
canPostAnnouncement () {
|
|
||||||
return this.currentUser && this.currentUser.privileges.includes('announcements_manage_announcements')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
postAnnouncement () {
|
|
||||||
this.posting = true
|
|
||||||
this.$store.dispatch('postAnnouncement', this.newAnnouncement)
|
|
||||||
.then(() => {
|
|
||||||
this.newAnnouncement.content = ''
|
|
||||||
this.startsAt = undefined
|
|
||||||
this.endsAt = undefined
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
this.error = error.error
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.posting = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clearError () {
|
|
||||||
this.error = undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default AnnouncementsPage
|
|
|
@ -1,78 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="panel panel-default announcements-page">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<span>
|
|
||||||
{{ $t('announcements.page_header') }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<section
|
|
||||||
v-if="canPostAnnouncement"
|
|
||||||
>
|
|
||||||
<div class="post-form">
|
|
||||||
<div class="heading">
|
|
||||||
<h4>{{ $t('announcements.post_form_header') }}</h4>
|
|
||||||
</div>
|
|
||||||
<div class="body">
|
|
||||||
<announcement-editor
|
|
||||||
:announcement="newAnnouncement"
|
|
||||||
:disabled="posting"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="footer">
|
|
||||||
<button
|
|
||||||
class="btn button-default post-button"
|
|
||||||
:disabled="posting"
|
|
||||||
@click.prevent="postAnnouncement"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.post_action') }}
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
v-if="error"
|
|
||||||
class="alert error"
|
|
||||||
>
|
|
||||||
{{ $t('announcements.post_error', { error }) }}
|
|
||||||
<button
|
|
||||||
class="button-unstyled"
|
|
||||||
@click="clearError"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="times"
|
|
||||||
:title="$t('announcements.close_error')"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section
|
|
||||||
v-for="announcement in announcements"
|
|
||||||
:key="announcement.id"
|
|
||||||
>
|
|
||||||
<announcement
|
|
||||||
:announcement="announcement"
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script src="./announcements_page.js"></script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.announcements-page {
|
|
||||||
.post-form {
|
|
||||||
padding: var(--status-margin);
|
|
||||||
|
|
||||||
.heading,
|
|
||||||
.body {
|
|
||||||
margin-bottom: var(--status-margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-button {
|
|
||||||
min-width: 10em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,43 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="async-component-error">
|
|
||||||
<div>
|
|
||||||
<h4>
|
|
||||||
{{ $t('general.generic_error') }}
|
|
||||||
</h4>
|
|
||||||
<p>
|
|
||||||
{{ $t('general.error_retry') }}
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
class="btn button-default"
|
|
||||||
@click="retry"
|
|
||||||
>
|
|
||||||
{{ $t('general.retry') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
emits: ['resetAsyncComponent'],
|
|
||||||
methods: {
|
|
||||||
retry () {
|
|
||||||
this.$emit('resetAsyncComponent')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.async-component-error {
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin: 0.5em;
|
|
||||||
padding: 0.5em 2em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,102 +1,36 @@
|
||||||
import StillImage from '../still-image/still-image.vue'
|
import StillImage from '../still-image/still-image.vue'
|
||||||
import Flash from '../flash/flash.vue'
|
|
||||||
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
import VideoAttachment from '../video_attachment/video_attachment.vue'
|
||||||
import nsfwImage from '../../assets/nsfw.png'
|
import nsfwImage from '../../assets/nsfw.png'
|
||||||
import fileTypeService from '../../services/file_type/file_type.service.js'
|
import fileTypeService from '../../services/file_type/file_type.service.js'
|
||||||
import { mapGetters } from 'vuex'
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import {
|
|
||||||
faFile,
|
|
||||||
faMusic,
|
|
||||||
faImage,
|
|
||||||
faVideo,
|
|
||||||
faPlayCircle,
|
|
||||||
faTimes,
|
|
||||||
faStop,
|
|
||||||
faSearchPlus,
|
|
||||||
faTrashAlt,
|
|
||||||
faPencilAlt,
|
|
||||||
faAlignRight
|
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
library.add(
|
|
||||||
faFile,
|
|
||||||
faMusic,
|
|
||||||
faImage,
|
|
||||||
faVideo,
|
|
||||||
faPlayCircle,
|
|
||||||
faTimes,
|
|
||||||
faStop,
|
|
||||||
faSearchPlus,
|
|
||||||
faTrashAlt,
|
|
||||||
faPencilAlt,
|
|
||||||
faAlignRight
|
|
||||||
)
|
|
||||||
|
|
||||||
const Attachment = {
|
const Attachment = {
|
||||||
props: [
|
props: [
|
||||||
'attachment',
|
'attachment',
|
||||||
'compact',
|
|
||||||
'description',
|
|
||||||
'hideDescription',
|
|
||||||
'nsfw',
|
'nsfw',
|
||||||
|
'statusId',
|
||||||
'size',
|
'size',
|
||||||
|
'allowPlay',
|
||||||
'setMedia',
|
'setMedia',
|
||||||
'remove',
|
'naturalSizeLoad'
|
||||||
'shiftUp',
|
|
||||||
'shiftDn',
|
|
||||||
'edit'
|
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
localDescription: this.description || this.attachment.description,
|
|
||||||
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
|
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
|
||||||
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
|
||||||
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
preloadImage: this.$store.getters.mergedConfig.preloadImage,
|
||||||
loading: false,
|
loading: false,
|
||||||
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
|
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
|
||||||
modalOpen: false,
|
modalOpen: false,
|
||||||
showHidden: false,
|
showHidden: false
|
||||||
flashLoaded: false,
|
|
||||||
showDescription: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Flash,
|
|
||||||
StillImage,
|
StillImage,
|
||||||
VideoAttachment
|
VideoAttachment
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
classNames () {
|
usePlaceHolder () {
|
||||||
return [
|
return this.size === 'hide' || this.type === 'unknown'
|
||||||
{
|
|
||||||
'-loading': this.loading,
|
|
||||||
'-nsfw-placeholder': this.hidden,
|
|
||||||
'-editable': this.edit !== undefined,
|
|
||||||
'-compact': this.compact
|
|
||||||
},
|
|
||||||
'-type-' + this.type,
|
|
||||||
this.size && '-size-' + this.size,
|
|
||||||
`-${this.useContainFit ? 'contain' : 'cover'}-fit`
|
|
||||||
]
|
|
||||||
},
|
|
||||||
usePlaceholder () {
|
|
||||||
return this.size === 'hide'
|
|
||||||
},
|
|
||||||
useContainFit () {
|
|
||||||
return this.$store.getters.mergedConfig.useContainFit
|
|
||||||
},
|
|
||||||
placeholderName () {
|
|
||||||
if (this.attachment.description === '' || !this.attachment.description) {
|
|
||||||
return this.type.toUpperCase()
|
|
||||||
}
|
|
||||||
return this.attachment.description
|
|
||||||
},
|
|
||||||
placeholderIconClass () {
|
|
||||||
if (this.type === 'image') return 'image'
|
|
||||||
if (this.type === 'video') return 'video'
|
|
||||||
if (this.type === 'audio') return 'music'
|
|
||||||
return 'file'
|
|
||||||
},
|
},
|
||||||
referrerpolicy () {
|
referrerpolicy () {
|
||||||
return this.$store.state.instance.mediaProxyAvailable ? '' : 'no-referrer'
|
return this.$store.state.instance.mediaProxyAvailable ? '' : 'no-referrer'
|
||||||
|
@ -108,34 +42,13 @@ const Attachment = {
|
||||||
return this.nsfw && this.hideNsfwLocal && !this.showHidden
|
return this.nsfw && this.hideNsfwLocal && !this.showHidden
|
||||||
},
|
},
|
||||||
isEmpty () {
|
isEmpty () {
|
||||||
return (this.type === 'html' && !this.attachment.oembed)
|
return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown'
|
||||||
},
|
},
|
||||||
useModal () {
|
isSmall () {
|
||||||
let modalTypes = []
|
return this.size === 'small'
|
||||||
switch (this.size) {
|
|
||||||
case 'hide':
|
|
||||||
case 'small':
|
|
||||||
modalTypes = ['image', 'video', 'audio', 'flash']
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
modalTypes = this.mergedConfig.playVideosInModal
|
|
||||||
? ['image', 'video', 'flash']
|
|
||||||
: ['image']
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return modalTypes.includes(this.type)
|
|
||||||
},
|
},
|
||||||
videoTag () {
|
fullwidth () {
|
||||||
return this.useModal ? 'button' : 'span'
|
return this.type === 'html' || this.type === 'audio'
|
||||||
},
|
|
||||||
...mapGetters(['mergedConfig'])
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'attachment.description' (newVal) {
|
|
||||||
this.localDescription = newVal
|
|
||||||
},
|
|
||||||
localDescription (newVal) {
|
|
||||||
this.onEdit(newVal)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -145,43 +58,20 @@ const Attachment = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openModal (event) {
|
openModal (event) {
|
||||||
if (this.useModal) {
|
const modalTypes = this.$store.getters.mergedConfig.playVideosInModal
|
||||||
this.$emit('setMedia')
|
? ['image', 'video']
|
||||||
this.$store.dispatch('setCurrentMedia', this.attachment)
|
: ['image']
|
||||||
} else if (this.type === 'unknown') {
|
if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) ||
|
||||||
window.open(this.attachment.url)
|
this.usePlaceHolder
|
||||||
|
) {
|
||||||
|
event.stopPropagation()
|
||||||
|
event.preventDefault()
|
||||||
|
this.setMedia()
|
||||||
|
this.$store.dispatch('setCurrent', this.attachment)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openModalForce (event) {
|
|
||||||
this.$emit('setMedia')
|
|
||||||
this.$store.dispatch('setCurrentMedia', this.attachment)
|
|
||||||
},
|
|
||||||
onEdit (event) {
|
|
||||||
this.edit && this.edit(this.attachment, event)
|
|
||||||
},
|
|
||||||
onRemove () {
|
|
||||||
this.remove && this.remove(this.attachment)
|
|
||||||
},
|
|
||||||
onShiftUp () {
|
|
||||||
this.shiftUp && this.shiftUp(this.attachment)
|
|
||||||
},
|
|
||||||
onShiftDn () {
|
|
||||||
this.shiftDn && this.shiftDn(this.attachment)
|
|
||||||
},
|
|
||||||
stopFlash () {
|
|
||||||
this.$refs.flash.closePlayer()
|
|
||||||
},
|
|
||||||
setFlashLoaded (event) {
|
|
||||||
this.flashLoaded = event
|
|
||||||
},
|
|
||||||
toggleDescription () {
|
|
||||||
this.showDescription = !this.showDescription
|
|
||||||
},
|
|
||||||
toggleHidden (event) {
|
toggleHidden (event) {
|
||||||
if (
|
if (this.$store.getters.mergedConfig.useOneClickNsfw && !this.showHidden) {
|
||||||
(this.mergedConfig.useOneClickNsfw && !this.showHidden) &&
|
|
||||||
(this.type !== 'video' || this.mergedConfig.playVideosInModal)
|
|
||||||
) {
|
|
||||||
this.openModal(event)
|
this.openModal(event)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -203,7 +93,7 @@ const Attachment = {
|
||||||
onImageLoad (image) {
|
onImageLoad (image) {
|
||||||
const width = image.naturalWidth
|
const width = image.naturalWidth
|
||||||
const height = image.naturalHeight
|
const height = image.naturalHeight
|
||||||
this.$emit('naturalSizeLoad', { id: this.attachment.id, width, height })
|
this.naturalSizeLoad && this.naturalSizeLoad({ width, height })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,266 +0,0 @@
|
||||||
.Attachment {
|
|
||||||
display: inline-flex;
|
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
|
||||||
align-self: flex-start;
|
|
||||||
line-height: 0;
|
|
||||||
height: 100%;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: var(--roundness);
|
|
||||||
border-color: var(--border);
|
|
||||||
|
|
||||||
.attachment-wrapper {
|
|
||||||
flex: 1 1 auto;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description-container {
|
|
||||||
flex: 0 1 0;
|
|
||||||
display: flex;
|
|
||||||
padding-top: 0.5em;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
p {
|
|
||||||
flex: 1;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 0.5em;
|
|
||||||
margin: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-static {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
padding-top: 0;
|
|
||||||
background: var(--popover);
|
|
||||||
box-shadow: var(--popupShadow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.description-field {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
& .placeholder-container,
|
|
||||||
& .image-container,
|
|
||||||
& .audio-container,
|
|
||||||
& .video-container,
|
|
||||||
& .flash-container,
|
|
||||||
& .oembed-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-container {
|
|
||||||
.image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
& .flash-container,
|
|
||||||
& .video-container {
|
|
||||||
& .flash,
|
|
||||||
& video {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: contain;
|
|
||||||
align-self: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-container {
|
|
||||||
border: none;
|
|
||||||
outline: none;
|
|
||||||
color: inherit;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.audio-container {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
|
|
||||||
audio {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.play-icon {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 64px;
|
|
||||||
top: calc(50% - 32px);
|
|
||||||
left: calc(50% - 32px);
|
|
||||||
color: rgb(255 255 255 / 75%);
|
|
||||||
text-shadow: 0 0 2px rgb(0 0 0 / 40%);
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachment-buttons {
|
|
||||||
display: flex;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
margin-top: 0.5em;
|
|
||||||
margin-right: 0.5em;
|
|
||||||
z-index: 1;
|
|
||||||
|
|
||||||
.attachment-button {
|
|
||||||
padding: 0;
|
|
||||||
border-radius: var(--roundness);
|
|
||||||
text-align: center;
|
|
||||||
width: 2em;
|
|
||||||
height: 2em;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
font-size: 1.25em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-contain-fit {
|
|
||||||
img,
|
|
||||||
canvas {
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-cover-fit {
|
|
||||||
img,
|
|
||||||
canvas {
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.oembed-container {
|
|
||||||
line-height: 1.2em;
|
|
||||||
flex: 1 0 100%;
|
|
||||||
width: 100%;
|
|
||||||
margin-right: 15px;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: 0;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
flex: 2;
|
|
||||||
margin: 8px;
|
|
||||||
word-break: break-all;
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 1rem;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-size-small {
|
|
||||||
.play-icon {
|
|
||||||
zoom: 0.5;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachment-buttons {
|
|
||||||
zoom: 0.7;
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-editable {
|
|
||||||
padding: 0.5em;
|
|
||||||
|
|
||||||
& .description-container,
|
|
||||||
& .attachment-buttons {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-placeholder {
|
|
||||||
display: inline-block;
|
|
||||||
color: var(--link);
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: auto;
|
|
||||||
line-height: 1.5;
|
|
||||||
|
|
||||||
&:not(.-editable) {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-editable {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: baseline;
|
|
||||||
|
|
||||||
& .description-container,
|
|
||||||
& .attachment-buttons {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description-container {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attachment-buttons {
|
|
||||||
order: 99;
|
|
||||||
align-self: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
display: inline-block;
|
|
||||||
max-width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-loading {
|
|
||||||
cursor: progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.-compact {
|
|
||||||
.placeholder-container {
|
|
||||||
padding-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
export default {
|
|
||||||
name: 'Attachment',
|
|
||||||
selector: '.Attachment',
|
|
||||||
validInnerComponents: [
|
|
||||||
'Border',
|
|
||||||
'ButtonUnstyled',
|
|
||||||
'Input'
|
|
||||||
],
|
|
||||||
defaultRules: [
|
|
||||||
{
|
|
||||||
directives: {
|
|
||||||
roundness: 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'ButtonUnstyled',
|
|
||||||
parent: { component: 'Attachment' },
|
|
||||||
directives: {
|
|
||||||
background: '#FFFFFF',
|
|
||||||
opacity: 0.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,8 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<button
|
<div
|
||||||
v-if="usePlaceholder"
|
v-if="usePlaceHolder"
|
||||||
class="Attachment -placeholder button-unstyled"
|
|
||||||
:class="classNames"
|
|
||||||
@click="openModal"
|
@click="openModal"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
|
@ -10,259 +8,288 @@
|
||||||
class="placeholder"
|
class="placeholder"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:href="attachment.url"
|
:href="attachment.url"
|
||||||
:alt="attachment.description"
|
|
||||||
:title="attachment.description"
|
|
||||||
@click.prevent
|
|
||||||
>
|
>
|
||||||
<FAIcon :icon="placeholderIconClass" />
|
[{{ nsfw ? "NSFW/" : "" }}{{ type.toUpperCase() }}]
|
||||||
<b>{{ nsfw ? "NSFW / " : "" }}</b>{{ edit ? '' : placeholderName }}
|
|
||||||
</a>
|
</a>
|
||||||
<div
|
</div>
|
||||||
v-if="edit || remove"
|
|
||||||
class="attachment-buttons"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
v-if="remove"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
@click.prevent="onRemove"
|
|
||||||
>
|
|
||||||
<FAIcon icon="trash-alt" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-if="size !== 'hide' && !hideDescription && (edit || localDescription || showDescription)"
|
|
||||||
class="description-container"
|
|
||||||
:class="{ '-static': !edit }"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
v-if="edit"
|
|
||||||
v-model="localDescription"
|
|
||||||
type="text"
|
|
||||||
class="input description-field"
|
|
||||||
:placeholder="$t('post_status.media_description')"
|
|
||||||
@keydown.enter.prevent=""
|
|
||||||
>
|
|
||||||
<p v-else>
|
|
||||||
{{ localDescription }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="Attachment"
|
v-show="!isEmpty"
|
||||||
:class="classNames"
|
class="attachment"
|
||||||
|
:class="{[type]: true, loading, 'fullwidth': fullwidth, 'nsfw-placeholder': hidden}"
|
||||||
>
|
>
|
||||||
|
<a
|
||||||
|
v-if="hidden"
|
||||||
|
class="image-attachment"
|
||||||
|
:href="attachment.url"
|
||||||
|
@click.prevent="toggleHidden"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:key="nsfwImage"
|
||||||
|
class="nsfw"
|
||||||
|
:src="nsfwImage"
|
||||||
|
:class="{'small': isSmall}"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
v-if="type === 'video'"
|
||||||
|
class="play-icon icon-play-circled"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
<div
|
<div
|
||||||
v-show="!isEmpty"
|
v-if="nsfw && hideNsfwLocal && !hidden"
|
||||||
class="attachment-wrapper"
|
class="hider"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
v-if="hidden"
|
href="#"
|
||||||
class="image-container"
|
@click.prevent="toggleHidden"
|
||||||
:href="attachment.url"
|
>Hide</a>
|
||||||
:alt="attachment.description"
|
|
||||||
:title="attachment.description"
|
|
||||||
@click.prevent.stop="toggleHidden"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:key="nsfwImage"
|
|
||||||
class="nsfw"
|
|
||||||
:src="nsfwImage"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
v-if="type === 'video'"
|
|
||||||
class="play-icon"
|
|
||||||
icon="play-circle"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<div
|
|
||||||
v-if="!hidden"
|
|
||||||
class="attachment-buttons"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
v-if="type === 'flash' && flashLoaded"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.attachment_stop_flash')"
|
|
||||||
@click.prevent="stopFlash"
|
|
||||||
>
|
|
||||||
<FAIcon icon="stop" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="attachment.description && size !== 'small' && !edit && type !== 'unknown'"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.show_attachment_description')"
|
|
||||||
@click.prevent="toggleDescription"
|
|
||||||
>
|
|
||||||
<FAIcon icon="align-right" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="!useModal && type !== 'unknown'"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.show_attachment_in_modal')"
|
|
||||||
@click.prevent="openModalForce"
|
|
||||||
>
|
|
||||||
<FAIcon icon="search-plus" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="nsfw && hideNsfwLocal"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.hide_attachment')"
|
|
||||||
@click.prevent="toggleHidden"
|
|
||||||
>
|
|
||||||
<FAIcon icon="times" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="shiftUp"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.move_up')"
|
|
||||||
@click.prevent="onShiftUp"
|
|
||||||
>
|
|
||||||
<FAIcon icon="chevron-left" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="shiftDn"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.move_down')"
|
|
||||||
@click.prevent="onShiftDn"
|
|
||||||
>
|
|
||||||
<FAIcon icon="chevron-right" />
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
v-if="remove"
|
|
||||||
class="button-unstyled attachment-button"
|
|
||||||
:title="$t('status.remove_attachment')"
|
|
||||||
@click.prevent="onRemove"
|
|
||||||
>
|
|
||||||
<FAIcon icon="trash-alt" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a
|
|
||||||
v-if="type === 'image' && (!hidden || preloadImage)"
|
|
||||||
class="image-container"
|
|
||||||
:class="{'-hidden': hidden && preloadImage }"
|
|
||||||
:href="attachment.url"
|
|
||||||
target="_blank"
|
|
||||||
@click.stop.prevent="openModal"
|
|
||||||
>
|
|
||||||
<StillImage
|
|
||||||
class="image"
|
|
||||||
:referrerpolicy="referrerpolicy"
|
|
||||||
:mimetype="attachment.mimetype"
|
|
||||||
:src="attachment.large_thumb_url || attachment.url"
|
|
||||||
:image-load-handler="onImageLoad"
|
|
||||||
:alt="attachment.description"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
v-if="type === 'unknown' && !hidden"
|
|
||||||
class="placeholder-container"
|
|
||||||
:href="attachment.url"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
:size="compact ? '2x' : '5x'"
|
|
||||||
:icon="placeholderIconClass"
|
|
||||||
:title="localDescription"
|
|
||||||
/>
|
|
||||||
<p v-if="!compact">
|
|
||||||
{{ localDescription }}
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<component
|
|
||||||
:is="videoTag"
|
|
||||||
v-if="type === 'video' && !hidden"
|
|
||||||
class="video-container"
|
|
||||||
:href="attachment.url"
|
|
||||||
@click.stop.prevent="openModal"
|
|
||||||
>
|
|
||||||
<VideoAttachment
|
|
||||||
class="video"
|
|
||||||
:attachment="attachment"
|
|
||||||
:controls="!useModal"
|
|
||||||
@play="$emit('play')"
|
|
||||||
@pause="$emit('pause')"
|
|
||||||
/>
|
|
||||||
<FAIcon
|
|
||||||
v-if="useModal"
|
|
||||||
class="play-icon"
|
|
||||||
icon="play-circle"
|
|
||||||
/>
|
|
||||||
</component>
|
|
||||||
|
|
||||||
<span
|
|
||||||
v-if="type === 'audio' && !hidden"
|
|
||||||
class="audio-container"
|
|
||||||
:href="attachment.url"
|
|
||||||
@click.stop.prevent="openModal"
|
|
||||||
>
|
|
||||||
<audio
|
|
||||||
v-if="type === 'audio'"
|
|
||||||
:src="attachment.url"
|
|
||||||
:alt="attachment.description"
|
|
||||||
:title="attachment.description"
|
|
||||||
controls
|
|
||||||
@play="$emit('play')"
|
|
||||||
@pause="$emit('pause')"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="type === 'html' && attachment.oembed"
|
|
||||||
class="oembed-container"
|
|
||||||
@click.prevent="linkClicked"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
v-if="attachment.thumb_url"
|
|
||||||
class="image"
|
|
||||||
>
|
|
||||||
<img :src="attachment.thumb_url">
|
|
||||||
</div>
|
|
||||||
<div class="text">
|
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
|
||||||
<h1><a :href="attachment.url">{{ attachment.oembed.title }}</a></h1>
|
|
||||||
<div v-html="attachment.oembed.oembedHTML" />
|
|
||||||
<!-- eslint-enable vue/no-v-html -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span
|
|
||||||
v-if="type === 'flash' && !hidden"
|
|
||||||
class="flash-container"
|
|
||||||
:href="attachment.url"
|
|
||||||
@click.stop.prevent="openModal"
|
|
||||||
>
|
|
||||||
<Flash
|
|
||||||
ref="flash"
|
|
||||||
class="flash"
|
|
||||||
:src="attachment.large_thumb_url || attachment.url"
|
|
||||||
@playerOpened="setFlashLoaded(true)"
|
|
||||||
@playerClosed="setFlashLoaded(false)"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
v-if="size !== 'hide' && !hideDescription && (edit || (localDescription && showDescription))"
|
<a
|
||||||
class="description-container"
|
v-if="type === 'image' && (!hidden || preloadImage)"
|
||||||
:class="{ '-static': !edit }"
|
class="image-attachment"
|
||||||
|
:class="{'hidden': hidden && preloadImage }"
|
||||||
|
:href="attachment.url"
|
||||||
|
target="_blank"
|
||||||
|
:title="attachment.description"
|
||||||
|
@click="openModal"
|
||||||
>
|
>
|
||||||
<input
|
<StillImage
|
||||||
v-if="edit"
|
:referrerpolicy="referrerpolicy"
|
||||||
v-model="localDescription"
|
:mimetype="attachment.mimetype"
|
||||||
type="text"
|
:src="attachment.large_thumb_url || attachment.url"
|
||||||
class="input description-field"
|
:image-load-handler="onImageLoad"
|
||||||
:placeholder="$t('post_status.media_description')"
|
/>
|
||||||
@keydown.enter.prevent=""
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
v-if="type === 'video' && !hidden"
|
||||||
|
class="video-container"
|
||||||
|
:class="{'small': isSmall}"
|
||||||
|
:href="allowPlay ? undefined : attachment.url"
|
||||||
|
@click="openModal"
|
||||||
|
>
|
||||||
|
<VideoAttachment
|
||||||
|
class="video"
|
||||||
|
:attachment="attachment"
|
||||||
|
:controls="allowPlay"
|
||||||
|
/>
|
||||||
|
<i
|
||||||
|
v-if="!allowPlay"
|
||||||
|
class="play-icon icon-play-circled"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<audio
|
||||||
|
v-if="type === 'audio'"
|
||||||
|
:src="attachment.url"
|
||||||
|
controls
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="type === 'html' && attachment.oembed"
|
||||||
|
class="oembed"
|
||||||
|
@click.prevent="linkClicked"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="attachment.thumb_url"
|
||||||
|
class="image"
|
||||||
>
|
>
|
||||||
<p v-else>
|
<img :src="attachment.thumb_url">
|
||||||
{{ localDescription }}
|
</div>
|
||||||
</p>
|
<div class="text">
|
||||||
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<h1><a :href="attachment.url">{{ attachment.oembed.title }}</a></h1>
|
||||||
|
<div v-html="attachment.oembed.oembedHTML" />
|
||||||
|
<!-- eslint-enable vue/no-v-html -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./attachment.js"></script>
|
<script src="./attachment.js"></script>
|
||||||
|
|
||||||
<style src="./attachment.scss" lang="scss"></style>
|
<style lang="scss">
|
||||||
|
@import '../../_variables.scss';
|
||||||
|
|
||||||
|
.attachments {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.attachment.media-upload-container {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
max-height: 200px;
|
||||||
|
max-width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
video {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nsfw-placeholder {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.loading {
|
||||||
|
cursor: progress;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 0.5em;
|
||||||
|
align-self: flex-start;
|
||||||
|
line-height: 0;
|
||||||
|
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: $fallback--attachmentRadius;
|
||||||
|
border-radius: var(--attachmentRadius, $fallback--attachmentRadius);
|
||||||
|
border-color: $fallback--border;
|
||||||
|
border-color: var(--border, $fallback--border);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.non-gallery.attachment {
|
||||||
|
&.video {
|
||||||
|
flex: 1 0 40%;
|
||||||
|
}
|
||||||
|
.nsfw {
|
||||||
|
height: 260px;
|
||||||
|
}
|
||||||
|
.small {
|
||||||
|
height: 120px;
|
||||||
|
flex-grow: 0;
|
||||||
|
}
|
||||||
|
.video {
|
||||||
|
height: 260px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
video {
|
||||||
|
max-height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullwidth {
|
||||||
|
flex-basis: 100%;
|
||||||
|
}
|
||||||
|
// fixes small gap below video
|
||||||
|
&.video {
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-container {
|
||||||
|
display: flex;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-icon {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 64px;
|
||||||
|
top: calc(50% - 32px);
|
||||||
|
left: calc(50% - 32px);
|
||||||
|
color: rgba(255, 255, 255, 0.75);
|
||||||
|
text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-icon::before {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.html {
|
||||||
|
flex-basis: 90%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hider {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
background: rgba(230,230,230,0.6);
|
||||||
|
font-weight: bold;
|
||||||
|
z-index: 4;
|
||||||
|
line-height: 1;
|
||||||
|
border-radius: $fallback--tooltipRadius;
|
||||||
|
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
video {
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
audio {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.media-upload {
|
||||||
|
line-height: 0;
|
||||||
|
max-height: 200px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oembed {
|
||||||
|
line-height: 1.2em;
|
||||||
|
flex: 1 0 100%;
|
||||||
|
width: 100%;
|
||||||
|
margin-right: 15px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
flex: 1;
|
||||||
|
img {
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 5px;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
flex: 2;
|
||||||
|
margin: 8px;
|
||||||
|
word-break: break-all;
|
||||||
|
h1 {
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-attachment {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nsfw {
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
image-orientation: from-image; // NOTE: only FF supports this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|