r90872 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90871‎ | r90872 | r90873 >
Date:12:25, 27 June 2011
Author:robin
Status:resolved (Comments)
Tags:
Comment:
LiquidThreads: better support for different directionality (LTR/RTL): make everything in user language direction except the header (the actual wikitext) and the text of the individual posts
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.css (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/TalkpageView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.css
@@ -1,3 +1,10 @@
 2+/* @noflip */.lqt_post_ltr {
 3+ direction: ltr;
 4+}
 5+/* @noflip */.lqt_post_rtl {
 6+ direction: rtl;
 7+}
 8+
29 .lqt_watchlist_messages_notice {
310 background-color: #eee;
411 border: 1px solid #ddd;
Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -1419,6 +1419,8 @@
14201420 $signature = Xml::tags( 'span', array( 'class' => 'lqt-thread-user-signature' ),
14211421 $signature );
14221422
 1423+ $signature .= $wgLang->getDirMark();
 1424+
14231425 $timestamp = $wgLang->timeanddate( $thread->created(), true );
14241426 $signature .= Xml::element( 'span',
14251427 array( 'class' => 'lqt-thread-toolbar-timestamp' ),
@@ -1530,11 +1532,13 @@
15311533 }
15321534
15331535 function postDivClass( $thread ) {
 1536+ global $wgContLang;
15341537 $levelClass = 'lqt-thread-nest-' . $this->threadNestingLevel;
15351538 $alternatingType = ( $this->threadNestingLevel % 2 ) ? 'odd' : 'even';
15361539 $alternatingClass = "lqt-thread-$alternatingType";
 1540+ $dir = $wgContLang->getDir();
15371541
1538 - return "lqt_post $levelClass $alternatingClass";
 1542+ return "lqt_post $levelClass $alternatingClass lqt_post_$dir";
15391543 }
15401544
15411545 static function anchorName( $thread ) {
Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php
@@ -271,6 +271,15 @@
272272 $this->showHeader();
273273 }
274274
 275+ global $wgLang, $wgBetterDirectionality;
 276+ if( $wgBetterDirectionality ) {
 277+ // This closes the div of mw-content-ltr/rtl containing lang and dir attributes
 278+ $this->output->addHTML( Html::closeElement( 'div' ) );
 279+ }
 280+ $this->output->addHTML( Html::openElement( 'div',
 281+ array( 'class' => 'lqt-talkpage', 'lang' => $wgLang->getCode(), 'dir' => wfUILang()->getDir() )
 282+ ) );
 283+
275284 $html = '';
276285
277286 // Set up a per-page header for new threads, search box, and sorting stuff.

Follow-up revisions

RevisionCommit summaryAuthorDate
r91165Fix r90872: put everything under $wgBetterDirectionality so it doesn't break ...robin11:48, 30 June 2011

Comments

#Comment by Krinkle (talk | contribs)   08:01, 30 June 2011

This breaks on pages that are not "Talk" but have {{#useliquidthreads:1}}, namely the fact that the div isn't closed properly and the footer becomes part of the mw-content.


http://i.imgur.com/vp90N.png

#Comment by SPQRobin (talk | contribs)   11:49, 30 June 2011

Fixed in r91165. I was going to fix this but forgot to..

#Comment by Krinkle (talk | contribs)   08:02, 30 June 2011

If I uncomment the 'wgBetterDirectionality' part it is fixed on those pages, but then it's off on Talk-pages.

Closing tags opened in a different context, looks scary.

#Comment by Nikerabbit (talk | contribs)   09:38, 21 August 2011

Good enough for now. Hopefully will be taken into account in the LQT rewrite.

Status & tagging log