MaxSem has uploaded a new change for review.

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


Change subject: Hooks for Zero
......................................................................

Hooks for Zero

Expose DOM anf page HTML post-transform to zero.
Remove special casing for Zero landing page, should be done using these hooks.

Change-Id: I60fec71e9b9d4e5869e7825e75c29d911e6b6d87
---
M includes/MobileFrontend.body.php
M includes/formatters/MobileFormatter.php
2 files changed, 4 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/07/73207/1

diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index e351be9..8c8b202 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -41,6 +41,8 @@
                $formatter = MobileFormatter::newFromContext( $context, $html );
                wfProfileOut( __METHOD__ . '-formatter-init' );
 
+               wfRunHooks( 'MobileFrontendBeforeDOM', array( $context, 
$formatter ) );
+
                wfProfileIn( __METHOD__ . '-filter' );
                if ( $context->getContentTransformations() ) {
                        $formatter->filterContent();
@@ -51,6 +53,8 @@
                $contentHtml = $formatter->getText();
                wfProfileOut( __METHOD__ . '-getText' );
 
+               wfRunHooks( 'MobileFrontendAfterDOM', array( $context, $html ) 
);
+
                wfProfileOut( __METHOD__ );
                return $contentHtml;
        }
diff --git a/includes/formatters/MobileFormatter.php 
b/includes/formatters/MobileFormatter.php
index bd65783..4cf1a3c 100644
--- a/includes/formatters/MobileFormatter.php
+++ b/includes/formatters/MobileFormatter.php
@@ -230,8 +230,6 @@
        protected function parseMainPage( DOMDocument $mainPage ) {
                wfProfileIn( __METHOD__ );
 
-               // FIXME: Move to ZeroRatedMobileAccess extension
-               $zeroLandingPage = $mainPage->getElementById( 
'zero-landing-page' );
                $featuredArticle = $mainPage->getElementById( 'mp-tfa' );
                $newsItems = $mainPage->getElementById( 'mp-itn' );
 
@@ -275,11 +273,6 @@
                }
                if ( $content->childNodes->length == 0 ) {
                        $content = null;
-               } else {
-                       // FIXME: Move to ZeroRatedMobileAccess extension
-                       if ( $zeroLandingPage ) {
-                               $content->appendChild( $zeroLandingPage );
-                       }
                }
 
                wfProfileOut( __METHOD__ );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60fec71e9b9d4e5869e7825e75c29d911e6b6d87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

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

Reply via email to