Merge "Reply-to placeholder"

This commit is contained in:
jenkins-bot 2020-03-03 22:59:44 +00:00 committed by Gerrit Code Review
commit f1fc955dc3
4 changed files with 9 additions and 3 deletions

View file

@ -103,6 +103,7 @@
"messages": [
"discussiontools-replywidget-anon-warning",
"discussiontools-replywidget-cancel",
"discussiontools-replywidget-placeholder-reply",
"discussiontools-replywidget-preview",
"discussiontools-replywidget-reply",
"discussiontools-replywidget-terms-click"

View file

@ -13,6 +13,7 @@
"discussiontools-replywidget-anon-warning": "<strong>You are not logged in.</strong> To receive attribution with your name instead of your IP address, you can [$1 log in] or [$2 create an account].",
"discussiontools-replywidget-cancel": "Cancel",
"discussiontools-replywidget-loading": "Loading…",
"discussiontools-replywidget-placeholder-reply": "Reply to {{BIDI:$1}}",
"discussiontools-replywidget-preview": "Preview",
"discussiontools-replywidget-reply": "Reply",
"discussiontools-replywidget-terms-click": "By clicking \"$1\", you agree to the terms of use for this wiki.",
@ -29,5 +30,4 @@
"tag-discussiontools-source-description": "DiscussionTools was in source mode",
"tag-discussiontools-visual": "Visual",
"tag-discussiontools-visual-description": "DiscussionTools was in VisualEditor mode"
}

View file

@ -18,6 +18,7 @@
"discussiontools-replywidget-anon-warning": "Warning message to be displayed when anonymous user starts writing a new topic or reply.\n* $1 is a URL to log in.\n* $2 is a URL to register an account.",
"discussiontools-replywidget-cancel": "Label for the cancel button in the reply widget",
"discussiontools-replywidget-loading": "Message shown while the reply widget is loading",
"discussiontools-replywidget-placeholder-reply": "Placeholder describing who is being replied to",
"discussiontools-replywidget-preview": "Label for the preview area of the reply widget",
"discussiontools-replywidget-reply": "Label for the button to submit a reply in the reply widget",
"discussiontools-replywidget-terms-click": "Terms of use for posting a reply.\n\n* $1 is the label of the button to be clicked, e.g. {{msg-mw|discussiontools-replywidget-reply}}.",

View file

@ -13,7 +13,7 @@ var controller = require( 'ext.discussionTools.controller' ),
* @param {Object} [config.input] Configuration options for the comment input widget
*/
function ReplyWidget( comment, config ) {
var returnTo, contextNode;
var returnTo, contextNode, inputConfig;
config = config || {};
@ -24,7 +24,11 @@ function ReplyWidget( comment, config ) {
contextNode = modifier.closest( this.comment.range.endContainer, 'dl, ul, ol' );
this.context = contextNode ? contextNode.nodeName.toLowerCase() : 'dl';
this.replyBodyWidget = this.createReplyBodyWidget( config.input );
inputConfig = $.extend(
{ placeholder: mw.msg( 'discussiontools-replywidget-placeholder-reply', comment.author ) },
config.input
);
this.replyBodyWidget = this.createReplyBodyWidget( inputConfig );
this.replyButton = new OO.ui.ButtonWidget( {
flags: [ 'primary', 'progressive' ],
label: mw.msg( 'discussiontools-replywidget-reply' )