r61381 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61380‎ | r61381 | r61382 >
Date:19:44, 22 January 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: (bug 22207) SimpleSearch disables mwsuggest even if SS itself is disabled
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
@@ -1,7 +1,8 @@
22 /* JavaScript for SimpleSearch extension */
33
44 // Disable mwsuggest.js on searchInput
5 -if ( typeof os_autoload_inputs !== 'undefined' && os_autoload_forms !== 'undefined' ) {
 5+if ( wgVectorEnabledModules.simplesearch && skin == 'vector' && typeof os_autoload_inputs !== 'undefined' &&
 6+ os_autoload_forms !== 'undefined' ) {
67 os_autoload_inputs = [];
78 os_autoload_forms = [];
89 }
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -16,13 +16,13 @@
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 5 ),
1919 array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 3 ),
20 - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 5 ),
 20+ array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 6 ),
2121 ),
2222 'combined' => array(
23 - array( 'src' => 'Vector.combined.js', 'version' => 16 ),
 23+ array( 'src' => 'Vector.combined.js', 'version' => 17 ),
2424 ),
2525 'minified' => array(
26 - array( 'src' => 'Vector.combined.min.js', 'version' => 16 ),
 26+ array( 'src' => 'Vector.combined.min.js', 'version' => 17 ),
2727 ),
2828 );
2929 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -235,7 +235,8 @@
236236 /* JavaScript for SimpleSearch extension */
237237
238238 // Disable mwsuggest.js on searchInput
239 -if ( typeof os_autoload_inputs !== 'undefined' && os_autoload_forms !== 'undefined' ) {
 239+if ( wgVectorEnabledModules.simplesearch && skin == 'vector' && typeof os_autoload_inputs !== 'undefined' &&
 240+ os_autoload_forms !== 'undefined' ) {
240241 os_autoload_inputs = [];
241242 os_autoload_forms = [];
242243 }
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -10,6 +10,6 @@
1111 $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;mw.ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
1212 $j('#editpage-copywarn').add('.editOptions').wrapAll('<div id="editpage-bottom"></div>');$j('#wpSummary').data('hint',$j('#wpSummaryLabel span small').remove().text().replace(/\)|\(/g,'')).change(function(){if($j(this).val().length==0){$j(this).addClass('inline-hint').val($j(this).data('hint'));}else{$j(this).removeClass('inline-hint');}}).focus(function(){if($j(this).val()==$j(this).data('hint')){$j(this).removeClass('inline-hint').val("");}}).blur(function(){$j(this).trigger('change');}).trigger('change');$j('#wpSummary').add('.editCheckboxes').wrapAll('<div id="editpage-summary-fields"></div>');$j('#editpage-specialchars').remove();var transclusionCount=$j('.templatesUsed ul li').size();$j('.templatesUsed ul').wrap('<div id="transclusions-list" class="collapsible-list collapsed"></div>').parent().prepend('<label>This page contains <a href="http://en.wikipedia.org/wiki/transclusion">transclusions</a> of <strong>'
1313 +transclusionCount
14 -+'</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(typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];}
 14++'</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=[];}
1515 mw.ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;}
1616 $j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(gM('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').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$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});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(gM('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();}}else{$j(this).hide();$j(this).empty();}},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

Status & tagging log