* 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
$this->mTitle->getNamespace() == Namespace::getUser() &&
preg_match('/\\/[\\w]+\\.(css|js)$/', $this->mTitle->getDBkey())
) {
- $wgOut->addWikiText( wfMsg('usercssjs'));
+ $wgOut->addWikiText( wfMsg('clearyourcache'));
$wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
} else if ( $pcache ) {
$wgOut->addWikiText( $text, true, $this );
class RawPage {
function RawPage( $article ) {
- global $wgRequest, $wgInputEncoding;
+ global $wgRequest, $wgInputEncoding, $wgSquidMaxage;
$allowedCTypes = array('text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit');
$this->mArticle =& $article;
$this->mTitle =& $article->mTitle;
+
$ctype = $wgRequest->getText( 'ctype' );
+ $charset = $wgRequest->getText( 'charset' );
+ $smaxage = $wgRequest->getText( 'smaxage' );
+ $maxage = $wgRequest->getText( 'maxage' );
+ $this->mOldId = $wgRequest->getInt( 'oldid' );
+ # special case for 'generated' raw things: user css/js
+ $gen = $wgRequest->getText( 'gen' );
+ if($gen == 'css') {
+ $this->mGen = $gen;
+ if($smaxage == '') $smaxage = $wgSquidMaxage;
+ if(empty($ctype)) $ctype = 'text/css';
+ } else if ($gen == 'js') {
+ $this->mGen = $gen;
+ if($smaxage == '') $smaxage = $wgSquidMaxage;
+ if(empty($ctype)) $ctype = 'text/javascript';
+ } else {
+ $this->mGen = false;
+ }
+ $this->mCharset = !empty($charset) ? $charset : $wgInputEncoding;
+ $this->mSmaxage = ($smaxage != '') ? $smaxage : 0;
+ $this->mMaxage = ($maxage != '') ? $maxage : 86400;
if(empty($ctype) or !in_array($ctype, $allowedCTypes)) {
$this->mContentType = 'text/x-wiki';
} else {
$this->mContentType = $ctype;
}
-
- $charset = $wgRequest->getText( 'charset' );
- $this->mCharset = !empty($charset) ? $charset : $wgInputEncoding;
- $smaxage = $wgRequest->getText( 'smaxage' );
- $this->mSmaxage = !empty($smaxage) ? $smaxage : 0;
- $this->mOldId = $wgRequest->getInt( 'oldid' );
}
function view() {
+ global $wgUser, $wgOut;
header( "Content-type: ".$this->mContentType.'; charset='.$this->mCharset );
# allow the client to cache this for 24 hours
- header( 'Cache-Control: s-maxage='.$this->mSmaxage.', max-age=86400' );
- echo $this->getrawtext();
+ header( 'Cache-Control: s-maxage='.$this->mSmaxage.', max-age='.$this->mMaxage );
+ if($this->mGen) {
+ $sk = $wgUser->getSkin();
+ $sk->initPage($wgOut);
+ if($this->mGen == 'css') {
+ echo $sk->getUserStylesheet();
+ } else if($this->mGen == 'js') {
+ echo $sk->getUserJs();
+ }
+ } else {
+ echo $this->getrawtext();
+ }
wfAbruptExit();
}
{
return 'wikistandard.css';
}
+ function getSkinName() {
+ return "standard";
+ }
function qbSetting()
{
}
function getHeadScripts() {
- global $wgStylePath;
+ global $wgStylePath, $wgUser, $wgLang;
$r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/wikibits.js\"></script>\n";
+ if( $wgUser->getID() != 0 ) { # logged in
+ $userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
+ $userjs = htmlspecialchars($this->makeUrl($userpage.'/'.$this->getSkinName().'.js', 'action=raw&ctype=text/javascript'));
+ $r .= '<script type="text/javascript" src="'.$userjs."\"></script>\n";
+ }
return $r;
}
+ # get the user/site-specific stylesheet, SkinPHPTal called from RawPage.php (settings are cached that way)
+ function getUserStylesheet() {
+ global $wgOut, $wgStylePath, $wgLang, $wgUser, $wgRequest, $wgTitle;
+ $sheet = $this->getStylesheet();
+ $action = $wgRequest->getText('action');
+ $s = "@import url(\"$wgStylePath/$sheet\");\n";
+ if($wgLang->isRTL()) $s .= "@import url(\"$wgStylePath/common_rtl.css\");\n";
+ if( $wgUser->getID() != 0 ) { # logged in
+ if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
+ $s .= '@import url('.$this->makeUrl('-','action=raw&gen=css&smaxage=0&maxage=0').');'."\n";
+ $s .= $wgRequest->getText('wpTextbox1');
+ } else {
+ $s .= '@import url('.$this->makeUrl('-','action=raw&gen=css&smaxage=0&maxage=0').');'."\n";
+ $userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
+ $s.= '@import url("'.$this->makeUrl($userpage.'/'.$this->getSkinName(), 'action=raw&ctype=text/css').'");'."\n";
+ }
+ }
+ $s .= $this->doGetUserStyles();
+ return $s."\n";
+ }
+ # placeholder, returns generated js in monobook
+ function getUserJs() {
+ return;
+ }
+
function getUserStyles()
{
global $wgOut, $wgStylePath, $wgLang;
- $sheet = $this->getStylesheet();
$s = "<style type='text/css'>\n";
$s .= "/*/*/\n"; # <-- Hide the styles from Netscape 4 without hiding them from IE/Mac
- $s .= "@import url(\"$wgStylePath/$sheet\");\n";
- if($wgLang->isRTL()) $s .= "@import url(\"$wgStylePath/common_rtl.css\");\n";
- $s .= $this->doGetUserStyles();
+ $s .= $this->getUserStylesheet();
$s .= "/* */\n";
$s .= "</style>\n";
return $s;
{
return "cologneblue.css";
}
+ function getSkinName() {
+ return "cologneblue";
+ }
function doBeforeContent()
{
function doGetUserStyles()
{
global $wgUser, $wgOut, $wgStyleSheetPath;
-
- $s = parent::doGetUserStyles();
+ $s = '';
$qb = $this->qbSetting();
if ( 2 == $qb ) { # Right
"#article { margin-left:148px; margin-right: 4px; } \n" .
"body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
}
+ $s .= parent::doGetUserStyles();
return $s;
}
function sysLinks()
{
return "nostalgia.css";
}
+ function getSkinName() {
+ return "nostalgia";
+ }
function doBeforeContent()
{
$this->userpageUrlDetails = $this->makeUrlDetails($this->userpage);
$this->usercss = $this->userjs = $this->userjsprev = false;
- if( $this->loggedin ) { $this->setupUserCssJs(); }
+ $this->setupUserCssJs();
$this->titletxt = $wgTitle->getPrefixedText();
$tpl->setRef( "usercss", &$this->usercss);
$tpl->setRef( "userjs", &$this->userjs);
$tpl->setRef( "userjsprev", &$this->userjsprev);
+ if($this->loggedin) {
+ $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js&smaxage=0') );
+ } else {
+ $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js') );
+ }
if( $wgUser->getNewtalk() ) {
$usertitle = Title::newFromText( $this->userpage );
$usertalktitle = $usertitle->getTalkPage();
$personal_urls['userpage'] = array(
'text' => $this->username,
'href' => &$this->userpageUrlDetails['href'],
- 'class' => $this->userpageUrlDetails['exists']?false:'new',
- 'ttip' => wfMsg('tooltip-userpage'),
- 'akey' => wfMsg('accesskey-userpage')
+ 'class' => $this->userpageUrlDetails['exists']?false:'new'
);
$usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
$personal_urls['mytalk'] = array(
'text' => wfMsg('mytalk'),
'href' => &$usertalkUrlDetails['href'],
- 'class' => $usertalkUrlDetails['exists']?false:'new',
- 'ttip' => wfMsg('tooltip-mytalk'),
- 'akey' => wfMsg('accesskey-mytalk')
+ 'class' => $usertalkUrlDetails['exists']?false:'new'
);
$personal_urls['preferences'] = array(
'text' => wfMsg('preferences'),
- 'href' => $this->makeSpecialUrl('Preferences'),
- 'ttip' => wfMsg('tooltip-preferences'),
- 'akey' => wfMsg('accesskey-preferences')
+ 'href' => $this->makeSpecialUrl('Preferences')
);
$personal_urls['watchlist'] = array(
'text' => wfMsg('watchlist'),
- 'href' => $this->makeSpecialUrl('Watchlist'),
- 'ttip' => wfMsg('tooltip-watchlist'),
- 'akey' => wfMsg('accesskey-watchlist')
+ 'href' => $this->makeSpecialUrl('Watchlist')
);
$personal_urls['mycontris'] = array(
'text' => wfMsg('mycontris'),
- 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username ) ),
- 'ttip' => wfMsg('tooltip-mycontris'),
- 'akey' => wfMsg('accesskey-mycontris')
+ 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username ) )
);
$personal_urls['logout'] = array(
'text' => wfMsg('userlogout'),
- 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl ),
- 'ttip' => wfMsg('tooltip-logout'),
- 'akey' => wfMsg('accesskey-logout')
+ 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl )
);
} else {
if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
$personal_urls['anonuserpage'] = array(
'text' => $this->username,
'href' => &$this->userpageUrlDetails['href'],
- 'class' => $this->userpageUrlDetails['exists']?false:'new',
- 'ttip' => wfMsg('tooltip-anonuserpage'),
- 'akey' => wfMsg('accesskey-anonuserpage')
+ 'class' => $this->userpageUrlDetails['exists']?false:'new'
);
$usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
$personal_urls['anontalk'] = array(
'text' => wfMsg('anontalk'),
'href' => &$usertalkUrlDetails['href'],
- 'class' => $usertalkUrlDetails['exists']?false:'new',
- 'ttip' => wfMsg('tooltip-anontalk'),
- 'akey' => wfMsg('accesskey-anontalk')
+ 'class' => $usertalkUrlDetails['exists']?false:'new'
);
$personal_urls['anonlogin'] = array(
'text' => wfMsg('userlogin'),
- 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
- 'ttip' => wfMsg('tooltip-login'),
- 'akey' => wfMsg('accesskey-login')
+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
);
} else {
$personal_urls['login'] = array(
'text' => wfMsg('userlogin'),
- 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
- 'ttip' => wfMsg('tooltip-login'),
- 'akey' => wfMsg('accesskey-login')
+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
);
}
}
if( $this->iscontent ) {
- $content_actions['article'] = array('class' => (!Namespace::isTalk( $wgTitle->getNamespace())) ? 'selected' : false,
- 'text' => $this->getNameSpaceWord(),
- 'href' => $this->makeArticleUrl($this->thispage),
- 'ttip' => wfMsg('tooltip-article'),
- 'akey' => wfMsg('accesskey-article'));
+ $nskey = $this->getNameSpaceKey();
+ $content_actions[$nskey] = array('class' => (!Namespace::isTalk( $wgTitle->getNamespace())) ? 'selected' : false,
+ 'text' => wfMsg($nskey),
+ 'href' => $this->makeArticleUrl($this->thispage));
/* set up the classes for the talk link */
$talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : false);
$content_actions['talk'] = array(
'class' => $talk_class,
'text' => wfMsg('talk'),
- 'href' => $this->makeTalkUrl($this->titletxt),
- 'ttip' => wfMsg('tooltip-talk'),
- 'akey' => wfMsg('accesskey-talk')
+ 'href' => $this->makeTalkUrl($this->titletxt)
);
} else {
$content_actions['talk'] = array(
'class' => $talk_class?$talk_class.' new':'new',
'text' => wfMsg('talk'),
- 'href' => $this->makeTalkUrl($this->titletxt,'action=edit'),
- 'ttip' => wfMsg('tooltip-talk'),
- 'akey' => wfMsg('accesskey-talk')
+ 'href' => $this->makeTalkUrl($this->titletxt,'action=edit')
);
}
$content_actions['edit'] = array(
'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass,
'text' => wfMsg('edit'),
- 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid),
- 'ttip' => wfMsg('tooltip-edit'),
- 'akey' => wfMsg('accesskey-edit')
+ 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid)
);
if ( $istalk ) {
$content_actions['addsection'] = array(
'class' => $section == 'new'?'selected':false,
'text' => wfMsg('addsection'),
- 'href' => $this->makeUrl($this->thispage, 'action=edit§ion=new'),
- 'ttip' => wfMsg('tooltip-addsection'),
- 'akey' => wfMsg('accesskey-addsection')
+ 'href' => $this->makeUrl($this->thispage, 'action=edit§ion=new')
);
}
} else {
$oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : '';
- $content_actions['edit'] = array('class' => ($action == 'edit') ? 'selected' : false,
+ $content_actions['viewsource'] = array('class' => ($action == 'edit') ? 'selected' : false,
'text' => wfMsg('viewsource'),
- 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid),
- 'ttip' => wfMsg('tooltip-viewsource'),
- 'akey' => wfMsg('accesskey-viewsource'));
+ 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid));
}
if ( $wgTitle->getArticleId() ) {
$content_actions['history'] = array('class' => ($action == 'history') ? 'selected' : false,
'text' => wfMsg('history_short'),
- 'href' => $this->makeUrl($this->thispage, 'action=history'),
- 'ttip' => wfMsg('tooltip-history'),
- 'akey' => wfMsg('accesskey-history'));
+ 'href' => $this->makeUrl($this->thispage, 'action=history'));
# XXX: is there a rollback action anywhere or is it planned?
# Don't recall where i got this from...
$content_actions['protect'] = array(
'class' => ($action == 'protect') ? 'selected' : false,
'text' => wfMsg('protect'),
- 'href' => $this->makeUrl($this->thispage, 'action=protect'),
- 'ttip' => wfMsg('tooltip-protect'),
- 'akey' => wfMsg('accesskey-protect')
+ 'href' => $this->makeUrl($this->thispage, 'action=protect')
);
} else {
$content_actions['unprotect'] = array(
'class' => ($action == 'unprotect') ? 'selected' : false,
'text' => wfMsg('unprotect'),
- 'href' => $this->makeUrl($this->thispage, 'action=unprotect'),
- 'ttip' => wfMsg('tooltip-protect'),
- 'akey' => wfMsg('accesskey-protect')
+ 'href' => $this->makeUrl($this->thispage, 'action=unprotect')
);
}
$content_actions['delete'] = array(
'class' => ($action == 'delete') ? 'selected' : false,
'text' => wfMsg('delete'),
- 'href' => $this->makeUrl($this->thispage, 'action=delete'),
- 'ttip' => wfMsg('tooltip-delete'),
- 'akey' => wfMsg('accesskey-delete')
+ 'href' => $this->makeUrl($this->thispage, 'action=delete')
);
}
if ( $wgUser->getID() != 0 ) {
if ( $wgTitle->userCanEdit()) {
$content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace == Namespace::getSpecial()) ? 'selected' : false,
'text' => wfMsg('move'),
- 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage )),
- 'ttip' => wfMsg('tooltip-move'),
- 'akey' => wfMsg('accesskey-move'));
+ 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage ))
+ );
} else {
$content_actions['move'] = array('class' => 'inactive',
'text' => wfMsg('move'),
- 'href' => false,
- 'ttip' => wfMsg('tooltip-nomove'),
- 'akey' => false);
+ 'href' => false);
}
}
$content_actions['delete'] = array(
'class' => false,
'text' => wfMsg( "undelete_short", $n ),
- 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage),
- 'ttip' => wfMsg('tooltip-undelete', $n),
- 'akey' => wfMsg('accesskey-undelete')
+ 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage)
);
}
}
if( !$wgTitle->userIsWatching()) {
$content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
'text' => wfMsg('watch'),
- 'href' => $this->makeUrl($this->thispage, 'action=watch'),
- 'ttip' => wfMsg('tooltip-watch'),
- 'akey' => wfMsg('accesskey-watch'));
+ 'href' => $this->makeUrl($this->thispage, 'action=watch'));
} else {
$content_actions['watch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
'text' => wfMsg('unwatch'),
- 'href' => $this->makeUrl($this->thispage, 'action=unwatch'),
- 'ttip' => wfMsg('tooltip-unwatch'),
- 'akey' => wfMsg('accesskey-unwatch'));
-
+ 'href' => $this->makeUrl($this->thispage, 'action=unwatch'));
}
}
} else {
$content_actions['article'] = array('class' => 'selected',
'text' => wfMsg('specialpage'),
- 'href' => false,
- 'ttip' => wfMsg('tooltip-specialpage'),
- 'akey' => false);
+ 'href' => false);
}
return $content_actions;
return $nav_urls;
}
- function getNameSpaceWord () {
+ function getNameSpaceKey () {
global $wgTitle;
switch ($wgTitle->getNamespace()) {
case NS_MAIN:
case NS_TALK:
- return wfMsg('nstab-main');
+ return 'nstab-main';
case NS_USER:
case NS_USER_TALK:
- return wfMsg('nstab-user');
+ return 'nstab-user';
case NS_MEDIA:
- return wfMsg('nstab-media');
+ return 'nstab-media';
case NS_SPECIAL:
- return wfMsg('nstab-special');
+ return 'nstab-special';
case NS_WP:
case NS_WP_TALK:
- return wfMsg('nstab-wp');
+ return 'nstab-wp';
case NS_IMAGE:
case NS_IMAGE_TALK:
- return wfMsg('nstab-image');
+ return 'nstab-image';
case NS_MEDIAWIKI:
case NS_MEDIAWIKI_TALK:
- return wfMsg('nstab-mediawiki');
+ return 'nstab-mediawiki';
case NS_TEMPLATE:
case NS_TEMPLATE_TALK:
- return wfMsg('nstab-template');
+ return 'nstab-template';
case NS_HELP:
case NS_HELP_TALK:
- return wfMsg('nstab-help');
+ return 'nstab-help';
case NS_CATEGORY:
case NS_CATEGORY_TALK:
- return wfMsg('nstab-category');
+ return 'nstab-category';
default:
- return wfMsg('nstab-main');
+ return 'nstab-main';
}
}
/* private */ function setupUserCssJs () {
- global $wgRequest, $wgTitle, $wgSquidMaxage;
+ global $wgRequest, $wgTitle;
$action = $wgRequest->getText('action');
- # global site css from MediaWiki NS
- $this->usercss = '@import url('.
- $this->makeNSUrl(ucfirst($this->skinname).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI).');'."\n";
+ # generated css
+ $this->usercss = '@import url('.$this->makeUrl('-','action=raw&gen=css').');'."\n";
- if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
- // css preview
- $this->usercss .= $wgRequest->getText('wpTextbox1');
- } else {
- $this->usercss .= '@import url('.
- $this->makeUrl($this->userpage.'/'.$this->skinname.'.css', 'action=raw&ctype=text/css').');';
+ if( $this->loggedin ) {
+ if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
+ # generated css
+ $this->usercss = '@import url('.$this->makeUrl('-','action=raw&gen=css&smaxage=0&maxage=0').');'."\n";
+ // css preview
+ $this->usercss .= $wgRequest->getText('wpTextbox1');
+ } else {
+ # generated css
+ $this->usercss .= '@import url('.$this->makeUrl('-','action=raw&gen=css&smaxage=0').');'."\n";
+ # import user stylesheet
+ $this->usercss .= '@import url('.
+ $this->makeUrl($this->userpage.'/'.$this->skinname.'.css', 'action=raw&ctype=text/css').');'."\n";
+ }
+ if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
+ # XXX: additional security check/prompt?
+ $this->userjsprev = $wgRequest->getText('wpTextbox1');
+ } else {
+ $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript');
+ }
}
- if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
- # XXX: additional security check/prompt?
- $this->userjsprev = $wgRequest->getText('wpTextbox1');
- } else {
- $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript');
+ }
+ # returns css with user-specific options
+ function getUserStylesheet() {
+ global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
+ $action = $wgRequest->getText('action');
+ $maxage = $wgRequest->getText('maxage');
+ $s = "/* generated user stylesheet */\n";
+ if($wgLang->isRTL()) $s .= '@import url('.$wgStylePath.'/'.$this->skinname.'/rtl.css);'."\n";
+ $s .= '@import url('.
+ $this->makeNSUrl(ucfirst($this->skinname).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI).');'."\n";
+ if($wgUser->getID() != 0) {
+ if ( 1 == $wgUser->getOption( "underline" ) ) {
+ $s .= "a { text-decoration: underline; }\n";
+ } else {
+ $s .= "a { text-decoration: none; }\n";
+ }
+ }
+ if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
+ $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
+ }
+ if ( 1 == $wgUser->getOption( "justify" ) ) {
+ $s .= "#bodyContent { text-align: justify; }\n";
}
+ return $s;
}
+ function getUserJs() {
+ global $wgUser, $wgStylePath;
+ $s = "/* generated javascript */";
+ $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
+ $s .= '/* MediaWiki:'.ucfirst($this->skinname)." */\n";
+ $s .= wfMsg(ucfirst($this->skinname).'.js');
+ return $s;
+ }
+
}
class SkinDaVinci extends SkinPHPTal {
function getUserStyles()
{
global $wgStylePath;
-
- $s = parent::getUserStyles();
+ $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;
}
$uid = $wgUser->getID();
$wgOut->addWikiText( wfMsg( "prefslogintext", $uname, $uid ) );
+ $wgOut->addWikiText( wfMsg('clearyourcache'));
$qbs = $wgLang->getQuickbarSettings();
$skinNames = $wgLang->getSkinNames();
$wgOut->addHTML( "<div><label><input type='radio' name=\"wpQuickbar\"
value=\"$i\"$checked /> {$qbs[$i]}</label></div>\n" );
}
+ $wgOut->addHtml('<div class="prefsectiontip">'.wfMsg('qbsettingsnote').'</div>');
$wgOut->addHtml( "</fieldset>\n\n" );
# Skin setting
'talkpagetext' => '<!-- MediaWiki:talkpagetext -->',
'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' ",
'noarticletext' => '(There is currently no text in this page)',
-'usercssjs' => "'''Note:''' After saving, you have to tell your bowser to get the new version: '''Mozilla:''' click ''reload''(or ''ctrl-r''), '''IE / Opera:''' ''ctrl-f5'', '''Safari:''' ''cmd-r'', '''Konqueror''' ''ctrl-r''.",
+'clearyourcache' => "'''Note:''' After saving, you have to clear your browser cache to see the changes: '''Mozilla:''' click ''reload''(or ''ctrl-r''), '''IE / Opera:''' ''ctrl-f5'', '''Safari:''' ''cmd-r'', '''Konqueror''' ''ctrl-r''.",
'usercssjsyoucanpreview' => "<strong>Tip:</strong> Use the 'Show preview' button to test your new css/js before saving.",
'usercsspreview' => "'''Remember that you are only previewing your user css, it has not yet been saved!'''",
'userjspreview' => "'''Remember that you are only testing/previewing your user javascript, it has not yet been saved!'''",
See [[{{ns:4}}:User preferences help]] for help deciphering the options.",
'prefsreset' => 'Preferences have been reset from storage.',
'qbsettings' => 'Quickbar settings',
+'qbsettingsnote' => 'This preference only works in the \'Standard\' and the \'CologneBlue\' skin.',
'changepassword' => 'Change password',
'skin' => 'Skin',
'math' => 'Rendering math',
'importhistoryconflict' => 'Conflicting history revision exists (may have imported this page before)',
# Keyboard access keys for power users
-'accesskey-article' => 'a',
-'accesskey-talk' => 't',
-'accesskey-edit' => 'e',
-'accesskey-addsection' => '+',
-'accesskey-viewsource' => 'e',
-'accesskey-history' => 'h',
-'accesskey-protect' => '=',
-'accesskey-delete' => 'd',
-'accesskey-undelete' => 'd',
-'accesskey-move' => 'm',
-'accesskey-watch' => 'w',
-'accesskey-unwatch' => 'w',
-'accesskey-watchlist' => 'l',
-'accesskey-userpage' => '.',
-'accesskey-anonuserpage' => '.',
-'accesskey-mytalk' => 'n',
-'accesskey-anontalk' => 'n',
-'accesskey-preferences' => '',
-'accesskey-mycontris' => 'y',
-'accesskey-login' => 'o',
-'accesskey-logout' => 'o',
-'accesskey-search' => 'f',
-'accesskey-mainpage' => 'z',
-'accesskey-portal' => '',
-'accesskey-randompage' => 'x',
-'accesskey-currentevents' => '',
-'accesskey-sitesupport' => '',
-'accesskey-help' => '',
-'accesskey-recentchanges' => 'r',
-'accesskey-recentchangeslinked' => 'c',
-'accesskey-whatlinkshere' => 'b',
-'accesskey-specialpages' => 'q',
-'accesskey-specialpage' => '',
-'accesskey-upload' => 'u',
'accesskey-minoredit' => 'i',
'accesskey-save' => 's',
'accesskey-preview' => 'p',
-'accesskey-contributions' => '',
-'accesskey-emailuser' => '',
'accesskey-compareselectedversions' => 'v',
-# tooltip help for the main actions
-'tooltip-atom' => 'Atom feed for this page',
-'tooltip-article' => 'View the content page [alt-a]',
-'tooltip-talk' => 'Discussion about the content page [alt-t]',
-'tooltip-edit' => 'You can edit this page. Please use the preview button before saving. [alt-e]',
-'tooltip-addsection' => 'Add a comment to this page. [alt-+]',
-'tooltip-viewsource' => 'This page is protected. You can view its source. [alt-e]',
-'tooltip-history' => 'Past versions of this page, [alt-h]',
-'tooltip-protect' => 'Protect this page [alt-=]',
-'tooltip-delete' => 'Delete this page [alt-d]',
-'tooltip-undelete' => "Restore the $1 edits done to this page before it was deleted [alt-d]",
-'tooltip-move' => 'Move this page [alt-m]',
-'tooltip-nomove' => 'You don\'t have the permissions to move this page',
-'tooltip-watch' => 'Add this page to your watchlist [alt-w]',
-'tooltip-unwatch' => 'Remove this page from your watchlist [alt-w]',
-'tooltip-watchlist' => 'The list of pages you\'re monitoring for changes. [alt-l]',
-'tooltip-userpage' => 'My user page [alt-.]',
-'tooltip-anonuserpage' => 'The user page for the ip you\'re editing as [alt-.]',
-'tooltip-mytalk' => 'My talk page [alt-n]',
-'tooltip-anontalk' => 'Discussion about edits from this ip address [alt-n]',
-'tooltip-preferences' => 'My preferences',
-'tooltip-mycontris' => 'List of my contributions [alt-y]',
-'tooltip-login' => 'You are encouraged to log in, it is not mandatory however. [alt-o]',
-'tooltip-logout' => 'Log out [alt-o]',
-'tooltip-search' => 'Search this wiki [alt-f]',
-'tooltip-mainpage' => 'Visit the Main Page [alt-z]',
-'tooltip-portal' => 'About the project, what you can do, where to find things',
-'tooltip-randompage' => 'Load a random page [alt-x]',
-'tooltip-currentevents' => 'Find background information on current events',
-'tooltip-sitesupport' => 'Support {{SITENAME}}',
-'tooltip-help' => 'The place to find out.',
-'tooltip-recentchanges' => 'The list of recent changes in the wiki. [alt-r]',
-'tooltip-recentchangeslinked' => 'Recent changes in pages linking to this page [alt-c]',
-'tooltip-whatlinkshere' => 'List of all wiki pages that link here [alt-b]',
-'tooltip-specialpages' => 'List of all special pages [alt-q]',
-'tooltip-upload' => 'Upload images or media files [alt-u]',
-'tooltip-specialpage' => 'This is a special page, you can\'t edit the page itself.',
+# tooltip help for some actions, most are in Monobook.js
'tooltip-minoredit' => 'Mark this as a minor edit [alt-i]',
'tooltip-save' => 'Save your changes [alt-s]',
'tooltip-preview' => 'Preview your changes, please use this before saving! [alt-p]',
-'tooltip-contributions' => 'View the list of contributions of this user',
-'tooltip-emailuser' => 'Send a mail to this user',
-'tooltip-rss' => 'RSS feed for this page',
'tooltip-compareselectedversions' => 'See the differences between the two selected versions of this page. [alt-v]',
# stylesheets
You might want to check the following regular expression for patterns that are currently blocked:',
'subcategorycount' => "There are $1 subcategories to this category.",
'categoryarticlecount' => "There are $1 articles in this category.",
-'usenewcategorypage' => "1\n\nSet first character to \"0\" to disable the new category page layout."
+'usenewcategorypage' => "1\n\nSet first character to \"0\" to disable the new category page layout.",
+
+# Monobook.js: tooltips and access keys for monobook
+'Monobook.js' => '/* tooltips and access keys */
+ta = new Object();
+ta[\'pt-userpage\'] = new Array(\'.\',\'My user page\');
+ta[\'pt-anonuserpage\'] = new Array(\'.\',\'The user page for the ip you\\\'re editing as\');
+ta[\'pt-mytalk\'] = new Array(\'n\',\'My talk page\');
+ta[\'pt-anontalk\'] = new Array(\'n\',\'Discussion about edits from this ip address\');
+ta[\'pt-preferences\'] = new Array(\'\',\'My preferences\');
+ta[\'pt-watchlist\'] = new Array(\'l\',\'The list of pages you\\\'re monitoring for changes.\');
+ta[\'pt-mycontris\'] = new Array(\'y\',\'List of my contributions\');
+ta[\'pt-login\'] = new Array(\'o\',\'You are encouraged to log in, it is not mandatory however.\');
+ta[\'pt-anonlogin\'] = new Array(\'o\',\'You are encouraged to log in, it is not mandatory however.\');
+ta[\'pt-logout\'] = new Array(\'o\',\'Log out\');
+ta[\'ca-article\'] = new Array(\'a\',\'View the content page\');
+ta[\'ca-talk\'] = new Array(\'t\',\'Discussion about the content page\');
+ta[\'ca-edit\'] = new Array(\'e\',\'You can edit this page. Please use the preview button before saving.\');
+ta[\'ca-addsection\'] = new Array(\'+\',\'Add a comment to this discussion.\');
+ta[\'ca-viewsource\'] = new Array(\'e\',\'This page is protected. You can view its source.\');
+ta[\'ca-history\'] = new Array(\'h\',\'Past versions of this page.\');
+ta[\'ca-protect\'] = new Array(\'=\',\'Protect this page\');
+ta[\'ca-delete\'] = new Array(\'d\',\'Delete this page\');
+ta[\'ca-undelete\'] = new Array(\'d\',\'Restore the edits done to this page before it was deleted\');
+ta[\'ca-move\'] = new Array(\'m\',\'Move this page\');
+ta[\'ca-nomove\'] = new Array(\'\',\'You don\\\'t have the permissions to move this page\');
+ta[\'ca-watch\'] = new Array(\'w\',\'Add this page to your watchlist\');
+ta[\'ca-unwatch\'] = new Array(\'w\',\'Remove this page from your watchlist\');
+ta[\'search\'] = new Array(\'f\',\'Search this wiki\');
+ta[\'p-logo\'] = new Array(\'\',\'Main Page\');
+ta[\'n-mainpage\'] = new Array(\'z\',\'Visit the Main Page\');
+ta[\'n-portal\'] = new Array(\'\',\'About the project, what you can do, where to find things\');
+ta[\'n-currentevents\'] = new Array(\'\',\'Find background information on current events\');
+ta[\'n-recentchanges\'] = new Array(\'r\',\'The list of recent changes in the wiki.\');
+ta[\'n-randompage\'] = new Array(\'x\',\'Load a random page\');
+ta[\'n-help\'] = new Array(\'\',\'The place to find out.\');
+ta[\'n-sitesupport\'] = new Array(\'\',\'Support us\');
+ta[\'t-whatlinkshere\'] = new Array(\'b\',\'List of all wiki pages that link here\');
+ta[\'t-recentchangeslinked\'] = new Array(\'c\',\'Recent changes in pages linking to this page\');
+ta[\'feed-rss\'] = new Array(\'\',\'RSS feed for this page\');
+ta[\'feed-atom\'] = new Array(\'\',\'Atom feed for this page\');
+ta[\'t-contributions\'] = new Array(\'\',\'View the list of contributions of this user\');
+ta[\'t-emailuser\'] = new Array(\'\',\'Send a mail to this user\');
+ta[\'t-upload\'] = new Array(\'u\',\'Upload images or media files\');
+ta[\'t-specialpages\'] = new Array(\'q\',\'List of all special pages\');
+ta[\'ca-nstab-main\'] = new Array(\'a\',\'View the content page\');
+ta[\'ca-nstab-user\'] = new Array(\'a\',\'View the user page\');
+ta[\'ca-nstab-media\'] = new Array(\'a\',\'View the media page\');
+ta[\'ca-nstab-special\'] = new Array(\'\',\'This is a special page, you can\\\'t edit the page itself.\');
+ta[\'ca-nstab-wp\'] = new Array(\'a\',\'View the project page\');
+ta[\'ca-nstab-image\'] = new Array(\'a\',\'View the image page\');
+ta[\'ca-nstab-mediawiki\'] = new Array(\'a\',\'View the system message\');
+ta[\'ca-nstab-template\'] = new Array(\'a\',\'View the template\');
+ta[\'ca-nstab-help\'] = new Array(\'a\',\'View the help page\');
+ta[\'ca-nstab-category\'] = new Array(\'a\',\'View the category page\');
+'
);
}
/* offsets to distinguish the tab groups */
li#ca-talk { margin-right: 1.6em; }
-li#ca-watch { margin-left: 1.6em; }
+li#ca-watch, li#ca-watch { margin-left: 1.6em; }
/*
margin-right: auto;
margin-left: 1.6em;
}
-li#ca-watch {
+li#ca-watch,li#ca-unwatch {
margin-right: 1.6em !important;
}
// Wikipedia JavaScript support functions
-
// if this is true, the toolbar will no longer overwrite the infobox when you move the mouse over individual items
var noOverwrite=false;
var alertText;
histrowinit();
unhidetzbutton();
tabbedprefs();
+ akeytt();
}
if (window.addEventListener) window.addEventListener("load",onloadhook,false);
else if (window.attachEvent) window.attachEvent("onload",onloadhook);
// document.write special stylesheet links
-function addcss ( stylepath ) {
- if (is_opera_preseven) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'Opera6Fixes.css">');
- } else if (is_opera_seven) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'Opera7Fixes.css">');
- } else if (is_khtml) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'KHTMLFixes.css">');
- }
- return;
+if (is_opera_preseven) {
+ document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera6Fixes.css">');
+} else if (is_opera_seven) {
+ document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera7Fixes.css">');
+} else if (is_khtml) {
+ document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/KHTMLFixes.css">');
}
// Un-trap us from framesets
// reposition cursor if possible
if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate();
}
+
+function akeytt() {
+ if(!ta) return;
+ pref = 'alt-';
+ if(is_safari || navigator.userAgent.toLowerCase().indexOf( 'mac' ) + 1 ) pref = 'cmd-';
+ if(is_opera) pref = 'shift-esc-';
+ for(id in ta) {
+ n = document.getElementById(id);
+ if(n){
+ a = n.childNodes[0];
+ if(a){
+ if(ta[id][0].length > 0) {
+ a.accesskey = ta[id][0];
+ ak = ' ['+pref+ta[id][0]+']';
+ } else {
+ ak = '';
+ }
+ a.title = ta[id][1]+ak;
+ }
+ }
+ }
+}
<meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
${headlinks}
<title tal:content="pagetitle">Exciting xhtml slimfast</title>
- <style type="text/css" media="screen">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
- <style type="text/css" media="projection">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="${stylepath}/commonPrint.css" />
<!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${skinname}/IEFixes.css";</style>
<script type="text/javascript" src="${stylepath}/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
+ <script type="text/javascript" tal:attributes="src jsvarurl"></script>
<script type="text/javascript" src="${stylepath}/wikibits.js"></script>
- <script type="text/javascript"> /*<![CDATA[*/ if(addcss){addcss('${stylepath}/${skinname}/');} /*]]>*/</script>
- <style tal:condition="rtl" type="text/css">/*<![CDATA[*/@import "${stylepath}/${skinname}/rtl.css";/*]]>*/</style>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
<script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
<ul>
<li tal:repeat="action content_actions"
tal:attributes="id string:ca-${repeat/action/key}; class action/class|default"><a
- tal:attributes="title action/ttip|default;accesskey action/akey|default;href action/href|default"
+ tal:attributes="href action/href|default"
tal:content="action/text">Linktext</a></li>
</ul>
</div>
<ul>
<li tal:repeat="item personal_urls"
tal:attributes="id string:pt-${repeat/item/key};"><a href="myuserpage"
- tal:attributes="href item/href; accesskey item/akey|default; title item/ttip|default; class item/class|default"
+ tal:attributes="href item/href; class item/class|default"
tal:content="item/text">Log in</a></li>
</ul>
</div>
<h5 i18n:translate="string:navigation">Navigation</h5>
<div class="pBody">
<ul>
- <li><a href="${nav_urls/mainpage/href}"
- i18n:attributes="accesskey string:accesskey-mainpage | default; title string:tooltip-mainpage"
+ <li id="n-mainpage"><a href="${nav_urls/mainpage/href}"
i18n:translate="string:mainpage">Main Page</a></li>
- <li tal:condition="nav_urls/portal/href"><a href="${nav_urls/portal/href}"
- i18n:attributes="accesskey string:accesskey-portal | default; title string:tooltip-portal|default"
+ <li id="n-portal" tal:condition="nav_urls/portal/href"><a href="${nav_urls/portal/href}"
i18n:translate="string:portal">Community Portal</a></li>
- <li tal:condition="nav_urls/currentevents/href"><a href="${nav_urls/currentevents/href}"
- i18n:attributes="title string:tooltip-currentevents|default"
+ <li id="n-currentevents" tal:condition="nav_urls/currentevents/href"><a href="${nav_urls/currentevents/href}"
i18n:translate="string:currentevents">Current Events</a></li>
- <li><a href="${nav_urls/recentchanges/href}"
- i18n:attributes="accesskey string:accesskey-recentchanges|default; title string:tooltip-recentchanges|default"
+ <li id="n-recentchanges"><a href="${nav_urls/recentchanges/href}"
i18n:translate="string:recentchanges">Recent Changes</a></li>
- <li><a href="${nav_urls/randompage/href}"
- i18n:attributes="accesskey string:accesskey-randompage | default; title string:tooltip-randompage"
+ <li id="n-randompage"><a href="${nav_urls/randompage/href}"
i18n:translate="string:randompage">Random Page</a></li>
- <li><a href="${nav_urls/help/href}"
- i18n:attributes="title string:tooltip-help|default"
+ <li id="n-help"><a href="${nav_urls/help/href}"
i18n:translate="string:help">Help</a></li>
- <li tal:condition="nav_urls/sitesupport/href"><a href="${nav_urls/sitesupport/href}"
- i18n:attributes="title string:tooltip-sitesupport|default"
+ <li id="n-sitesupport" tal:condition="nav_urls/sitesupport/href"><a href="${nav_urls/sitesupport/href}"
i18n:translate="string:sitesupport">Donations</a></li>
</ul>
</div>
<h5 i18n:translate="string:toolbox">Toolbox</h5>
<div class="pBody">
<ul>
- <li><a href="${nav_urls/whatlinkshere/href}"
- i18n:attributes="accesskey string:accesskey-whatlinkshere|default; title string:tooltip-whatlinkshere|default"
+ <li id="t-whatlinkshere"><a href="${nav_urls/whatlinkshere/href}"
i18n:translate="string:whatlinkshere">What links here</a></li>
- <li><a href="${nav_urls/recentchangeslinked/href}"
- i18n:attributes="accesskey string:accesskey-recentchangeslinked|default;title string:tooltip-recentchangeslinked | default"
+ <li id="t-recentchangeslinked"><a href="${nav_urls/recentchangeslinked/href}"
i18n:translate="string:recentchangeslinked">Related Changes</a></li>
<li tal:condition="feeds" id="feedlinks">
<span i18n:translate="string:feedlinks">Feeds:</span>
<span tal:repeat="feed feeds"
tal:attributes="id string:feed-${repeat/feed/key};"><a
- tal:attributes="href feed/href; title feed/ttip|default"
+ tal:attributes="href feed/href;"
tal:content="feed/text">rss</a> </span>
</li>
- <li tal:condition="nav_urls/contributions/href"><a href="${nav_urls/contributions/href}"
- i18n:attributes="accesskey string:accesskey-contributions|default; title string:tooltip-contributions|default"
+ <li id="t-contributions" tal:condition="nav_urls/contributions/href"><a href="${nav_urls/contributions/href}"
i18n:translate="string:contributions">Contributions</a></li>
- <li tal:condition="nav_urls/emailuser/href"><a href="${nav_urls/emailuser/href}"
- i18n:attributes="accesskey string:accesskey-emailuser|default; title string:tooltip-emailuser|default"
+ <li id="t-emailuser" tal:condition="nav_urls/emailuser/href"><a href="${nav_urls/emailuser/href}"
i18n:translate="string:emailuser">Email this user</a></li>
- <li tal:condition="loggedin"><a href="${nav_urls/upload/href}"
- i18n:attributes="accesskey string:accesskey-upload|default; title string:tooltip-upload|default"
+ <li id="t-upload" tal:condition="loggedin"><a href="${nav_urls/upload/href}"
i18n:translate="string:upload">Upload a file</a></li>
- <li><a href="${nav_urls/specialpages/href}"
- i18n:attributes="accesskey string:accesskey-specialpages|default;title string:tooltip-specialpages|default"
+ <li id="t-specialpages"><a href="${nav_urls/specialpages/href}"
i18n:translate="string:specialpages">Special Pages</a></li>
</ul>
</div>