jenkins-bot has submitted this change and it was merged.
Change subject: Use Array.prototype.indexOf in support check
......................................................................
Use Array.prototype.indexOf in support check
The SupportCheck method asserts that the method is available so use it
instead of the confusingly named jQuery version.
Change-Id: I2105384cc4f6f2ec1cdb24a7bf3b0f4cce7672d3
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index d76a8c8..5a23c15 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -634,18 +634,16 @@
// Whether VisualEditor should be available for the current user, page,
wiki, mediawiki skin,
// browser etc.
init.isAvailable = (
+ // Support check asserts that Array.prototype.indexOf is
available so we can use it below
VisualEditorSupportCheck() &&
( ( 'vewhitelist' in uri.query ) || !$.client.test(
init.blacklist, null, true ) ) &&
// Only in supported skins
- $.inArray( mw.config.get( 'skin' ), conf.skins ) !== -1 &&
+ conf.skins.indexOf( mw.config.get( 'skin' ) ) !== -1 &&
// Only in enabled namespaces
- $.inArray(
- new mw.Title( mw.config.get( 'wgRelevantPageName' )
).getNamespaceId(),
- conf.namespaces
- ) !== -1 &&
+ conf.namespaces.indexOf( new mw.Title( mw.config.get(
'wgRelevantPageName' ) ).getNamespaceId() ) !== -1 &&
// Not on pages like Special:RevisionDelete
mw.config.get( 'wgNamespaceNumber' ) !== -1 &&
--
To view, visit https://gerrit.wikimedia.org/r/284678
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2105384cc4f6f2ec1cdb24a7bf3b0f4cce7672d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits