Mattflaschen has uploaded a new change for review.

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

Change subject: Correctly register WikiLove before toolbarView
......................................................................

Correctly register WikiLove before toolbarView

Avoids a race condition

Change-Id: I807bd551e628d8bd6cef567299dde34f842ea16e
---
M PageTriage.hooks.php
1 file changed, 27 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/57/324857/1

diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 9275685..b5ac024 100644
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -550,6 +550,26 @@
                        'remoteExtPath' => 'PageTriage/modules'
                ];
 
+               $toolBaseClass = [
+                       
'ext.pageTriage.views.toolbar/ext.pageTriage.toolView.js', // abstract class 
first
+               ];
+
+               // Individual tools on toolbar
+               $tools = [
+                       
'ext.pageTriage.views.toolbar/ext.pageTriage.articleInfo.js', // article 
metadata
+                       
'ext.pageTriage.views.toolbar/ext.pageTriage.minimize.js', // minimize
+                       'ext.pageTriage.views.toolbar/ext.pageTriage.tags.js', 
// tagging
+                       'ext.pageTriage.views.toolbar/ext.pageTriage.mark.js', 
// mark as reviewed
+                       'ext.pageTriage.views.toolbar/ext.pageTriage.next.js', 
// next article
+                       
'ext.pageTriage.views.toolbar/ext.pageTriage.delete.js', // mark for deletion
+               ];
+
+               $afterTools = [
+                       
'ext.pageTriage.views.toolbar/ext.pageTriage.toolbarView.js', // overall 
toolbar view last
+                       'external/jquery.effects.core.js',
+                       'external/jquery.effects.squish.js',
+               ];
+
                $module = $template + [
                        'dependencies' => [
                                'mediawiki.jqueryMsg',
@@ -562,18 +582,6 @@
                                'jquery.client',
                                'ext.pageTriage.externalTagsOptions',
                                'ext.pageTriage.externalDeletionTagsOptions'
-                       ],
-                       'scripts' => [
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.toolView.js', // abstract class 
first
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.articleInfo.js', // article 
metadata
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.minimize.js', // minimize
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.tags.js', // tagging
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.mark.js', // mark as reviewed
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.next.js', // next article
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.delete.js', // mark for deletion
-                               
'ext.pageTriage.views.toolbar/ext.pageTriage.toolbarView.js', // overall 
toolbar view last
-                               'external/jquery.effects.core.js',
-                               'external/jquery.effects.squish.js',
                        ],
                        'styles' => [
                                'ext.pageTriage.css', // stuff that's shared 
across all views
@@ -665,7 +673,7 @@
                ];
 
                if ( ExtensionRegistry::getInstance()->isLoaded( 'WikiLove' ) ) 
{
-                       $module['scripts'][] = 
'ext.pageTriage.views.toolbar/ext.pageTriage.wikilove.js';
+                       $tools[] = 
'ext.pageTriage.views.toolbar/ext.pageTriage.wikilove.js';
                        $module['styles'][] = 
'ext.pageTriage.views.toolbar/ext.pageTriage.wikilove.css';
                        $module['messages'] = array_merge( $module['messages'], 
[
                                'pagetriage-wikilove-page-creator',
@@ -678,6 +686,12 @@
                        ] );
                }
 
+               $module['scripts'] = array_merge(
+                       $toolBaseClass,
+                       $tools,
+                       $afterTools
+               );
+
                $resourceLoader->register( 'ext.pageTriage.views.toolbar', 
$module );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/324857
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I807bd551e628d8bd6cef567299dde34f842ea16e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <mflasc...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to