r68054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68053‎ | r68054 | r68055 >
Date:02:48, 15 June 2010
Author:adam
Status:ok
Tags:
Comment:
Recombining for r68053
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)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -64,7 +64,7 @@
6565 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
6666 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
6767 array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 17 ),
68 - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 24 ),
 68+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 25 ),
6969 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 36 ),
7070 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 195 ),
7171 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
@@ -80,10 +80,10 @@
8181 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 2 ),
8282 ),
8383 'combined' => array(
84 - array( 'src' => 'js/plugins.combined.js', 'version' => 431 ),
 84+ array( 'src' => 'js/plugins.combined.js', 'version' => 432 ),
8585 ),
8686 'minified' => array(
87 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 432 ),
 87+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 433 ),
8888 ),
8989 ),
9090 );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1184,7 +1184,10 @@
11851185 */
11861186 highlight: function( context, result, updateTextbox ) {
11871187 var selected = context.data.$container.find( '.suggestions-result-current' );
1188 - if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
 1188+ if ( result.get && selected.get( 0 ) == result.get( 0 ) ) {
 1189+ // if the currently selected item is equal to the result, exit please
 1190+ return true;
 1191+ } else if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
11891192 if ( result == 'prev' ) {
11901193 if( selected.is( '.suggestions-special' ) ) {
11911194 result = context.data.$container.find( '.suggestions-result:last' )
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -67,7 +67,7 @@
6868 $autoEllipseMe=$autoEllipseMe.add($result);}}
6969 if(expWidth>context.data.$container.width()){var maxWidth=context.config.maxExpandFactor*context.data.$textbox.width();context.data.$container.width(Math.min(expWidth,maxWidth));}
7070 $autoEllipseMe.autoEllipsis({hasSpan:true,tooltip:true,matchText:matchedText});}}
71 -break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'maxExpandFactor':context.config[property]=Math.max(1,value);break;case'submitOnClick':case'positionFromLeft':case'highlightInput':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){if(selected.is('.suggestions-special')){result=context.data.$container.find('.suggestions-result:last')}else{result=selected.prev();if(selected.length==0){if(context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}else{result=context.data.$container.find('.suggestions-results div:last');}}}}else if(result=='next'){if(selected.length==0){result=context.data.$container.find('.suggestions-results div:first');if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}else{result=selected.next();if(selected.is('.suggestions-special')){result=$([]);}else if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}}
 71+break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'maxExpandFactor':context.config[property]=Math.max(1,value);break;case'submitOnClick':case'positionFromLeft':case'highlightInput':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(result.get&&selected.get(0)==result.get(0)){return true;}else if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){if(selected.is('.suggestions-special')){result=context.data.$container.find('.suggestions-result:last')}else{result=selected.prev();if(selected.length==0){if(context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}else{result=context.data.$container.find('.suggestions-results div:last');}}}}else if(result=='next'){if(selected.length==0){result=context.data.$container.find('.suggestions-results div:first');if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}else{result=selected.next();if(selected.is('.suggestions-special')){result=$([]);}else if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}}
7272 selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');}
7373 if(updateTextbox){if(result.length==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}
7474 context.data.$textbox.trigger('change');}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68053SimpleSearch - adding an early out to the hightlight function for repeated ca...adam02:48, 15 June 2010

Status & tagging log