Remove handling of Minerva edit links

After the other changes in T346944, desktop Minerva can display
multiple edit tabs and section edit links without these hacks.

Bug: T346944
Change-Id: I3721f9387303386493664366988961242a26dba5
This commit is contained in:
Bartosz Dziewoński 2023-10-24 03:27:09 +02:00
parent bc1df07882
commit 8ec439d417
3 changed files with 3 additions and 64 deletions

View file

@ -324,10 +324,6 @@
],
"monobook": [
"modules/ve-mw/preinit/styles/ve.init.mw.DesktopArticleTarget.init-apextheme.css"
],
"minerva": [
"modules/ve-mw/preinit/styles/ve.init.mw.DesktopArticleTarget.init-wikimediatheme.css",
"modules/ve-mw/preinit/styles/ve.init.mw.DesktopArticleTarget.init-minerva.css"
]
},
"dependencies": [

View file

@ -1,25 +0,0 @@
/*!
* VisualEditor MediaWiki DesktopArticleTarget Minerva skin init styles.
*
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
.ve-edit-source .mw-ui-icon-wikiText,
.ve-edit-visual .mw-ui-icon-eye {
position: absolute;
opacity: 0.65;
/* Align with pencil icon in the parent element */
left: 0;
top: 0;
/* Position relative to the center, easier this way because dimensions differ */
transform: scale( 0.6 ) translate( 12px, 12px );
}
.mw-editsection-divider {
display: none;
}
.mw-editsection {
white-space: nowrap;
}

View file

@ -914,11 +914,9 @@
},
setupMultiTabs: function () {
var
isMinerva = mw.config.get( 'skin' ) === 'minerva',
// Minerva puts the '#ca-...' ids on <a> nodes
$caEdit = $( '#ca-edit, li#page-actions-edit' ),
$caVeEdit = $( '#ca-ve-edit' );
// Minerva puts the '#ca-...' ids on <a> nodes, other skins put them on <li>
var $caEdit = $( '#ca-edit' );
var $caVeEdit = $( '#ca-ve-edit' );
if ( pageCanLoadEditor ) {
// Allow instant switching to edit mode, without refresh
@ -934,20 +932,6 @@
$( '#ca-addsection' ).off( '.ve-target' ).on( 'click.ve-target', init.onEditTabClick.bind( init, 'source' ) );
}
if ( isMinerva ) {
// Minerva hides the link text - display tiny icons instead
mw.loader.load( [ 'oojs-ui.styles.icons-editing-advanced', 'oojs-ui.styles.icons-accessibility' ] );
$caEdit.find( '.mw-ui-icon' ).each( function () {
// Use <b> to dodge some styles targeting <span> to hide labels
var $icon = $( '<b>' ).addClass( 'mw-ui-icon mw-ui-icon-element mw-ui-icon-wikiText' );
$( this ).addClass( 've-edit-source' ).prepend( $icon );
} );
$caVeEdit.find( '.mw-ui-icon' ).each( function () {
var $icon = $( '<b>' ).addClass( 'mw-ui-icon mw-ui-icon-element mw-ui-icon-eye' );
$( this ).addClass( 've-edit-visual' ).prepend( $icon );
} );
}
if ( init.isVisualAvailable ) {
if ( conf.tabPosition === 'before' ) {
$caEdit.addClass( 'collapsible' );
@ -968,22 +952,6 @@
$editsections.css( 'direction', bodyDir );
}
var isMinerva = mw.config.get( 'skin' ) === 'minerva';
if ( isMinerva ) {
// Minerva hides the link text - display tiny icons instead
mw.loader.load( [ 'oojs-ui.styles.icons-editing-advanced', 'oojs-ui.styles.icons-accessibility' ] );
$( '#mw-content-text .mw-editsection a:not(.mw-editsection-visualeditor)' ).each( function () {
// Use <b> to dodge some styles targeting <span> to hide labels
var $icon = $( '<b>' ).addClass( 'mw-ui-icon mw-ui-icon-element mw-ui-icon-wikiText' );
$( this ).addClass( 've-edit-source' ).prepend( $icon );
} );
$( '#mw-content-text .mw-editsection a.mw-editsection-visualeditor' ).each( function () {
var $icon = $( '<b>' ).addClass( 'mw-ui-icon mw-ui-icon-element mw-ui-icon-eye' );
$( this ).addClass( 've-edit-visual' ).prepend( $icon );
} );
}
if ( pageCanLoadEditor ) {
// Only init without refresh if we're on a view page. Though section edit links
// are rarely shown on non-view pages, they appear in one other case, namely