Merge branch 'master' into better-graph

This commit is contained in:
Chi Vinh Le
2018-03-14 09:59:50 +01:00
209 changed files with 4319 additions and 1321 deletions
+21
View File
@@ -0,0 +1,21 @@
---
title: talk-plugin-akismet
permalink: /plugin/talk-plugin-akismet/
layout: plugin
plugin:
name: talk-plugin-akismet
provides:
- Server
- Client
---
Enables spam detection from [Akismet](https://akismet.com/). Comments will be passed to the Akismet API for spam detection. If a comment
is determined to be spam, it will prompt the user, indicating that the comment might be considered spam. If the user continues after this
point with the still spam-like comment, the comment will be reported as containing spam, and sent for moderator approval.
**Note: [Akismet](https://akismet.com/) is a premium service, charges may apply.**
Configuration:
- `TALK_AKISMET_API_KEY` (**required**) - The Akismet API key located on your account page.
- `TALK_AKISMET_SITE` (**required**) - The URL where you are embedding the comment stream on to provide context to Akismet. If you're hosting talk on https://talk.mynews.org/, and your news site is https://mynews.org/, then you should set this parameter to `https://mynews.org/`
@@ -1,3 +1,17 @@
ar:
error:
COMMENT_IS_SPAM: |
تبدو اللغة في هذا التعليق مثل الرسائل غير المرغوب فيها. تستطيع تعديل التعليق أو تقديمه على أي حال لمراجعة مشرف.
talk-plugin-akismet:
spam: "بريد غير مرغوب فيه"
spam_comment: "بريد غير مرغوب فيه"
detected: "الكشف عنها من قبل Akismet"
still_spam: |
شكرا لكم. سيراجع فريق الإشراف لدينا تعليقك قريبا.
flags:
reasons:
comment:
spam_comment: "تم اكتشاف الرسائل غير المرغوب فيها"
da:
error:
COMMENT_IS_SPAM: |
@@ -61,7 +75,7 @@ fr:
nl_NL:
error:
COMMENT_IS_SPAM: |
Deze reactie ziet er uit als spam. Je kan je reactie
Deze reactie ziet er uit als spam. Je kan je reactie
wijzigen, of indienen zodat ons moderatieteam het kan beoordelen.
talk-plugin-akismet:
spam: "Spam"
+16
View File
@@ -0,0 +1,16 @@
---
title: talk-plugin-auth
permalink: /plugin/talk-plugin-auth/
layout: plugin
plugin:
name: talk-plugin-auth
default: true
provides:
- Client
---
This provides the base plugin that is the basis for all auth based plugins that
utilize our internal authentication system.
To sync Talk auth with your own auth systems, you can use this plugin as a
template.
@@ -1,3 +1,48 @@
ar:
talk-plugin-auth:
login:
email_verify_cta: "يرجى التحقق من عنوان البريد الإلكتروني الخاص بك."
request_new_verify_email: "طلب بريد إلكتروني آخر"
verify_email: "شكرا لك على إنشاء حساب جديد! لقد أرسلنا رسالة إلكترونية إلى البريد الإلكتروني الذي قدمته للتحقق من حسابك."
verify_email2: "يجب إثبات ملكية حسابك قبل التفاعل مع المجموعة."
not_you: "ليس انت؟"
logged_in_as: "تسجيل الدخول ك"
facebook_sign_in: "تسجيل الدخول باستخدام الفيسبوك"
facebook_sign_up: "اشترك عبر حساب فايسبوك"
logout: "خروج"
sign_in: "تسجيل الدخول"
sign_in_to_join: "سجل الدخول للانضمام إلى المحادثة"
or: "أو"
email: "البريد الإلكتروني"
password: "كلمة المرور"
forgot_your_pass: "نسيت كلمة المرور؟"
need_an_account: "تحتاج الى حساب؟"
register: "تسجيل"
sign_up: "سجل"
confirm_password: "تأكيد كلمة المرور"
username: "اسم المستخدم"
already_have_an_account: "هل لديك حساب؟"
recover_password: "إستعادة كلمة المرور"
email_in_use: "البريد الالكتروني قيد الاستخدام"
email_or_username_in_use: "البريد الإلكتروني أو اسم المستخدم قيد الاستخدام"
required_field: "هذه الخانة مطلوبه"
passwords_dont_match: "كلمات المرور غير متطابقة."
special_characters: "يمكن أن تحتوي أسماء المستخدمين على أحرف وأرقام و _ فقط"
sign_in_to_comment: "تسجيل الدخول للتعليق"
check_the_form: "استمارة غير صالحة. يرجى التحقق من الحقول"
set_username_dialog:
check_the_form: "استمارة غير صالحة. يرجى التحقق من الحقول"
continue: "تابع بنفس اسم المستخدم الخاص بفيسبوك"
error_create: "حدث خطأ أثناء تغيير اسم المستخدم"
fake_comment_body: "هذا مثال للتعليق. يمكن للقراء تبادل الأفكار والآراء مع غرف الأخبار في قسم التعليقات."
fake_comment_date: "منذ دقيقة"
if_you_dont_change_your_name: "إذا لم تقم بتغيير اسم المستخدم الخاص بك في هذه الخطوة سوف يظهر اسم المستخدم الخاص بفيسبوك جنبا إلى جنب مع كل تعليقاتك."
required_field: "حقل مطلوب"
save: حفظ
special_characters: "يمكن أن تحتوي أسماء المستخدمين على أحرف, أرقام و _ فقط"
username: اسم المستخدم
write_your_username: "عدل اسم المستخدم"
your_username: "يظهر اسم المستخدم في كل تعليق تنشره."
da:
talk-plugin-auth:
login:
+20
View File
@@ -0,0 +1,20 @@
---
title: talk-plugin-author-menu
permalink: /plugin/talk-plugin-author-menu/
layout: plugin
plugin:
name: talk-plugin-author-menu
default: true
provides:
- Client
---
Enables plugins to integrate into the embed stream at the author name location.
We have recipes for showing the commenter's "member since" date, and to show a
subscriber badge. These will require some integration on your side to connect
them to the data source that houses this information.
- [talk-plugin-member-since](/talk/plugin/talk-plugin-member-since)
- [talk-plugin-subscriber](/talk/plugin/talk-plugin-subscriber)
To get started, check out our [Talk Recipes](https://github.com/coralproject/talk-recipes).
@@ -1,3 +1,5 @@
ar:
talk-plugin-author-menu:
da:
talk-plugin-author-menu:
en:
@@ -0,0 +1,15 @@
---
title: talk-plugin-comment-content
permalink: /plugin/talk-plugin-comment-content/
layout: plugin
plugin:
name: talk-plugin-comment-content
default: true
provides:
- Client
---
Pluginizes the text of a comment to support custom treatment of this text. This
plugin currently parses the given text to see if it contains a link, and makes
them clickable using
[react-linkify](https://www.npmjs.com/package/react-linkify).
@@ -0,0 +1,15 @@
---
title: talk-plugin-deep-reply-count
permalink: /plugin/talk-plugin-deep-reply-count/
layout: plugin
plugin:
name: talk-plugin-deep-reply-count
provides:
- Server
---
The Deep Reply Count plugin will add a new graph edge, `Comment.deepReplyCount`
that will return the count of all descendant replies.
**Warning: Enabling the talk-plugin-deep-reply-count plugin introduces a significant
performance impact on larger sites, use with care.**
@@ -4,7 +4,7 @@ const DataLoader = require('dataloader');
const CommentModel = require('../../models/comment');
console.warn(
'Enabling the talk-plugin-deep-reply-count plugin introduces a signifigant performance impact on larger sites, use with care.'
'Enabling the talk-plugin-deep-reply-count plugin introduces a significant performance impact on larger sites, use with care.'
);
// genDeepCommentCount will return the deep comment count for a given parent id.
@@ -72,7 +72,7 @@ module.exports = {
typeDefs: `
type Comment {
# deepReplyCount is the count of all decendant replies.
# deepReplyCount is the count of all descendant replies.
deepReplyCount: Int
}
`,
@@ -0,0 +1,30 @@
---
title: talk-plugin-facebook-auth
permalink: /plugin/talk-plugin-facebook-auth/
layout: plugin
plugin:
name: talk-plugin-facebook-auth
depends:
- name: talk-plugin-auth
provides:
- Server
- Client
---
Enables sign-in via Facebook via the server side passport middleware.
Configuration:
- `TALK_FACEBOOK_APP_ID` (**required**) - The Facebook App ID for your Facebook
Login enabled app. You can learn more about getting a Facebook App ID at the
[Facebook Developers Portal](https://developers.facebook.com) or by visiting
the [Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
- `TALK_FACEBOOK_APP_SECRET` (**required**) - The Facebook App Secret for your
Facebook Login enabled app. You can learn more about getting a Facebook App
Secret at the [Facebook Developers Portal](https://developers.facebook.com)
or by visiting the
[Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
@@ -1,3 +1,7 @@
ar:
talk-plugin-facebook-auth:
sign_in: "تسجيل الدخول عبر حساب الفيسبوك"
sign_up: "اشترك عبر حساب الفيسبوك"
en:
talk-plugin-facebook-auth:
sign_in: "Sign in with Facebook"
@@ -21,4 +25,4 @@ zh_TW:
de:
talk-plugin-facebook-auth:
sign_in: "Mit Facebook anmelden"
sign_up: "Mit Facebook registrieren"
sign_up: "Mit Facebook registrieren"
@@ -0,0 +1,19 @@
---
title: talk-plugin-featured-comments
permalink: /plugin/talk-plugin-featured-comments/
layout: plugin
plugin:
name: talk-plugin-featured-comments
default: true
provides:
- Server
- Client
---
Enables the ability for Moderators to feature and un-feature comments via the
Stream and the Admin. Featured comments show in a first-place tab on the Stream
if there are any featured comments on that story.
When paired with the [talk-plugin-moderator-actions](/talk/plugin/talk-plugin-moderator-actions)
plugin, moderators will have the option of featuring comments from the comment
stream.
@@ -1,3 +1,18 @@
ar:
talk-plugin-featured-comments:
un_feature: إلغاء التميّز
feature: ميّز
featured: متميز
featured_comments: التعليقات المميزة
go_to_conversation: انتقل إلى المحادثة
tooltip_description: تعليقات مختارة من قبل فريقنا تستحق القراءة
notify_self_featured: 'التعليق من {0} هو الآن مميّز و موافق عليه'
notify_featured: '{0} ميّز و وافق على التعليق "{1}"'
notify_unfeatured: '{0} ألغي تميّز التعليق "{1}"'
feature_comment: ميّز التعليق؟
are_you_sure: هل أنت متأكد أنك تريد تميّز هذا التعليق؟
cancel: إلغاء
yes_feature_comment: نعم، ميّز التعليق؟
da:
talk-plugin-featured-comments:
un_feature: Un-Feature
@@ -0,0 +1,13 @@
---
title: talk-plugin-flag-details
permalink: /plugin/talk-plugin-flag-details/
layout: plugin
plugin:
name: talk-plugin-flag-details
default: true
provides:
- Client
---
Pluginizes the Flag Details area of comments in the Moderation Queues to display
data. Some basic details are already included on flags by default.
@@ -1,3 +1,6 @@
ar:
talk-plugin-flag-details:
flags: تقارير
da:
talk-plugin-flag-details:
flags: Reports
+29
View File
@@ -0,0 +1,29 @@
---
title: talk-plugin-google-auth
permalink: /plugin/talk-plugin-google-auth/
layout: plugin
plugin:
name: talk-plugin-google-auth
depends:
- name: talk-plugin-auth
provides:
- Server
- Client
---
Enables sign-in via Facebook via the server side passport middleware.
You will need to enable the Google+ API in the dashboard and create credentials
for a new OAuth client ID web application. The authorized JavaScript origin
should be set to the Talk domain, and the authorized redirect URI should be set
to http://<example.com>/api/v1/auth/google/callback. This is only required while
the `talk-plugin-google-auth` plugin is enabled.
Configuration:
- `TALK_GOOGLE_CLIENT_ID` (**required**) - The Google OAuth2 client ID for your
Google login web app. You can learn more about getting a Google Client ID at
the [Google API Console](https://console.developers.google.com/apis/).
- `TALK_GOOGLE_CLIENT_SECRET` (**required**) - The Google OAuth2 client ID for
your Google login web app. You can learn more about getting a Google Client
ID at the [Google API Console](https://console.developers.google.com/apis/).
@@ -1,3 +1,7 @@
ar:
talk-plugin-google-auth:
sign_in: "تسجيل الدخول عبر حساب جوجل"
sign_up: "اشترك عبر حساب جوجل"
en:
talk-plugin-google-auth:
sign_in: "Sign in with Google"
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-ignore-user
permalink: /plugin/talk-plugin-ignore-user/
layout: plugin
plugin:
name: talk-plugin-ignore-user
default: true
provides:
- Client
---
Enables ability for users to ignore (or "mute") other users. If a user is
ignored, you will not see any of their comments. You can un-ignore a user via
the My Profile tab.
@@ -1,3 +1,15 @@
ar:
talk-plugin-ignore-user:
section_title: المستخدمون الذين تم تجاهلهم
section_info: لأنك تجاهلت المعلقين التاليين، يتم إخفاء تعليقاتهم.
stop_ignoring: إيقاف التجاهل
ignore_user: تجاهل المستخدم
cancel: إلغاء
confirmation: |
عند تجاهل المستخدم، سيتم إخفاء جميع التعليقات التي كتبها على الموقع منك. يمكنك التراجع عن هذا لاحقا من ملفي الشخصي.
notify_success: |
أنت الآن تتجاهل {0}. يمكنك التراجع عن هذا الإجراء من ملفي الشخصي.
confirmation_title: تجاهل {0}؟
da:
talk-plugin-ignore-user:
section_title: Ignored users
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-like
permalink: /plugin/talk-plugin-like/
layout: plugin
plugin:
name: talk-plugin-like
provides:
- Server
- Client
---
Enables a `like` reaction button.
@@ -1,3 +1,7 @@
ar:
talk-plugin-like:
like: أعجبني
liked: إعجاب
da:
talk-plugin-like:
like: Like
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-love
permalink: /plugin/talk-plugin-love/
layout: plugin
plugin:
name: talk-plugin-love
provides:
- Server
- Client
---
Enables a `love` reaction button.
@@ -1,3 +1,7 @@
ar:
talk-plugin-love:
love: Love
loved: Loved
da:
talk-plugin-love:
love: Love
@@ -0,0 +1,15 @@
---
title: talk-plugin-member-since
permalink: /plugin/talk-plugin-member-since/
layout: plugin
plugin:
name: talk-plugin-member-since
default: true
depends:
- name: talk-plugin-author-menu
provides:
- Client
---
It will show the date that the member/user joined when you hover over the
username as retrieved from the `createdAt` time on the user.
@@ -1,3 +1,6 @@
ar:
talk-plugin-member-since:
member_since: "عضو منذ"
da:
talk-plugin-member-since:
member_since: "Member Since"
@@ -0,0 +1,15 @@
---
title: talk-plugin-moderator-actions
permalink: /plugin/talk-plugin-moderator-actions/
layout: plugin
plugin:
name: talk-plugin-moderator-actions
default: true
provides:
- Client
---
Enables in-stream moderation so that Moderators can reject, approve comments,
as well as ban users, directly from the comment stream. When
[talk-plugin-featured-comments](/talk/plugin/talk-plugin-featured-comments) is
enabled, it will also give the User's an option to feature from the stream.
@@ -1,3 +1,15 @@
ar:
talk-plugin-moderation-actions:
reject_comment: "رفض"
approve_comment: "موافقة"
approved_comment: "موافق عليه"
moderation_actions: "إجراءات الإشراف"
ban_user: "حجب المستخدم"
ban_user_dialog_sub: "هل أنت متأكد أنك تريد حجب هذا المستخدم؟"
ban_user_dialog_copy: "ملاحظة: سيؤدي حجب هذا المستخدم أيضا إلى وضع هذا التعليق في قائمة الرفض."
ban_user_dialog_cancel: "إلغاء"
ban_user_dialog_yes: "نعم، احجب المستخدم"
ban_user_dialog_headline: "احجب المستخدم؟"
da:
talk-plugin-moderation-actions:
reject_comment: "Reject"
@@ -0,0 +1,17 @@
---
title: talk-plugin-notifications-category-featured
permalink: /plugin/talk-plugin-notifications-category-featured/
layout: plugin
plugin:
name: talk-plugin-notifications-category-featured
depends:
- name: talk-plugin-notifications
- name: talk-plugin-featured-comments
provides:
- Server
- Client
---
When a comment is featured (via the
[talk-plugin-featured-comments](/talk/plugin/talk-plugin-featured-comments)
plugin), the user will receive a notification email.
@@ -0,0 +1,15 @@
---
title: talk-plugin-notifications-category-reply
permalink: /plugin/talk-plugin-notifications-category-reply/
layout: plugin
plugin:
name: talk-plugin-notifications-category-reply
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Replies made to each user will trigger an email to be sent with the notification
details if enabled.
@@ -0,0 +1,15 @@
---
title: talk-plugin-notifications-category-staff
permalink: /plugin/talk-plugin-notifications-category-staff/
layout: plugin
plugin:
name: talk-plugin-notifications-category-staff
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Replies made to each user by a staff member will trigger an email to be sent
with the notification details if enabled.
@@ -0,0 +1,16 @@
---
title: talk-plugin-notifications-digest-daily
permalink: /plugin/talk-plugin-notifications-digest-daily/
layout: plugin
plugin:
name: talk-plugin-notifications-digest-daily
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables a digesting option for users to digest their notifications on an `DAILY`
basis, where the notification batching occurs every day at midnight in the
`America/New_York` timezone.
@@ -0,0 +1,16 @@
---
title: talk-plugin-notifications-digest-hourly
permalink: /plugin/talk-plugin-notifications-digest-hourly/
layout: plugin
plugin:
name: talk-plugin-notifications-digest-hourly
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables a digesting option for users to digest their notifications on an `HOURLY`
basis, where the notification batching occurs every hour in the
`America/New_York` timezone.
@@ -0,0 +1,21 @@
---
title: talk-plugin-notifications
permalink: /plugin/talk-plugin-notifications/
layout: plugin
plugin:
name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables the Notification system for sending out enabled email notifications to
users when they interact with Talk. By itself, this plugin will not send
anything. You need to enable one of the `talk-plugin-notifications-category-*` plugins.
Configuration:
- `DISABLE_REQUIRE_EMAIL_VERIFICATIONS` - When `TRUE`, it will disable the verification email check before sending notifications for those emails. **Note that organizations implementing a custom authentication system _must_ disable this feature, as they don't use our integrated auth**. (Default `FALSE`).
You can enable other notification options by adding more
`talk-plugin-notification-*` plugins!
@@ -165,7 +165,6 @@ class NotificationManager {
);
const flattenedDigestCategories = this.flattenDigests(ctx, digests);
console.log(JSON.stringify(flattenedDigestCategories));
// Get all the notifications together.
const allMessages = await renderDigestMessage(
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-offtopic
permalink: /plugin/talk-plugin-offtopic/
layout: plugin
plugin:
name: talk-plugin-offtopic
default: true
provides:
- Server
- Client
---
Allows the comment authors to tag their comment as `Off-Topic` which will add a
visible badge on the frontend to other users that their comment is off-topic.
@@ -1,4 +1,8 @@
{
"ar": {
"off_topic": "خارج الموضوع",
"hide_off_topic": "إخفاء التعليقات التي خارجة عن الموضوع"
},
"da": {
"off_topic": "Off Topic",
"hide_off_topic": "Hide Off-Topic Comments"
+13
View File
@@ -0,0 +1,13 @@
---
title: talk-plugin-permalink
permalink: /plugin/talk-plugin-permalink/
layout: plugin
plugin:
name: talk-plugin-permalink
default: true
provides:
- Client
---
Enables a `Link` button that will provide a permalink to the comment that can be
shared with others.
@@ -0,0 +1,11 @@
---
title: talk-plugin-remember-sort
permalink: /plugin/talk-plugin-remember-sort/
layout: plugin
plugin:
name: talk-plugin-remember-sort
provides:
- Client
---
Enables saving a users last sort selection as they browse other articles.
+13
View File
@@ -0,0 +1,13 @@
---
title: talk-plugin-respect
permalink: /plugin/talk-plugin-respect/
layout: plugin
plugin:
name: talk-plugin-respect
default: true
provides:
- Server
- Client
---
Enables a `respect` reaction button.
@@ -1,3 +1,7 @@
ar:
talk-plugin-respect:
respect: احترم
respected: احترام
da:
talk-plugin-respect:
respect: Respect
+38 -9
View File
@@ -1,20 +1,49 @@
# Talk Plugin Rich Text - Pell
---
title: talk-plugin-rich-text-pell
permalink: /plugin/talk-plugin-rich-text-pell/
layout: plugin
plugin:
name: talk-plugin-rich-text-pell
depends:
- name: talk-plugin-rich-text
provides:
- Client
---
Enables rich text support client-side by using [Pell](https://github.com/jaredreich/pell).
## Installation
Add `talk-plugin-rich-text-pell` to the `plugins.json` in your Talk installation. Remember to add this in the `client` property since this plugin only covers the client side. To add server support, please use `talk-plugin-rich-text`. Ensure that you don't have any other plugins utilizing the `commentContent` slot, as it would result in duplicate comments.
Add `"talk-plugin-rich-text-pell"` to the `plugins.json` in your Talk
installation. Remember to add this in the `client` property since this plugin
only covers the client side. To add server support, please use
[talk-plugin-rich-text](/talk/plugin/talk-plugin-rich-text).
_Note: Ensure that you don't have any other plugins utilizing the
`commentContent` slot, as it would result in duplicate comments._
## How does this work?
This plugin contains 2 important components:
- The Editor (`./components/Editor.js`)
- The Comment Content Renderer (`./components/CommentContent.js`)
The editor component contains the rich text editor. For this particular plugin we chose [Pell](https://github.com/jaredreich/pell). Pell is the simplest and smallest WYSIWYG text editor with no dependencies that we could find.
- The Editor (`./components/Editor.js`)
- The Comment Content Renderer (`./components/CommentContent.js`)
If you check our `index.js` you will notice that we inject this editor in the `commentBox` slot. We do this to replace the core comment box with this one.
The editor component contains the rich text editor. For this particular plugin
we chose [Pell](https://github.com/jaredreich/pell). Pell is the simplest and
smallest WYSIWYG text editor with no dependencies that we could find.
Now, in order to render the new styled comments we need a comment renderer. For this task we will have to replace our core comment renderer by using the `commentContent` slot.
If you check our `index.js` you will notice that we inject this editor in the
`commentBox` slot. We do this to replace the core comment box with this one.
If you are not familiar with GraphQL `client/index.js` will look complicated, but fear not! With those functions we specify what to expect from the server schema, how to perform optimistic updates and how keep the client store updated with the latest changes.
Now, in order to render the new styled comments we need a comment renderer. For
this task we will have to replace our core comment renderer by using the
`commentContent` slot.
We encourage you to see the files and check how easy is to build plugins! If you have any feedback, please let us know.
If you are not familiar with GraphQL `client/index.js` will look complicated,
but fear not! With those functions we specify what to expect from the server
schema, how to perform optimistic updates and how keep the client store updated
with the latest changes.
We encourage you to see the files and check how easy is to build plugins! If you
have any feedback, please let us know.
@@ -7,6 +7,6 @@
"author": "The Coral Project Team <coral@mozillafoundation.org>",
"license": "Apache-2.0",
"dependencies": {
"pell": "^0.7.0"
"pell": "^1.0.1"
}
}
+30 -5
View File
@@ -1,24 +1,49 @@
# Talk Plugin Rich Text
---
title: talk-plugin-rich-text
permalink: /plugin/talk-plugin-rich-text/
layout: plugin
plugin:
name: talk-plugin-rich-text
provides:
- Client
---
Enables secure rich text support server-side.
## Installation
Add `talk-plugin-rich-text` to the `plugins.json` in your Talk installation. Remember to add this in the `server` property since this plugin only covers the server side. To add frontend support consider using `talk-plugin-rich-text-pell`.
Add `"talk-plugin-rich-text"` to the `plugins.json` in your Talk installation.
Remember to add this in the `server` property since this plugin only covers the
server side. To add frontend support consider using
[talk-plugin-rich-text-pell](/talk/plugin/talk-plugin-rich-text-pell).
## How does this work?
This plugin uses the `comment.metadata` field to store the `richTextBody`. By adding `richTextBody` to the schema we can later on resolve it as part of the comment. The original `comment.body` is never touched. Using the `metadata` field allow us to build plugins that are not invasive to the core and also test the capabilities of our plugin framework. We encourage you to see the files and check how easy is to build plugins! If you have any feedback, please let us know.
This plugin uses the `comment.metadata` field to store the `richTextBody`. By
adding `richTextBody` to the schema we can later on resolve it as part of the
comment. The original `comment.body` is never touched. Using the `metadata`
field allow us to build plugins that are not invasive to the core and also test
the capabilities of our plugin framework. We encourage you to see the files and
check how easy is to build plugins! If you have any feedback, please let us
know.
## Configuration
There is a `config.js` in the root folder. This file contains the recommended settings.
There is a `config.js` in the root folder. This file contains the recommended
settings.
### `highlightLinks`
A `boolean` to highlight links. Set it to `false` to turn it off.
### `linkify`
Settings for highlighting links. These will only apply if `higlightLinks` is set to `true`.
### `dompurify`
Rules to sanitize html input. We use [DOMPurify] (https://github.com/cure53/DOMPurify) to prevent web attacks and XSS. Here is the complete list of [settings] (https://github.com/cure53/DOMPurify)
## `jsdom`
In order to run html in the server we need [jsdom](https://github.com/jsdom/jsdom). Usually you wouldnt need to modify this settings.
@@ -0,0 +1,24 @@
---
title: talk-plugin-slack-notifications
permalink: /plugin/talk-plugin-slack-notifications/
layout: plugin
plugin:
name: talk-plugin-slack-notifications
provides:
- Server
---
Enables all new comments that are written to be posted to a Slack channel as
well. Configure an
[Incoming Webhook](https://api.slack.com/incoming-webhooks)
app and provide that url in the form of the `SLACK_WEBHOOK_URL`
detailed below.
*Warning: On high volume sites, this means every single comment will flow into
Slack, if this isn't what you want, be sure to use the provided plugin as a
recipe to further customize the behavior*.
Configuration:
- `SLACK_WEBHOOK_URL` (**required**) - The webhook url that will be
used to post new comments to.
@@ -10,7 +10,7 @@ if (process.env.NODE_ENV === 'test') {
module.exports = {
RootMutation: {
createComment: {
async post(_, _, context, info, result) {
async post(root, args, context, info, result) {
debug(`Posting notification to Slack webhook: ${SLACK_WEBHOOK_URL}`);
const { comment: { body: text, created_at: createdAt } } = result;
const username = context.user.username;
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-liked
permalink: /plugin/talk-plugin-sort-most-liked/
layout: plugin
plugin:
name: talk-plugin-sort-most-liked
depends:
- name: talk-plugin-like
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `like` reactions first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-most-liked:
label: الأكثر إعجاباً أولاً
da:
talk-plugin-sort-most-liked:
label: Most liked first
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-loved
permalink: /plugin/talk-plugin-sort-most-loved/
layout: plugin
plugin:
name: talk-plugin-sort-most-loved
depends:
- name: talk-plugin-love
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `love` reactions first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-most-loved:
label: الأكثر حبً أولاً
da:
talk-plugin-sort-most-loved:
label: Most loved first
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-replied
permalink: /plugin/talk-plugin-sort-most-replied/
layout: plugin
plugin:
name: talk-plugin-sort-most-replied
default: true
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most replies first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-most-replied:
label: الأكثر ردودً أولاً
da:
talk-plugin-sort-most-replied:
label: Most replied first
@@ -0,0 +1,16 @@
---
title: talk-plugin-sort-most-respected
permalink: /plugin/talk-plugin-sort-most-respected/
layout: plugin
plugin:
name: talk-plugin-sort-most-respected
default: true
depends:
- name: talk-plugin-respect
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `respect` reactions first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-most-respected:
label: الأكثر احتراماً أولاً
da:
talk-plugin-sort-most-respected:
label: Most respected first
+15
View File
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-newest
permalink: /plugin/talk-plugin-sort-newest/
layout: plugin
plugin:
name: talk-plugin-sort-newest
default: true
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the newest comments first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(() => t('talk-plugin-sort-newest.label'), {
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-newest:
label: الأحدث أولاً
da:
talk-plugin-sort-newest:
label: Newest first
+15
View File
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-oldest
permalink: /plugin/talk-plugin-sort-oldest/
layout: plugin
plugin:
name: talk-plugin-sort-oldest
default: true
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the oldest comments first.
@@ -1,5 +1,5 @@
import translations from './translations.yml';
import { createSortOption } from 'plugin-api/beta/client/factories';
import { createSortOption } from 'talk-plugin-viewing-options/client/api/factories';
import { t } from 'plugin-api/beta/client/services';
const SortOption = createSortOption(() => t('talk-plugin-sort-oldest.label'), {
@@ -1,3 +1,6 @@
ar:
talk-plugin-sort-oldest:
label: الأقدم أولاً
da:
talk-plugin-sort-oldest:
label: Oldest first
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-subscriber
permalink: /plugin/talk-plugin-subscriber/
layout: plugin
plugin:
name: talk-plugin-subscriber
provides:
- Server
- Client
---
Enables a `Subscriber` badge to be added to comments where the author has the
`SUBSCRIBER` tag. This must match with a custom auth integration that adds the
tag to the users that are subscribed to the service.
@@ -1,3 +1,6 @@
ar:
talk-plugin-subscriber:
subscriber: "Subscriber"
da:
talk-plugin-subscriber:
subscriber: "Subscriber"
@@ -0,0 +1,28 @@
---
title: talk-plugin-toxic-comments
permalink: /plugin/talk-plugin-toxic-comments/
layout: plugin
plugin:
name: talk-plugin-toxic-comments
provides:
- Server
- Client
---
Using the [Perspective API](http://perspectiveapi.com/), this
plugin will warn users and reject comments that exceed the predefined toxicity
threshold. For more information on what Toxic Comments are, check out the
[Toxic Comments](./toxic-comments/) documentation.
Configuration:
- `TALK_PERSPECTIVE_API_KEY` (**required**) - The API Key for Perspective. You
can register and get your own key at [http://perspectiveapi.com/](http://perspectiveapi.com/).
- `TALK_TOXICITY_THRESHOLD` - If the comments toxicity exceeds this threshold,
the comment will be rejected. (Default `0.8`)
- `TALK_PERSPECTIVE_API_ENDPOINT` - API Endpoint for hitting the
perspective API. (Default `https://commentanalyzer.googleapis.com/v1alpha1`)
- `TALK_PERSPECTIVE_TIMEOUT` - The timeout for sending a comment to
be processed before it will skip the toxicity analysis, parsed by
[ms](https://www.npmjs.com/package/ms). (Default `300ms`)
- `TALK_PERSPECTIVE_DO_NOT_STORE` - Whether the API is permitted to store comment and context from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. (Default `true`) [Perspective API - Analize Comment Request](https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md#analyzecomment-request)
@@ -1,3 +1,19 @@
ar:
error:
COMMENT_IS_TOXIC: |
هل أنت واثق؟ قد تنتهك اللغة الواردة في هذا التعليق إرشادات المجموعة. يمكنك تعديل التعليق أو إرساله لمراجعته.
talk-plugin-toxic-comments:
unlikely: "من غير المرجح"
highly_likely: "من المرجح جدا"
possibly: "ربما"
likely: "مرجح"
toxic_comment: "تعليق سام"
still_toxic: |
قد يظل هذا التعليق المعدل منتهكاً لإرشادات المجموعة. سيراجع فريق الإشراف لدينا تعليقك قريبا.
flags:
reasons:
comment:
toxic_comment: "من المرجح جدا أن يكون ساماً"
da:
error:
COMMENT_IS_TOXIC: |
@@ -0,0 +1,12 @@
---
title: talk-plugin-viewing-options
permalink: /plugin/talk-plugin-viewing-options/
layout: plugin
plugin:
name: talk-plugin-viewing-options
default: true
provides:
- Client
---
Pluginizes the sorting/viewing options for a comment stream.
@@ -0,0 +1,16 @@
.label {
display: block;
cursor: pointer;
width: 100%;
padding: 6px 16px 6px 10px;
box-sizing: border-box;
&:hover {
background-color: rgba(0, 0, 0, 0.05);
}
}
.input {
cursor: pointer;
margin-right: 6px;
}
@@ -0,0 +1,37 @@
import React from 'react';
import cn from 'classnames';
import styles from './SortOption.css';
import PropTypes from 'prop-types';
import { PLUGIN_NAME } from '../../constants';
export default class SortOption extends React.Component {
render() {
const className = cn([
styles.label,
`${PLUGIN_NAME}-sort-option`,
{ [`${PLUGIN_NAME}-sort-option-active`]: this.props.active },
]);
return (
<label className={className}>
<input
type="radio"
onChange={this.props.setSort}
checked={this.props.active}
className={styles.input}
/>
{this.props.label}
</label>
);
}
}
SortOption.propTypes = {
// A simple callback to be called when clicking on this sort option.
setSort: PropTypes.func.isRequired,
// Whether or not this sort option is active.
active: PropTypes.bool.isRequired,
// Label to show next to the input control.
label: PropTypes.string.isRequired,
};
@@ -0,0 +1,13 @@
import withSortOption from 'plugin-api/beta/client/hocs/withSortOption';
import SortOption from '../components/SortOption';
/**
* A factory creating a sort option component.
* @param {string|function} label label to display, can be a callback for lazy evaluation.
* @param {Object} sort sort parameters
* @param {string} sort.sortBy
* @param {string} sort.sortOrder
* @return {Object} Component
*/
export const createSortOption = (label, sort) =>
withSortOption({ ...sort, label })(SortOption);
@@ -1,4 +1,6 @@
const prefix = 'TALK_VIEWING_OPTIONS';
export const PLUGIN_NAME = 'talk-plugin-viewing-options';
/* Contants for redux actions */
const prefix = 'TALK_VIEWING_OPTIONS';
export const OPEN_MENU = `${prefix}_OPEN_MENU`;
export const CLOSE_MENU = `${prefix}_CLOSE_MENU`;
@@ -1,3 +1,8 @@
ar:
talk-plugin-viewing-options:
viewing_options: "خيارات العرض"
sort: فرز
filter: تصفية
da:
talk-plugin-viewing-options:
viewing_options: "Viewing Options"