r55011 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55010‎ | r55011 | r55012 >
Date:11:54, 14 August 2009
Author:werdna
Status:deferred
Tags:
Comment:
* Remove a bunch of dead code.
* Wrap replies for each thread in a div, in prep for JS hiding/showing
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -744,23 +744,6 @@
745745 return $html;
746746 }
747747
748 - function showThreadFooter( $thread ) {
749 - global $wgLang, $wgUser;
750 -
751 - $sk = $wgUser->getSkin();
752 - $html = '';
753 -
754 - // Footer commands
755 - $footerCommands =
756 - $this->listItemsForCommands( $this->threadFooterCommands( $thread ) );
757 - $html .=
758 - Xml::tags( 'span', array( 'class' => "lqt_footer_commands" ), $footerCommands );
759 -
760 - $html = Xml::tags( 'ul', array( 'class' => 'lqt_footer' ), $html );
761 -
762 - return $html;
763 - }
764 -
765748 function listItemsForCommands( $commands ) {
766749 $result = array();
767750 foreach ( $commands as $key => $command ) {
@@ -837,7 +820,6 @@
838821 $this->showPostEditingForm( $thread );
839822 $html .= Xml::closeElement( 'div' );
840823 } else {
841 - $html .= $this->getReplyContext( $thread );
842824 $html .= Xml::openElement( 'div', array( 'class' => $divClass ) );
843825 $html .= $this->showPostBody( $post, $oldid );
844826 $html .= Xml::closeElement( 'div' );
@@ -847,10 +829,9 @@
848830 // If we're replying to this thread, show the reply form after it.
849831 if ( $this->methodAppliesToThread( 'reply', $thread ) ) {
850832 // As with above, flush HTML to avoid refactoring EditPage.
851 - $html .= $this->indent( $thread );
852833 $this->output->addHTML( $html );
853834 $this->showReplyForm( $thread );
854 - $html = $this->unindent( $thread );
 835+ $html = '';
855836 } else {
856837 $html .= Xml::tags( 'div',
857838 array( 'class' => 'lqt-reply-form lqt-edit-form',
@@ -900,23 +881,6 @@
901882 return $thread->getAnchorName();
902883 }
903884
904 - // Gets HTML for the 'in reply to' thing if warranted.
905 - function getReplyContext( $thread ) {
906 - if ( $this->lastUnindentedSuperthread ) {
907 - wfLoadExtensionMessages( 'LiquidThreads' );
908 - $tmp = $this->lastUnindentedSuperthread;
909 - $replyLink = Xml::tags( 'a', array( 'href' => '#'.$this->anchorName( $tmp ) ),
910 - $tmp->subject() );
911 - $msg = wfMsgExt( 'lqt_in_response_to', array( 'parseinline', 'replaceafter' ),
912 - array( $replyLink, $tmp->author()->getName() ) );
913 -
914 - return Xml::tags( 'span', array( 'class' => 'lqt_nonindent_message' ),
915 - "← $msg" );
916 - }
917 -
918 - return '';
919 - }
920 -
921885 // Display a moved thread
922886 function showMovedThread( $thread ) {
923887 global $wgLang;
@@ -1018,11 +982,15 @@
1019983 $this->showSingleThread( $thread );
1020984
1021985 if ( $thread->hasSubthreads() ) {
 986+ $repliesClass = 'lqt-thread-replies lqt-thread-replies-'.$this->threadNestingLevel;
 987+ $div = Xml::openElement( 'div', array( 'class' => $repliesClass ) );
 988+ $this->output->addHTML( $div );
1022989 foreach ( $thread->subthreads() as $st ) {
1023990 if ($st->type() != Threads::TYPE_DELETED) {
1024991 $this->showThread( $st );
1025992 }
1026993 }
 994+ $this->output->addHTML( Xml::CloseElement( 'div' ) );
1027995 }
1028996
1029997 $this->output->addHTML( Xml::closeElement( 'div' ) );
@@ -1038,34 +1006,6 @@
10391007 return "lqt_thread $levelClass $alternatingClass";
10401008 }
10411009
1042 - // FIXME does indentation need rethinking?
1043 - function indent( $thread ) {
1044 - $result = '';
1045 - if ( $this->headerLevel <= $this->maxIndentationLevel ) {
1046 - $result = '<dl class="lqt_replies"><dd>';
1047 - } else {
1048 - $result = '<div class="lqt_replies_without_indent">';
1049 - }
1050 - $this->lastUnindentedSuperthread = null;
1051 - $this->headerLevel += 1;
1052 -
1053 - return $result;
1054 - }
1055 -
1056 - function unindent( $thread ) {
1057 - $result = '';
1058 - if ( $this->headerLevel <= $this->maxIndentationLevel + 1 ) {
1059 - $result = '</dd></dl>';
1060 - } else {
1061 - $result = '</div>';
1062 - }
1063 - // See the beginning of showThread().
1064 - $this->lastUnindentedSuperthread = $thread->superthread();
1065 - $this->headerLevel -= 1;
1066 -
1067 - return $result;
1068 - }
1069 -
10701010 function getSummary( $t ) {
10711011 if ( !$t->summary() ) return;
10721012 wfLoadExtensionMessages( 'LiquidThreads' );

Status & tagging log