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

Change subject: Show profiling data on preview
......................................................................


Show profiling data on preview

Change Ie065c7b5 added profiling data at the bottom of preview pages.
This adds the same data to TemplateSandbox previews.

Note this will work correctly even in the absence of that change to
core, as it checks for the new function's existence before calling it.

Change-Id: Id653cd18ab9070fab4ad0c50cb976a6f64235b47
---
M SpecialTemplateSandbox.php
M TemplateSandbox.hooks.php
2 files changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialTemplateSandbox.php b/SpecialTemplateSandbox.php
index 77e0dae..5be21a4 100644
--- a/SpecialTemplateSandbox.php
+++ b/SpecialTemplateSandbox.php
@@ -89,6 +89,13 @@
                        } else {
                                $output->addParserOutput( $this->output );
                        }
+
+                       if ( is_callable( 'EditPage::getPreviewLimitReport' ) ) 
{
+                               $out .= $output->addHTML( Html::rawElement( 
'div', array( 'class' => 'limitreport' ),
+                                       EditPage::getPreviewLimitReport( 
$this->output ) ) );
+                               $output->addModules( 
'mediawiki.collapseFooterLists' );
+                       }
+
                        $titleText = $this->output->getTitleText();
                        if ( strval( $titleText ) !== '' ) {
                                $output->setPageTitle( $this->msg( 
'templatesandbox-title-output', $titleText ) );
diff --git a/TemplateSandbox.hooks.php b/TemplateSandbox.hooks.php
index 84ac60f..76decc3 100644
--- a/TemplateSandbox.hooks.php
+++ b/TemplateSandbox.hooks.php
@@ -90,6 +90,7 @@
 
                $note = '';
                $dtitle = false;
+               $parserOutput = null;
 
                try {
                        TemplateSandboxHooks::$template = 
$editpage->getTitle()->getFullText();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id653cd18ab9070fab4ad0c50cb976a6f64235b47
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/TemplateSandbox
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to