[go: up one dir, main page]

Jump to content

User:Enterprisey/reply-link

From Wikipedia, the free encyclopedia
reply-link
DescriptionAdds a link after signatures that shows a form for replying
Author(s)User:Enterprisey
Statussuperseded
UpdatedJuly 30, 2020; 4 years ago (2020-07-30)
BrowsersFirefox, Google Chrome
SkinsVector
SourceUser:Enterprisey/reply-link.js
GitHub repositoryreply-link
Bugs is/are still present

A userscript to add a "reply" link after signatures on a discussion page. When you click on the link, a form comes up that lets you type your response without having to go through the edit window first. Posts are auto-indented and auto-signed.

Warning! This script is still being tested and debugged. Bugs are still present. When you use this script, please verify that no other comments have been touched and your reply has been added properly. If there are any problems, please let me know at User talk:Enterprisey/reply-link. This script has a newsletter informing people of important updates; you can sign up at User:Enterprisey/Reply-link updates.

As of September 2021, this script is no longer developed. Its ideas live on in mw:Extension:DiscussionTools, which you can install at Preferences → Beta features under "Discussion tools". So long and thanks for all the fish!


Features

[edit]
  • Automatically places your reply below other replies to the same comment, if any
  • One-click closing of edit requests
  • Automatically pings the user who wrote the comment to which you're replying (can be turned off)
  • (Almost) always uses correct characters for indentation, even on XfDs

Installation instructions

[edit]

Hint: It's much easier if you get ScriptInstaller, then navigate to User:Enterprisey/reply-link.js and click "Install" at the top.

However, here's the manual method:

  1. Place {{subst:iusc|User:Enterprisey/reply-link.js}} on Special:MyPage/common.js or Special:MyPage/skin.js.
  2. Press "Publish Changes".
  3. When you have pressed "Publish Changes", a message will pop up saying "The document contains errors. Are you sure you want to publish?". Please ignore that message and press "OK", the script will still work anyway.
  4. Enjoy!

Usage

[edit]

When you load any discussion page, "(reply)" links should appear after every signature. When you click on one, it will open a form where you can type your reply to that comment; click the "Reply" button (or use the keyboard shortcut Ctrl-Enter) when you're done. The script will automatically sign and indent your comment.

Options

[edit]

The reply-link script has a number of options that allow you to customize the script's behavior. To set any of the preferences, follow the following pattern (on a new line in your common.js file):

window.OPTION = VALUE;

For example, if I wanted to set the option replyLinkAutoReload to false and the option replyLinkAutoIndentation to "always", I would put the following lines somewhere in my common.js:

window.replyLinkAutoReload = false;
window.replyLinkAutoIndentation = "always";
Name Values
(Default in bold)
Description
replyLinkSigPrefix Any string, "" Puts a prefix in front of your signature whenever you sign, in the style of the signature button from the editing toolbar. For example, if you want a -- in front of your signature, use "--"
replyLinkPreloadPing "always", "button", "never" When should a ping template be preloaded in the text area? "button" will add a button to insert the ping.
replyLinkPreloadPingTpl Some code with a ##, "{{u|##}}, " Which ping template to preload. For {{re}} use "{{re|##}} ", etc. The text ## will be replaced with a username.
replyLinkCustomSummary true, false Whether to display an additional text field, allowing a custom edit summary. The edit summary will replace the normal "Replying to comment by so-and-so" text.
replyLinkAutoIndentation "always", "checkbox", "never" Controls whether indentation will be prepended automatically. If this preference is set to "always" or the checkbox is checked, indentation will be prepended. Before this preference was introduced, the default behavior was "always".
replyLinkAutoReload true, false Should the page automatically reload after you click the "Reply" button? (Overrides by replyLinkInPlaceReload - if this setting is false, that setting won't matter.)
replyLinkInPlaceReload true, false Should the section automatically reload in place after you click the "Reply" button? (Overridden by replyLinkAutoReload - if that's false, this setting won't matter.)

There are also a few of other options for development and such, like replyLinkDryRun, replyLinkTestMode, and replyLinkTestInstantReply, that are only documented, for now, in the code.

History

[edit]

In October 2017, I got angry at the dreadful user interface of Wikipedia discussions, and wanted a "reply" button just like Reddit had. While procrastinating other work, I wrote some code to go through all the HTML elements in a page, find the comments, and insert a "reply" link after the signature. I then connected it to some dreadful code to find the corresponding comment in the page's wikitext and some even more dreadful code to insert the new comment on a new line in the wikitext (with the appropriate indentation), and the first version of reply-link was born. I modeled some parts of the interface (the text area and how it was arranged with the buttons) after Flow, actually - the circle of life.

I uploaded the first version to GitHub and Wikipedia in November 2017. It was, as I said, dreadful, but it was already much more convenient than editing wikitext. I kept running into various exciting issues: signatures that used strange link syntax, or user talk pages that had been wrapped in tables or other containers to add style. The regular expression to match signatures grew to a frightening size. The subsystem (and it really was a subsystem!) to locate a comment in wikitext given its HTML version went through a few iterations. At the very beginning, it used Parsoid, but I found the interface unworkable, so I went to some awful regular expression-based stuff that used timestamps. That went through a couple of revisions, then I went back to Parsoid in January 2019 in order to handle replying in a discussion transcluded from another page.

As one could imagine, I constantly found pages, discussions, comments, and signatures that the script couldn't handle. The test suite was never good because I never prioritized it, so I can't say it was ever that robust. Handling the edge cases would've required a simply ridiculous amount of time. However, it performed decently well for what it was.

That is, besides some hilarious mistakes: soon after I'd released the script, I accidentally included my signature, so for 42 hours until I fixed it, everyone signed as me. I also made everyone wait for 5 seconds for no reason (I think that's what that code did, anyway...) until 2019. Also, a highlight: I got to this feature request in 13 minutes.

In October 2019, I had a call with the WMF's Editing team about the design of reply-link and other things. They're wonderful people and cared a lot about the work. DiscussionTools (specifically, the Reply Tool) hit beta on the first set of production Wikipedias in February 2020, and it was really cool! The WMF could put a lot more resources into such a tool than I could, especially around internationalization/localization, which was always a deficient area of the script, and it's very much the sort of tool that you want people working full-time on. In September 2021, I recognized that DiscussionTools was far ahead of reply-link in terms of performance, usability, and robustness and I saw no further reason to continue developing reply-link. I deeply appreciate their hard work, and look forward to where DiscussionTools goes in the future!

See also

[edit]

{{User wikipedia/reply-link}}, a userbox indicating an editor uses reply-link