62 737
modifications
mAucun résumé des modifications |
Ajout de la fonction permettant aux utilisateurs sans droit de suppression d'ajouter le bandeau de suppression sur l'ancienne catégorie. |
||
Ligne 17 : | Ligne 17 : | ||
// Site-related parameters | // Site-related parameters | ||
const TAG = 'RenommageCategorie'; | const TAG = 'RenommageCategorie'; | ||
const DAILY_LIMIT = | const DAILY_LIMIT = 2500; | ||
const DR_TEMPLATE = '{{Suppression|utilisateur=$1}}\n\n'; | |||
// Literal non-breaking space, for situations where HTML entities can't be used | // Literal non-breaking space, for situations where HTML entities can't be used | ||
const NBSP = String.fromCharCode( 0xA0 ); | const NBSP = String.fromCharCode( 0xA0 ); | ||
Ligne 652 : | Ligne 653 : | ||
dialog.errorHandler( error ); | dialog.errorHandler( error ); | ||
} | } | ||
} ); | |||
return this.deferred; | |||
}; | |||
/** | |||
* Post a deletion request. | |||
* | |||
* @return {JQuery.Deferred} Promise telling to continue the process | |||
* when it is its turn to execute. | |||
*/ | |||
CatRename.prototype.postDR = function () { | |||
var dialog = this; | |||
this.deferred = $.Deferred(); | |||
this.showStatus( mw.msg( 'catrename-status-postdr' ) ); | |||
var content = DR_TEMPLATE | |||
.replace( /\$1/g, mw.config.get( 'wgUserName' ) ); | |||
this.api.postWithToken( 'csrf', { | |||
'action': 'edit', | |||
'format': 'json', | |||
'title': this.oldPageName, | |||
'summary': mw.msg( 'catrename-dr-summary' ), | |||
'tags': TAG, | |||
'nocreate': 1, | |||
'prependtext': content, | |||
'formatversion': '2' | |||
} ).then( function ( data ) { | |||
dialog.deferred.resolve(); | |||
} ).fail( function ( error ) { | |||
dialog.errorHandler( error ); | |||
} ); | } ); | ||
modifications