Merge branch 'master' into viewing-options-sort-option-classnames

This commit is contained in:
Wyatt Johnson
2018-03-09 16:49:56 -07:00
committed by GitHub
156 changed files with 3446 additions and 1213 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/`
+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.
+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).
@@ -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.
@@ -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.
@@ -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.
+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/).
+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.
+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.
+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.
@@ -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.
@@ -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.
@@ -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!
+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.
+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.
+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.
+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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
+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.
+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.
+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.
@@ -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)
@@ -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.