Disable mobile editor (skins.minerva.editor) on desktop

This module is no longer necessary to allow editing pages in the
Minerva skin. When it is not loaded, the normal desktop editor will
be used instead (that may be WikiEditor, VisualEditor, just the plain
textarea from MediaWiki core, or something else).

Bug: T198765
Bug: T208068
Change-Id: I1eb9d4b4bc937522e527dbdc0d6be82baf3b7413
This commit is contained in:
Bartosz Dziewoński 2018-10-26 21:21:13 +02:00
parent a79a0276bd
commit d57f8290c3

View file

@ -1332,12 +1332,15 @@ class SkinMinerva extends SkinTemplate {
$req = $this->getRequest(); $req = $this->getRequest();
$title = $this->getTitle(); $title = $this->getTitle();
$isMFMobile = class_exists( 'MobileContext' ) &&
MobileContext::singleton()->shouldDisplayMobileView();
if ( !$title->isSpecialPage() ) { if ( !$title->isSpecialPage() ) {
if ( $this->isAllowedPageAction( 'watch' ) ) { if ( $this->isAllowedPageAction( 'watch' ) ) {
// Explicitly add the mobile watchstar code. // Explicitly add the mobile watchstar code.
$modules[] = 'skins.minerva.watchstar'; $modules[] = 'skins.minerva.watchstar';
} }
if ( $this->isCurrentPageContentModelEditable() ) { if ( $isMFMobile && $this->isCurrentPageContentModelEditable() ) {
$modules[] = 'skins.minerva.editor'; $modules[] = 'skins.minerva.editor';
} }
} }