Jump to content

User:JayanthVikash/GSoC/InlineComments-Draft

From mediawiki.org
MediaWiki extensions manual
InlineComments
Release status: stable
Implementation ContentHandler
Description Allows adding inline comments to pages
Author(s)
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.
License No license specified
Download
README
Translate the JayanthVikash/GSoC/InlineComments-Draft extension if it is available at translatewiki.net

The InlineComments extension adds the ability for viewers to add inline comments to a page, in a manner similar to the annotations within software such as Google Docs.

Usage

[edit]

To attach a comment to specific text, first highlight the text you want to attach the comment to. A "+" icon will then appear. If you click on it, or use the keyboard shortcut Ctrl+Alt+m, a comment entry form will appear on the side. Fill out the text area and hit "Save" to record your comment.

Once a comment is made, anyone can reply to it by hitting the "Reply" button and adding more text. A thread within InlineComments can grow to any length.

Comments can be edited by the author or the administrator by hitting the pencil icon on the right side of the comment.

You can also delete a thread (which can include one or more comments) by hitting the "Close discussion" button. This will delete all of that text from the InlineComments "slot" of the page. Since this deletion shows up in the page history, you can undo it any time, and restore the thread, simply by undoing that edit.

Users can be mentioned in the comments by using the "@" annotator.

If Echo extension is installed,

  - Mentioning a user in an inline comment will trigger an echo notification to that user.

  - The comment thread creator will also get notified on any replies or the closure of the thread.

All inline comments are assigned with #inlinecomments tag so that the changes can be easily filtered by tag in Special:RecentChanges and Watchlist

See also the screenshots below.

Download

[edit]

You can download the InlineComments code, in .zip format, here.

You can also download the code directly via Git from the MediaWiki source code repository. From a command line, call the following:

git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InlineComments.git

To view the code online, including version history for each file, go here: view InlineComments code

Installation

[edit]
  • Download and move the extracted JayanthVikash folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/JayanthVikash
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'JayanthVikash' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]

The following settings can be added to LocalSettings.php:

$wgInlineCommentsAutoDeleteComments
Whether or not to automatically remove comments if the text they are commenting on gets deleted (default true)
$wgInlineCommentsNamespaces
The only namespaces for which InlineComments should be enabled. By default, it is set to $wgContentNamespaces. If set explicitly to an array of some namespaces, $wgContentNamespaces will not be included until the user adds it in LocalSettings.php

InlineComments defines the following user rights:

inlinecomments-add
Whether you can add and delete comments on a page. By default this is given to all logged in users.
inlinecomments-view
Whether inline comments are shown to you. Please note, this controls the default interface but users may still be able to view existing comments by other means if the have 'read' rights on the wiki, such as through the history page or API.
inlinecomments-edit-all
Whether you can edit the inline comments on a page. By default this is given to all sysop users.

Screenshots

[edit]

Video demo

[edit]

Please use "source" resolution in the player for the best quality

Version history

[edit]
  • 0.1 - April 29, 2023 - Initial version
  • 0.2 - February 27, 2024 - Look-and-feel improvements, many bug fixes
  • 0.3 - April 11, 2024 - Renamed $wgInlineCommentsAutoResolveComments setting to $wgInlineCommentsAutoDeleteComments; renamed "Mark resolved" to "Close discussion"; added "inlinecomments-view" permission; added timestamp display on comment creation
  • 1.0 - August 21, 2024 - Added user mentions along with autocompletion; added edit functionality to comments; added $wgInlineCommentsNamespaces setting; overriden JSON diff with custom diff for comment edits; made the sidebar skin-neutral; added #inlinecomments tag for all comment edits; fixed permission issues for view and edit rights of logged out users, blocked users and hidden users; added notification for the comment initiator on reply and close action through Echo notification; added notification for the mentioned user through Echo notification

See also

[edit]