* (bug 6100) BiDi: different directionality for user interface and wiki content ...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 31 May 2006 15:19:40 +0000 (15:19 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 31 May 2006 15:19:40 +0000 (15:19 +0000)
14 files changed:
RELEASE-NOTES
includes/Article.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/OutputPage.php
includes/Skin.php
includes/SkinTemplate.php
skins/CologneBlue.php
skins/MonoBook.php
skins/Standard.php
skins/common/common_content_rtl.css [new file with mode: 0644]
skins/monobook/content_rtl.css [new file with mode: 0644]
skins/monobook/main.css
skins/monobook/rtl.css

index c4926e2..7d65490 100644 (file)
@@ -391,7 +391,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6126) Allow fallback to customized primary language when user language
   message contains '-'; fixes licenses selector on Commons configuration after
   recent addition of the message to Messages.php
-
+* (bug 6100) BiDi: different directionality for user interface and wiki content
 
 == Compatibility ==
 
index d4a3cde..d970a20 100644 (file)
@@ -734,7 +734,7 @@ class Article {
         * the given title.
        */
        function view() {
-               global $wgUser, $wgOut, $wgRequest, $wgContLang;
+               global $wgUser, $wgOut, $wgRequest, $wgLang;
                global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
                global $wgUseTrackbacks;
                $sk = $wgUser->getSkin();
@@ -891,7 +891,7 @@ class Article {
                                $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
                        } else if ( $rt = Title::newFromRedirect( $text ) ) {
                                # Display redirect
-                               $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
+                               $imageDir = $wgLang->isRTL() ? 'rtl' : 'ltr';
                                $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
                                # Don't overwrite the subtitle if this was an old revision
                                if( !$wasRedirected && $this->isCurrent() ) {
index 341427b..30ed522 100644 (file)
@@ -1313,7 +1313,10 @@ END
                        $wgOut->addParserOutputNoText( $parserOutput );
 
                        wfProfileOut( $fname );
-                       return $previewhead . $previewHTML;
+                       return $previewhead . 
+                       '<div id="realContent"' . contentdir() . '>' .
+                       $previewHTML . 
+                       '</div><!-- realContent -->';
                }
        }
 
index f8ef126..389a797 100644 (file)
@@ -1850,6 +1850,36 @@ function wfExplodeMarkup( $separator, $text ) {
        return $items;
 }
 
+/** @todo document */
+/* returns a dir="rtl" or dir="ltr" for the layout (eg: uselang) */
+function layoutdir() {
+       global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode;
+       $lang = "";
+       $dir = "";
+       if ( $wgLanguageCode != $wgContLanguageCode ) {
+               $lang = " lang='$wgLanguageCode'";
+       }
+       if ( $wgLang->isRTL() != $wgContLang->isRTL() ) {
+               $dir = $wgLang->isRTL() ? " dir='rtl'" : " dir='ltr'";
+       }
+       return $lang . $dir;
+}
+       
+/** @todo document */
+/* returns a dir="rtl" or dir="ltr" for the content (wiki lang) */
+function contentdir() {
+       global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode;
+       $lang = "";
+       $dir = "";
+       if ( $wgLanguageCode != $wgContLanguageCode ) {
+               $lang = " lang='$wgContLanguageCode'";
+       }
+       if ( $wgLang->isRTL() != $wgContLang->isRTL() ) {
+               $dir = $wgContLang->isRTL() ? " dir='rtl'" : " dir='ltr'";
+       }
+       return $lang . $dir;
+}
+
 class ReplacerCallback {
        function ReplacerCallback( $from, $to ) {
                $this->from = $from;
index c155d38..98977e4 100644 (file)
@@ -332,7 +332,9 @@ class OutputPage {
                $text = $parserOutput->getText();
                wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) );
                $parserOutput->setText( $text );
+               $this->addHTML( '<div id="realContent"' . contentdir() . '>');
                $this->addHTML( $parserOutput->getText() );
+               $this->addHTML( '</div><!-- realContent -->');
        }
 
        /**
@@ -385,7 +387,9 @@ class OutputPage {
                        $this->mNewSectionLink = $parserOutput->getNewSection();
                        $text = $parserOutput->getText();
                        wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
+                       $this->addHTML( '<div id="realContent"' . contentdir() . '>');
                        $this->addHTML( $text );
+                       $this->addHTML( '</div><!-- realContent -->');
                        $t = $parserOutput->getTitleText();
                        if( !empty( $t ) ) {
                                $this->setPageTitle( $t );
@@ -948,6 +952,7 @@ class OutputPage {
        function headElement() {
                global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
                global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle;
+               global $wgLang, $wgLanguageCode;
 
                if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
                        $ret = "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?>\n";
@@ -961,8 +966,8 @@ class OutputPage {
                        $this->setHTMLTitle(  wfMsg( 'pagetitle', $this->getPageTitle() ));
                }
 
-               $rtl = $wgContLang->isRTL() ? " dir='RTL'" : '';
-               $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" $rtl>\n";
+               $rtl = $wgLang->isRTL() ? " dir='RTL'" : '';
+               $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgLanguageCode\" lang=\"$wgLanguageCode\" $rtl>\n";
                $ret .= "<head>\n<title>" . htmlspecialchars( $this->getHTMLTitle() ) . "</title>\n";
                array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) );
 
index 5bf36ab..a66fe2e 100644 (file)
@@ -297,11 +297,12 @@ class Skin extends Linker {
 
        # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
        function getUserStylesheet() {
-               global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
+               global $wgStylePath, $wgRequest, $wgLang, $wgContLang, $wgSquidMaxage;
                $sheet = $this->getStylesheet();
                $action = $wgRequest->getText('action');
                $s = "@import \"$wgStylePath/$sheet\";\n";
-               if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
+               if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
+               if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_content_rtl.css\";\n";
 
                $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
                $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
@@ -434,7 +435,7 @@ END;
        }
 
        function doBeforeContent() {
-               global $wgContLang;
+               global $wgLang;
                $fname = 'Skin::doBeforeContent';
                wfProfileIn( $fname );
 
@@ -455,7 +456,7 @@ END;
 
                $shove = ($qb != 0);
                $left = ($qb == 1 || $qb == 3);
-               if($wgContLang->isRTL()) $left = !$left;
+               if($wgLang->isRTL()) $left = !$left;
 
                if ( !$shove ) {
                        $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
@@ -463,13 +464,13 @@ END;
                } elseif( $left ) {
                        $s .= $this->getQuickbarCompensator( $rows );
                }
-               $l = $wgContLang->isRTL() ? 'right' : 'left';
+               $l = $wgLang->isRTL() ? 'right' : 'left';
                $s .= "<td {$borderhack} align='$l' valign='top'>\n";
 
                $s .= $this->topLinks() ;
                $s .= "<p class='subtitle'>" . $this->pageTitleLinks() . "</p>\n";
 
-               $r = $wgContLang->isRTL() ? "left" : "right";
+               $r = $wgLang->isRTL() ? "left" : "right";
                $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
                $s .= $this->nameAndLogin();
                $s .= "\n<br />" . $this->searchForm() . "</td>";
@@ -996,7 +997,7 @@ END;
                if ( '' != $align ) { $a = " align='{$align}'"; }
                else { $a = ''; }
 
-               $mp = wfMsg( 'mainpage' );
+               $mp = wfMsgForContent( 'mainpage' );
                $titleObj = Title::newFromText( $mp );
                if ( is_object( $titleObj ) ) {
                        $url = $titleObj->escapeLocalURL();
@@ -1251,7 +1252,7 @@ END;
        }
 
        function otherLanguages() {
-               global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
+               global $wgOut, $wgLang, $wgHideInterlanguageLinks;
 
                if ( $wgHideInterlanguageLinks ) {
                        return '';
@@ -1264,20 +1265,20 @@ END;
 
                $s = wfMsg( 'otherlanguages' ) . ': ';
                $first = true;
-               if($wgContLang->isRTL()) $s .= '<span dir="LTR">';
+               if($wgLang->isRTL()) $s .= '<span dir="LTR">';
                foreach( $a as $l ) {
                        if ( ! $first ) { $s .= ' | '; }
                        $first = false;
 
                        $nt = Title::newFromText( $l );
                        $url = $nt->escapeFullURL();
-                       $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
+                       $text = $wgLang->getLanguageName( $nt->getInterwiki() );
 
                        if ( '' == $text ) { $text = $l; }
                        $style = $this->getExternalLinkAttributes( $l, $text );
                        $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
                }
-               if($wgContLang->isRTL()) $s .= '</span>';
+               if($wgLang->isRTL()) $s .= '</span>';
                return $s;
        }
 
index f054153..5b86d02 100644 (file)
@@ -134,7 +134,7 @@ class SkinTemplate extends Skin {
         */
        function outputPage( &$out ) {
                global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
-               global $wgScript, $wgStylePath, $wgContLanguageCode;
+               global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode;
                global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
                global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks;
                global $wgMaxCredits, $wgShowCreditsIfMax;
@@ -247,8 +247,20 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'stylepath', $wgStylePath );
                $tpl->setRef( 'logopath', $wgLogo );
                $tpl->setRef( "lang", $wgContLanguageCode );
-               $tpl->set( 'dir', $wgContLang->isRTL() ? "rtl" : "ltr" );
-               $tpl->set( 'rtl', $wgContLang->isRTL() );
+               $tpl->setRef( 'uselang', $wgLanguageCode );
+               $tpl->set( 'dir', $wgLang->isRTL() ? "rtl" : "ltr" );
+               $tpl->set( 'rtl', $wgLang->isRTL() );
+               /* display, if needed, dir=ltr or dir=rtl for the
+                  firstHeading title. This is when the title is
+                  content, eg a site-localized string;
+                  that is the case for all the pages not in Special:
+                  when action is view or history
+                */
+               $tpl->set( 'titledir',
+                       ($this->mTitle->getNamespace() != NS_SPECIAL &&
+                        ($action == 'view' || $action == 'history')) ?
+                               contentdir() : ""
+               );
                $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) );
                $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
                $tpl->setRef( 'username', $this->username );
