From acbe677d2c55ba0e23f1f9883eece1360f0b2c68 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 17 Sep 2009 01:14:00 +0000 Subject: [PATCH] partial revert on r55573; livePreview() is still used --- includes/EditPage.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/includes/EditPage.php b/includes/EditPage.php index 3b8d3a0a07..6756222065 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2338,6 +2338,36 @@ END return $buttons; } + /** + * Output preview text only. This can be sucked into the edit page + * via JavaScript, and saves the server time rendering the skin as + * well as theoretically being more robust on the client (doesn't + * disturb the edit box's undo history, won't eat your text on + * failure, etc). + * + * @todo This doesn't include category or interlanguage links. + * Would need to enhance it a bit, maybe wrap them in XML + * or something... that might also require more skin + * initialization, so check whether that's a problem. + */ + function livePreview() { + global $wgOut; + $wgOut->disable(); + header( 'Content-type: text/xml; charset=utf-8' ); + header( 'Cache-control: no-cache' ); + + $previewText = $this->getPreviewText(); + #$categories = $skin->getCategoryLinks(); + + $s = + '' . "\n" . + Xml::tags( 'livepreview', null, + Xml::element( 'preview', null, $previewText ) + #. Xml::element( 'category', null, $categories ) + ); + echo $s; + } + /** * Get a diff between the current contents of the edit box and the -- 2.20.1