mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 16:10:55 +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
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
( function ( M ) {
|
|
/**
|
|
* Compares the default Uri host, usually `window.location.host`, and `mw.Uri.host`. Equivalence
|
|
* tests internal linkage, a mismatch may indicate an external link. Interwiki links are
|
|
* considered external.
|
|
*
|
|
* This function only indicates internal in the sense of being on the same host or not. It has
|
|
* no knowledge of [[Link]] vs [Link] links.
|
|
*
|
|
* On https://meta.wikimedia.org/wiki/Foo, the following links would be considered *internal*
|
|
* and return `true`:
|
|
*
|
|
* https://meta.wikimedia.org/
|
|
* https://meta.wikimedia.org/wiki/Bar
|
|
* https://meta.wikimedia.org/w/index.php?title=Bar
|
|
*
|
|
* Similarly, the following links would be considered *not* internal and return `false`:
|
|
*
|
|
* https://archive.org/
|
|
* https://foo.wikimedia.org/
|
|
* https://en.wikipedia.org/
|
|
* https://en.wikipedia.org/wiki/Bar
|
|
*
|
|
* @param {mw.Uri} uri
|
|
* @return {boolean}
|
|
*/
|
|
function isInternal( uri ) {
|
|
return uri.host === mw.Uri().host;
|
|
}
|
|
|
|
M.define( 'skins.minerva.scripts/UriUtil', {
|
|
isInternal: isInternal
|
|
} );
|
|
}( mw.mobileFrontend ) );
|