$out->out( $this->afterContent() );
+ $out->out( $this->bottomScripts() );
+
$out->out( $out->reportTime() );
$out->out( "\n</body></html>" );
}
/**
- * This gets called immediately before the \</body\> tag.
- * @return String HTML to be put after \</body\> ???
+ * This gets called shortly before the \</body\> tag.
+ * @return String HTML to be put before \</body\>
*/
function afterContent() {
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
return $printfooter . $this->doAfterContent();
}
+ /**
+ * This gets called shortly before the \</body\> tag.
+ * @return String HTML-wrapped JS code to be put before \</body\>
+ */
+ function bottomScripts() {
+ global $wgJsMimeType;
+ return "\n\t\t<script type=\"$wgJsMimeType\">if (window.runOnloadHook) runOnloadHook();</script>\n";
+ }
+
/** @return string Retrievied from HTML text */
function printSource() {
global $wgTitle;
$tpl->setRef( 'debug', $out->mDebugtext );
$tpl->set( 'reporttime', $out->reportTime() );
$tpl->set( 'sitenotice', wfGetSiteNotice() );
+ $tpl->set( 'bottomscripts', $this->bottomScripts() );
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
$out->mBodytext .= $printfooter ;
?>
</ul>
</div>
- <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
+
+ <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
</div>
<?php $this->html('reporttime') ?>
attachEvent("on" + hookName, hookFunct);
}
+//note: all skins shoud call runOnloadHook() at the end of html output,
+// so the below should be redundant. It's there just in case.
hookEvent("load", runOnloadHook);
// document.write special stylesheet links