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

Change subject: Don't lazy load sections on the first load
......................................................................


Don't lazy load sections on the first load

Switch focus to lazy page loading due to lack
of traction and apparently unsolveable 'bugs'

See http://osdir.com/ml/general/2013-05/msg36167.html

Renders bug 42746 and bug 41569 invalid

Change-Id: I40ebba95146fbb97db550933bc891ff47aa23324
---
M includes/MobileFormatter.php
M includes/MobileFrontend.body.php
M javascripts/modules/mf-toggle-dynamic.js
3 files changed, 2 insertions(+), 40 deletions(-)

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



diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index fc92ca9..b1e920f 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -14,7 +14,6 @@
        protected $title;
 
        protected $expandableSections = false;
-       protected $removeSections = false;
        protected $mainPage = false;
        protected $backToTopLink = true;
 
@@ -89,10 +88,6 @@
                $this->backToTopLink = false;
        }
 
-       public function enableRemovableSections( $flag = true ) {
-               $this->removeSections = $flag;
-       }
-
        public function setIsMainPage( $value = true ) {
                $this->mainPage = $value;
        }
@@ -153,18 +148,6 @@
                        case 'HTML':
                                if ( $this->expandableSections && strlen( $html 
) > 4000 ) {
                                        $html = $this->headingTransform( $html 
);
-                                       if ( $this->removeSections ) {
-                                               $temp = new HtmlFormatter( 
$html ); // hack hack hack
-                                               $doc = $temp->getDoc();
-
-                                               $xpath = new DOMXpath( $doc );
-                                               $elements = $xpath->query( 
'//*[@class="content_block"]' );
-                                               /** @var $element DOMElement */
-                                               foreach ( $elements as $element 
) { // empty elements
-                                                       $element->nodeValue = 
'';
-                                               }
-                                               $html = $temp->getText();
-                                       }
                                }
                                break;
                        case 'WML':
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 3496c90..4d97c54 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -121,7 +121,6 @@
                $ns = $this->getTitle()->getNamespace();
                $isMainPage = $this->getTitle()->isMainPage();
                $isFilePage = $ns === NS_FILE;
-               $formatter->enableRemovableSections( 
$context->isBetaGroupMember() && $ns === NS_MAIN && !$isMainPage );
                $doc = $formatter->getDoc();
                wfProfileOut( __METHOD__ . '-formatter-init' );
 
diff --git a/javascripts/modules/mf-toggle-dynamic.js 
b/javascripts/modules/mf-toggle-dynamic.js
index 745c85a..6dc6f56 100644
--- a/javascripts/modules/mf-toggle-dynamic.js
+++ b/javascripts/modules/mf-toggle-dynamic.js
@@ -1,10 +1,9 @@
 ( function( M, $ ) {
 
-var T = ( function() {
+( function() {
        var
                toggle = M.require( 'toggle' ),
-               currentPage,
-               Page = M.require( 'page' );
+               currentPage;
 
        M.on( 'section-toggle', function( section_id ) {
                var
@@ -45,27 +44,8 @@
                checkHash();
        }
 
-       function init() {
-               var pageTitle = mw.config.get( 'wgTitle'),
-                       inViewMode = mw.config.get( 'wgAction' ) === 'view',
-                       isMainPage = mw.config.get( 'wgIsMainPage' ),
-                       isMainNamespace = mw.config.get( 'wgNamespaceNumber' ) 
===  mw.config.get( 'wgNamespaceIds' )[''];
-
-               if ( !isMainPage && isMainNamespace && inViewMode ) {
-                       M.history.retrievePage( pageTitle ).done( function( 
pageData ) {
-                               currentPage = new Page( pageData );
-                               refresh( currentPage );
-                       } );
-               }
-       }
        M.on( 'page-loaded', refresh );
 
-       return {
-               init: init
-       };
-
 }() );
-
-M.define( 'toggle-dynamic', T );
 
 }( mw.mobileFrontend, jQuery ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40ebba95146fbb97db550933bc891ff47aa23324
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to