Move translate extension hack up to 'isAvailable'

All modes of VE should be disabled on these pages.

Bug: T153445
Change-Id: I5adfae940ee35c5ee6712e620a0ddda967a542ad
This commit is contained in:
Ed Sanders 2016-12-24 16:17:01 +00:00
parent 55a9cf5208
commit 827d4185c4

View file

@ -767,6 +767,10 @@
// Only in supported skins
conf.skins.indexOf( mw.config.get( 'skin' ) ) !== -1 &&
// Not on pages which are outputs of the Translate extensions
// TODO: Allow the Translate extension to do this itself
mw.config.get( 'wgTranslatePageTranslation' ) !== 'translation' &&
// Not on pages like Special:RevisionDelete
mw.config.get( 'wgNamespaceNumber' ) !== -1
);
@ -777,9 +781,6 @@
// Only in enabled namespaces
conf.namespaces.indexOf( new mw.Title( mw.config.get( 'wgRelevantPageName' ) ).getNamespaceId() ) !== -1 &&
// Not on pages which are outputs of the Page Translation feature
mw.config.get( 'wgTranslatePageTranslation' ) !== 'translation' &&
// Only for pages with a supported content model
conf.contentModels.hasOwnProperty( mw.config.get( 'wgPageContentModel' ) )
);