Kaldari has uploaded a new change for review.

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

Change subject: Wrap 1x1 images in a div so that MobileFrontend can ignore them
......................................................................

Wrap 1x1 images in a div so that MobileFrontend can ignore them

Bug: T87290
Change-Id: I7e4120e5724221faf1bf838efab1dac5d14b9f54
---
M includes/CentralAuthHooks.php
1 file changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/45/189145/1

diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index 5119020..3f28cba 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -1382,6 +1382,7 @@
         * @param &$out OutputPage
         * @param &$skin Skin
         * @return bool
+        * @todo Add 1x1 images somewhere besides page content
         */
        static function onBeforePageDisplay( &$out, &$skin ) {
                global $wgCentralAuthLoginWiki, $wgCentralAuthUseEventLogging;
@@ -1430,10 +1431,21 @@
                return true;
        }
 
+       /**
+        * Build the HTML containing the 1x1 images
+        * @return string
+        */
        static function getEdgeLoginHTML() {
                global $wgCentralAuthLoginWiki, $wgCentralAuthAutoLoginWikis;
 
-               $html = '';
+               // Put images inside a div so that other code that manipulates 
page content can
+               // explicitly ignore them.
+               $html = Xml::openElement( 'div',
+                       array(
+                               'id' => 'central-auth-images',
+                               'style' => 'position: absolute;',
+                       )
+               );
 
                foreach ( $wgCentralAuthAutoLoginWikis as $wiki ) {
                        $wiki = WikiMap::getWiki( $wiki );
@@ -1449,7 +1461,7 @@
                                        'title' => '',
                                        'width' => 1,
                                        'height' => 1,
-                                       'style' => 'border: none; position: 
absolute;',
+                                       'style' => 'border: none;',
                                )
                        );
                }
@@ -1468,11 +1480,13 @@
                                        'title' => '',
                                        'width' => 1,
                                        'height' => 1,
-                                       'style' => 'border: none; position: 
absolute;',
+                                       'style' => 'border: none;',
                                )
                        );
                }
 
+               $html .= Xml::closeElement( 'div' );
+
                return $html;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e4120e5724221faf1bf838efab1dac5d14b9f54
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>

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

Reply via email to