@@ -392,7 +404,7 @@ class SkinTemplate extends Skin {
                                $nt = Title::newFromText( $l );
                                $language_urls[] = array(
                                        'href' => $nt->getFullURL(),
-                                       'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
+                                       'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
                                        'class' => $class
                                );
                        }
@@ -887,7 +899,7 @@ class SkinTemplate extends Skin {
                $fname = 'SkinTemplate::setupUserCss';
                wfProfileIn( $fname );
 
-               global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser;
+               global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgLang, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser;
 
                $sitecss = '';
                $usercss = '';
@@ -911,7 +923,8 @@ class SkinTemplate extends Skin {
                        $siteargs .= '&ts=' . $wgUser->mTouched;
                }
 
-               if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n";
+               if ($wgLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n";
+               if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/content_rtl.css";' . "\n";
 
                # If we use the site's dynamic CSS, throw that in, too
                if ( $wgUseSiteCss ) {
index 9cb3ef3..d08bbbe 100644 (file)
@@ -98,14 +98,15 @@ class SkinCologneBlue extends Skin {
        }
 
        function doGetUserStyles() {
-               global $wgOut;
+               global $wgOut, $wgLang, $wgUser;
                $s = parent::doGetUserStyles();
                $qb = $this->qbSetting();
 
-               if ( 2 == $qb ) { # Right
+               if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) ||
+                    ( 2 == $qb ) ) { # Right
                        $s .= "#quickbar { position: absolute; right: 4px; }\n" .
                          "#article { margin-left: 4px; margin-right: 148px; }\n";
-               } else if ( 1 == $qb ) {
+               } else if ( (!$wgUser->isLoggedIn()) || ( 1 == $qb ) ) {
                        $s .= "#quickbar { position: absolute; left: 4px; }\n" .
                          "#article { margin-left: 148px; margin-right: 4px; }\n";
                } else if ( 3 == $qb ) { # Floating left
index d4c6638..024c126 100644 (file)
@@ -51,7 +51,7 @@ class MonoBookTemplate extends QuickTemplate {
                wfSuppressWarnings();
 
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('uselang') ?>" lang="<?php $this->text('uselang') ?>" dir="<?php $this->text('dir') ?>">
        <head>
                <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
                <?php $this->html('headlinks') ?>
@@ -93,7 +93,7 @@ class MonoBookTemplate extends QuickTemplate {
        <div id="content">
                <a name="top" id="top"></a>
                <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
-               <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
+               <h1 class="firstHeading"<?php $this->text('titledir') ?>><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
                <div id="bodyContent">
                        <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
                        <div id="contentSub"><?php $this->html('subtitle') ?></div>
@@ -124,6 +124,9 @@ class MonoBookTemplate extends QuickTemplate {
                <h5><?php $this->msg('personaltools') ?></h5>
                <div class="pBody">
                        <ul>
+<?php                  if ($this->data['rtl'] == "1") 
+                               $this->data['personal_urls'] = 
+                               array_reverse($this->data['personal_urls'], true); ?>
 <?php                  foreach($this->data['personal_urls'] as $key => $item) { ?>
                                <li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
                                        if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
index 8140b7d..1b1b309 100644 (file)
@@ -52,16 +52,18 @@ class SkinStandard extends Skin {
         *
         */
        function doGetUserStyles() {
-               global $wgStylePath;
+               global $wgStylePath, $wgLang, $wgUser;
 
                $s = parent::doGetUserStyles();
                $qb = $this->qbSetting();
 
-               if ( 2 == $qb ) { # Right
+               if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) ||
+                    ( 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 ) {
+               } else if ( (!$wgUser->isLoggedIn()) ||
+                 ( 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";
@@ -90,7 +92,7 @@ class SkinStandard extends Skin {
        }
 
        function doAfterContent() {
-               global $wgContLang;
+               global $wgLang;
                $fname =  'SkinStandard::doAfterContent';
                wfProfileIn( $fname );
                wfProfileIn( $fname.'-1' );
@@ -105,14 +107,14 @@ class SkinStandard extends Skin {
                $qb = $this->qbSetting();
                $shove = ($qb != 0);
                $left = ($qb == 1 || $qb == 3);
-               if($wgContLang->isRTL()) $left = !$left;
+               if($wgLang->isRTL()) $left = !$left;
 
                if ( $shove && $left ) { # Left
                                $s .= $this->getQuickbarCompensator();
                }
                wfProfileOut( $fname.'-2' );
                wfProfileIn( $fname.'-3' );
-               $l = $wgContLang->isRTL() ? 'right' : 'left';
+               $l = $wgLang->isRTL() ? 'right' : 'left';
                $s .= "<td class='bottom' align='$l' valign='top'>";
 
                $s .= $this->bottomLinks();
diff --git a/skins/common/common_content_rtl.css b/skins/common/common_content_rtl.css
new file mode 100644 (file)
index 0000000..972c6d6
--- /dev/null
@@ -0,0 +1 @@
+/* RTL specific styles for date content (not layout) go here */
diff --git a/skins/monobook/content_rtl.css b/skins/monobook/content_rtl.css
new file mode 100644 (file)
index 0000000..2f65978
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+Right-to-left fixes for MonoBook.
+Places sidebar on right, tweaks various alignment issues.
+
+Works mostly ok nicely on Safari 1.2.1; fine in Mozilla.
+
+Safari bugs (1.2.1):
+* Tabs are still appearing in left-to-right order. (Try after localizing)
+
+Opera bugs (7.23 linux):
+* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other
+
+IE/mac bugs:
+* The thing barfs on Hebrew and Arabic anyway, so no point testing.
+
+Missing features due to lack of support:
+* external link icons
+
+To test:
+* Opera6
+* IE 5.0
+* etc
+
+*/
+#realContent {
+       direction: rtl;
+/*    unicode-bidi: bidi-override;*/
+       unicode-bidi: embed;
+}
+
+/* Fix alignment */
+.documentByLine {
+       text-align: left;
+}
+
+div div.thumbcaption {
+       text-align: right;
+}
+
+div.magnify,
+#div.townBox {
+       left: auto;
+       right: 0;
+}
+
+/* Fix margins for non-css2 browsers */
+/* top right bottom left */
+
+ul {
+       margin-left: 0;
+       margin-right: 1.5em;
+}
+ol {
+       margin-left: 0;
+       margin-right: 2.4em;
+}
+dd {
+       margin-left: 0;
+       margin-right: 1.6em;
+}
+/* ??? */
+li { 
+       margin-left: 0;
+       margin-right: 2.4em;
+}
+.tocindent {
+       margin-left: 0;
+       margin-right: 2em;
+}
+div.tright, div.floatright, table.floatright {
+       clear: none;
+}
+div.tleft, div.floatleft, table.floatleft {
+       clear: left;
+}
+div.townBox {
+       margin-left: 0;
+       margin-right: 1em;
+}
+div.townBox dl dd {
+       margin-left: 0;
+       margin-right: 1.1em;
+}
+/* Fix link icons */
+.external {
+       padding: 0 !important;
+       background: none !important;
+}
+
+
+
+/* workaround for moz bug, displayed bullets on left side */
+
+#toc ul {
+       text-align: right;
+}
+
+#toc ul ul {
+       margin: 0 2em 0 0;
+}
index 2aa0114..c43c922 100644 (file)
@@ -569,7 +569,7 @@ span.diffchange {
 ** keep the whitespace in front of the ^=, hides rule from konqueror
 ** this is css3, the validator doesn't like it when validating as css2
 */
-#bodyContent a.external,
+#bodyContent a.external[DIR="ltr"],
 #bodyContent a[href ^="gopher://"] {
        background: url(external.png) center right no-repeat;
        padding-right: 13px;
@@ -676,6 +676,8 @@ special external link styling */
        list-style-type: square;
        list-style-image: url(bullet.gif);
        font-size: 95%;
+       margin: .3em 0 0 1.5em;
+       padding: 0;
 }
 .portlet li {
        padding: 0;
@@ -718,7 +720,7 @@ special external link styling */
 }
 
 #p-navigation .pBody {
-       padding-right: 0;
+/*     padding-right: 0; */
 }
 
 #p-navigation a {
index 91e2fb3..0db2263 100644 (file)
@@ -52,19 +52,11 @@ html>body .portlet {
 }
 
 /* Fix alignment */
-.documentByLine,
 .portletDetails,
 .portletMore,
 #p-personal {
        text-align: left;
 }
-
-div div.thumbcaption {
-       text-align: right;
-}
-
-div.magnify,
-#div.townBox,
 #p-logo {
        left: auto;
        right: 0;
@@ -73,7 +65,20 @@ div.magnify,
        left: auto;
        right: 0;
 }
+#p-navigation .pBody {
+       padding-right: auto;
+}
 
+/* the icon in front of the user name, single quotes
+in bg url to hide it from iemac */
+li#pt-userpage,
+li#pt-anonuserpage,
+li#pt-login {
+       background: url(user.gif) top right no-repeat;
+       padding-left: 0px;
+       padding-right: 20px;
+       text-transform: none;
+}
 #p-cactions {
        left: auto;
        right: 11.5em;
@@ -104,15 +109,15 @@ li#ca-watch,li#ca-unwatch {
 /* Fix margins for non-css2 browsers */
 /* top right bottom left */
 
-ul {
+.portlet ul {
        margin-left: 0;
        margin-right: 1.5em;
 }
-ol {
+.portlet ol {
        margin-left: 0;
        margin-right: 2.4em;
 }
-dd {
+.portlet dd {
        margin-left: 0;
        margin-right: 1.6em;
 }
@@ -120,24 +125,6 @@ dd {
        margin-right: 1em;
        margin-left: 0;
 }
-.tocindent {
-       margin-left: 0;
-       margin-right: 2em;
-}
-div.tright, div.floatright, table.floatright {
-       clear: none;
-}
-div.tleft, div.floatleft, table.floatleft {
-       clear: left;
-}
-div.townBox {
-       margin-left: 0;
-       margin-right: 1em;
-}
-div.townBox dl dd {
-       margin-left: 0;
-       margin-right: 1.1em;
-}
 #p-personal li {
        margin-left: 0;
        margin-right: 1em;
@@ -152,11 +139,6 @@ li#ca-watch {
 #p-personal li {
        float: left;
 }
-/* Fix link icons */
-.external {
-       padding: 0 !important;
-       background: none !important;
-}
 #footer {
        clear: both;
 }
@@ -191,16 +173,6 @@ li#ca-watch {
        padding-right: 2em;
 }
 
-/* workaround for moz bug, displayed bullets on left side */
-
-#toc ul {
-       text-align: right;
-}
-
-#toc ul ul {
-       margin: 0 2em 0 0;
-}
-
 input#wpSave, input#wpDiff {
        margin-right: 0;
        margin-left: .33em;