From 349751f1435786f20affc1770f5e8936cd75e5c6 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 4f768adb..eb352d44 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 4dfd96ce8cfe7fdda101475aac06eb537187e9d9 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 eb352d44..3aec60f2 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 7be3cff7142f18b00298e730e49901572fc48f95 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 3aec60f2..65870730 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 9140faded03bedfac051a1d65f349b4d13a25bfe 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 e9be459d..65870730 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 61a5bcaf04c689b666b814294b22d2c1cebcf76f 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 6a0ffdb3..7803ee4e 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 d6d060f7ab07ebe40cece4edfe7ff61880a1a157 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 65870730..1a2a6ef0 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 7bbb071b0b4679ede269fca26d9c16873159098a 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 f4eb1181..e4543d66 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 2998957617cd49dbd6bd5969d44a7e11bc51c739 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 b1d4f138..f26ae0ec 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 867cfd81..b1da9882 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 33c63c89..c8d888be 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 9d02dd86..221c9211 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 5c3ff6d2..ba5cc6ad 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 ac60ba74..64687a3d 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 9f16edb5..6bf4164f 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 dd651092..e03f1ff7 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 849822af..18ba98c9 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 677007ca..ebc7d7b7 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 931ced2d..f57d8913 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 c8627845..13b4d2ea 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 18b5d341..604c2617 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 26475a38..25cfadef 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 09129d67..1475de6b 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 bd954d20..cd3961b5 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 3b12f927524462c49251260f01891e5f3776acec 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 122783d4..09f13097 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -1,29 +1,28 @@ + + + + + - - - - - + + + - - - + + + + + - - - - - - - - - - - -
- $bundles - + + + + + +
+ $bundles + From a7ac1d3bad577323edf3686a3813f142813e6333 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 046fc88d..a42d096e 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 && (