r68099 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68098‎ | r68099 | r68100 >
Date:18:37, 15 June 2010
Author:adam
Status:ok
Tags:
Comment:
SimpleSearch - removing uneccisary and redundant code.
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.suggestions.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' => 26 ),
 68+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 27 ),
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' => 433 ),
 84+ array( 'src' => 'js/plugins.combined.js', 'version' => 434 ),
8585 ),
8686 'minified' => array(
87 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 434 ),
 87+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 435 ),
8888 ),
8989 ),
9090 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js
@@ -215,10 +215,6 @@
216216 */
217217 highlight: function( context, result, updateTextbox ) {
218218 var selected = context.data.$container.find( '.suggestions-result-current' );
219 - if ( result.get && selected.get( 0 ) == result.get( 0 ) ) {
220 - // if the currently selected item is equal to the result, exit please
221 - return true;
222 - }
223219 if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
224220 if ( result == 'prev' ) {
225221 if( selected.is( '.suggestions-special' ) ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1184,10 +1184,6 @@
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 ) ) {
1189 - // if the currently selected item is equal to the result, exit please
1190 - return true;
1191 - }
11921188 if ( !result.get || selected.get( 0 ) != result.get( 0 ) ) {
11931189 if ( result == 'prev' ) {
11941190 if( selected.is( '.suggestions-special' ) ) {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -67,8 +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)){return true;}
72 -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)){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');}}}
7372 selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');}
7473 if(updateTextbox){if(result.length==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}
7574 context.data.$textbox.trigger('change');}

Status & tagging log