r77329 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77328‎ | r77329 | r77330 >
Date:13:57, 26 November 2010
Author:catrope
Status:ok
Tags:
Comment:
1.16wmf4: Attempted fix for bug 25937
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js
@@ -88,7 +88,9 @@
8989 },
9090 dataType: 'json',
9191 success: function( data ) {
92 - $this.suggestions( 'suggestions', data[1] );
 92+ if ( data && 1 in data ) {
 93+ $this.suggestions( 'suggestions', data[1] );
 94+ }
9395 }
9496 });
9597 $j(this).data( 'request', request );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -495,7 +495,9 @@
496496 },
497497 dataType: 'json',
498498 success: function( data ) {
499 - $this.suggestions( 'suggestions', data[1] );
 499+ if ( data && 1 in data ) {
 500+ $this.suggestions( 'suggestions', data[1] );
 501+ }
500502 }
501503 });
502504 $j(this).data( 'request', request );
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -30,5 +30,5 @@
3131 $j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||wgVectorPreferences.simplesearch.disablesuggest||skin!='vector'){return true;}
3232 var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'docomo':false,'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':[['>=',9.6]],'docomo':false,'blackberry':false,'ipod':false,'iphone':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
3333 if('placeholder'in document.createElement('input')){$j('div#simpleSearch > input#searchInput').attr('placeholder',mw.usability.getMsg('vector-simplesearch-search'));}else{$j('div#simpleSearch > input#searchInput').each(function(){var $input=$j(this);$input.bind('blur',function(){if($input.val().length==0){$input.val(mw.usability.getMsg('vector-simplesearch-search')).addClass('placeholder');}}).bind('focus',function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}}).parents('form').bind('submit',function(){if($input.hasClass('placeholder')){$input.val('').removeClass('placeholder');}});if($input.val()==''){$input.trigger('blur');}});}
34 -$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120,positionFromLeft:$j('body').is('.rtl'),highlightInput:true}).bind('paste cut',function(e){$j(this).trigger('keypress');});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){if($j(this).children().size()==0){$j(this).show()
 34+$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){if(data&&1 in data){$this.suggestions('suggestions',data[1]);}}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120,positionFromLeft:$j('body').is('.rtl'),highlightInput:true}).bind('paste cut',function(e){$j(this).trigger('keypress');});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){if($j(this).children().size()==0){$j(this).show()
3535 $label=$j('<div />').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});});
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r77330Merge r77329 into trunk from 1.16wmf4catrope14:03, 26 November 2010

Status & tagging log