Commit graph

2117 commits

Author SHA1 Message Date
SleeplessOne1917 d5cfc7337a Autoexpand 2024-04-18 19:49:09 -04:00
SleeplessOne1917 3cbe7e1efc Prevent images from downloading without consent 2024-04-18 19:28:54 -04:00
SleeplessOne1917 ce723776a5 Make blur work correctly 2024-04-18 09:25:42 -04:00
Matthias Camenzind 1b4903d732 Blur SSR by default when content warning is set 2024-04-18 13:18:39 +02:00
Matthias Camenzind 8e5599e3a9 Revert "Remove delay between page loading and being blurred"
This reverts commit 51972060a7.
2024-04-18 13:18:36 +02:00
SleeplessOne1917 bbce9096f6 Merge branch 'main' into content-warning 2024-04-17 12:21:20 -04:00
TechVest c1fbba2768
chore: fix some comments (#2427)
Signed-off-by: TechVest <techdashen@qq.com>
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-17 09:19:21 -04:00
Dessalines 9dcaff4301
Adding image upload views for admins and profiles. (#2424)
* Adding image upload views for admins and profiles.

* Upgraded lemmy-js-client dep.

* Removing this.

* Upgrade to pnpm v9.0.1

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-17 08:37:58 -04:00
SleeplessOne1917 f97f3960fa
Merge branch 'main' into content-warning 2024-04-16 17:57:19 +00:00
SleeplessOne1917 51972060a7 Remove delay between page loading and being blurred 2024-04-16 13:56:01 -04:00
Dessalines accf1b2d72
Use muted display names, and always show instance for non-local. #1975 #2064 (#2425)
* Use muted display names. #1975 #2064

* Removing pointless undefined equality.
2024-04-16 13:56:47 +00:00
SleeplessOne1917 160048ced2 Add translations 2024-04-16 09:44:25 -04:00
SleeplessOne1917 1e76395d29 Blur background of modal to hide spicy things 2024-04-16 09:27:53 -04:00
SleeplessOne1917 afae55c2eb Handle enable_nsfw correctly 2024-04-15 07:20:22 -04:00
SleeplessOne1917 9869b00fe0 Center modal title 2024-04-14 10:36:54 -04:00
SleeplessOne1917 42bc4ab7d3 Add go-back redirect countdown 2024-04-14 10:18:00 -04:00
SleeplessOne1917 b6d7efd8ae Fix consent modal showing up for currently logged in admin 2024-04-13 21:18:36 -04:00
SleeplessOne1917 4fc425b286 Make modal use markdown 2024-04-13 20:59:02 -04:00
SleeplessOne1917 c4306787f8 Put adult consent logic all in one place 2024-04-13 20:35:11 -04:00
SleeplessOne1917 fb38fafd16 Fix modal bug 2024-04-13 20:18:20 -04:00
SleeplessOne1917 fea5ff1297 Add setting to site settings form 2024-04-13 19:39:30 -04:00
SleeplessOne1917 0413fd6c37 Make confirmation popup more stylish 2024-04-13 18:55:56 -04:00
SleeplessOne1917 3cae1b5a23 Merge branch 'main' into content-warning 2024-04-13 14:54:24 -04:00
matc-pub fdeb9244db
Only conditionally render most of content action dropdown and workaround for tippy warning (#2422)
* Avoid destroyed tippy warning

Tippy doesn't remove its onDocumentPress listener when destroyed.
Instead the listener removes itself after calling hide for hideOnClick.

It doesn't look like there is a way to reliable work around this.

This skips the warning for the first hide call on a destroyed tippy
instance.

Cleanup is only performed after at least ten tippy instances have been
created.

* Hide tooltips for elements that are no longer connected to the document

* Only render action modals after first show

* Only render action dropdown after first show

* Modals fix for quick unmount

Modals use `await import("bootstrap/js/dist/modal")` when being mounted.
This means its possible that the component unmounts before the promise
resolves.

* bind() dropdown toggle click handler

* Modal mixin
2024-04-13 11:15:29 -04:00
SleeplessOne1917 e98d1c9dac Merge branch 'content-warning' of https://github.com/LemmyNet/lemmy-ui into content-warning 2024-04-12 20:47:00 -04:00
SleeplessOne1917 b1fc470ba0 Fix blur and adjust user settings 2024-04-12 20:46:42 -04:00
SleeplessOne1917 588bacb7b8
Merge branch 'main' into content-warning 2024-04-12 14:00:13 +00:00
SleeplessOne1917 6e33395572
Correct mistake from block urls PR (#2420) 2024-04-12 09:45:13 -04:00
SleeplessOne1917 c1722a0b6b
Add hide post UI (#2408)
* Add hide post UI

* Add toggle to home and community feeds to show hidden posts

* Add i18n (and add lockfile to prettier ignore)

* Change show hidden style

* Tippy
2024-04-12 09:43:09 -04:00
SleeplessOne1917 d51cf751b5 Fix import 2024-04-11 23:44:39 -04:00
SleeplessOne1917 fff198a012 Make confirm popup for adult consent 2024-04-11 22:50:36 -04:00
matc-pub e48590b9d6
Use mixins and decorators for scroll restoration and tippy cleanup (#2415)
* Enable @babel/plugin-proposal-decorators

Dependency already exists

* Use tippy.js delegate addon, cleanup tippy instances from a mixin.

The delegate addon creates tippy instances from mouse and touch events
with a matching `event.target`. This is initially significantly cheaper
than creating all instances at once. The addon keeps all created tippy
instances alive until it is destroyed itself.

`tippyMixin` destroys the addon instance after every render, as long as
all instances are hidden. This drops some tippy instances that may have
to be recreated later (e.g when the mouse moves over the trigger again),
but is otherwise fairly cheap (creates one tippy instance).

* Restore scroll positions when resource loading settles.

The history module generates a random string (`location.key`) for every
browser history entry. The names for saved positions include this key.
The position is saved before a route component unmounts or before the
`location.key` changes.

The `scrollMixin` tires to restore the scroll position after every
change of `location.key`. It only does so after the first render for
which the route components `loadingSettled()` returns true.

Things like `scrollToComments` should only scroll when `history.action`
is not "POP".

* Drop individual scrollTo calls

* Scroll to comments without reloading post

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-11 13:18:07 -04:00
snan b983071e79
Fix parent comment linking when not showing context (#2417)
The same code is reused for the "show context" button as for the "link
to self" button. I'm not sure that's such a good idea in the long run.

There was a const `parentCommentId` that was always set even when not
having the `showContext` prop, causing the bug #2401.
2024-04-11 08:58:23 -04:00
SleeplessOne1917 ddd4a98fd7
Block urls (#2409)
* Add markup

* Make textarea reactive

* Fix bug mixing up urls and instances

* Tweak url enforcement logic

* Extract url list textarea to component

* Add translations

* Add pnpm lock to prettier ignore
2024-04-11 08:56:56 -04:00
matc-pub 0dbfe050cf
Fix deselecting community/creator filter for search form (#2416) 2024-04-11 10:43:34 +00:00
Dessalines be10d62257 0.19.4-beta.3 2024-04-10 11:02:20 -04:00
Richard bbe9c610be
fix: add a default margin bottom to ul and ol in a comment field (#2414)
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-10 08:46:49 -04:00
Alexander Harding 7c891a42b5
Fix incorrectly escaped user export JSON (#2412)
Resolves https://github.com/LemmyNet/lemmy/issues/4600
2024-04-10 08:15:43 -04:00
Dessalines 0894c77b6c
Adding generate translations to pnpm dev task. (#2410) 2024-04-09 14:03:09 +00:00
Dessalines 9aa1e06ae3
Adding alt_text and custom_thumbnail to post form. (#2404)
* Adding alt_text and custom_thumbnail to post form.

* Adding htmlFor, and only show alt_text if its an image post.

* Only show custom thumbnail url field when its not an image post.
2024-04-04 19:59:13 -04:00
Dessalines 3769a76618
Fix tag failure notifs. (#2403) 2024-04-04 08:28:40 -04:00
Dessalines 1a1cb8fce2 0.19.4-beta.2 2024-04-03 18:40:20 -04:00
Dessalines 4e548d7238 0.19.4-beta.1 2024-04-03 16:50:27 -04:00
Dessalines 18a00168e0 Updating translations. 2024-04-03 16:49:17 -04:00
SleeplessOne1917 23fb711efa
Add matrix account link to create private message form (#2399) 2024-03-28 11:12:06 -04:00
Rodrigo 72553e429b
Adds a loading skeleton to posts, comments and trending communities (#2311)
* creates the initial loading skeleton for the home page

* initial setup for the trending communities loading skeleton

* adds posts loading skeleton to the community page

* finishes the creation of all loading skeletons for large devices

* finishes loading skeleton for smaller screens

* removes unecessary code for the loading skeleton

* [loading skeleton] removes unecessary mock code

* [loading skeleton] removes custom css classes and adds more bootstrap css classes on the skeleton loading

* replaces custom styles with bootstrap classes

* rendes only one component for desktop and mobile screens

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>

* fixes lint's indentation problems

* transforms span tags into self-closing tags

* removes every inline style from the loading-skeleton.tsx file

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-27 16:25:49 -04:00
Dessalines 4dbf8fd2f1
Fixing woodpecker. (#2402)
Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-03-27 13:04:59 -04:00
SleeplessOne1917 ad07fc4fed
Show user email in registration application (#2400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-03-27 10:17:44 -04:00
matc-pub 70e382b3d9
Rework query parsing (#2396)
* Pass parsed query params as props to components

* Pass parsed query params to fetchInitialData

* Pass router Match to fetchInitialData

* Cast individual routes to their concrete types

Adds an IRoutePropsWithFetch definition for routes with getQueryParams
or fetchInitialData to cause compiler errors when the types no longer
match.

* Don't double decode query parameters.

Problem: A search for "%ab" produces a url with "%25ab". Refreshing
the page results in URLSearchParams turning "%25ab" back into "%ab".
decodeURIComponent() then complains about "%ab" being malformed.

This removes decodeURIComponent() calls for query parameters and
composes all query strings with getQueryString(), which now uses
URLSearchParams. Query parsing already goes through getQueryParams()
which also uses URLSearchParams.

* Fix for PictrsImage when src also has query params

* Small getQueryParams cleanup
2024-03-27 09:25:59 -04:00
SleeplessOne1917 579aea40d0
Notify users that they are banned from a community (#2397)
* Add banned blurb to community sidebar

* Hide interactable parts of posts and comments when banned from community

* Add translation

* Fix some typescript errors

* Fix typescript errors

* PR feedback
2024-03-26 19:03:02 -04:00