Merge "Disable "Share feedback..." links by default"

This commit is contained in:
jenkins-bot 2022-11-08 22:04:08 +00:00 committed by Gerrit Code Review
commit af6f6e6149
3 changed files with 24 additions and 15 deletions

View file

@ -59,7 +59,8 @@
"config": {
"enable": "DiscussionToolsEnable",
"replyIndentation": "DiscussionToolsReplyIndentation",
"switchTime": "DiscussionToolsTimestampFormatSwitchTime"
"switchTime": "DiscussionToolsTimestampFormatSwitchTime",
"showFeedbackLinks": "DiscussionToolsShowFeedbackLinks"
}
},
"ReplyLinksController.js",
@ -546,6 +547,10 @@
"value": "invisible",
"description": "Reply indentation syntax to use: 'invisible' (use `<dl><dd>` tags to output `:` in wikitext) or 'bullet' (use `<ul><li>` tags to output `*` in wikitext)."
},
"DiscussionToolsShowFeedbackLinks": {
"value": false,
"description": "Show 'Share feedback...' links in the footer of reply tool and new topic tool."
},
"DiscussionToolsTimestampFormatSwitchTime": {
"value": "2022-07-12",
"description": "Date on which the internal timestamp format has changed (T304595), in ISO 8601 format."

View file

@ -85,5 +85,6 @@ module.exports = {
HeadingItem: require( './HeadingItem.js' ),
CommentItem: require( './CommentItem.js' ),
utils: require( './utils.js' ),
config: require( './config.json' ),
logger: require( './logger.js' )
};

View file

@ -5,7 +5,8 @@ var controller = require( 'ext.discussionTools.init' ).controller,
ModeTabOptionWidget = require( './ModeTabOptionWidget.js' ),
licenseMessages = require( './licenseMessages.json' ),
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},
enable2017Wikitext = featuresEnabled.sourcemodetoolbar;
enable2017Wikitext = featuresEnabled.sourcemodetoolbar,
dtConf = require( 'ext.discussionTools.init' ).config;
require( './AbandonCommentDialog.js' );
require( './AbandonTopicDialog.js' );
@ -189,19 +190,21 @@ function ReplyWidget( commentController, commentDetails, config ) {
)
);
}
$footerLinks.append(
$( '<li>' ).append(
$( '<a>' )
.attr( {
href: this.isNewTopic ?
mw.msg( 'discussiontools-replywidget-feedback-link-newtopic' ) :
mw.msg( 'discussiontools-replywidget-feedback-link' ),
target: '_blank',
rel: 'noopener'
} )
.text( mw.msg( 'discussiontools-replywidget-feedback' ) )
)
);
if ( dtConf.showFeedbackLinks ) {
$footerLinks.append(
$( '<li>' ).append(
$( '<a>' )
.attr( {
href: this.isNewTopic ?
mw.msg( 'discussiontools-replywidget-feedback-link-newtopic' ) :
mw.msg( 'discussiontools-replywidget-feedback-link' ),
target: '_blank',
rel: 'noopener'
} )
.text( mw.msg( 'discussiontools-replywidget-feedback' ) )
)
);
}
this.$footer.append(
$( '<p>' ).addClass( 'plainlinks' ).html(
this.isNewTopic ? licenseMessages.newtopic : licenseMessages.reply