mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 14:06:52 +00:00
Edit check: let ecenable bypass the account age requirement
Clean up accountShouldSeeEditCheck since nothing is calling it but the
new method inside BaseEditCheck
Follow-up to e947e53f98
Change-Id: Ic55187bb77f5ef003369313b76a65897fb3be392
This commit is contained in:
parent
b19679e381
commit
709e791acd
|
@ -62,8 +62,16 @@ mw.editcheck.BaseEditCheck.prototype.canBeShown = function () {
|
|||
return false;
|
||||
}
|
||||
// some checks are configured to only be for logged in / out users
|
||||
if ( !mw.editcheck.accountShouldSeeEditCheck( this.config ) ) {
|
||||
// includes checking for mw.editcheck.ecenable
|
||||
if ( mw.editcheck.ecenable ) {
|
||||
return true;
|
||||
}
|
||||
// account status:
|
||||
// loggedin, loggedout, or any-other-value meaning 'both'
|
||||
// we'll count temporary users as "logged out" by using isNamed here
|
||||
if ( this.config.account === 'loggedout' && mw.user.isNamed() ) {
|
||||
return false;
|
||||
}
|
||||
if ( this.config.account === 'loggedin' && !mw.user.isNamed() ) {
|
||||
return false;
|
||||
}
|
||||
// some checks are only shown for newer users
|
||||
|
|
|
@ -10,22 +10,6 @@ require( './EditCheckFactory.js' );
|
|||
require( './EditCheckAction.js' );
|
||||
require( './BaseEditCheck.js' );
|
||||
|
||||
mw.editcheck.accountShouldSeeEditCheck = function ( config ) {
|
||||
if ( mw.editcheck.ecenable ) {
|
||||
return true;
|
||||
}
|
||||
// account status:
|
||||
// loggedin, loggedout, or any-other-value meaning 'both'
|
||||
// we'll count temporary users as "logged out" by using isNamed here
|
||||
if ( config.account === 'loggedout' && mw.user.isNamed() ) {
|
||||
return false;
|
||||
}
|
||||
if ( config.account === 'loggedin' && !mw.user.isNamed() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// TODO: Load these checks behind feature flags
|
||||
// require( './ConvertReferenceEditCheck.js' );
|
||||
// require( './TextMatchEditCheck.js' );
|
||||
|
|
Loading…
Reference in a new issue