Index: skins/Standard.php =================================================================== --- skins/Standard.php (revision 16128) +++ skins/Standard.php (working copy) @@ -21,9 +21,21 @@ * */ function getHeadScripts() { - global $wgStylePath, $wgJsMimeType; + global $wgStylePath, $wgJsMimeType, $wgUseSiteJs; $s = parent::getHeadScripts(); + + // allow inclusion of MediaWiki:Standard.js, adapted from SkinTemplate::outputPage + if ($wgUseSiteJs) { + global $wgUser; + if($wgUser->isLoggedIn()) { + $sitejs = $this->makeUrl('-','action=raw&smaxage=0&gen=js'); + } else { + $sitejs = $this->makeUrl('-','action=raw&gen=js'); + } + $s .= "\n"; + } + if ( 3 == $this->qbSetting() ) { # Floating left $s .= "\n"; @@ -73,6 +85,30 @@ } /** + * Adapted from SkinTemplate::getUserJs. Too bad SkinStandard doesn't extend SkinTemplate. + * @see RawPage + */ + function getUserJs() { + $fname = 'SkinStandard::getUserJs'; + wfProfileIn( $fname ); + + global $wgStylePath; + $s = '/* generated javascript */'; + $s .= "var skin = 'standard';\nvar stylepath = '{$wgStylePath}';"; + $s .= "/* MediaWiki:Standard */\n"; + + // avoid inclusion of non defined user JavaScript (with custom skins only) + $msgKey = 'Standard.js'; + $userJS = wfMsg($msgKey); + if (!wfEmptyMsg($msgKey, $userJS)) { + $s .= $userJS; + } + + wfProfileOut( $fname ); + return $s; + } + + /** * */ function getBodyOptions() {