Jump to content

Extension:PageComments

From mediawiki.org
MediaWiki extensions manual
PageComments
Release status: beta
Implementation User interface, API , Database , Hook
Description Inline page comments for selected text with threaded discussion
Author(s) Vedmaka
Latest version 0.1.0
MediaWiki 1.43.0+
PHP 8.1+
Database changes Yes
  • $wgPageCommentsEnabledNamespaces
  • $wgPageCommentsMaxCommentLength
  • $wgPageCommentsMaxAnchorLength
  • $wgPageCommentsHideResolvedHighlights
pagecomments-read, pagecomments-write, pagecomments-moderate
Licence MIT License
Download

PageComments adds Google-Docs-style inline comment threads directly on wiki page text with the following features:

  • Browse comments on a page (All users, configurable)
  • Create comments anchored to selection (Logged-in users)
  • Reply in threads
  • Edit/Delete comment (authors allowed to Edit/Delete own comments)
  • Resolve/Reopen thread state
  • Tracking of unread/new comments since the last visit

The extension is in beta. There might be issues, errors or security flaws in the extension code. Use at your own risk!

Installation

[edit]
  • Download, extract and place the file(s) in a directory called PageComments in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'PageComments' );
    
  • Add wfLoadExtension( 'PageComments' ); to LocalSettings.php
  • Run php maintenance/run.php update
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]
Variable Default Description
$wgPageCommentsEnabledNamespaces [ 0 ] Namespaces where PageComments is enabled
$wgPageCommentsMaxCommentLength 2000 Maximum number of characters allowed in comment body
$wgPageCommentsMaxAnchorLength 600 Maximum number of characters allowed in captured selected text
$wgPageCommentsHideResolvedHighlights false When true, resolved thread highlights are hidden in page text

Rights

[edit]
Right Default group Description
pagecomments-read * Read comments and replies
pagecomments-write user Create comments and replies
pagecomments-moderate sysop Allows editing and deleting all the comments. By default only comment authors allowed to edit their own comments.

Known limitations

[edit]
  • Overlapping selection ranges are rejected
  • If article text changes, some anchors can become orphaned (still displayed on the Comments panel)
  • Only tested with Vector-2022 skin