mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge changes I310e638a,I397ac16a
* changes: hooks: Only check relevant page title instead of both Don't set ignoreHidden=true when calling User::getOption
This commit is contained in:
commit
bf342d660c
|
@ -62,22 +62,13 @@ class VisualEditorHooks {
|
||||||
!$skin->getTitle()->isRedirect() &&
|
!$skin->getTitle()->isRedirect() &&
|
||||||
|
|
||||||
// User has the 'visualeditor-enable' preference set
|
// User has the 'visualeditor-enable' preference set
|
||||||
$skin->getUser()->getOption(
|
$skin->getUser()->getOption( 'visualeditor-enable' ) &&
|
||||||
'visualeditor-enable',
|
|
||||||
/*default=*/ false,
|
|
||||||
// HACK: Allows us to suppress the option in preferences when it's on for all.
|
|
||||||
/*ignoreHidden=*/ true
|
|
||||||
) &&
|
|
||||||
|
|
||||||
// The user's current skin is supported
|
// The user's current skin is supported
|
||||||
in_array( $skin->getSkinName(), self::$supportedSkins ) &&
|
in_array( $skin->getSkinName(), self::$supportedSkins ) &&
|
||||||
|
|
||||||
(
|
// The current page is in a VisualEditor-enabled namespace
|
||||||
// Article in the VisualEditor namespace
|
in_array( $skin->getRelevantTitle()->getNamespace(), $wgVisualEditorNamespaces ) &&
|
||||||
in_array( $skin->getTitle()->getNamespace(), $wgVisualEditorNamespaces ) ||
|
|
||||||
// Special page action for an article in the VisualEditor namespace
|
|
||||||
in_array( $skin->getRelevantTitle()->getNamespace(), $wgVisualEditorNamespaces )
|
|
||||||
) &&
|
|
||||||
|
|
||||||
// Only use VisualEditor if the page is wikitext, not CSS/JS
|
// Only use VisualEditor if the page is wikitext, not CSS/JS
|
||||||
$skin->getTitle()->getContentModel() === CONTENT_MODEL_WIKITEXT
|
$skin->getTitle()->getContentModel() === CONTENT_MODEL_WIKITEXT
|
||||||
|
|
Loading…
Reference in a new issue