mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-16 18:58:45 +00:00
88dd2530e7
Suppress the redlink drawer for User namespace pages. The redlink drawer prompts the user to create a missing page but this hinders the usual workflow for User page visits specifically. A User page is connection to an account's contributions, age, and other activities and encouraging the creation of a missing User page when trying to view these connections is a hindrance, especially if the missing User page is not associated with the current user. Bug: T201339 Change-Id: I784493a8ecf28176b5a393cb52d7bfa9fa9b1309
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
( function ( M ) {
|
|
var UriUtil = M.require( 'skins.minerva.scripts/UriUtil' );
|
|
|
|
QUnit.module( 'Minerva UriUtil', QUnit.newMwEnvironment( {
|
|
setup: function () {
|
|
this.mwUriOrg = mw.Uri;
|
|
mw.Uri = mw.UriRelative( 'https://meta.wikimedia.org/w/index.php' );
|
|
},
|
|
teardown: function () {
|
|
mw.Uri = this.mwUriOrg;
|
|
delete this.mwUriOrg;
|
|
}
|
|
} ) );
|
|
|
|
QUnit.test( '.isInternal()', function ( assert ) {
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( '/relative' ) ),
|
|
true,
|
|
'relative URLs are internal'
|
|
);
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( 'http://meta.wikimedia.org/' ) ),
|
|
true,
|
|
'matching hosts are internal'
|
|
);
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( 'https:/meta.wikimedia.org/' ) ),
|
|
true,
|
|
'protocol is irrelevant'
|
|
);
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( 'https://meta.wikimedia.org/path' ) ),
|
|
true,
|
|
'path is irrelevant'
|
|
);
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( 'https://archive.org/' ) ),
|
|
false,
|
|
'external links are not internal'
|
|
);
|
|
assert.strictEqual(
|
|
UriUtil.isInternal( new mw.Uri( 'https://www.meta.wikimedia.org/' ) ),
|
|
false,
|
|
'differing subdomains are not internal'
|
|
);
|
|
} );
|
|
}( mw.mobileFrontend ) );
|