From 85264c484c223e51de717d790e34ec356c2d19b6 Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri, 24 Jan 2020 16:47:33 -0800 Subject: [PATCH 01/42] Fix a typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f768adb2..eb352d44d 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - Emojis with autocomplete support. Start typing `:` - User tagging using `@`, Community tagging using `#`. - Integrated image uploading in both posts and comments. - - A post can consist of a title and any comination of self text, a URL, or nothing else. + - A post can consist of a title and any combination of self text, a URL, or nothing else. - Notifications, on comment replies and when you're tagged. - Optionally, notifications can be sent via email. - i18n / internationalization support. From 9c71f6b9df6bdf4f05f5f5591cf39dda827e3279 Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri, 24 Jan 2020 17:35:41 -0800 Subject: [PATCH 02/42] Add a list of repository mirrors to the README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index eb352d44d..3aec60f2e 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - [Releases / Changelog](/RELEASES.md) - [Contributing](https://dev.lemmy.ml/docs/contributing.html) +## Official Repository Mirrors + +- GitHub: https://github.com/dessalines/lemmy +- yerbamate.dev: https://yerbamate.dev/dessalines/lemmy +- GitLab: https://gitlab.com/dessalines/lemmy + ## Features - Open source, [AGPL License](/LICENSE). From 3e517a59b6cb35ece4f5a95a8249134c63770050 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 20:41:48 -0500 Subject: [PATCH 03/42] Some minor additions. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3aec60f2e..65870730e 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,10 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - [Releases / Changelog](/RELEASES.md) - [Contributing](https://dev.lemmy.ml/docs/contributing.html) -## Official Repository Mirrors +## Repository Mirrors - GitHub: https://github.com/dessalines/lemmy -- yerbamate.dev: https://yerbamate.dev/dessalines/lemmy +- Yerbamate.dev: https://yerbamate.dev/dessalines/lemmy - GitLab: https://gitlab.com/dessalines/lemmy ## Features @@ -61,9 +61,9 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - Open source, [AGPL License](/LICENSE). - Self hostable, easy to deploy. - Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes). -- Only a minimum of a username and password is required to sign up! -- User avatar support. - Clean, mobile-friendly interface. + - Only a minimum of a username and password is required to sign up! + - User avatar support. - Live-updating Comment threads. - Full vote scores `(+/-)` like old reddit. - Themes, including light, dark, and solarized. @@ -72,14 +72,14 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - Integrated image uploading in both posts and comments. - A post can consist of a title and any combination of self text, a URL, or nothing else. - Notifications, on comment replies and when you're tagged. - - Optionally, notifications can be sent via email. + - Notifications can be sent via email. - i18n / internationalization support. - RSS / Atom feeds for `All`, `Subscribed`, `Inbox`, `User`, and `Community`. - Cross-posting support. - A *similar post search* when creating new posts. Great for question / answer communities. - Moderation abilities. - Public Moderation Logs. - - Can sticky posts to the top of the timeline. + - Can sticky posts to the top of communities. - Both site admins, and community moderators, who can appoint other moderators. - Can lock, remove, and restore posts and comments. - Can ban and unban users from communities and the site. From 7a0b6566344ba9b207089cc5ea898dc114e5daeb Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 20:43:57 -0500 Subject: [PATCH 04/42] Squashed commit of the following: commit 7be3cff7142f18b00298e730e49901572fc48f95 Author: Dessalines Date: Fri Jan 24 20:41:48 2020 -0500 Some minor additions. commit 4dfd96ce8cfe7fdda101475aac06eb537187e9d9 Author: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri Jan 24 17:35:41 2020 -0800 Add a list of repository mirrors to the README.md commit 349751f1435786f20affc1770f5e8936cd75e5c6 Author: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri Jan 24 16:47:33 2020 -0800 Fix a typo in README.md commit bfc45aa9bc8b106f4df652b18f0cc7588e604182 Merge: 197bd67 9024809 Author: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri Jan 24 15:55:15 2020 -0800 Merge pull request #1 from StaticallyTypedRice/StaticallyTypedRice-documentation Add more implemented features to README.md commit 9024809a5c19b6d0143cd37d8d794de11a7bddf9 Author: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri Jan 24 15:52:27 2020 -0800 Add more implemented features to README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index e9be459db..65870730e 100644 --- a/README.md +++ b/README.md @@ -50,24 +50,36 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern - [Releases / Changelog](/RELEASES.md) - [Contributing](https://dev.lemmy.ml/docs/contributing.html) +## Repository Mirrors + +- GitHub: https://github.com/dessalines/lemmy +- Yerbamate.dev: https://yerbamate.dev/dessalines/lemmy +- GitLab: https://gitlab.com/dessalines/lemmy + ## Features - Open source, [AGPL License](/LICENSE). - Self hostable, easy to deploy. - Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes). - Clean, mobile-friendly interface. + - Only a minimum of a username and password is required to sign up! + - User avatar support. - Live-updating Comment threads. - Full vote scores `(+/-)` like old reddit. - Themes, including light, dark, and solarized. - Emojis with autocomplete support. Start typing `:` - User tagging using `@`, Community tagging using `#`. + - Integrated image uploading in both posts and comments. + - A post can consist of a title and any combination of self text, a URL, or nothing else. - Notifications, on comment replies and when you're tagged. + - Notifications can be sent via email. - i18n / internationalization support. - RSS / Atom feeds for `All`, `Subscribed`, `Inbox`, `User`, and `Community`. - Cross-posting support. - A *similar post search* when creating new posts. Great for question / answer communities. - Moderation abilities. - Public Moderation Logs. + - Can sticky posts to the top of communities. - Both site admins, and community moderators, who can appoint other moderators. - Can lock, remove, and restore posts and comments. - Can ban and unban users from communities and the site. From d26f4c50d300e108882c23c954155bd03abe3d88 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 20:55:57 -0500 Subject: [PATCH 05/42] Moving notification to bottom left. Fixes #457 --- ui/src/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 6a0ffdb3e..7803ee4ed 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -382,6 +382,8 @@ export function toast(text: string, background: string = 'success') { Toastify({ text: text, backgroundColor: backgroundColor, + gravity: 'bottom', + position: 'left', }).showToast(); } From ec042d1d616735bc9117b9d47f9cf3c020111d8a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 21:19:37 -0500 Subject: [PATCH 06/42] Fixing repo mirrors section. --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 65870730e..1a2a6ef0f 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,8 @@
-[![Github](https://img.shields.io/badge/-Github-blue)](https://github.com/dessalines/lemmy) -[![Gitlab](https://img.shields.io/badge/-Gitlab-yellowgreen)](https://gitlab.com/dessalines/lemmy) -[![Mastodon Follow](https://img.shields.io/mastodon/follow/810572?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@LemmyDev) ![GitHub stars](https://img.shields.io/github/stars/dessalines/lemmy?style=social) +[![Mastodon Follow](https://img.shields.io/mastodon/follow/810572?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@LemmyDev) [![Matrix](https://img.shields.io/matrix/rust-reddit-fediverse:matrix.org.svg?label=matrix-chat)](https://riot.im/app/#/room/#rust-reddit-fediverse:matrix.org) ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/dessalines/lemmy.svg) [![Build Status](https://travis-ci.org/dessalines/lemmy.svg?branch=master)](https://travis-ci.org/dessalines/lemmy) @@ -52,9 +50,9 @@ Made with [Rust](https://www.rust-lang.org), [Actix](https://actix.rs/), [Infern ## Repository Mirrors -- GitHub: https://github.com/dessalines/lemmy -- Yerbamate.dev: https://yerbamate.dev/dessalines/lemmy -- GitLab: https://gitlab.com/dessalines/lemmy +- [GitHub](https://github.com/dessalines/lemmy) +- [Gitea](https://yerbamate.dev/dessalines/lemmy) +- [GitLab](https://gitlab.com/dessalines/lemmy) ## Features From 7e6842e63a84d8fa97135ec1d94342e5b10e5dc5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2020 21:53:37 -0500 Subject: [PATCH 07/42] Comment image uploads resize textarea. Fixes #460 --- ui/src/components/comment-form.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index f4eb11815..e4543d665 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -225,13 +225,15 @@ export class CommentForm extends Component { .then(res => res.json()) .then(res => { let url = `${window.location.origin}/pictshare/${res.url}`; - let markdown = + let imageMarkdown = res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`; let content = i.state.commentForm.content; - content = content ? `${content} ${markdown}` : markdown; + content = content ? `${content}\n${imageMarkdown}` : imageMarkdown; i.state.commentForm.content = content; i.state.imageLoading = false; i.setState(i.state); + var textarea: any = document.getElementById(i.id); + autosize.update(textarea); }) .catch(error => { i.state.imageLoading = false; From aa5a911edc9d78cb0c462bbd525287e0f3a122ec Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 25 Jan 2020 09:58:53 -0500 Subject: [PATCH 08/42] Fixing front end error messages. Fixes #462 --- server/src/websocket/server.rs | 1 + ui/src/components/communities.tsx | 2 +- ui/src/components/community-form.tsx | 2 +- ui/src/components/community.tsx | 2 +- ui/src/components/inbox.tsx | 2 +- ui/src/components/login.tsx | 2 +- ui/src/components/main.tsx | 2 +- ui/src/components/modlog.tsx | 2 +- ui/src/components/navbar.tsx | 4 ++-- ui/src/components/post-form.tsx | 2 +- ui/src/components/post.tsx | 2 +- ui/src/components/private-message-form.tsx | 2 +- ui/src/components/search.tsx | 2 +- ui/src/components/setup.tsx | 2 +- ui/src/components/user.tsx | 4 ++-- ui/src/interfaces.ts | 5 ++--- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/src/websocket/server.rs b/server/src/websocket/server.rs index b1d4f1387..f26ae0ec3 100644 --- a/server/src/websocket/server.rs +++ b/server/src/websocket/server.rs @@ -291,6 +291,7 @@ impl Handler for ChatServer { Err(e) => e.to_string(), }; + println!("Message Sent: {}", msg_out); MessageResult(msg_out) } } diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index 867cfd818..b1da98827 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -235,7 +235,7 @@ export class Communities extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.ListCommunities) { diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index 33c63c897..c8d888be4 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -261,7 +261,7 @@ export class CommunityForm extends Component< parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); console.log(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state.loading = false; this.setState(this.state); diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index 9d02dd866..221c9211e 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -258,7 +258,7 @@ export class Community extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.context.router.history.push('/'); return; diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx index 5c3ff6d2b..ba5cc6ad5 100644 --- a/ui/src/components/inbox.tsx +++ b/ui/src/components/inbox.tsx @@ -324,7 +324,7 @@ export class Inbox extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.GetReplies) { diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index ac60ba74b..64687a3d8 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -295,7 +295,7 @@ export class Login extends Component { parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state = this.emptyState; this.setState(this.state); diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 9f16edb5d..6bf4164ff 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -566,7 +566,7 @@ export class Main extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.GetFollowedCommunities) { diff --git a/ui/src/components/modlog.tsx b/ui/src/components/modlog.tsx index dd6510928..e03f1ff75 100644 --- a/ui/src/components/modlog.tsx +++ b/ui/src/components/modlog.tsx @@ -425,7 +425,7 @@ export class Modlog extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.GetModlog) { diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index 849822af1..18ba98c92 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -202,8 +202,8 @@ export class Navbar extends Component { parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); - if (res.error) { - if (res.error == 'not_logged_in') { + if (msg.error) { + if (msg.error == 'not_logged_in') { UserService.Instance.logout(); location.reload(); } diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 677007caf..ebc7d7b76 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -475,7 +475,7 @@ export class PostForm extends Component { parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state.loading = false; this.setState(this.state); diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index 931ced2d1..f57d89137 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -345,7 +345,7 @@ export class Post extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.GetPost) { diff --git a/ui/src/components/private-message-form.tsx b/ui/src/components/private-message-form.tsx index c8627845d..13b4d2eab 100644 --- a/ui/src/components/private-message-form.tsx +++ b/ui/src/components/private-message-form.tsx @@ -283,7 +283,7 @@ export class PrivateMessageForm extends Component< parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state.loading = false; this.setState(this.state); diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx index 18b5d3419..604c26173 100644 --- a/ui/src/components/search.tsx +++ b/ui/src/components/search.tsx @@ -479,7 +479,7 @@ export class Search extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); return; } else if (res.op == UserOperation.Search) { diff --git a/ui/src/components/setup.tsx b/ui/src/components/setup.tsx index 26475a387..25cfadef1 100644 --- a/ui/src/components/setup.tsx +++ b/ui/src/components/setup.tsx @@ -188,7 +188,7 @@ export class Setup extends Component { parseMessage(msg: WebSocketJsonResponse) { let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state.userLoading = false; this.setState(this.state); diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index 09129d67c..1475de6b2 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -1016,12 +1016,12 @@ export class User extends Component { parseMessage(msg: WebSocketJsonResponse) { console.log(msg); let res = wsJsonToRes(msg); - if (res.error) { + if (msg.error) { toast(i18n.t(msg.error), 'danger'); this.state.deleteAccountLoading = false; this.state.avatarLoading = false; this.state.userSettingsLoading = false; - if (res.error == 'couldnt_find_that_username_or_email') { + if (msg.error == 'couldnt_find_that_username_or_email') { this.context.router.history.push('/'); } this.setState(this.state); diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index bd954d20a..cd3961b5f 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -784,11 +784,10 @@ type ResponseType = export interface WebSocketResponse { op: UserOperation; data: ResponseType; - error?: string; } export interface WebSocketJsonResponse { - op: string; - data: ResponseType; + op?: string; + data?: ResponseType; error?: string; } From 1da94464eb57cf8a22e48301c59713d2aa2da3b9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 25 Jan 2020 10:19:37 -0500 Subject: [PATCH 09/42] Adding a noscript message. Fixes #464 --- ui/src/index.html | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/ui/src/index.html b/ui/src/index.html index 122783d41..09f13097d 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -1,29 +1,28 @@ + + + + + - - - - - + + + - - - + + + + + - - - - - - - - - - - -
- $bundles - + + + + + +
+ $bundles + From f4ecb53342254c40de4695480c4ae6f102ad760a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 25 Jan 2020 13:39:22 -0500 Subject: [PATCH 10/42] Removing disabled from comment and post upvoting, showing toast now. Fixes #450 --- ui/src/components/comment-node.tsx | 18 ++++++++++-------- ui/src/components/post-listing.tsx | 11 +++++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 046fc88d3..a42d096e4 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -117,7 +117,6 @@ export class CommentNode extends Component { .viewOnly && 'no-click'}`} >
{WebSocketService.Instance.site.enable_downvotes && (