Merge "Don't change section edit links on foreign file description pages"

This commit is contained in:
jenkins-bot 2014-04-28 18:53:06 +00:00 committed by Gerrit Code Review
commit 27d3286362
2 changed files with 22 additions and 12 deletions

View file

@ -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;
}

View file

@ -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 );
}
}
} );
}