mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-15 19:59:35 +00:00
2499e834bb
Follow up to 87dd101a
* bump coverage to reflect improved test state
* remove ts-ignore statements
* Drop eslint-disable-next-line compat/compat rules in ES6 code
* Drop TypeScript checking on Jest files
* Identifies an existing usage of ES7 includes method in place
where ES6 browsers need to be supported.
* Update App.vue booleans to default to false. Note this doesn't
impact our usage of the search app as we always pass these values
in.
* Drop unused eslintEs6.json configuration file
Change-Id: Ib6f1ef77bf4e27ecdcc54b5fb963818437f8195c
41 lines
1,005 B
JavaScript
41 lines
1,005 B
JavaScript
/**
|
|
* Copies interwiki links to main menu
|
|
*
|
|
* Temporary solution to T287206, can be removed when the new ULS built in Vue.js
|
|
* has been released and contains this
|
|
*/
|
|
function addInterwikiLinkToMainMenu() {
|
|
// eslint-disable-next-line no-jquery/no-global-selector
|
|
const $editLink = $( '#p-lang-btn .wbc-editpage' );
|
|
|
|
if ( !$editLink.length ) {
|
|
return;
|
|
}
|
|
const title = $editLink.attr( 'title' ) || '';
|
|
|
|
const addInterlanguageLink = mw.util.addPortletLink(
|
|
'p-tb',
|
|
$editLink.attr( 'href' ) || '#',
|
|
// Original text is "Edit links".
|
|
// Since its taken out of context the title is more descriptive.
|
|
title,
|
|
'wbc-editpage',
|
|
title
|
|
);
|
|
|
|
if ( addInterlanguageLink ) {
|
|
addInterlanguageLink.addEventListener( 'click', function ( /** @type {Event} */ e ) {
|
|
e.preventDefault();
|
|
// redirect to the detached and original edit link
|
|
$editLink.trigger( 'click' );
|
|
} );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Initialize the language button.
|
|
*/
|
|
module.exports = function () {
|
|
addInterwikiLinkToMainMenu();
|
|
};
|