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

Change subject: Revert "Don't hardcode script tags. Use RL makeInlineScript 
method"
......................................................................


Revert "Don't hardcode script tags. Use RL makeInlineScript method"

This reverts commit 75f4cf09a27c019b8ee9e029fa9f3e367699a42a
We should be careful about changing the page HTML and shouldn't
rush merge things. Yes the bug we are fixing is a regression but
it's not a high impact one.

The delay is unacceptable and if we decide this is the way forward
there is no reason to have a `mobile.head` module at all.
Change-Id: I386a6c99cd6700f5927857a6636555c82c9dab2c
---
M includes/skins/MinervaTemplate.php
1 file changed, 20 insertions(+), 11 deletions(-)

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



diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index d99112a..fe42b9c 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -316,20 +316,29 @@
         * @param array $data Data used to build the page
         */
        protected function renderContentWrapper( $data ) {
-               $script = "mw.loader.using('mobile.head', function () {";
                if ( $this->renderHistoryLinkBeforeContent ) {
                        echo $this->getHistoryLinkTopHtml( $data );
-                       $script .= "mw.mobileFrontend.emit( 
'history-link-loaded' );";
+               ?>
+                       <script>
+                               if ( window.mw && mw.mobileFrontend ) { 
mw.mobileFrontend.emit( 'history-link-loaded' ); }
+                       </script>
+               <?php
                }
-               $script .= "mw.mobileFrontend.emit( 'header-loaded' );";
-               $this->renderPreContent( $data );
-               $this->renderContent( $data );
-               if ( !$this->renderHistoryLinkBeforeContent ) {
-                       echo $this->getHistoryLinkTopHtml( $data );
-                       $script .= "mw.mobileFrontend.emit( 
'history-link-loaded' );";
-               }
-               $script .= "});";
-               echo ResourceLoader::makeInlineScript( $script );
+               ?>
+               <script>
+                       if ( window.mw && mw.mobileFrontend ) { 
mw.mobileFrontend.emit( 'header-loaded' ); }
+               </script>
+               <?php
+                       $this->renderPreContent( $data );
+                       $this->renderContent( $data );
+                       if ( !$this->renderHistoryLinkBeforeContent ) {
+                               echo $this->getHistoryLinkTopHtml( $data );
+               ?>
+                               <script>
+                                       if ( window.mw && mw.mobileFrontend ) { 
mw.mobileFrontend.emit( 'history-link-loaded' ); }
+                               </script>
+               <?php
+                       }
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I386a6c99cd6700f5927857a6636555c82c9dab2c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to