wiki.techinc.nl/includes/SkinStandard.php
Gabriel Wicke f719dca05f Reworked css include/pref/tooltip/accesskey subsystem
* accesskeys and tooltips moved to js, needs to be customized/localized at MediaWiki:Monobook.js. Saves many calls to wfMsg, reduces page size, shows access key prefix depending on browser/os. Easy to customize by changing the ta array.
* skinphptal underline and justification wired up to produce generated css
* MediaWiki:Skin.css used for anons as well
* addcss call removed from header
* separate js var file included that holds things like the stylepath and the tooltip/accesskey array
* rtl css included from generated css
2004-06-09 13:04:52 +00:00

65 lines
1.4 KiB
PHP

<?php
# See skin.doc
class SkinStandard extends Skin {
function getHeadScripts()
{
global $wgStylePath;
$s = parent::getHeadScripts();
if ( 3 == $this->qbSetting() ) { # Floating left
$s .= "<script language='javascript' type='text/javascript' " .
"src='{$wgStylePath}/sticky.js'></script>\n";
}
return $s;
}
function getUserStyles()
{
global $wgStylePath;
$s = '';
if ( 3 == $this->qbSetting() ) { # Floating left
$s .= "<style type='text/css'>\n" .
"@import '{$wgStylePath}/quickbar.css';\n</style>\n";
}
$s .= parent::getUserStyles();
return $s;
}
function doGetUserStyles()
{
global $wgUser, $wgOut, $wgStylePath;
$s = parent::doGetUserStyles();
$qb = $this->qbSetting();
if ( 2 == $qb ) { # Right
$s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
"border-left: 2px solid #000000; }\n" .
"#article { margin-left: 4px; margin-right: 152px; }\n";
} else if ( 1 == $qb || 3 == $qb ) {
$s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
"border-right: 1px solid gray; }\n" .
"#article { margin-left: 152px; margin-right: 4px; }\n";
}
return $s;
}
function getBodyOptions()
{
$a = parent::getBodyOptions();
if ( 3 == $this->qbSetting() ) { # Floating left
$qb = "setup(\"quickbar\")";
if($a["onload"]) {
$a["onload"] .= ";$qb";
} else {
$a["onload"] = $qb;
}
}
return $a;
}
}
?>