r68240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68239‎ | r68240 | r68241 >
Date:20:56, 18 June 2010
Author:adam
Status:ok
Tags:
Comment:
SimpleSearch fix for bug 24032
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js
@@ -50,8 +50,9 @@
5151 'line-height': '13px'
5252 })
5353 .css( ( $j( 'body' ).is( '.rtl' ) ? 'right' : 'left' ), 0 )
54 - .click( function() {
 54+ .mousedown( function() {
5555 $j(this).parent().find( 'input#searchInput' ).focus();
 56+ return false;
5657 })
5758 .appendTo( $j(this).parent() );
5859 if ( $j(this).val() == '' ) {
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -17,13 +17,13 @@
1818 array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 5 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 9 ),
2020 array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ),
21 - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 18 ),
 21+ array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 19 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 56 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 57 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 57 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 58 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -555,8 +555,9 @@
556556 'line-height': '13px'
557557 })
558558 .css( ( $j( 'body' ).is( '.rtl' ) ? 'right' : 'left' ), 0 )
559 - .click( function() {
 559+ .mousedown( function() {
560560 $j(this).parent().find( 'input#searchInput' ).focus();
 561+ return false;
561562 })
562563 .appendTo( $j(this).parent() );
563564 if ( $j(this).val() == '' ) {
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -26,7 +26,7 @@
2727 +'</strong> other pages.</label>');$j('.mw-templatesUsedExplanation').remove();$j('.collapsible-list label').click(function(){$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('ul').slideToggle('fast');return false;}).trigger('click');$j('#wpPreview, #wpDiff, .editHelp, #editpage-specialchars').remove();$j('#mw-editform-cancel').remove().appendTo('.editButtons');});if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];}
2828 $j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||wgVectorPreferences.simplesearch.disablesuggest||skin!='vector'){return true;}
2929 var mod={'browsers':{'ltr':{'opera':[['>=',9.6]],'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':[['>=',9.6]],'blackberry':false,'ipod':false,'iphone':false}}};if(!$j.wikiEditor.isSupported(mod)){return true;}
30 -$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','color':'#999999','cursor':'text','margin':'0 4px','top':'6px','line-height':'13px'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').fadeIn(100);}}).bind('keypress',function(){if($j(this).parent().find('label:visible').size()>0)
 30+$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','color':'#999999','cursor':'text','margin':'0 4px','top':'6px','line-height':'13px'}).css(($j('body').is('.rtl')?'right':'left'),0).mousedown(function(){$j(this).parent().find('input#searchInput').focus();return false;}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').fadeIn(100);}}).bind('keypress',function(){if($j(this).parent().find('label:visible').size()>0)
3131 $j(this).parent().find('label').fadeOut(100);}).focus(function(){$j(this).parent().find('label').fadeOut(100);}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').fadeIn(100);}});$j(document).bind('dragend',function(event){if($j('div#simpleSearch > label:visible').size()>0&&$j('div#simpleSearch > input#searchInput').val().length>0)
3232 $j('div#simpleSearch > label').fadeOut(100);});$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 click',function(){$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()
3333 $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')}).bind('paste cut click',function(){$j(this).trigger('keypress');});});
\ No newline at end of file
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -83,7 +83,7 @@
8484 array( 'src' => 'js/plugins.combined.js', 'version' => 436 ),
8585 ),
8686 'minified' => array(
87 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 438 ),
 87+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 439 ),
8888 ),
8989 ),
9090 );

Status & tagging log