Index: trunk/phase3/skins/Vector.php |
— | — | @@ -675,7 +675,7 @@ |
676 | 676 | * when UI is in RTL mode |
677 | 677 | */ |
678 | 678 | private function renderNavigation( $elements ) { |
679 | | - global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName; |
| 679 | + global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser; |
680 | 680 | |
681 | 681 | // If only one element was given, wrap it in an array, allowing more |
682 | 682 | // flexible arguments |
— | — | @@ -768,7 +768,7 @@ |
769 | 769 | <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> |
770 | 770 | <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> |
771 | 771 | <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> |
772 | | - <?php if ( $wgVectorUseSimpleSearch ): ?> |
| 772 | + <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?> |
773 | 773 | <div id="simpleSearch"> |
774 | 774 | <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> /> |
775 | 775 | <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>> </button> |
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.i18n.php |
— | — | @@ -14,6 +14,7 @@ |
15 | 15 | $messages['en'] = array( |
16 | 16 | 'vector-simplesearch-search' => 'Search', |
17 | 17 | 'vector-simplesearch-containing' => 'containing...', |
| 18 | + 'vector-simplesearch-preference' => 'Enable enhanced search suggestions (Vector skin only)', |
18 | 19 | ); |
19 | 20 | |
20 | 21 | /** Message documentation (Message documentation) |
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | $j(document).ready( function() { |
12 | 12 | // Only use this function in conjuction with the Vector skin |
13 | | - if( !wgVectorEnabledModules.simplesearch || skin != 'vector' ) { |
| 13 | + if( !wgVectorEnabledModules.simplesearch || wgVectorPreferences.simplesearch.disablesuggest || skin != 'vector' ) { |
14 | 14 | return true; |
15 | 15 | } |
16 | 16 | var mod = { |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.php |
— | — | @@ -25,9 +25,11 @@ |
26 | 26 | 'editwarning' => array( 'global' => false, 'user' => true ), |
27 | 27 | 'expandablesearch' => array( 'global' => true, 'user' => true ), |
28 | 28 | 'footercleanup' => array( 'global' => false, 'user' => false ), |
29 | | - 'simplesearch' => array( 'global' => true, 'user' => false ), |
| 29 | + 'simplesearch' => array( 'global' => false, 'user' => true ), |
30 | 30 | ); |
31 | 31 | |
| 32 | +$wgDefaultUserOptions['vector-simplesearch'] = 1; |
| 33 | + |
32 | 34 | /* Setup */ |
33 | 35 | |
34 | 36 | // Enable bucket testing for new version of collapsible nav |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -17,13 +17,13 @@ |
18 | 18 | array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 5 ), |
19 | 19 | array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ), |
20 | 20 | array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ), |
21 | | - array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 17 ), |
| 21 | + array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 18 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'Vector.combined.js', 'version' => 54 ), |
| 24 | + array( 'src' => 'Vector.combined.js', 'version' => 55 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'Vector.combined.min.js', 'version' => 55 ), |
| 27 | + array( 'src' => 'Vector.combined.min.js', 'version' => 56 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $modules = array( |
— | — | @@ -71,7 +71,20 @@ |
72 | 72 | 'footercleanup' => array( |
73 | 73 | ), |
74 | 74 | 'simplesearch' => array( |
75 | | - 'i18n' => 'WikiEditorToc', |
| 75 | + 'preferences' => array( |
| 76 | + 'enable' => array( |
| 77 | + 'key' => 'vector-simplesearch', |
| 78 | + 'ui' => array( |
| 79 | + 'type' => 'toggle', |
| 80 | + 'label-message' => 'vector-simplesearch-preference', |
| 81 | + 'section' => 'searchoptions/display' |
| 82 | + ), |
| 83 | + ), |
| 84 | + 'disablesuggest' => array( |
| 85 | + 'key' => 'disablesuggest', |
| 86 | + ), |
| 87 | + ), |
| 88 | + 'i18n' => 'VectorSimpleSearch', |
76 | 89 | 'messages' => array( |
77 | 90 | 'vector-simplesearch-search', |
78 | 91 | 'vector-simplesearch-containing', |
— | — | @@ -167,7 +180,7 @@ |
168 | 181 | isset( self::$modules[$module]['preferences'] ) ) { |
169 | 182 | wfLoadExtensionMessages( self::$modules[$module]['i18n'] ); |
170 | 183 | foreach ( self::$modules[$module]['preferences'] as $key => $preference ) { |
171 | | - if ( $key == 'enable' && !$enable['user'] ) { |
| 184 | + if ( ( $key == 'enable' && !$enable['user'] ) || !isset( $preference['ui'] ) ) { |
172 | 185 | continue; |
173 | 186 | } |
174 | 187 | |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js |
— | — | @@ -495,7 +495,7 @@ |
496 | 496 | |
497 | 497 | $j(document).ready( function() { |
498 | 498 | // Only use this function in conjuction with the Vector skin |
499 | | - if( !wgVectorEnabledModules.simplesearch || skin != 'vector' ) { |
| 499 | + if( !wgVectorEnabledModules.simplesearch || wgVectorPreferences.simplesearch.disablesuggest || skin != 'vector' ) { |
500 | 500 | return true; |
501 | 501 | } |
502 | 502 | var mod = { |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | $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>' |
26 | 26 | +transclusionCount |
27 | 27 | +'</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=[];} |
28 | | -$j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;} |
| 28 | +$j(document).ready(function(){if(!wgVectorEnabledModules.simplesearch||wgVectorPreferences.simplesearch.disablesuggest||skin!='vector'){return true;} |
29 | 29 | 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 | 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) |
31 | 31 | $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) |