Anomie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/53803
Change subject: Use new "show profiling data on preview" pref
......................................................................
Use new "show profiling data on preview" pref
Change Ie065c7b5 added an option to show 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, 11 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateSandbox
refs/changes/03/53803/1
diff --git a/SpecialTemplateSandbox.php b/SpecialTemplateSandbox.php
index 77e0dae..c1a9e2b 100644
--- a/SpecialTemplateSandbox.php
+++ b/SpecialTemplateSandbox.php
@@ -89,6 +89,12 @@
} else {
$output->addParserOutput( $this->output );
}
+
+ if ( is_callable( 'EditPage::getPreviewLimitReport' ) )
{
+ global $wgUser;
+ $output->addHTML(
EditPage::getPreviewLimitReport( $wgUser, $this->output ) );
+ }
+
$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..c07aaaa 100644
--- a/TemplateSandbox.hooks.php
+++ b/TemplateSandbox.hooks.php
@@ -90,6 +90,7 @@
$note = '';
$dtitle = false;
+ $parserOutput = null;
try {
TemplateSandboxHooks::$template =
$editpage->getTitle()->getFullText();
@@ -153,6 +154,10 @@
'class' => 'mw-content-' . $pageLang->getDir() );
$out = Html::rawElement( 'div', $attribs, $out );
+ if ( is_callable( 'EditPage::getPreviewLimitReport' ) &&
$parserOutput ) {
+ $out .= EditPage::getPreviewLimitReport( $wgUser,
$parserOutput );
+ }
+
$out = $previewhead . $out . $editpage->previewTextAfterContent;
wfProfileOut( __METHOD__ );
--
To view, visit https://gerrit.wikimedia.org/r/53803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id653cd18ab9070fab4ad0c50cb976a6f64235b47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateSandbox
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits