mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Merge "Don't change section edit links on foreign file description pages"
This commit is contained in:
commit
27d3286362
|
@ -191,10 +191,16 @@ class VisualEditorHooks {
|
|||
public static function onDoEditSectionLink( $skin, $title, $section, $tooltip, &$result, $lang ) {
|
||||
// Only do this if the user has VE enabled
|
||||
// (and we're not in parserTests)
|
||||
// (and we're not on a foreign file description page)
|
||||
if (
|
||||
isset( $GLOBALS[ 'wgVisualEditorInParserTests' ] ) ||
|
||||
!$skin->getUser()->getOption( 'visualeditor-enable' ) ||
|
||||
$skin->getUser()->getOption( 'visualeditor-betatempdisable' )
|
||||
$skin->getUser()->getOption( 'visualeditor-betatempdisable' ) ||
|
||||
(
|
||||
$title->inNamespace( NS_FILE ) &&
|
||||
WikiPage::factory( $title ) instanceof WikiFilePage &&
|
||||
!WikiPage::factory( $title )->isLocal()
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -282,6 +282,9 @@
|
|||
$divider
|
||||
.addClass( 'mw-editsection-divider' )
|
||||
.text( dividerText );
|
||||
// Don't mess with section edit links on foreign file description pages
|
||||
// (bug 54259)
|
||||
if ( !$( '#ca-view-foreign' ).length ) {
|
||||
$editLink
|
||||
.attr( 'href', function ( i, val ) {
|
||||
return new mw.Uri( veEditUri ).extend( {
|
||||
|
@ -294,6 +297,7 @@
|
|||
} else {
|
||||
$editSourceLink.after( $divider, $editLink );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue