Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284678

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/78/284678/1

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: newchange
Gerrit-Change-Id: I2105384cc4f6f2ec1cdb24a7bf3b0f4cce7672d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to