r66728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66727‎ | r66728 | r66729 >
Date:18:09, 21 May 2010
Author:catrope
Status:deferred
Tags:
Comment:
Followup to r66725: add tooltip for cache hits as well
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -64,7 +64,7 @@
6565
6666 // Core functionality of extension scripts
6767 array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ),
68 - array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 10 ),
 68+ array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 11 ),
6969 array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 6 ),
7070 array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 6 ),
7171 array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ),
@@ -85,10 +85,10 @@
8686 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8787 ),
8888 'combined' => array(
89 - array( 'src' => 'js/plugins.combined.js', 'version' => 407 ),
 89+ array( 'src' => 'js/plugins.combined.js', 'version' => 408 ),
9090 ),
9191 'minified' => array(
92 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 407 ),
 92+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 408 ),
9393 ),
9494 ),
9595 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js
@@ -39,6 +39,8 @@
4040 }
4141 if ( w in cache[text] ) {
4242 $text.text( cache[text][w] );
 43+ if ( options.tooltip )
 44+ $text.attr( 'title', text );
4345 return;
4446 }
4547
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5211,6 +5211,8 @@
52125212 }
52135213 if ( w in cache[text] ) {
52145214 $text.text( cache[text][w] );
 5215+ if ( options.tooltip )
 5216+ $text.attr( 'title', text );
52155217 return;
52165218 }
52175219
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -362,7 +362,8 @@
363363 {$.eachAsync(this,opts);return this;}})(jQuery);(function($){var cache={};$.fn.autoEllipsis=function(options){options=$.extend({'position':'center','tooltip':false,'selector':'span','restoreText':false,'hasSpan':false},options);$(this).each(function(){var $this=$(this);if(options.restoreText){if(!$this.data('autoEllipsis.originalText')){$this.data('autoEllipsis.originalText',$this.text());}else{$this.text($this.data('autoEllipsis.originalText'));}}
364364 var text=$this.text();var w=$this.width();var $text;if(options.hasSpan){$text=$this.children(options.selector);}else{$text=$('<span />').css('whiteSpace','nowrap');$this.empty().append($text);}
365365 if(!(text in cache)){cache[text]={};}
366 -if(w in cache[text]){$text.text(cache[text][w]);return;}
 366+if(w in cache[text]){$text.text(cache[text][w]);if(options.tooltip)
 367+$text.attr('title',text);return;}
367368 $text.text(text);if($text.width()>w){switch(options.position){case'right':var l=0,r=text.length;do{var m=Math.ceil((l+r)/2);$text.text(text.substr(0,m)+'...');if($text.width()>w){r=m-1;}else{l=m;}}while(l<r);$text.text(text.substr(0,l)+'...');break;case'center':var i=[Math.round(text.length/2),Math.round(text.length/2)];var side=1;while($text.outerWidth()>w&&i[0]>0){$text.text(text.substr(0,i[0])+'...'+text.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}}
368369 break;case'left':var r=0;while($text.outerWidth()>w&&r<text.length){$text.text('...'+text.substr(r));r++;}
369370 break;}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r667291.16wmf4: MFT r66728catrope18:14, 21 May 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66725UsabilityInitiative: (bug 23617) Some tooltips get dropped, no idea why, so j...catrope16:23, 21 May 2010

Status & tagging log