From: Daniel Kinzler Date: Sat, 29 Jul 2006 22:34:22 +0000 (+0000) Subject: call JS onload hooks at the end of the html body in all skins X-Git-Tag: 1.31.0-rc.0~56126 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=3887dc7a82ea065d0d2abac3f4238abb259b4749;p=lhc%2Fweb%2Fwiklou.git call JS onload hooks at the end of the html body in all skins --- diff --git a/includes/Skin.php b/includes/Skin.php index d8dbc16ac0..a99ff0ab8d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -255,6 +255,8 @@ class Skin extends Linker { $out->out( $this->afterContent() ); + $out->out( $this->bottomScripts() ); + $out->out( $out->reportTime() ); $out->out( "\n" ); @@ -620,14 +622,23 @@ END; } /** - * This gets called immediately before the \ tag. - * @return String HTML to be put after \ ??? + * This gets called shortly before the \ tag. + * @return String HTML to be put before \ */ function afterContent() { $printfooter = "
\n" . $this->printFooter() . "
\n"; return $printfooter . $this->doAfterContent(); } + /** + * This gets called shortly before the \ tag. + * @return String HTML-wrapped JS code to be put before \ + */ + function bottomScripts() { + global $wgJsMimeType; + return "\n\t\t\n"; + } + /** @return string Retrievied from HTML text */ function printSource() { global $wgTitle; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ddbc40b3f7..64d75cdd43 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -390,6 +390,7 @@ class SkinTemplate extends Skin { $tpl->setRef( 'debug', $out->mDebugtext ); $tpl->set( 'reporttime', $out->reportTime() ); $tpl->set( 'sitenotice', wfGetSiteNotice() ); + $tpl->set( 'bottomscripts', $this->bottomScripts() ); $printfooter = "
\n" . $this->printSource() . "
\n"; $out->mBodytext .= $printfooter ; diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 9532eabede..81e923682f 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -265,7 +265,8 @@ class MonoBookTemplate extends QuickTemplate { ?> - + + html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> html('reporttime') ?> diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index d95c4dcc6f..0cfb6002a7 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -49,6 +49,8 @@ function hookEvent(hookName, hookFunct) { 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