Jdlrobson has uploaded a new change for review.

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


Change subject: Use bodyContent to be consistent with desktop
......................................................................

Use bodyContent to be consistent with desktop

Take advantage of upcoming varnish flush.
Ensure backwards compatibility with modules in stable for time being
by looking for both #bodyContent and #content

Change-Id: Ib524d0bd8a398047186fa4d2f8831081266653d8
---
M includes/skins/MobileTemplateBeta.php
M javascripts/common/history-alpha.js
M javascripts/modules/editor/EditorOverlay.js
M javascripts/modules/mf-homepage.js
M javascripts/modules/mf-inline-style-scrubber.js
M javascripts/modules/mf-photo.js
M javascripts/modules/mf-references.js
M javascripts/specials/nearby.js
8 files changed, 12 insertions(+), 8 deletions(-)


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

diff --git a/includes/skins/MobileTemplateBeta.php 
b/includes/skins/MobileTemplateBeta.php
index badc89d..5e88703 100644
--- a/includes/skins/MobileTemplateBeta.php
+++ b/includes/skins/MobileTemplateBeta.php
@@ -10,7 +10,7 @@
                                        $this->renderPageActions( $data );
                                }
                        ?>
-                       <div id="content" class="content">
+                       <div id="bodyContent" class="content">
                        <?php
                                        echo $data[ 'bodytext' ];
                                        $this->renderLanguages( $data );
diff --git a/javascripts/common/history-alpha.js 
b/javascripts/common/history-alpha.js
index da4bd8f..a323c69 100644
--- a/javascripts/common/history-alpha.js
+++ b/javascripts/common/history-alpha.js
@@ -35,7 +35,7 @@
                // Bind to future StateChange Events
                History.Adapter.bind( window, 'statechange', function(){
                        var s = History.getState();
-                       new Page( { title: s.title, el: $( '#content' ) } ).on( 
'error', function() {
+                       new Page( { title: s.title, el: $( '#bodyContent' ) } 
).on( 'error', function() {
                                window.location.reload(); // the page either 
doesn't exist or was a Special:Page so force a refresh
                        } );
                } );
diff --git a/javascripts/modules/editor/EditorOverlay.js 
b/javascripts/modules/editor/EditorOverlay.js
index a40d1d3..0a99c54 100644
--- a/javascripts/modules/editor/EditorOverlay.js
+++ b/javascripts/modules/editor/EditorOverlay.js
@@ -173,7 +173,7 @@
                                        // log success!
                                        self.log( 'success' );
                                        M.history.invalidateCachedPage( title );
-                                       new Page( { title: title, el: $( 
'#content' ) } );
+                                       new Page( { title: title, el: $( 
'#bodyContent' ) } );
                                        self.hide();
                                        popup.show(
                                                mw.msg( 
'mobile-frontend-editor-success' ),
diff --git a/javascripts/modules/mf-homepage.js 
b/javascripts/modules/mf-homepage.js
index 80a891c..fe61ad1 100644
--- a/javascripts/modules/mf-homepage.js
+++ b/javascripts/modules/mf-homepage.js
@@ -3,7 +3,8 @@
 
 $( function() {
        $( 'h1.section_0' ).remove();
-       if ( $( '#mainpage' ).children().length === 0 || $( '#content' 
).children().length === 0 ) {
+       // FIXME: Only check #bodyContent when new nav goes live
+       if ( $( '#mainpage' ).children().length === 0 || $( 
'#content,#bodyContent' ).children().length === 0 ) {
                $( '<div class="alert warning">' ).html( mw.msg( 
'mobile-frontend-empty-homepage-text' ) ).prependTo( '#content_wrapper' );
        }
 } );
diff --git a/javascripts/modules/mf-inline-style-scrubber.js 
b/javascripts/modules/mf-inline-style-scrubber.js
index 90d0528..3377aa3 100644
--- a/javascripts/modules/mf-inline-style-scrubber.js
+++ b/javascripts/modules/mf-inline-style-scrubber.js
@@ -15,7 +15,7 @@
                        on( 'page-loaded', function() {
                                scrub( $( '#content_0' ) );
                        } );
-               scrub( $( '#content' ) );
+               scrub( $( '#bodyContent' ) );
 
        } );
 
diff --git a/javascripts/modules/mf-photo.js b/javascripts/modules/mf-photo.js
index 09c81e7..21dd369 100644
--- a/javascripts/modules/mf-photo.js
+++ b/javascripts/modules/mf-photo.js
@@ -688,7 +688,8 @@
                var namespaceIds = mw.config.get( 'wgNamespaceIds' ),
                        namespace = mw.config.get( 'wgNamespaceNumber' ),
                        validNamespace = ( namespace === namespaceIds[''] || 
namespace === namespaceIds.user ),
-                       $page = $( '#content' ),
+                       // FIXME: Only check #bodyContent when new nav goes live
+                       $page = $( '#bodyContent,#content' ),
                        $pageHeading = $page.find( 'h1' ).first(),
                        optionsPhotoUploader,
                        photoUploader;
diff --git a/javascripts/modules/mf-references.js 
b/javascripts/modules/mf-references.js
index af5705e..5182480 100644
--- a/javascripts/modules/mf-references.js
+++ b/javascripts/modules/mf-references.js
@@ -21,7 +21,8 @@
                */
                function setupReferences( container, options ) {
                        var lastLink, data, html, href, references = collect();
-                       container = container || $( '#content' )[ 0 ];
+                       // FIXME: Only check #bodyContent when new nav goes live
+                       container = container || $( '#content,#bodyContent' )[ 
0 ];
                        function cancelBubble( ev ) {
                                ev.stopPropagation();
                        }
diff --git a/javascripts/specials/nearby.js b/javascripts/specials/nearby.js
index 6343d85..1b622c3 100644
--- a/javascripts/specials/nearby.js
+++ b/javascripts/specials/nearby.js
@@ -238,7 +238,8 @@
                        }
                }
                if ( lastSearchResult && window.location.hash ) {
-                       render( $( '#content' ), $.parseJSON( lastSearchResult 
) );
+                       // FIXME: Only check #bodyContent when new nav goes live
+                       render( $( '#content,#bodyContent' ), $.parseJSON( 
lastSearchResult ) );
                } else {
                        init();
                }

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

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

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

Reply via email to