jenkins-bot has submitted this change and it was merged.

Change subject: Load style module only when needed
......................................................................


Load style module only when needed

Change-Id: I5626325ad634de4fb5c97282d14e48e4d3d812cc
Phabricator: T672
---
M GoogleLogin.php
M includes/GoogleLogin.body.php
M includes/GoogleLogin.hooks.php
M includes/specials/SpecialGoogleLogin.php
4 files changed, 7 insertions(+), 10 deletions(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/GoogleLogin.php b/GoogleLogin.php
index fa8c198..bf07d15 100644
--- a/GoogleLogin.php
+++ b/GoogleLogin.php
@@ -81,7 +81,6 @@
        $wgHooks['PersonalUrls'][] = 'GoogleLoginHooks::onPersonalUrls';
        $wgHooks['SpecialPage_initList'][] = 
'GoogleLoginHooks::onSpecialPage_initList';
        $wgHooks['GetPreferences'][] = 'GoogleLoginHooks::onGetPreferences';
-       $wgHooks['BeforePageDisplay'][] = 
'GoogleLoginHooks::onBeforePageDisplay';
        $wgHooks['RecentChange_save'][] = 
'GoogleLoginHooks::onRecentChange_save';
 
        // ResourceLoader modules
diff --git a/includes/GoogleLogin.body.php b/includes/GoogleLogin.body.php
index 18c00fc..bb9acac 100644
--- a/includes/GoogleLogin.body.php
+++ b/includes/GoogleLogin.body.php
@@ -549,6 +549,10 @@
                        // we don't want to delete the output of other 
extensions, so "extend" header
                        $header = $tpl->get( 'header' );
 
+                       // add css module
+                       $out = $tpl->getSkin()->getOutput();
+                       $out->addModules( 'ext.GoogleLogin.style' );
+
                        $keepLogin = '';
                        if ( $glConfig->get( 'GLShowKeepLogin' ) && $login ) {
                                $keepLogin = Html::openElement( 'div', array( 
'class' => 'mw-ui-vform-field' ) ) .
diff --git a/includes/GoogleLogin.hooks.php b/includes/GoogleLogin.hooks.php
index 3149d67..90e774e 100644
--- a/includes/GoogleLogin.hooks.php
+++ b/includes/GoogleLogin.hooks.php
@@ -121,15 +121,6 @@
                }
 
                /**
-                * Load our css module
-                * @param OutputPage $out OutputPage object
-                * @param Skin $skin Skin object that will be used to generate 
the page
-                */
-               public static function onBeforePageDisplay( OutputPage &$out, 
Skin &$skin ) {
-                       $out->addModules( 'ext.GoogleLogin.style' );
-               }
-
-               /**
                 * Replaces the RC comment with a filterable RC tag
                 *
                 * @param RecentChange $recentChange The recentChange object
diff --git a/includes/specials/SpecialGoogleLogin.php 
b/includes/specials/SpecialGoogleLogin.php
index a21233b..009df54 100644
--- a/includes/specials/SpecialGoogleLogin.php
+++ b/includes/specials/SpecialGoogleLogin.php
@@ -29,6 +29,9 @@
                        $db = new GoogleLoginDB;
                        $this->mGoogleLogin = $googleLogin = new GoogleLogin;
 
+                       // add module styles
+                       $out->addModules( 'ext.GoogleLogin.style' );
+
                        $par = (empty( $par ) ? $request->getVal( 'action' ) : 
$par);
                        $googleLogin->setLoginParameter( $request );
                        $client = $googleLogin->getClient();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5626325ad634de4fb5c97282d14e48e4d3d812cc
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to