r63591 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63590‎ | r63591 | r63592 >
Date:11:16, 11 March 2010
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads: Fix issues with previews and reply forms not appearing under all circumstances. Patch does not apply to SVN HEAD, as this has significant inferface changes in it
Modified paths:
  • /branches/wmf-deployment/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php
@@ -301,11 +301,15 @@
302302 }
303303
304304 function showReplyForm( $thread ) {
 305+ $html = Xml::openElement( 'div',
 306+ array( 'class' => 'lqt-reply-form' ) );
 307+ $this->output->addHTML( $html );
305308 if ( $thread->root()->getTitle()->userCan( 'edit' ) ) {
306 - $this->showEditingFormInGeneral( null, 'reply', $thread );
 309+ $this->showEditingFormInGeneral( null, 'reply', $thread );
307310 } else {
308311 $this->showReplyProtectedNotice( $thread );
309312 }
 313+ $this->output->addHTML('</div>');
310314 }
311315
312316 function showSummarizeForm( $thread ) {
@@ -1558,6 +1562,10 @@
15591563 $this->showThreadReplies( $thread, $startAt, $maxCount, $showThreads,
15601564 $cascadeOptions );
15611565 } elseif ( $hasSubthreads && !$showThreads ) {
 1566+ if ($replyTo) {
 1567+ $this->showReplyForm( $thread );
 1568+ }
 1569+
15621570 // Add a "show subthreads" link.
15631571 $link = $this->getShowReplies( $thread );
15641572
@@ -1575,10 +1583,8 @@
15761584 $class = 'lqt-thread-replies lqt-thread-replies-'.
15771585 $this->threadNestingLevel;
15781586 $html = Xml::openElement( 'div', array( 'class' => $class ) );
1579 - $html .= Xml::openElement( 'div',
1580 - array( 'class' => 'lqt-reply-form' ) );
15811587 $this->output->addHTML( $html );
1582 -
 1588+
15831589 $this->showReplyForm( $thread );
15841590
15851591 $finishDiv = Xml::tags( 'div',
@@ -1594,6 +1600,22 @@
15951601 $finishHTML .= Xml::closeElement( 'div' ); // lqt-thread-replies
15961602 $this->output->addHTML( $finishHTML );
15971603 }
 1604+ } elseif ( !$hasSubthreads && $replyTo ) {
 1605+ $class = 'lqt-thread-replies lqt-thread-replies-'.
 1606+ $this->threadNestingLevel;
 1607+ $html = Xml::openElement( 'div', array( 'class' => $class ) );
 1608+ $this->output->addHTML( $html );
 1609+
 1610+ $this->showReplyForm( $thread );
 1611+
 1612+ $html = Xml::tags( 'div',
 1613+ array( 'class' => 'lqt-replies-finish' ),
 1614+ Xml::tags( 'div',
 1615+ array( 'class' =>
 1616+ 'lqt-replies-finish-corner'
 1617+ ), '&nbsp;' ) );
 1618+ $html .= Xml::closeElement( 'div' );
 1619+ $this->output->addHTML( $html );
15981620 }
15991621
16001622 if ( $this->threadNestingLevel == 1 ) {
@@ -1616,10 +1638,7 @@
16171639 // Check if we're actually replying to this thread.
16181640 if ( $this->methodAppliesToThread( 'reply', $thread ) ) {
16191641 // As with above, flush HTML to avoid refactoring EditPage.
1620 - $this->output->addHTML( Xml::openElement( 'div',
1621 - array( 'class' => 'lqt-reply-form' ) ) );
16221642 $this->showReplyForm( $thread );
1623 - $this->output->addHTML( Xml::closeElement( 'div' ) );
16241643 return;
16251644 } elseif ( !$thread->canUserReply( $this->user ) ) {
16261645 return;
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php
@@ -307,11 +307,15 @@
308308 }
309309
310310 function showReplyForm( $thread ) {
 311+ $html = Xml::openElement( 'div',
 312+ array( 'class' => 'lqt-reply-form' ) );
 313+ $this->output->addHTML( $html );
311314 if ( $thread->root()->getTitle()->userCan( 'edit' ) ) {
312 - $this->showEditingFormInGeneral( null, 'reply', $thread );
 315+ $this->showEditingFormInGeneral( null, 'reply', $thread );
313316 } else {
314317 $this->showReplyProtectedNotice( $thread );
315318 }
 319+ $this->output->addHTML('</div>');
316320 }
317321
318322 function showSummarizeForm( $thread ) {
@@ -1605,6 +1609,10 @@
16061610 $this->showThreadReplies( $thread, $startAt, $maxCount, $showThreads,
16071611 $cascadeOptions );
16081612 } elseif ( $hasSubthreads && !$showThreads ) {
 1613+ if ($replyTo) {
 1614+ $this->showReplyForm( $thread );
 1615+ }
 1616+
16091617 // Add a "show subthreads" link.
16101618 $link = $this->getShowReplies( $thread );
16111619
@@ -1622,10 +1630,8 @@
16231631 $class = 'lqt-thread-replies lqt-thread-replies-' .
16241632 $this->threadNestingLevel;
16251633 $html = Xml::openElement( 'div', array( 'class' => $class ) );
1626 - $html .= Xml::openElement( 'div',
1627 - array( 'class' => 'lqt-reply-form' ) );
16281634 $this->output->addHTML( $html );
1629 -
 1635+
16301636 $this->showReplyForm( $thread );
16311637
16321638 $finishDiv = Xml::tags( 'div',
@@ -1641,6 +1647,22 @@
16421648 $finishHTML .= Xml::closeElement( 'div' ); // lqt-thread-replies
16431649 $this->output->addHTML( $finishHTML );
16441650 }
 1651+ } elseif ( !$hasSubthreads && $replyTo ) {
 1652+ $class = 'lqt-thread-replies lqt-thread-replies-'.
 1653+ $this->threadNestingLevel;
 1654+ $html = Xml::openElement( 'div', array( 'class' => $class ) );
 1655+ $this->output->addHTML( $html );
 1656+
 1657+ $this->showReplyForm( $thread );
 1658+
 1659+ $html = Xml::tags( 'div',
 1660+ array( 'class' => 'lqt-replies-finish' ),
 1661+ Xml::tags( 'div',
 1662+ array( 'class' =>
 1663+ 'lqt-replies-finish-corner'
 1664+ ), '&nbsp;' ) );
 1665+ $html .= Xml::closeElement( 'div' );
 1666+ $this->output->addHTML( $html );
16451667 }
16461668
16471669 if ( $this->threadNestingLevel == 1 ) {
@@ -1663,10 +1685,7 @@
16641686 // Check if we're actually replying to this thread.
16651687 if ( $this->methodAppliesToThread( 'reply', $thread ) ) {
16661688 // As with above, flush HTML to avoid refactoring EditPage.
1667 - $this->output->addHTML( Xml::openElement( 'div',
1668 - array( 'class' => 'lqt-reply-form' ) ) );
16691689 $this->showReplyForm( $thread );
1670 - $this->output->addHTML( Xml::closeElement( 'div' ) );
16711690 return;
16721691 } elseif ( !$thread->canUserReply( $this->user ) ) {
16731692 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r63725LiquidThreads: Merge r63591 from deployment versions into trunk, apparently t...werdna04:22, 14 March 2010

Status & tagging log