mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Update edit check decline reasons and record tags for them"
This commit is contained in:
commit
e45da5269a
|
@ -613,9 +613,9 @@
|
|||
"editcheck-dialog-addref-description",
|
||||
"editcheck-dialog-addref-reject-question",
|
||||
"editcheck-dialog-addref-reject-description",
|
||||
"editcheck-dialog-addref-reject-no-info",
|
||||
"editcheck-dialog-addref-reject-already-cited",
|
||||
"editcheck-dialog-addref-reject-not-sure",
|
||||
"editcheck-dialog-addref-reject-irrelevant",
|
||||
"editcheck-dialog-addref-reject-common-knowledge",
|
||||
"editcheck-dialog-addref-reject-uncertain",
|
||||
"editcheck-dialog-addref-reject-other",
|
||||
"editcheck-dialog-addref-success-notify",
|
||||
"editcheck-dialog-addref-title",
|
||||
|
|
|
@ -103,6 +103,10 @@ class Hooks implements
|
|||
'editcheck-references-activated',
|
||||
'editcheck-newcontent',
|
||||
'editcheck-newreference',
|
||||
'editcheck-reference-decline-common-knowledge',
|
||||
'editcheck-reference-decline-irrelevant',
|
||||
'editcheck-reference-decline-uncertain',
|
||||
'editcheck-reference-decline-other',
|
||||
// No longer in active use:
|
||||
'visualeditor-needcheck',
|
||||
'visualeditor-switched'
|
||||
|
|
|
@ -59,16 +59,16 @@ ve.ui.EditCheckInspector.prototype.initialize = function () {
|
|||
this.answerRadioSelect = new OO.ui.RadioSelectWidget( {
|
||||
items: [
|
||||
new OO.ui.RadioOptionWidget( {
|
||||
data: 'no-info',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-no-info' )
|
||||
data: 'uncertain',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-uncertain' )
|
||||
} ),
|
||||
new OO.ui.RadioOptionWidget( {
|
||||
data: 'already-cited',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-already-cited' )
|
||||
data: 'common-knowledge',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-common-knowledge' )
|
||||
} ),
|
||||
new OO.ui.RadioOptionWidget( {
|
||||
data: 'not-sure',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-not-sure' )
|
||||
data: 'irrelevant',
|
||||
label: ve.msg( 'editcheck-dialog-addref-reject-irrelevant' )
|
||||
} ),
|
||||
new OO.ui.RadioOptionWidget( {
|
||||
data: 'other',
|
||||
|
|
|
@ -5,11 +5,19 @@
|
|||
"editcheck-dialog-addref-description": "Help readers understand where this information is coming from by adding a citation.",
|
||||
"editcheck-dialog-addref-reject-question": "Why are you not adding a citation?",
|
||||
"editcheck-dialog-addref-reject-description": "Other editors would value learning more about your decision to dismiss the citation.",
|
||||
"editcheck-dialog-addref-reject-no-info": "I didn't add new information",
|
||||
"editcheck-dialog-addref-reject-already-cited": "My changes are already cited earlier",
|
||||
"editcheck-dialog-addref-reject-not-sure": "I'm not sure what citation to add",
|
||||
"editcheck-dialog-addref-reject-irrelevant": "I don't think citations are relevant to the change I'm making",
|
||||
"editcheck-dialog-addref-reject-common-knowledge": "The information I'm adding is widely known",
|
||||
"editcheck-dialog-addref-reject-uncertain": "I'm not sure what citation to add",
|
||||
"editcheck-dialog-addref-reject-other": "Other",
|
||||
"editcheck-dialog-addref-success-notify": "Thank you for adding a citation!",
|
||||
"editcheck-dialog-addref-title": "Add a citation",
|
||||
"editcheck-dialog-title": "Before publishing"
|
||||
"editcheck-dialog-title": "Before publishing",
|
||||
"tag-editcheck-reference-decline-common-knowledge": "NOREF: common knowledge",
|
||||
"tag-editcheck-reference-decline-common-knowledge-description": "EditCheck reference was declined as common knowledge",
|
||||
"tag-editcheck-reference-decline-irrelevant": "NOREF: irrelevant",
|
||||
"tag-editcheck-reference-decline-irrelevant-description": "EditCheck reference was declined as irrelevant",
|
||||
"tag-editcheck-reference-decline-other": "NOREF: other",
|
||||
"tag-editcheck-reference-decline-other-description": "EditCheck reference was declined for an unlisted reason",
|
||||
"tag-editcheck-reference-decline-uncertain": "NOREF: uncertain",
|
||||
"tag-editcheck-reference-decline-uncertain-description": "EditCheck reference was declined as being uncertain"
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
"editcheck-dialog-addref-description": "Aidez les lecteurs à comprendre d'où proviennent ces informations en ajoutant une source.",
|
||||
"editcheck-dialog-addref-reject-question": "Pourquoi n'ajoutez-vous pas une source ?",
|
||||
"editcheck-dialog-addref-reject-description": "Les autres éditeurs aimeraient en savoir plus sur votre décision de ne pas ajouter une source.",
|
||||
"editcheck-dialog-addref-reject-no-info": "Je n'ai pas ajouté de nouvelles informations",
|
||||
"editcheck-dialog-addref-reject-already-cited": "Mes modifications sont déjà sourcées plus haut",
|
||||
"editcheck-dialog-addref-reject-not-sure": "Je ne sais pas quelle source ajouter",
|
||||
"editcheck-dialog-addref-reject-uncertain": "Je ne sais pas quelle source ajouter",
|
||||
"editcheck-dialog-addref-reject-other": "Autre",
|
||||
"editcheck-dialog-addref-success-notify": "Merci d'avoir ajouté une source !",
|
||||
"editcheck-dialog-addref-title": "Ajouter une source",
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
"editcheck-dialog-addref-description": "Help text explaining why it is helpful to add a citation.",
|
||||
"editcheck-dialog-addref-reject-question": "Heading for form question asking why the user didn't add a citation.",
|
||||
"editcheck-dialog-addref-reject-description": "Help text for form question asking why the user didn't add a citation.",
|
||||
"editcheck-dialog-addref-reject-no-info": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-already-cited": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-not-sure": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-irrelevant": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-common-knowledge": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-uncertain": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-reject-other": "Answer option in repsonse to {{msg-mw|editcheck-dialog-addref-reject-question}}",
|
||||
"editcheck-dialog-addref-success-notify": "Notification messages shown after a citation is added successfully.",
|
||||
"editcheck-dialog-addref-title": "Title for the edit check context asking user to add a citation.",
|
||||
|
|
|
@ -108,6 +108,12 @@ mw.editcheck.getContentRanges = function ( documentModel, range, covers ) {
|
|||
return ranges;
|
||||
};
|
||||
|
||||
mw.editcheck.rejections = [];
|
||||
|
||||
mw.editcheck.getRejectionReasons = function () {
|
||||
return mw.editcheck.rejections;
|
||||
};
|
||||
|
||||
mw.editcheck.refCheckShown = false;
|
||||
|
||||
if ( mw.config.get( 'wgVisualEditorConfig' ).editCheckTagging ) {
|
||||
|
@ -151,6 +157,9 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || new URL( location.href
|
|||
mw.hook( 've.preSaveProcess' ).add( function ( saveProcess, target ) {
|
||||
var surface = target.getSurface();
|
||||
|
||||
// clear rejection-reasons between runs of the save process, so only the last one counts
|
||||
mw.editcheck.rejections.length = 0;
|
||||
|
||||
var selections = mw.editcheck.findAddedContentNeedingReference( surface.getModel().getDocument() );
|
||||
|
||||
if ( selections.length ) {
|
||||
|
@ -241,6 +250,8 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || new URL( location.href
|
|||
if ( data && data.action ) {
|
||||
if ( data.action !== 'reject' ) {
|
||||
mw.notify( ve.msg( 'editcheck-dialog-addref-success-notify' ), { type: 'success' } );
|
||||
} else if ( data.reason ) {
|
||||
mw.editcheck.rejections.push( data.reason );
|
||||
}
|
||||
var delay = ve.createDeferred();
|
||||
// If they inserted, wait 2 seconds on desktop before showing save dialog
|
||||
|
|
|
@ -1568,6 +1568,13 @@ ve.init.mw.ArticleTarget.prototype.save = function ( doc, options ) {
|
|||
if ( mw.editcheck.findAddedContentNeedingReference( documentModel, true ).length ) {
|
||||
taglist.push( 'editcheck-newcontent' );
|
||||
}
|
||||
// Rejection reasons for references
|
||||
var rejections = mw.editcheck.getRejectionReasons();
|
||||
if ( rejections.length > 0 ) {
|
||||
rejections.forEach( function ( reason ) {
|
||||
taglist.push( 'editcheck-reference-decline-' + reason );
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
data.vetags = taglist.join( ',' );
|
||||
|
|
Loading…
Reference in a new issue