r93823 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93822‎ | r93823 | r93824 >
Date:13:22, 3 August 2011
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Fix for bug 30195 (tag cloud is inexplicably shuffled), based on patch by Kalan
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/WordCloud.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -145,6 +145,9 @@
146146 // What is the default SVN import chunk size?
147147 $wgCodeReviewImportBatchSize = 400;
148148
 149+// Shuffle the tag cloud
 150+$wgCodeReviewShuffleTagCloud = false;
 151+
149152 $commonModuleInfo = array(
150153 'localBasePath' => dirname( __FILE__ ) . '/modules',
151154 'remoteExtPath' => 'CodeReview/modules',
Index: trunk/extensions/CodeReview/ui/WordCloud.php
@@ -85,10 +85,17 @@
8686 * @return String
8787 */
8888 public function getCloudHtml() {
 89+ global $wgCodeReviewShuffleTagCloud;
8990 if( 0 === count( $this->wordsArray ) ) {
9091 return '';
9192 }
92 - $this->shuffleCloud();
 93+
 94+ if ( $wgCodeReviewShuffleTagCloud ) {
 95+ $this->shuffleCloud();
 96+ } else {
 97+ ksort( $this->wordsArray );
 98+ }
 99+
93100 $max = max( $this->wordsArray );
94101 if( is_array( $this->wordsArray ) ) {
95102 $return = '';

Follow-up revisions

RevisionCommit summaryAuthorDate
r93824MFT r93823tstarling13:25, 3 August 2011

Comments

#Comment by Krinkle (talk | contribs)   13:53, 3 August 2011

Hm.. looks a little weird.

The reason it order was shuffled is because the sizes are variable (more common tags are bigger). So I think the configuration variable should be "enable tag cloud", not "enable alphabetic sorting in tag cloud".

If the variable* is set to false it would show an unordered list of tags with links to their revisions and their sizes in parentheses (all text the same size).


-- Krinkle

  • Variable can either be a configuration variable, but preferably a url parameter or form element so that both are possible
#Comment by Krinkle (talk | contribs)   13:56, 3 August 2011

in pseudo code it could look like

if ( $wgCodeReviewEnableTagCloud ) {
or
if  ( $params['cloud'] ) {

  showCloud() // change font-size respective to number of revs, and randomize order

} else {

  showList() // something like this, without variable sizes or order:
  
    foreach( ... ) {
  • <a>{tag}</a> (### revs) }
}
#Comment by Tim Starling (talk | contribs)   13:58, 3 August 2011

I don't understand why variable font size means you would want it shuffled.

#Comment by 😂 (talk | contribs)   15:00, 3 August 2011

I happened to like the shuffling, but I can't help but think I'm in the minority here :(

Status & tagging log