r88575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88574‎ | r88575 | r88576 >
Date:13:43, 22 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Code tweaks, show filtering by tag

Improve comments
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeCommentsListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionTagView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/WordCloud.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -122,6 +122,7 @@
123123 'code-pathsearch-filter' => 'Filter applied:',
124124 'code-revfilter-cr_status' => 'Status = $1',
125125 'code-revfilter-cr_author' => 'Author = $1',
 126+ 'code-revfilter-ct_tag' => 'Tag = $1',
126127 'code-revfilter-clear' => 'Clear filter',
127128 'code-rev-submit' => 'Save changes',
128129 'code-rev-submit-accesskey' => 's',
Index: trunk/extensions/CodeReview/ui/WordCloud.php
@@ -86,7 +86,7 @@
8787 */
8888 public function getCloudHtml() {
8989 if( 0 === count( $this->wordsArray ) ) {
90 - return;
 90+ return '';
9191 }
9292 $this->shuffleCloud();
9393 $max = max( $this->wordsArray );
@@ -98,10 +98,16 @@
9999 }
100100 return '<div class="mw-wordcloud">' . $return . '</div>';
101101 }
 102+ return '';
102103 }
103104
104105 /**
105106 * Default text callback for word display
 107+ *
 108+ * @param $word string
 109+ * @param $sizeRange
 110+ *
 111+ * @return string
106112 */
107113 public function defaultTextCallback( $word, $sizeRange ) {
108114 return Html::element( 'span', array(
@@ -128,6 +134,8 @@
129135 /**
130136 * Get the class range using a percentage
131137 *
 138+ * @param $percent
 139+ *
132140 * @return Int
133141 */
134142 private function getClassFromPercent( $percent ) {
Index: trunk/extensions/CodeReview/ui/CodeView.php
@@ -112,7 +112,7 @@
113113 protected $mView;
114114
115115 /**
116 - * @param $view CodeView
 116+ * @param $view CodeView
117117 *
118118 */
119119 function __construct( $view ) {
Index: trunk/extensions/CodeReview/ui/CodeCommentsListView.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -// Special:Code/MediaWiki
 4+// Special:Code/MediaWiki/comments
55 class CodeCommentsListView extends CodeView {
66 public $mRepo;
77
@@ -33,7 +33,7 @@
3434 }
3535 }
3636
37 -// Pager for CodeRevisionListView
 37+// Pager for CodeCommentsListView
3838 class CodeCommentsTablePager extends SvnTablePager {
3939
4040 function isFieldSortable( $field ) {
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -9,6 +9,11 @@
1010 public $mPath, $batchForm;
1111
1212 /**
 13+ * @var
 14+ */
 15+ protected $filters = array();
 16+
 17+ /**
1318 * @param $repo CodeRepository|String
1419 */
1520 function __construct( $repo ) {
@@ -26,17 +31,16 @@
2732 $this->mAuthor = $wgRequest->getText( 'author' );
2833 $this->mStatus = $wgRequest->getText( 'status' );
2934
30 - $filters = array();
3135 if ( $this->mAuthor ) {
32 - $filters[] = wfMsg( 'code-revfilter-cr_author', $this->mAuthor );
 36+ $this->filters[] = wfMsg( 'code-revfilter-cr_author', $this->mAuthor );
3337 }
3438 if ( $this->mStatus ) {
35 - $filters[] = wfMsg( 'code-revfilter-cr_status', $this->mStatus );
 39+ $this->filters[] = wfMsg( 'code-revfilter-cr_status', $this->mStatus );
3640 }
3741
38 - if ( count( $filters) ) {
 42+ if ( count( $this->filters ) ) {
3943 global $wgLang;
40 - $this->mAppliedFilter = $wgLang->listToText( $filters );
 44+ $this->mAppliedFilter = $wgLang->listToText( $this->filters );
4145 } else {
4246 $this->mAppliedFilter = null;
4347 }
@@ -362,7 +366,7 @@
363367 SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ),
364368 htmlspecialchars( $value ),
365369 array(),
366 - $pathQuery
 370+ array()
367371 );
368372 case 'cr_status':
369373 $options = $pathQuery;
Index: trunk/extensions/CodeReview/ui/CodeRevisionTagView.php
@@ -2,8 +2,12 @@
33
44 class CodeRevisionTagView extends CodeRevisionListView {
55 function __construct( $repo, $tag ) {
 6+ $this->mTag = $tag;
 7+
 8+ if ( $this->mTag ) {
 9+ $this->filters[] = wfMsg( 'code-revfilter-ct_tag', $this->mTag );
 10+ }
611 parent::__construct( $repo );
7 - $this->mTag = $tag;
812 }
913
1014 function getPager() {

Status & tagging log