Index: branches/wmf-deployment/includes/EditPage.php |
— | — | @@ -2332,7 +2332,37 @@ |
2333 | 2333 | return $buttons; |
2334 | 2334 | } |
2335 | 2335 | |
| 2336 | + /** |
| 2337 | + * Output preview text only. This can be sucked into the edit page |
| 2338 | + * via JavaScript, and saves the server time rendering the skin as |
| 2339 | + * well as theoretically being more robust on the client (doesn't |
| 2340 | + * disturb the edit box's undo history, won't eat your text on |
| 2341 | + * failure, etc). |
| 2342 | + * |
| 2343 | + * @todo This doesn't include category or interlanguage links. |
| 2344 | + * Would need to enhance it a bit, <s>maybe wrap them in XML |
| 2345 | + * or something...</s> that might also require more skin |
| 2346 | + * initialization, so check whether that's a problem. |
| 2347 | + */ |
| 2348 | + function livePreview() { |
| 2349 | + global $wgOut; |
| 2350 | + $wgOut->disable(); |
| 2351 | + header( 'Content-type: text/xml; charset=utf-8' ); |
| 2352 | + header( 'Cache-control: no-cache' ); |
2336 | 2353 | |
| 2354 | + $previewText = $this->getPreviewText(); |
| 2355 | + #$categories = $skin->getCategoryLinks(); |
| 2356 | + |
| 2357 | + $s = |
| 2358 | + '<?xml version="1.0" encoding="UTF-8" ?>' . "\n" . |
| 2359 | + Xml::tags( 'livepreview', null, |
| 2360 | + Xml::element( 'preview', null, $previewText ) |
| 2361 | + #. Xml::element( 'category', null, $categories ) |
| 2362 | + ); |
| 2363 | + echo $s; |
| 2364 | + } |
| 2365 | + |
| 2366 | + |
2337 | 2367 | /** |
2338 | 2368 | * Get a diff between the current contents of the edit box and the |
2339 | 2369 | * version of the page we're editing from. |
Property changes on: branches/wmf-deployment/includes/EditPage.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
2340 | 2370 | + /branches/REL1_15/phase3/includes/EditPage.php:51646 |
/branches/wmf-deployment/includes/EditPage.php:53381 |
/trunk/phase3/includes/EditPage.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,56478 |