mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Customise abandon edit dialog copy"
This commit is contained in:
commit
e89f58eddf
|
@ -93,6 +93,9 @@
|
|||
"dt.ui.ReplyWidget.less"
|
||||
],
|
||||
"messages": [
|
||||
"discussiontools-replywidget-abandon",
|
||||
"discussiontools-replywidget-abandon-discard",
|
||||
"discussiontools-replywidget-abandon-keep",
|
||||
"discussiontools-replywidget-anon-warning",
|
||||
"discussiontools-replywidget-cancel",
|
||||
"discussiontools-replywidget-feedback",
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
"discussiontools-preference-info-link": "https:\/\/mediawiki.org\/wiki\/Special:MyLanguage\/Talk_pages_project",
|
||||
"discussiontools-preference-discussion-link": "https:\/\/mediawiki.org\/wiki\/Talk:Talk_pages_project",
|
||||
"discussiontools-replylink": "reply",
|
||||
"discussiontools-replywidget-abandon": "Are you sure you want to discard the comment you are writing?",
|
||||
"discussiontools-replywidget-abandon-discard": "Discard comment",
|
||||
"discussiontools-replywidget-abandon-keep": "Continue writing",
|
||||
"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-feedback": "Share feedback about this feature",
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
"discussiontools-preference-info-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can learn about this Beta Feature. Defaults to a page on MediaWiki.org.}}",
|
||||
"discussiontools-preference-discussion-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can discuss this Beta Feature. Defaults to a page on MediaWiki.org.}}",
|
||||
"discussiontools-replylink": "Label for the reply link added after each comment. Use the same casing as section edit links.\n* {{Related|editsection}}.",
|
||||
"discussiontools-replywidget-abandon": "Message shown when abandoning a comment",
|
||||
"discussiontools-replywidget-abandon-discard": "Label for button to abandon a comment",
|
||||
"discussiontools-replywidget-abandon-keep": "Label for button to cancel abandoning a comment",
|
||||
"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-feedback": "Label for link to share feedback about the reply widget",
|
||||
|
|
|
@ -293,8 +293,7 @@ ReplyWidget.prototype.tryTeardown = function () {
|
|||
widget = this;
|
||||
|
||||
if ( !this.isEmpty() ) {
|
||||
// TODO: Override messages in dialog to be more ReplyWidget specific
|
||||
promise = OO.ui.getWindowManager().openWindow( 'abandonedit' )
|
||||
promise = OO.ui.getWindowManager().openWindow( 'abandoncomment' )
|
||||
.closed.then( function ( data ) {
|
||||
if ( !( data && data.action === 'discard' ) ) {
|
||||
return $.Deferred().reject().promise();
|
||||
|
@ -632,6 +631,24 @@ ReplyWidget.prototype.onReplyClick = function () {
|
|||
|
||||
/* Window registration */
|
||||
|
||||
OO.ui.getWindowManager().addWindows( [ new mw.widgets.AbandonEditDialog() ] );
|
||||
function AbandonCommentDialog() {
|
||||
// Parent constructor
|
||||
AbandonCommentDialog.super.apply( this, arguments );
|
||||
}
|
||||
|
||||
/* Inheritance */
|
||||
|
||||
OO.inheritClass( AbandonCommentDialog, mw.widgets.AbandonEditDialog );
|
||||
|
||||
AbandonCommentDialog.static.name = 'abandoncomment';
|
||||
AbandonCommentDialog.static.message = OO.ui.deferMsg( 'discussiontools-replywidget-abandon' );
|
||||
AbandonCommentDialog.static.actions = OO.copy( AbandonCommentDialog.static.actions );
|
||||
AbandonCommentDialog.static.actions[ 0 ].label =
|
||||
OO.ui.deferMsg( 'discussiontools-replywidget-abandon-discard' );
|
||||
|
||||
AbandonCommentDialog.static.actions[ 1 ].label =
|
||||
OO.ui.deferMsg( 'discussiontools-replywidget-abandon-keep' );
|
||||
|
||||
OO.ui.getWindowManager().addWindows( [ new AbandonCommentDialog() ] );
|
||||
|
||||
module.exports = ReplyWidget;
|
||||
|
|
Loading…
Reference in a new issue