Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -390,6 +390,7 @@ |
391 | 391 | $tpl->setRef( 'debug', $out->mDebugtext ); |
392 | 392 | $tpl->set( 'reporttime', $out->reportTime() ); |
393 | 393 | $tpl->set( 'sitenotice', wfGetSiteNotice() ); |
| 394 | + $tpl->set( 'bottomscripts', $this->bottomScripts() ); |
394 | 395 | |
395 | 396 | $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n"; |
396 | 397 | $out->mBodytext .= $printfooter ; |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -255,6 +255,8 @@ |
256 | 256 | |
257 | 257 | $out->out( $this->afterContent() ); |
258 | 258 | |
| 259 | + $out->out( $this->bottomScripts() ); |
| 260 | + |
259 | 261 | $out->out( $out->reportTime() ); |
260 | 262 | |
261 | 263 | $out->out( "\n</body></html>" ); |
— | — | @@ -620,14 +622,23 @@ |
621 | 623 | } |
622 | 624 | |
623 | 625 | /** |
624 | | - * This gets called immediately before the \</body\> tag. |
625 | | - * @return String HTML to be put after \</body\> ??? |
| 626 | + * This gets called shortly before the \</body\> tag. |
| 627 | + * @return String HTML to be put before \</body\> |
626 | 628 | */ |
627 | 629 | function afterContent() { |
628 | 630 | $printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n"; |
629 | 631 | return $printfooter . $this->doAfterContent(); |
630 | 632 | } |
631 | 633 | |
| 634 | + /** |
| 635 | + * This gets called shortly before the \</body\> tag. |
| 636 | + * @return String HTML-wrapped JS code to be put before \</body\> |
| 637 | + */ |
| 638 | + function bottomScripts() { |
| 639 | + global $wgJsMimeType; |
| 640 | + return "\n\t\t<script type=\"$wgJsMimeType\">if (window.runOnloadHook) runOnloadHook();</script>\n"; |
| 641 | + } |
| 642 | + |
632 | 643 | /** @return string Retrievied from HTML text */ |
633 | 644 | function printSource() { |
634 | 645 | global $wgTitle; |
Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -265,7 +265,8 @@ |
266 | 266 | ?> |
267 | 267 | </ul> |
268 | 268 | </div> |
269 | | - <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script> |
| 269 | + |
| 270 | + <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> |
270 | 271 | </div> |
271 | 272 | <?php $this->html('reporttime') ?> |
272 | 273 | |
Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -49,6 +49,8 @@ |
50 | 50 | attachEvent("on" + hookName, hookFunct); |
51 | 51 | } |
52 | 52 | |
| 53 | +//note: all skins shoud call runOnloadHook() at the end of html output, |
| 54 | +// so the below should be redundant. It's there just in case. |
53 | 55 | hookEvent("load", runOnloadHook); |
54 | 56 | |
55 | 57 | // document.write special stylesheet links |