r67194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67193‎ | r67194 | r67195 >
Date:18:58, 1 June 2010
Author:adam
Status:ok
Tags:
Comment:
Adding a paste, cut and click handler to address bug 23622
Modified paths:
  • /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
@@ -76,7 +76,10 @@
7777 },
7878 delay: 120,
7979 positionFromLeft: $j( 'body' ).is( '.rtl' )
80 - } );
 80+ } )
 81+ .bind( 'paste cut click', function() {
 82+ $j( this ).trigger( 'keypress' );
 83+ } );
8184 $j( '#searchInput' ).suggestions( {
8285 result: {
8386 select: function( $textbox ) {
@@ -111,5 +114,8 @@
112115 }
113116 },
114117 $region: $j( '#simpleSearch' )
115 - } );
 118+ } )
 119+ .bind( 'paste cut click', function() {
 120+ $j( this ).trigger( 'keypress' );
 121+ } );
116122 });
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -17,13 +17,13 @@
1818 array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 2 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ),
2020 array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ),
21 - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 11 ),
 21+ array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 12 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 31 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 32 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 31 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 32 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -380,7 +380,10 @@
381381 },
382382 delay: 120,
383383 positionFromLeft: $j( 'body' ).is( '.rtl' )
384 - } );
 384+ } )
 385+ .bind( 'paste cut click', function() {
 386+ $j( this ).trigger( 'keypress' );
 387+ } );
385388 $j( '#searchInput' ).suggestions( {
386389 result: {
387390 select: function( $textbox ) {
@@ -415,5 +418,8 @@
416419 }
417420 },
418421 $region: $j( '#simpleSearch' )
419 - } );
 422+ } )
 423+ .bind( 'paste cut click', function() {
 424+ $j( this ).trigger( 'keypress' );
 425+ } );
420426 });
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -15,5 +15,5 @@
1616 +transclusionCount
1717 +'</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=[];}
1818 $j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;}
19 -$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).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);}}).focus(function(){$j(this).parent().find('label').fadeOut(100);}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').fadeIn(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')});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){if($j(this).children().size()==0){$j(this).show()
20 -$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
 19+$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(mw.usability.getMsg('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).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);}}).focus(function(){$j(this).parent().find('label').fadeOut(100);}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').fadeIn(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')}).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()
 20+$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

Status & tagging log